mvebu: switch to the new image build code
[oweals/openwrt.git] / target / linux / mvebu / image / Makefile
1 #
2 # Copyright (C) 2012-2015 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 JFFS2_BLOCKSIZE = 128k
9
10 include $(TOPDIR)/rules.mk
11 include $(INCLUDE_DIR)/image.mk
12
13 KERNEL_LOADADDR := 0x00008000
14
15 DEVICE_VARS += KERNEL_SIZE
16
17 define Device/Default
18   DEVICE_DTS := $(1)
19   BOARD_NAME = $$(DEVICE_DTS)
20   KERNEL_NAME := zImage
21   KERNEL := kernel-bin | append-dtb | uImage none
22 endef
23
24 define Device/UBI
25   IMAGES := sysupgrade.bin
26   IMAGE/sysupgrade.bin := sysupgrade-nand
27 endef
28
29 define Device/UBI-factory
30   $(Device/UBI)
31   IMAGES += factory.img
32   IMAGE/factory.img := append-kernel $$$$(KERNEL_SIZE) | append-ubi | pad-to $$$$(PAGESIZE)
33 endef
34
35 define Device/NAND-128K
36   $(Device/UBI)
37   BLOCKSIZE := 128KiB
38   PAGESIZE := 2048
39   SUBPAGESIZE := 512
40   VID_HDR_OFFSET := 2048
41 endef
42
43 define Device/NAND-256K
44   $(Device/UBI)
45   BLOCKSIZE := 256KiB
46   PAGESIZE := 4096
47 endef
48
49 define Device/NAND-512K
50   $(Device/UBI)
51   BLOCKSIZE := 512KiB
52   PAGESIZE := 4096
53 endef
54
55 define Device/linksys
56   DEVICE_TITLE := Linksys $(1)
57   DEVICE_PACKAGES := kmod-mwlwifi wpad-mini swconfig
58 endef
59
60 define Device/armada-385-linksys
61   $(Device/NAND-128K)
62   $(Device/UBI-factory)
63   KERNEL_SIZE := 6144k
64 endef
65
66 define Device/linksys-wrt1200ac
67   $(call Device/linksys,WRT1200AC (Caiman))
68   $(Device/armada-385-linksys)
69   DEVICE_DTS := armada-385-linksys-caiman
70 endef
71 TARGET_DEVICES += linksys-wrt1200ac
72
73 define Device/linksys-wrt1900acv2
74   $(call Device/linksys,WRT1900ACv2 (Cobra))
75   $(Device/armada-385-linksys)
76   DEVICE_DTS := armada-385-linksys-cobra
77 endef
78 TARGET_DEVICES += linksys-wrt1900acv2
79
80 define Device/linksys-wrt1900acs
81   $(call Device/linksys,WRT1900ACS (Shelby))
82   $(Device/armada-385-linksys)
83   DEVICE_DTS := armada-385-linksys-shelby
84 endef
85 TARGET_DEVICES += linksys-wrt1900acs
86
87 define Device/linksys-wrt1900ac
88   $(call Device/linksys,WRT1900AC (Mamba))
89   DEVICE_DTS := armada-xp-linksys-mamba
90   $(Device/NAND-128K)
91   $(Device/UBI-factory)
92   KERNEL_SIZE := 3072k
93 endef
94 TARGET_DEVICES += linksys-wrt1900ac
95
96 define Device/openblocks-ax3
97   $(Device/UBI-factory)
98   DEVICE_DTS := armada-xp-openblocks-ax3-4
99   BLOCKSIZE := 128KiB
100   PAGESIZE := 1
101   IMAGE/factory.img := append-kernel $$$$(KERNEL_SIZE) | append-ubi
102   DEVICE_TITLE := Plat'Home OpenBlocks AX3
103 endef
104 TARGET_DEVICES += openblocks-ax3
105
106 define Device/armada-385-db-ap
107   $(Device/NAND-256K)
108   $(Device/UBI-factory)
109   KERNEL_SIZE := 8192k
110   DEVICE_TITLE := Marvell Armada 385 DB AP (DB-88F6820-AP)
111 endef
112 TARGET_DEVICES += armada-385-db-ap
113
114 define Device/marvell-nand
115   $(Device/NAND-512K)
116   DEVICE_TITLE := Marvell Armada $(1)
117 endef
118
119 Device/armada-370-db = $(call Device/marvell-nand,370 DB (DB-88F6710-BP-DDR3))
120 Device/armada-370-rd = $(call Device/marvell-nand,370 RD (RD-88F6710-A1))
121 Device/armada-xp-db = $(call Device/marvell-nand,XP DB (DB-78460-BP))
122 Device/armada-xp-gp = $(call Device/marvell-nand,XP GP (DB-MV784MP-GP))
123 TARGET_DEVICES += armada-370-db armada-370-rd armada-xp-db armada-xp-gp
124
125 define Device/armada-388-rd
126   DEVICE_TITLE := Marvell Armada 388 RD (RD-88F6820-AP)
127   IMAGES := firmware.bin
128   IMAGE/firmware.bin := append-kernel 256k | append-rootfs | pad-rootfs
129 endef
130 TARGET_DEVICES += armada-388-rd
131
132 define Device/armada-388-clearfog
133   KERNEL_INSTALL := 1
134   DEVICE_TITLE := SolidRun ClearFog
135 endef
136 TARGET_DEVICES += armada-388-clearfog
137
138 define Device/globalscale-mirabox
139   $(Device/NAND-512K)
140   DEVICE_DTS := armada-370-mirabox
141   DEVICE_TITLE := Globalscale Mirabox
142 endef
143 TARGET_DEVICES += globalscale-mirabox
144
145 $(eval $(call BuildImage))