2 # Copyright (C) 2012-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
10 include $(TOPDIR
)/rules.mk
11 include $(INCLUDE_DIR
)/image.mk
13 KERNEL_LOADADDR
:= 0x00008000
15 DEVICE_VARS
+= KERNEL_SIZE
18 $(call Image
/BuildDTB
,$(DTS_DIR
)/$(DEVICE_DTS
).dts
,$@.dtb
)
21 define Build
/clearfog-bundle
23 $(TAR
) -cp
--numeric-owner
--owner
=0 --group
=0 --sort=name \
24 $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)") \
25 --file
=$@.new
-C
$(TARGET_DIR
)/ .
26 $(TAR
) -rp
--numeric-owner
--owner
=0 --group
=0 --sort=name \
27 $(if
$(SOURCE_DATE_EPOCH
),--mtime
="@$(SOURCE_DATE_EPOCH)") \
28 --file
=$@.new
-C
$(dir $(IMAGE_KERNEL
)) $(notdir $(IMAGE_KERNEL
)) $(notdir $(IMAGE_KERNEL
).dtb
)
29 gzip
-9n
-c
$@.new
> $@
33 # these values are optimized for a 4GB labeled sdcard that actually holds 7744512 sectors of 512 byte
35 # Partition 1: 32768 sectors
36 # Partition 2: 98304 sectors (configurable)
40 mkimage
-A arm
-O linux
-T script
-C none
-a
0 -e
0 -d boot.script
$@.bootscript
45 mkfs.fat
-C
$@.boot
16384
46 $(foreach dts
,$(DEVICE_DTS
), mcopy
-i
$@.boot
$(DTS_DIR
)/$(dts
).dtb
::$(dts
).dtb
)
47 mcopy
-i
$@.boot
$(IMAGE_KERNEL
) ::zImage
48 mcopy
-i
$@.boot
$@.bootscript
::boot.scr
51 define Build
/sdcard-img
52 ROOTFS_SIZE
=$$(( $(CONFIG_TARGET_ROOTFS_PARTSIZE
) * 1024 * 2 )); \
53 .
/gen_mvebu_sdcard_img.sh
$@ \
54 "$(BIN_DIR)/uboot-mvebu-clearfog/openwrt-mvebu-clearfog-u-boot-spl.kwb" \
56 83 $$ROOTFS_SIZE $(IMAGE_ROOTFS
)
62 BOARD_NAME
= $$(DEVICE_DTS
)
64 KERNEL
:= kernel-bin | append-dtb | uImage none
68 IMAGES
:= sysupgrade.bin
69 IMAGE
/sysupgrade.bin
:= sysupgrade-tar
72 define Device
/UBI-factory
76 IMAGE
/factory.img
:= append-kernel
$$$$(KERNEL_SIZE
) | append-ubi | pad-to
$$$$(PAGESIZE
)
79 define Device
/NAND-128K
84 VID_HDR_OFFSET
:= 2048
87 define Device
/NAND-256K
93 define Device
/NAND-512K
100 DEVICE_TITLE
:= Linksys
$(1)
101 DEVICE_PACKAGES
:= kmod-mwlwifi wpad-mini swconfig
104 define Device
/armada-385-linksys
106 $(Device
/UBI-factory
)
110 define Device
/linksys-wrt1200ac
111 $(call Device
/linksys
,WRT1200AC
(Caiman
))
112 $(Device
/armada-385-linksys
)
113 DEVICE_DTS
:= armada-385-linksys-caiman
115 TARGET_DEVICES
+= linksys-wrt1200ac
117 define Device
/linksys-wrt1900acv2
118 $(call Device
/linksys
,WRT1900ACv2
(Cobra
))
119 $(Device
/armada-385-linksys
)
120 DEVICE_DTS
:= armada-385-linksys-cobra
122 TARGET_DEVICES
+= linksys-wrt1900acv2
124 define Device
/linksys-wrt1900acs
125 $(call Device
/linksys
,WRT1900ACS
(Shelby
))
126 $(Device
/armada-385-linksys
)
127 DEVICE_DTS
:= armada-385-linksys-shelby
129 TARGET_DEVICES
+= linksys-wrt1900acs
131 define Device
/linksys-wrt1900ac
132 $(call Device
/linksys
,WRT1900AC
(Mamba
))
133 DEVICE_DTS
:= armada-xp-linksys-mamba
135 $(Device
/UBI-factory
)
138 TARGET_DEVICES
+= linksys-wrt1900ac
140 define Device
/openblocks-ax3
141 $(Device
/UBI-factory
)
142 DEVICE_DTS
:= armada-xp-openblocks-ax3-4
145 IMAGE
/factory.img
:= append-kernel | pad-to
$$(BLOCKSIZE
) | append-ubi
146 DEVICE_TITLE
:= Plat
'Home OpenBlocks AX3
148 TARGET_DEVICES += openblocks-ax3
150 define Device/armada-385-db-ap
152 $(Device/UBI-factory)
154 DEVICE_TITLE := Marvell Armada 385 DB AP (DB-88F6820-AP)
156 TARGET_DEVICES += armada-385-db-ap
158 define Device/marvell-nand
160 DEVICE_TITLE := Marvell Armada $(1)
163 Device/armada-370-db = $(call Device/marvell-nand,370 DB (DB-88F6710-BP-DDR3))
164 Device/armada-370-rd = $(call Device/marvell-nand,370 RD (RD-88F6710-A1))
165 Device/armada-xp-db = $(call Device/marvell-nand,XP DB (DB-78460-BP))
166 Device/armada-xp-gp = $(call Device/marvell-nand,XP GP (DB-MV784MP-GP))
167 TARGET_DEVICES += armada-370-db armada-370-rd armada-xp-db armada-xp-gp
169 define Device/armada-388-rd
170 DEVICE_TITLE := Marvell Armada 388 RD (RD-88F6820-AP)
171 IMAGES := firmware.bin
172 IMAGE/firmware.bin := append-kernel 256k | append-rootfs | pad-rootfs
174 TARGET_DEVICES += armada-388-rd
176 define Device/armada-388-clearfog
178 KERNEL := dtb | kernel-bin
179 DEVICE_TITLE := SolidRun ClearFog
180 DEVICE_PACKAGES := uboot-mvebu-clearfog mkf2fs e2fsprogs
181 IMAGES := bundle.tar.gz sdcard.img.gz
182 IMAGE/bundle.tar.gz := clearfog-bundle
183 IMAGE/sdcard.img.gz := boot-scr | boot-img | sdcard-img | gzip
184 IMAGE_NAME = $$(IMAGE_PREFIX)-$$(2)
186 TARGET_DEVICES += armada-388-clearfog
188 define Device/globalscale-mirabox
190 DEVICE_DTS := armada-370-mirabox
191 DEVICE_TITLE := Globalscale Mirabox
193 TARGET_DEVICES += globalscale-mirabox
195 $(eval $(call BuildImage))