2 # Copyright (C) 2012-2016 OpenWrt.org
3 # Copyright (C) 2016 LEDE-project.org
5 # This is free software, licensed under the GNU General Public License v2.
6 # See /LICENSE for more information.
11 include $(TOPDIR
)/rules.mk
12 include $(INCLUDE_DIR
)/image.mk
14 KERNEL_LOADADDR
:= 0x00008000
17 $(call Image
/BuildDTB
,$(DTS_DIR
)/$(DEVICE_DTS
).dts
,$@.dtb
)
20 define Build
/clearfog-bundle
22 $(TAR
) -cp
--numeric-owner
--owner
=0 --group
=0 --sort=name \
23 $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)") \
24 --file
=$@.new
-C
$(TARGET_DIR
)/ .
25 $(TAR
) -rp
--numeric-owner
--owner
=0 --group
=0 --sort=name \
26 $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)") \
27 --file
=$@.new
-C
$(dir $(IMAGE_KERNEL
)) $(notdir $(IMAGE_KERNEL
)) $(notdir $(IMAGE_KERNEL
).dtb
)
28 gzip
-9n
-c
$@.new
> $@
32 # these values are optimized for a 4GB labeled sdcard that actually holds 7744512 sectors of 512 byte
34 # Partition 1: 32768 sectors
35 # Partition 2: 98304 sectors (configurable)
39 mkimage
-A arm
-O linux
-T script
-C none
-a
0 -e
0 -d boot.script
$@.bootscript
44 mkfs.fat
-C
$@.boot
16384
45 $(foreach dts
,$(DEVICE_DTS
), mcopy
-i
$@.boot
$(DTS_DIR
)/$(dts
).dtb
::$(dts
).dtb
)
46 mcopy
-i
$@.boot
$(IMAGE_KERNEL
) ::zImage
47 mcopy
-i
$@.boot
$@.bootscript
::boot.scr
50 define Build
/sdcard-img
51 ROOTFS_SIZE
=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE
) * 1024 * 2 )); \
52 .
/gen_mvebu_sdcard_img.sh
$@ \
53 "$(KDIR)/openwrt-mvebu-clearfog-u-boot-spl.kwb" \
55 83 $$ROOTFS_SIZE $(IMAGE_ROOTFS
)
61 BOARD_NAME
= $$(DEVICE_DTS
)
63 KERNEL
:= kernel-bin | append-dtb | uImage none
67 IMAGES
:= sysupgrade.bin
68 IMAGE
/sysupgrade.bin
:= sysupgrade-tar
71 define Device
/UBI-factory
75 IMAGE
/factory.img
:= append-kernel | pad-to
$$$$(KERNEL_SIZE
) | append-ubi | pad-to
$$$$(PAGESIZE
)
78 define Device
/NAND-128K
83 VID_HDR_OFFSET
:= 2048
86 define Device
/NAND-256K
92 define Device
/NAND-512K
99 DEVICE_TITLE
:= Linksys
$(1)
100 DEVICE_PACKAGES
:= kmod-mwlwifi wpad-mini swconfig
103 define Device
/armada-385-linksys
105 $(Device
/UBI-factory
)
109 define Device
/linksys-wrt1200ac
110 $(call Device
/linksys
,WRT1200AC
(Caiman
))
111 $(Device
/armada-385-linksys
)
112 DEVICE_DTS
:= armada-385-linksys-caiman
114 TARGET_DEVICES
+= linksys-wrt1200ac
116 define Device
/linksys-wrt1900acv2
117 $(call Device
/linksys
,WRT1900ACv2
(Cobra
))
118 $(Device
/armada-385-linksys
)
119 DEVICE_DTS
:= armada-385-linksys-cobra
121 TARGET_DEVICES
+= linksys-wrt1900acv2
123 define Device
/linksys-wrt3200acm
124 $(call Device
/linksys
,WRT3200ACM
(Rango
))
125 $(Device
/armada-385-linksys
)
126 DEVICE_DTS
:= armada-385-linksys-rango
128 TARGET_DEVICES
+= linksys-wrt3200acm
130 define Device
/linksys-wrt1900acs
131 $(call Device
/linksys
,WRT1900ACS
(Shelby
))
132 $(Device
/armada-385-linksys
)
133 DEVICE_DTS
:= armada-385-linksys-shelby
135 TARGET_DEVICES
+= linksys-wrt1900acs
137 define Device
/linksys-wrt1900ac
138 $(call Device
/linksys
,WRT1900AC
(Mamba
))
139 DEVICE_DTS
:= armada-xp-linksys-mamba
141 $(Device
/UBI-factory
)
144 TARGET_DEVICES
+= linksys-wrt1900ac
146 define Device
/openblocks-ax3
147 $(Device
/UBI-factory
)
148 DEVICE_DTS
:= armada-xp-openblocks-ax3-4
151 IMAGE
/factory.img
:= append-kernel | pad-to
$$(BLOCKSIZE
) | append-ubi
152 DEVICE_TITLE
:= Plat
'Home OpenBlocks AX3
154 TARGET_DEVICES += openblocks-ax3
156 define Device/armada-385-db-ap
158 $(Device/UBI-factory)
160 DEVICE_TITLE := Marvell Armada 385 DB AP (DB-88F6820-AP)
162 TARGET_DEVICES += armada-385-db-ap
164 define Device/marvell-nand
166 DEVICE_TITLE := Marvell Armada $(1)
169 Device/armada-370-db = $(call Device/marvell-nand,370 DB (DB-88F6710-BP-DDR3))
170 Device/armada-370-rd = $(call Device/marvell-nand,370 RD (RD-88F6710-A1))
171 Device/armada-xp-db = $(call Device/marvell-nand,XP DB (DB-78460-BP))
172 Device/armada-xp-gp = $(call Device/marvell-nand,XP GP (DB-MV784MP-GP))
173 TARGET_DEVICES += armada-370-db armada-370-rd armada-xp-db armada-xp-gp
175 define Device/armada-388-rd
176 DEVICE_TITLE := Marvell Armada 388 RD (RD-88F6820-AP)
177 IMAGES := firmware.bin
178 IMAGE/firmware.bin := append-kernel | pad-to 256k | append-rootfs | pad-rootfs
180 TARGET_DEVICES += armada-388-rd
182 define Device/armada-388-clearfog
184 KERNEL := dtb | kernel-bin
185 DEVICE_TITLE := SolidRun ClearFog
186 DEVICE_PACKAGES := mkf2fs e2fsprogs swconfig kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1
187 IMAGES := bundle.tar.gz sdcard.img.gz
188 IMAGE/bundle.tar.gz := clearfog-bundle
189 IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip
190 IMAGE_NAME = $$(IMAGE_PREFIX)-$$(2)
192 TARGET_DEVICES += armada-388-clearfog
194 define Device/globalscale-mirabox
196 DEVICE_DTS := armada-370-mirabox
197 DEVICE_TITLE := Globalscale Mirabox
199 TARGET_DEVICES += globalscale-mirabox
201 $(eval $(call BuildImage))