generic: ar8216: use ar8216_read_port_link to get the CPU port link parameters
[openwrt.git] / target / linux / lantiq / image / Makefile
1 #
2 # Copyright (C) 2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
9
10 JFFS2_BLOCKSIZE = 64k 128k 256k
11
12 ase_cmdline=-console=ttyLTQ0,115200 rootfstype=squashfs,jffs2
13 xway_cmdline=-console=ttyLTQ1,115200 rootfstype=squashfs,jffs2
14 falcon_cmdline=-console=ttyLTQ0,115200 rootfstype=squashfs,jffs2
15
16 define CompressLzma
17 $(STAGING_DIR_HOST)/bin/lzma e $(1) $(2)
18 endef
19
20 define PatchKernelLzma
21 cp $(KDIR)/vmlinux $(KDIR)/vmlinux-$(1)
22 $(STAGING_DIR_HOST)/bin/patch-cmdline $(KDIR)/vmlinux-$(1) '$(strip $(2))'
23 $(call CompressLzma,$(KDIR)/vmlinux-$(1),$(KDIR)/vmlinux-$(1).lzma)
24 endef
25
26 define MkBrnImage
27 mkbrncmdline -i $(KDIR)/vmlinux-$(4) -o $(KDIR)/vmlinux-$(4)-brn BRN-BOOT $(6)
28 $(call CompressLzma,$(KDIR)/vmlinux-$(4)-brn,$(KDIR)/vmlinux-$(4)-brn.lzma)
29 mkbrnimg -s $(1) -m $(2) -o $(3) $(KDIR)/vmlinux-$(4)-brn.lzma $(KDIR)/root.$(5)
30 endef
31
32 define MkImageLzma
33 mkimage -A mips -O linux -T kernel -a 0x80002000 -C lzma \
34 -e 0x80002000 -n 'MIPS OpenWrt Linux-$(LINUX_VERSION)' \
35 -d $(KDIR)/vmlinux-$(1).lzma $(KDIR)/uImage-$(1)
36 endef
37
38 define Image/Build/squashfs
39 cat $(KDIR)/uImage-$(2) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
40 $(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image)
41 $(if $(3),$(call MkBrnImage,$(3),$(4),$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(3)-brnImage,$(2),$(1),$(5)))
42 endef
43
44 define Image/Build/jffs2-64k
45 dd if=$(KDIR)/uImage-$(2) of=$(KDIR)/uImage-$(2)-$(1) bs=64k conv=sync
46 cat $(KDIR)/uImage-$(2)-$(1) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
47 endef
48
49 define Image/Build/jffs2-128k
50 dd if=$(KDIR)/uImage-$(2) of=$(KDIR)/uImage-$(2)-$(1) bs=128k conv=sync
51 cat $(KDIR)/uImage-$(2)-$(1) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
52 endef
53
54 define Image/Build/jffs2-256k
55 dd if=$(KDIR)/uImage-$(2) of=$(KDIR)/uImage-$(2)-$(1) bs=256k conv=sync
56 cat $(KDIR)/uImage-$(2)-$(1) $(KDIR)/root.$(1) > $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1).image
57 endef
58
59 define Image/BuildKernel/Template
60 $(call PatchKernelLzma,$(1),$(if $(2),$(2) machtype=$(1),))
61 $(call MkImageLzma,$(1))
62 $(CP) $(KDIR)/uImage-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-uImage
63 endef
64
65 ifeq ($(CONFIG_TARGET_lantiq_danube),y)
66 define Image/BuildKernel/Profile/EASY50712
67 $(call Image/BuildKernel/Template,EASY50712,$(xway_cmdline))
68 endef
69
70 define Image/Build/Profile/EASY50712
71 $(call Image/Build/$(1),$(1),EASY50712)
72 endef
73
74 define Image/BuildKernel/Profile/EASY50812
75 $(call Image/BuildKernel/Template,EASY50812,$(xway_cmdline))
76 endef
77
78 define Image/Build/Profile/EASY50812
79 $(call Image/Build/$(1),$(1),EASY50812)
80 endef
81
82 define Image/BuildKernel/Profile/ARV3527P
83 $(call Image/BuildKernel/Template,ARV3527P,$(xway_cmdline))
84 endef
85
86 define Image/Build/Profile/ARV3527P
87 $(call Image/Build/$(1),$(1),ARV3527P)
88 endef
89
90 define Image/BuildKernel/Profile/ARV4510PW
91 $(call Image/BuildKernel/Template,ARV4510PW,$(xway_cmdline))
92 endef
93
94 define Image/Build/Profile/ARV4510PW
95 $(call Image/Build/$(1),$(1),ARV4510PW)
96 endef
97
98 define Image/BuildKernel/Profile/ARV4518PW
99 $(call Image/BuildKernel/Template,ARV4518PW,$(xway_cmdline))
100 endef
101
102 define Image/Build/Profile/ARV4518PW
103 $(call Image/Build/$(1),$(1),ARV4518PW)
104 endef
105
106 define Image/BuildKernel/Profile/ARV4520PW
107 $(call Image/BuildKernel/Template,ARV4520PW,$(xway_cmdline))
108 endef
109
110 define Image/Build/Profile/ARV4520PW
111 $(call Image/Build/$(1),$(1),ARV4520PW)
112 endef
113
114 define Image/BuildKernel/Profile/ARV4525PW
115 $(call Image/BuildKernel/Template,ARV4525PW,$(xway_cmdline))
116 endef
117
118 define Image/Build/Profile/ARV4525PW
119 $(call Image/Build/$(1),$(1),ARV4525PW,BRNDTW502,0x12345678,memsize=32)
120 endef
121
122 define Image/BuildKernel/Profile/ARV7525PW
123 $(call Image/BuildKernel/Template,ARV7525PW,$(xway_cmdline))
124 endef
125
126 define Image/Build/Profile/ARV7525PW
127 $(call Image/Build/$(1),$(1),ARV7525PW)
128 endef
129
130 define Image/BuildKernel/Profile/ARV452CPW
131 $(call Image/BuildKernel/Template,ARV452CPW,$(xway_cmdline))
132 endef
133
134 define Image/Build/Profile/ARV452CPW
135 $(call Image/Build/$(1),$(1),ARV452CPW)
136 endef
137
138 define Image/BuildKernel/Profile/ARV7518PW
139 $(call Image/BuildKernel/Template,ARV7518PW,$(xway_cmdline))
140 endef
141
142 define Image/Build/Profile/ARV7518PW
143 $(call Image/Build/$(1),$(1),ARV7518PW)
144 endef
145
146 define Image/BuildKernel/Profile/ARV752DPW
147 $(call Image/BuildKernel/Template,ARV752DPW,$(xway_cmdline))
148 endef
149
150 define Image/Build/Profile/ARV752DPW
151 $(call Image/Build/$(1),$(1),ARV752DPW)
152 endef
153
154 define Image/BuildKernel/Profile/ARV752DPW22
155 $(call Image/BuildKernel/Template,ARV752DPW22,$(xway_cmdline))
156 endef
157
158 define Image/Build/Profile/ARV752DPW22
159 $(call Image/Build/$(1),$(1),ARV752DPW22)
160 endef
161
162 define Image/BuildKernel/Profile/GIGASX76X
163 $(call Image/BuildKernel/Template,GIGASX76X,$(xway_cmdline))
164 endef
165
166 define Image/Build/Profile/GIGASX76X
167 $(call Image/Build/$(1),$(1),GIGASX76X)
168 endef
169
170 define Image/BuildKernel/Profile/Generic
171 $(call Image/BuildKernel/Template,EASY4010,$(xway_cmdline))
172 $(call Image/BuildKernel/Template,EASY50712,$(xway_cmdline))
173 $(call Image/BuildKernel/Template,EASY50812,$(xway_cmdline))
174 $(call Image/BuildKernel/Template,ARV3527P,$(xway_cmdline))
175 $(call Image/BuildKernel/Template,ARV4510PW,$(xway_cmdline))
176 $(call Image/BuildKernel/Template,ARV4518PW,$(xway_cmdline))
177 $(call Image/BuildKernel/Template,ARV4520PW,$(xway_cmdline))
178 $(call Image/BuildKernel/Template,ARV452CPW,$(xway_cmdline))
179 $(call Image/BuildKernel/Template,ARV4525PW,$(xway_cmdline))
180 $(call Image/BuildKernel/Template,ARV7525PW,$(xway_cmdline))
181 $(call Image/BuildKernel/Template,ARV7518PW,$(xway_cmdline))
182 $(call Image/BuildKernel/Template,ARV752DPW,$(xway_cmdline))
183 $(call Image/BuildKernel/Template,ARV752DPW22,$(xway_cmdline))
184 $(call Image/BuildKernel/Template,GIGASX76X,$(xway_cmdline))
185 $(call Image/BuildKernel/Template,NONE)
186 endef
187
188 define Image/Build/Profile/Generic
189 $(call Image/Build/$(1),$(1),EASY4010)
190 $(call Image/Build/$(1),$(1),EASY50712)
191 $(call Image/Build/$(1),$(1),EASY50812)
192 $(call Image/Build/$(1),$(1),ARV3527P)
193 $(call Image/Build/$(1),$(1),ARV4510PW)
194 $(call Image/Build/$(1),$(1),ARV4518PW)
195 $(call Image/Build/$(1),$(1),ARV4520PW)
196 $(call Image/Build/$(1),$(1),ARV452CPW)
197 $(call Image/Build/$(1),$(1),ARV4525PW)
198 $(call Image/Build/$(1),$(1),ARV7525PW)
199 $(call Image/Build/$(1),$(1),ARV7518PW)
200 $(call Image/Build/$(1),$(1),ARV752DPW)
201 $(call Image/Build/$(1),$(1),ARV752DPW22)
202 $(call Image/Build/$(1),$(1),GIGASX76X)
203 $(call Image/Build/$(1),$(1),NONE)
204 $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).rootfs
205 endef
206 endif
207
208 ifeq ($(CONFIG_TARGET_lantiq_ar9),y)
209 define Image/BuildKernel/Profile/WBMR
210 $(call Image/BuildKernel/Template,WBMR,$(xway_cmdline))
211 endef
212
213 define Image/Build/Profile/WBMR
214 $(call Image/Build/$(1),$(1),WBMR)
215 endef
216
217 define Image/BuildKernel/Profile/DGN3500B
218 $(call Image/BuildKernel/Template,DGN3500B,$(xway_cmdline))
219 endef
220
221 define Image/Build/Profile/DGN3500B
222 $(call Image/Build/$(1),$(1),DGN3500B)
223 endef
224
225 define Image/BuildKernel/Profile/Generic
226 $(call Image/BuildKernel/Template,WBMR,$(xway_cmdline))
227 $(call Image/BuildKernel/Template,DGN3500B,$(xway_cmdline))
228 $(call Image/BuildKernel/Template,NONE)
229 endef
230
231 define Image/Build/Profile/Generic
232 $(call Image/Build/$(1),$(1),WBMR)
233 $(call Image/Build/$(1),$(1),DGN3500B)
234 $(call Image/Build/$(1),$(1),NONE)
235 $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).rootfs
236 endef
237 endif
238
239 ifeq ($(CONFIG_TARGET_lantiq_falcon)$(CONFIG_TARGET_lantiq_falcon_stable),y)
240 define Image/BuildKernel/Profile/EASY98000
241 $(call Image/BuildKernel/Template,EASY98000,$(falcon_cmdline))
242 endef
243
244 define Image/Build/Profile/EASY98000
245 $(call Image/Build/$(1),$(1),EASY98000)
246 endef
247
248 define Image/BuildKernel/Profile/EASY98020
249 $(call Image/BuildKernel/Template,EASY98020,$(falcon_cmdline))
250 endef
251
252 define Image/Build/Profile/EASY98020
253 $(call Image/Build/$(1),$(1),EASY98020)
254 endef
255
256 define Image/BuildKernel/Profile/Generic
257 $(call Image/BuildKernel/Template,EASY98000,$(falcon_cmdline))
258 $(call Image/BuildKernel/Template,EASY98020,$(falcon_cmdline))
259 $(call Image/BuildKernel/Template,NONE)
260 endef
261
262 define Image/Build/Profile/Generic
263 $(call Image/Build/$(1),$(1),EASY98000)
264 $(call Image/Build/$(1),$(1),EASY98020)
265 $(call Image/Build/$(1),$(1),NONE)
266 $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).rootfs
267 endef
268 endif
269
270 ifeq ($(CONFIG_TARGET_lantiq_ase),y)
271 define Image/BuildKernel/Profile/EASY50601
272 $(call Image/BuildKernel/Template,EASY50601,$(ase_cmdline))
273 endef
274
275 define Image/Build/Profile/EASY50601
276 $(call Image/Build/$(1),$(1),EASY50601)
277 endef
278
279 define Image/BuildKernel/Profile/Generic
280 $(call Image/BuildKernel/Template,EASY50601,$(ase_cmdline))
281 $(call Image/BuildKernel/Template,NONE)
282 endef
283
284 define Image/Build/Profile/Generic
285 $(call Image/Build/$(1),$(1),EASY50601)
286 $(call Image/Build/$(1),$(1),NONE)
287 $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).rootfs
288 endef
289 endif
290
291 define Image/BuildKernel
292 $(call Image/BuildKernel/Profile/$(PROFILE))
293 endef
294
295 define Image/Build
296 $(call Image/Build/Profile/$(PROFILE),$(1))
297 endef
298
299 $(eval $(call BuildImage))
This page took 0.053157 seconds and 5 git commands to generate.