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)
21 # these values are optimized for a 4GB labeled sdcard that actually holds 7744512 sectors of 512 byte
23 # Partition 1: 32768 sectors
24 # Partition 2: 98304 sectors (configurable)
26 define Build/boot-scr-cfpro
28 mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d cfpro-boot.script $@.bootscript
31 define Build/boot-scr-cfbase
33 mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d cfbase-boot.script $@.bootscript
38 mkfs.fat -C $@.boot 16384
39 $(foreach dts,$(DEVICE_DTS), mcopy -i $@.boot $(DTS_DIR)/$(dts).dtb ::$(dts).dtb;)
40 mcopy -i $@.boot $(IMAGE_KERNEL) ::zImage
41 mcopy -i $@.boot $@.bootscript ::boot.scr
44 define Build/sdcard-img
45 ROOTFS_SIZE=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE) * 1024 * 2 )); \
46 ./gen_mvebu_sdcard_img.sh $@ \
47 "$(STAGING_DIR_IMAGE)/clearfog-u-boot-spl.kwb" \
49 83 $$ROOTFS_SIZE $(IMAGE_ROOTFS)
55 BOARD_NAME = $$(DEVICE_DTS)
57 KERNEL := kernel-bin | append-dtb | uImage none
58 SUPPORTED_DEVICES = $$(DEVICE_DTS)
62 IMAGES := sysupgrade.bin
63 IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
66 define Device/UBI-factory
70 IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | pad-to $$$$(PAGESIZE)
73 define Device/NAND-128K
78 VID_HDR_OFFSET := 2048
81 define Device/NAND-256K
87 define Device/NAND-512K
94 DEVICE_TITLE := Linksys $(1)
95 DEVICE_PACKAGES := kmod-mwlwifi wpad-mini swconfig
98 define Device/armada-385-linksys
100 $(Device/UBI-factory)
104 define Device/linksys-wrt1200ac
105 $(call Device/linksys,WRT1200AC (Caiman))
106 $(Device/armada-385-linksys)
107 DEVICE_DTS := armada-385-linksys-caiman
109 TARGET_DEVICES += linksys-wrt1200ac
111 define Device/linksys-wrt1900acv2
112 $(call Device/linksys,WRT1900ACv2 (Cobra))
113 $(Device/armada-385-linksys)
114 DEVICE_DTS := armada-385-linksys-cobra
116 TARGET_DEVICES += linksys-wrt1900acv2
118 define Device/linksys-wrt3200acm
119 $(call Device/linksys,WRT3200ACM (Rango))
120 $(Device/armada-385-linksys)
121 DEVICE_DTS := armada-385-linksys-rango
122 DEVICE_PACKAGES += kmod-btmrvl kmod-mwifiex-sdio
124 TARGET_DEVICES += linksys-wrt3200acm
126 define Device/linksys-wrt1900acs
127 $(call Device/linksys,WRT1900ACS (Shelby))
128 $(Device/armada-385-linksys)
129 DEVICE_DTS := armada-385-linksys-shelby
131 TARGET_DEVICES += linksys-wrt1900acs
133 define Device/linksys-wrt1900ac
134 $(call Device/linksys,WRT1900AC (Mamba))
135 DEVICE_DTS := armada-xp-linksys-mamba
137 $(Device/UBI-factory)
140 TARGET_DEVICES += linksys-wrt1900ac
142 define Device/openblocks-ax3-4
143 $(Device/UBI-factory)
144 DEVICE_DTS := armada-xp-openblocks-ax3-4
145 SUPPORTED_DEVICES := $(1)
148 IMAGE/factory.img := append-kernel | pad-to $$(BLOCKSIZE) | append-ubi
149 DEVICE_TITLE := Plat'Home OpenBlocks AX3
151 TARGET_DEVICES += openblocks-ax3-4
153 define Device/armada-385-db-ap
155 $(Device/UBI-factory)
157 DEVICE_TITLE := Marvell Armada 385 DB AP (DB-88F6820-AP)
159 TARGET_DEVICES += armada-385-db-ap
161 define Device/marvell-nand
163 DEVICE_TITLE := Marvell Armada $(1)
166 define Device/armada-370-db
167 $(call Device/marvell-nand,370 DB (DB-88F6710-BP-DDR3))
169 TARGET_DEVICES += armada-370-db
171 define Device/armada-370-rd
172 $(call Device/marvell-nand,370 RD (RD-88F6710-A1))
174 TARGET_DEVICES += armada-370-rd
176 define Device/armada-xp-db
177 $(call Device/marvell-nand,XP DB (DB-78460-BP))
179 TARGET_DEVICES += armada-xp-db
181 define Device/armada-xp-gp
182 $(call Device/marvell-nand,XP GP (DB-MV784MP-GP))
184 TARGET_DEVICES += armada-xp-gp
186 define Device/armada-388-rd
187 DEVICE_TITLE := Marvell Armada 388 RD (RD-88F6820-AP)
188 IMAGES := firmware.bin
189 IMAGE/firmware.bin := append-kernel | pad-to 256k | append-rootfs | pad-rootfs
191 TARGET_DEVICES += armada-388-rd
193 define Device/armada-388-clearfog-pro
196 DEVICE_TITLE := SolidRun ClearFog Pro
197 DEVICE_PACKAGES := mkf2fs e2fsprogs swconfig kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1
198 IMAGES := sdcard.img.gz
199 IMAGE/sdcard.img.gz := boot-scr-cfpro | boot-img | sdcard-img | gzip | append-metadata
200 IMAGE_NAME = $$(IMAGE_PREFIX)-$$(2)
201 DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base
203 TARGET_DEVICES += armada-388-clearfog-pro
205 define Device/armada-388-clearfog-base
208 DEVICE_TITLE := SolidRun ClearFog Base
209 DEVICE_PACKAGES := mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1
210 IMAGES := sdcard.img.gz
211 IMAGE/sdcard.img.gz := boot-scr-cfbase | boot-img | sdcard-img | gzip | append-metadata
212 IMAGE_NAME = $$(IMAGE_PREFIX)-$$(2)
213 DEVICE_DTS := armada-388-clearfog-pro armada-388-clearfog-base
215 TARGET_DEVICES += armada-388-clearfog-base
217 define Device/globalscale-mirabox
219 DEVICE_DTS := armada-370-mirabox
220 SUPPORTED_DEVICES := mirabox
221 DEVICE_TITLE := Globalscale Mirabox
223 TARGET_DEVICES += globalscale-mirabox
225 $(eval $(call BuildImage))