96b008ac7c6a2c99a8f1e38d7fbb2a8d008c563e
[oweals/u-boot_mod.git] / u-boot / Makefile
1 #
2 # Copyright (C) 2016 Piotr Dymacz <piotr@dymacz.pl>
3 #
4 # (C) Copyright 2000-2006 Wolfgang Denk,
5 # DENX Software Engineering, wd@denx.de.
6 #
7 # SPDX-License-Identifier: GPL-2.0
8 #
9
10 VERSION      = 1
11 PATCHLEVEL   = 1
12 SUBLEVEL     = 4
13 EXTRAVERSION = -$(shell git rev-parse --short=8 HEAD)
14 ISREPODIRTY  = $(shell if git diff-files | read dummy; then echo 1; else echo 0; fi)
15 VERSION_FILE = include/version_autogenerated.h
16
17 MKCONFIG = $(BUILD_TOPDIR)/u-boot/mkconfig
18 MKIMAGE  = $(BUILD_TOPDIR)/u-boot/tools/mkimage
19 LZMA     = $(BUILD_TOPDIR)/host_util/$(HOSTOS)-$(HOSTARCH)/lzma
20
21 # Show in version string if we are not building from clean repository
22 ifeq ($(ISREPODIRTY),1)
23   U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)"-dirty"
24 else
25   U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)"-clean"
26 endif
27
28 # ===============================================================
29
30 TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
31 export TOPDIR
32
33 # Some variables passed as arguments in cmd
34 ifneq ($(IMG_SIZE),)
35   CONFIG_MAX_UBOOT_SIZE = $(IMG_SIZE)
36   export CONFIG_MAX_UBOOT_SIZE
37 endif
38
39 ifeq ($(IMG_LZMA),1)
40   COMPRESSED_UBOOT = 1
41   export COMPRESSED_UBOOT
42 endif
43
44 ifeq ($(IMG_RAM),1)
45   CONFIG_SKIP_LOWLEVEL_INIT = 1
46   export CONFIG_SKIP_LOWLEVEL_INIT
47 endif
48
49 ifneq ($(DEVICE_VENDOR),)
50   DEVICE_VENDOR = $(DEVICE_VENDOR)
51   export DEVICE_VENDOR
52 endif
53
54 # Never use LZMA compression
55 # for a RAM version of image
56 ifdef CONFIG_SKIP_LOWLEVEL_INIT
57   unexport COMPRESSED_UBOOT
58   COMPRESSED_UBOOT =
59 endif
60
61 ifndef CROSS_COMPILE
62   $(error "CROSS_COMPILE is not defined!")
63 endif
64 export CROSS_COMPILE
65
66 ifndef STAGING_DIR
67   $(error "STAGING_DIR is not defined!")
68 endif
69 export STAGING_DIR
70
71 # Endianness
72 ifndef ENDIANNESS
73   ENDIANNESS=-EB
74 endif
75 export ENDIANNESS
76
77 # =======================
78 # CUSTOM HELPER FUNCTIONS
79 # =======================
80
81 define echo_green
82   echo -e "\e[92m$(1)\e[0m"
83 endef
84
85 define echo_red
86   echo -e "\e[91m$(1)\e[0m"
87 endef
88
89 define echo_yellow
90   echo -e "\e[93m$(1)\e[0m"
91 endef
92
93 define ih_name
94 u-boot_mod $(if $(filter $(IMG_RAM),1),RAM,$(if $(filter $(IMG_LZMA),1),LZMA FLASH,FLASH)) image
95 endef
96
97 # $(1): define name
98 # $(2): define value
99 define define_add
100   len=$$((5 - ($$(expr length $(1))/8))); \
101   tab=`printf '%*s' "$$len" | tr ' ' "\t"`; \
102   echo -ne "#define $(strip $(1))$${tab}" >> include/config.h; \
103   echo -e  '$(strip $(2))' >> include/config.h
104 endef
105
106 # $(1): define name
107 define undef_add
108   echo -e '#undef $(strip $(1))' >> include/config.h
109 endef
110
111 # $(1): path
112 define include_add
113   echo -e '#include <$(strip $(1))>' >> include/config.h
114 endef
115
116 # $(1): name
117 define board_name
118 $(if $(1),$(strip $(1)),OEM/Unknown)
119 endef
120
121 # $(1): size
122 define flash_size
123 $(if $(1),$(strip $(1)),4)
124 endef
125
126 # $(1): vendor, board name/model
127 # $(2): default FLASH size in MB
128 # $(3): reset button GPIO number
129 # $(4): 1 if reset button is active low
130 # $(5): SOC_TYPE
131 define config_init
132   $(call echo_green,Preparing configuration for target: $@)
133   echo
134
135   $(call echo_yellow,  Device vendor/model:\t$(call board_name,$(1)))
136   $(if $(DEVICE_VENDOR), \
137     $(call echo_yellow,  Custom recovery web:\tyes ($(DEVICE_VENDOR))), \
138     $(call echo_yellow,  Custom recovery web:\tno) \
139   )
140
141   $(if $(CONFIG_MAX_UBOOT_SIZE), \
142     $(call echo_yellow,  Image size limit:\t$$(($(CONFIG_MAX_UBOOT_SIZE) / 1024)) KB),
143     $(call echo_yellow,  Image size limit:\tnot specified)
144   )
145
146   $(call echo_yellow,  Default FLASH size:\t$(call flash_size,$(2)) MB)
147
148   $(if $(3),
149     $(call echo_yellow,  GPIO reset button:\t$(strip $(3))), \
150     $(call echo_yellow,  GPIO reset button:\tnot specified) \
151   )
152
153   $(if $(filter $(4),1),
154     $(call echo_yellow,  Button active low:\tyes), \
155     $(call echo_yellow,  Button active low:\tno) \
156   )
157
158   $(if $(filter $(COMPRESSED_UBOOT),1), \
159     $(call echo_yellow,  LZMA compression:\tyes), \
160     $(call echo_yellow,  LZMA compression:\tno) \
161   )
162
163   $(if $(filter $(CONFIG_SKIP_LOWLEVEL_INIT),1), \
164     $(call echo_yellow,  RAM-loadable only:\tyes), \
165     $(call echo_yellow,  RAM-loadable only:\tno) \
166   )
167
168   $(if $(3),$(call define_add,CONFIG_GPIO_RESET_BTN,$(strip $(3))))
169   $(if $(filter $(4),1),$(call define_add,CONFIG_GPIO_RESET_BTN_ACTIVE_LOW,1))
170   $(if $(CONFIG_MAX_UBOOT_SIZE), \
171     $(call define_add,CONFIG_MAX_UBOOT_SIZE,$(CONFIG_MAX_UBOOT_SIZE))
172   )
173
174   $(if $(filter $(CONFIG_SKIP_LOWLEVEL_INIT),1), \
175     $(call define_add,CONFIG_SKIP_LOWLEVEL_INIT,1) \
176   )
177   $(if $(filter $(CONFIG_SKIP_LOWLEVEL_INIT),1), \
178     $(call undef_add,COMPRESSED_UBOOT) \
179   )
180
181   $(if $(5), \
182     $(call define_add,SOC_TYPE,$(5)) \
183   )
184
185   $(call define_add,CONFIG_BOARD_CUSTOM_STRING,"$(call board_name,$(1))")
186   $(call define_add,CONFIG_DEFAULT_FLASH_SIZE_IN_MB,$(call flash_size,$(2)))
187
188   echo
189 endef
190
191 # ===============================================================
192
193 # First, check if configuration was done
194 ifneq (include/config.mk, $(wildcard include/config.mk))
195 all install u-boot u-boot.srec depend dep:
196         $(error "System was not configured!")
197 else
198 # Load ARCH, BOARD, and CPU configuration
199 include include/config.mk
200 export ARCH CPU BOARD VENDOR SOC
201
202 # Load other configuration
203 include $(TOPDIR)/config.mk
204
205 # ===============================================================
206 # U-Boot objects....order is important (i.e. start must be first)
207 OBJS = cpu/$(CPU)/start.o
208
209 LIBS  = lib_generic/libgeneric.a
210 LIBS += common/libcommon.a
211
212 LIBS += lib_$(ARCH)/lib$(ARCH).a
213 LIBS += drivers/libdrivers.a
214 LIBS += net/libnet.a
215 LIBS += rtc/librtc.a
216 LIBS += httpd/libhttpd.a
217 LIBS += $(BOARDLIBS)
218
219 LIBS_SHARED = board/$(BOARDDIR)/lib$(BOARD).a
220 ifdef SOC
221   LIBS_SHARED += cpu/$(CPU)/$(SOC)/lib$(SOC).a
222 endif
223 LIBS_SHARED += cpu/$(CPU)/lib$(CPU).a
224
225 ifdef COMPRESSED_UBOOT
226   OBJS_BOOTSTRAP = cpu/$(CPU)/start_bootstrap.o
227   LIBS_BOOTSTRAP = lib_bootstrap/libbootstrap.a
228   PHONY_LIBS = $(LIBS_BOOTSTRAP) $(LIBS_SHARED)
229 else
230   PHONY_LIBS = $(LIBS) $(LIBS_SHARED)
231 endif
232 .PHONY: $(PHONY_LIBS)
233
234 # Add GCC lib
235 PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
236
237 # The "tools" are needed early, so put this first
238 # Don't include stuff already done in $(LIBS)
239 SUBDIRS = tools
240
241 .PHONY: $(SUBDIRS)
242
243 # ===============================================================
244
245 ALL = u-boot.srec u-boot.bin System.map
246
247 ifdef COMPRESSED_UBOOT
248 all: $(ALL) tuboot.bin
249 else
250 all: $(ALL) u-boot.img
251 endif
252
253 u-boot.hex: u-boot
254         $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
255
256 u-boot.srec: u-boot
257         $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
258
259 u-boot.bin: u-boot
260         $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
261
262 u-boot.img: u-boot.bin
263         @echo
264         $(call echo_green,Preparing regular U-Boot image $@...)
265         $(MKIMAGE) -A $(ARCH) -T firmware -C none -a $(TEXT_BASE) \
266                    -e 0 -n '$(call ih_name)' -d $< $@
267
268 u-boot.dis: u-boot
269         $(OBJDUMP) -d $< > $@
270
271 u-boot: depend version $(SUBDIRS) $(OBJS) $(LIBS) $(LIBS_SHARED) $(LDSCRIPT)
272         UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) $(LIBS_SHARED) | \
273                    sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p' | \
274                    sort | uniq`; \
275         $(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
276               --start-group $(LIBS) $(LIBS_SHARED) \
277               --end-group $(PLATFORM_LIBS) \
278               -Map u-boot.map -o u-boot
279
280 $(LIBS_SHARED):
281         $(MAKE) -C `dirname $@`
282
283 $(LIBS):
284         $(MAKE) -C `dirname $@`
285
286 $(SUBDIRS):
287         $(MAKE) -C $@ all
288
289 # For LZMA compressed image
290 ifdef COMPRESSED_UBOOT
291 tuboot.bin: System.map bootstrap.bin u-boot.lzimg
292         @cat bootstrap.bin > $@
293         @cat u-boot.lzimg >> $@
294
295 u-boot.lzimg: $(obj)u-boot.bin System.map
296         @echo
297         @rm -rf u-boot.bin.lzma
298         @$(call echo_green,Compressing U-Boot image $<...)
299         @$(LZMA) --best --keep $(obj)u-boot.bin
300         $(call echo_green,Preparing LZMA compressed U-Boot image $@...)
301         $(MKIMAGE) -A $(ARCH) -T firmware -C lzma \
302                    -a 0x$(shell grep "T _start" $(TOPDIR)/System.map | \
303                     awk '{ printf "%s", $$1 }') \
304                    -e 0x$(shell grep "T _start" $(TOPDIR)/System.map | \
305                     awk '{ printf "%s", $$1 }') \
306                    -n '$(call ih_name)' -d $(obj)u-boot.bin.lzma $@
307
308 bootstrap.bin: bootstrap
309         $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
310
311 bootstrap: depend version $(SUBDIRS) $(OBJS_BOOTSTRAP) $(LIBS_BOOTSTRAP) $(LIBS_SHARED) $(LDSCRIPT_BOOTSTRAP)
312         UNDEF_SYM=`$(OBJDUMP) -x $(LIBS_BOOTSTRAP) | \
313                    sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p' | \
314                    sort | uniq`; \
315         $(LD) $(LDFLAGS_BOOTSTRAP) $$UNDEF_SYM $(OBJS_BOOTSTRAP) \
316               --start-group $(LIBS_BOOTSTRAP) $(LIBS_SHARED) \
317               --end-group $(PLATFORM_LIBS) \
318               -Map bootstrap.map -o bootstrap
319
320 $(LIBS_BOOTSTRAP):
321         $(MAKE) -C `dirname $@`
322 endif # ifdef COMPRESSED_UBOOT
323
324 version:
325         @echo -n "#define U_BOOT_VERSION \"U-Boot $(U_BOOT_VERSION)\"" > $(VERSION_FILE)
326
327 depend dep:
328         @for dir in $(SUBDIRS); do $(MAKE) -C $$dir .depend; done
329
330 System.map: u-boot
331         @$(NM) $< | \
332                grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
333                sort > System.map
334 endif # include/config.mk
335
336 # =====================
337 # COMMON/SHARED TARGETS
338 # =====================
339
340 unconfig:
341         @$(call echo_green,Removing configuration...)
342         @rm -f include/config.h include/config.mk board/*/config.tmp
343
344 config_common:
345         @ >include/config.h
346         @$(call include_add,soc/soc_list.h)
347         @$(call define_add,CONFIG_MAX_BUTTON_PRESSING,10)
348         @$(call define_add,CONFIG_DELAY_TO_AUTORUN_HTTPD,3)
349         @$(call define_add,CONFIG_DELAY_TO_AUTORUN_CONSOLE,5)
350         @$(call define_add,CONFIG_DELAY_TO_AUTORUN_NETCONSOLE,7)
351
352 ar933x_common: unconfig config_common
353         @$(call define_add,CFG_AG7240_NMACS,2)
354         @$(call define_add,CFG_ATHRS26_PHY,1)
355         @$(call define_add,CONFIG_MACH_HORNET,1)
356
357 ar934x_common: unconfig config_common
358         @$(call define_add,CONFIG_WASP,1)
359         @$(call define_add,CONFIG_WASP_SUPPORT,1)
360
361 qca953x_common: unconfig config_common
362         @$(call define_add,CONFIG_ATHEROS,1)
363         @$(call define_add,CONFIG_MACH_QCA953x,1)
364
365 # =============================
366 # TARGETS IN ALPHABETICAL ORDER
367 # =============================
368
369 8devices_carambola2: ar933x_common
370         @$(call config_init,8devices Carambola 2,16,11,1,QCA_AR933X_SOC)
371         @$(call define_add,CONFIG_FOR_8DEVICES_CARAMBOLA2,1)
372         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
373
374 d-link_dir-505: ar933x_common
375         @$(call config_init,D-Link DIR-505,8,11,1,QCA_AR933X_SOC)
376         @$(call define_add,CONFIG_FOR_DLINK_DIR505_A1,1)
377         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
378
379 dragino_v2_ms14: ar933x_common
380         @$(call config_init,Dragino v2 (MS14),16,11,1,QCA_AR933X_SOC)
381         @$(call define_add,CONFIG_FOR_DRAGINO_V2,1)
382         @$(call define_add,WEBFAILSAFE_DISABLE_ART_UPGRADE,1)
383         @$(call define_add,WEBFAILSAFE_DISABLE_UBOOT_UPGRADE,1)
384         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
385
386 gainstrong_oolite_v1_dev: ar933x_common
387         @$(call config_init,Gainstrong Oolite v1 (dev board),16,11,,QCA_AR933X_SOC)
388         @$(call define_add,CONFIG_FOR_GS_OOLITE_V1_DEV,1)
389         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
390
391 gl-innovations_gl-inet-6416: ar933x_common
392         @$(call config_init,GL-Innovations GL.iNet 6416,8,11,,QCA_AR933X_SOC)
393         @$(call define_add,CONFIG_FOR_GL_INET,1)
394         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
395
396 tp-link_tl-mr10u: ar933x_common
397         @$(call config_init,TP-Link TL-MR10U,4,11,,QCA_AR933X_SOC)
398         @$(call define_add,CONFIG_FOR_TPLINK_MR10U_V1,1)
399         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
400
401 tp-link_tl-mr13u: ar933x_common
402         @$(call config_init,TP-Link TL-MR13U,4,11,,QCA_AR933X_SOC)
403         @$(call define_add,CONFIG_FOR_TPLINK_MR13U_V1,1)
404         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
405
406 tp-link_tl-mr3020: ar933x_common
407         @$(call config_init,TP-Link TL-MR3020,4,11,,QCA_AR933X_SOC)
408         @$(call define_add,CONFIG_FOR_TPLINK_MR3020_V1,1)
409         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
410
411 tp-link_tl-mr3040: ar933x_common
412         @$(call config_init,TP-Link TL-MR3040,4,11,,QCA_AR933X_SOC)
413         @$(call define_add,CONFIG_FOR_TPLINK_MR3040_V1V2,1)
414         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
415
416 tp-link_tl-mr3220_v2: ar933x_common
417         @$(call config_init,TP-Link TL-MR3220 v2,4,11,,QCA_AR933X_SOC)
418         @$(call define_add,CONFIG_FOR_TPLINK_MR3220_V2,1)
419         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
420
421 tp-link_tl-mr3420_v2: ar934x_common
422         @$(call config_init,TP-Link TL-MR3420 v2,4,17,1,QCA_AR9341_SOC)
423         @$(call define_add,CONFIG_FOR_TPLINK_MR3420_V2,1)
424         @$(call define_add,CFG_ATHRS27_PHY,1)
425         @$(call define_add,CFG_AG7240_NMACS,2)
426         @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
427
428 tp-link_tl-wa830re_v2_tl-wa801nd_v2: ar934x_common
429         @$(call config_init,TP-Link TL-WA830RE/TL-WA801ND v2,4,17,1,QCA_AR9341_SOC)
430         @$(call define_add,CONFIG_FOR_TPLINK_WA830RE_V2_WA801ND_V2,1)
431         @$(call define_add,CFG_ATHRS27_PHY,1)
432         @$(call define_add,CFG_AG7240_NMACS,2)
433         @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
434
435 tp-link_tl-wdr3500: ar934x_common
436         @$(call config_init,TP-Link TL-WDR3500,8,16,1,QCA_AR9344_SOC)
437         @$(call define_add,CONFIG_FOR_TPLINK_WDR3500_V1,1)
438         @$(call define_add,CFG_ATHRS27_PHY,1)
439         @$(call define_add,CFG_AG7240_NMACS,2)
440         @$(call define_add,CONFIG_PCI,1)
441         @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
442
443 tp-link_tl-wdr3600_tl-43x0: ar934x_common
444         @$(call config_init,TP-Link TL-WDR3600/43x0,8,16,1,QCA_AR9344_SOC)
445         @$(call define_add,CONFIG_FOR_TPLINK_WDR3600_WDR43X0_V1,1)
446         @$(call define_add,CFG_ATHRS17_PHY,1)
447         @$(call define_add,CFG_AG7240_NMACS,1)
448         @$(call define_add,CONFIG_PCI,1)
449         @$(call define_add,CFG_DUAL_PHY_SUPPORT,1)
450         @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
451
452 tp-link_tl-wr703n: ar933x_common
453         @$(call config_init,TP-Link TL-WR703N,4,11,,QCA_AR933X_SOC)
454         @$(call define_add,CONFIG_FOR_TPLINK_WR703N_V1,1)
455         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
456
457 tp-link_tl-wr710n: ar933x_common
458         @$(call config_init,TP-Link TL-WR710N,8,11,,QCA_AR933X_SOC)
459         @$(call define_add,CONFIG_FOR_TPLINK_WR710N_V1,1)
460         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
461
462 tp-link_tl-wr720n_v3_CN: ar933x_common
463         @$(call config_init,TP-Link TL-WR720N v3 CN,4,11,,QCA_AR933X_SOC)
464         @$(call define_add,CONFIG_FOR_TPLINK_WR720N_V3,1)
465         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
466
467 tp-link_tl-wr740n_v4: ar933x_common
468         @$(call config_init,TP-Link TL-WR74xN/D v4,4,11,,QCA_AR933X_SOC)
469         @$(call define_add,CONFIG_FOR_TPLINK_WR740N_V4,1)
470         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
471
472 tp-link_tl-wr802n: qca953x_common
473         @$(call config_init,TP-Link TL-WR802N,4,12,1,QCA_QCA953X_SOC)
474         @$(call define_add,CONFIG_FOR_TPLINK_WR802N,1)
475         @$(call define_add,CFG_ATHRS27_PHY,1)
476         @$(call define_add,CFG_ATH_GMAC_NMACS,2)
477         @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
478
479 tp-link_tl-wr820n_CN: qca953x_common
480         @$(call config_init,TP-Link TL-WR820N CN,4,12,1,QCA_QCA953X_SOC)
481         @$(call define_add,CONFIG_FOR_TPLINK_WR820N_CN,1)
482         @$(call define_add,CFG_ATHRS27_PHY,1)
483         @$(call define_add,CFG_ATH_GMAC_NMACS,2)
484         @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
485
486 tp-link_tl-wr841n_v8: ar934x_common
487         @$(call config_init,TP-Link TL-WR841N/D v8,4,17,1,QCA_AR9341_SOC)
488         @$(call define_add,CONFIG_FOR_TPLINK_WR841N_V8,1)
489         @$(call define_add,CFG_ATHRS27_PHY,1)
490         @$(call define_add,CFG_AG7240_NMACS,2)
491         @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
492
493 tp-link_tl-wr841n_v9: qca953x_common
494         @$(call config_init,TP-Link TL-WR841N/D v9,4,12,1,QCA_QCA953X_SOC)
495         @$(call define_add,CONFIG_FOR_TPLINK_WR841N_V9,1)
496         @$(call define_add,CFG_ATHRS27_PHY,1)
497         @$(call define_add,CFG_ATH_GMAC_NMACS,2)
498         @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
499
500 unwireddevices_unwired-one: ar933x_common
501         @$(call config_init,Black Swift aka Unwired One,16,11,1,QCA_AR933X_SOC)
502         @$(call define_add,CONFIG_FOR_BLACK_SWIFT_BOARD,1)
503         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
504
505 village-telco_mesh-potato_v2: ar933x_common
506         @$(call config_init,Village Telco Mesh Potato 2,16,11,1,QCA_AR933X_SOC)
507         @$(call define_add,CONFIG_FOR_MESH_POTATO_V2,1)
508         @$(call define_add,WEBFAILSAFE_DISABLE_ART_UPGRADE,1)
509         @$(call define_add,WEBFAILSAFE_DISABLE_UBOOT_UPGRADE,1)
510         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
511
512 wallys_dr531: qca953x_common
513         @$(call config_init,Wallys DR531,8,17,1,QCA_QCA953X_SOC)
514         @$(call define_add,CONFIG_FOR_WALLYS_DR531,1)
515         @$(call define_add,CFG_ATHRS27_PHY,1)
516         @$(call define_add,CFG_ATH_GMAC_NMACS,2)
517         @$(call define_add,CONFIG_PCI,1)
518         @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
519
520 zbtlink_zbt-we1526: qca953x_common
521         @$(call config_init,Zbtlink ZBT-WE1526,16,17,1,QCA_QCA953X_SOC)
522         @$(call define_add,CONFIG_FOR_ZBTLINK_ZBT_WE1526,1)
523         @$(call define_add,CFG_ATHRS27_PHY,1)
524         @$(call define_add,CFG_ATH_GMAC_NMACS,2)
525         @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
526
527 # =============
528 # CLEAN TARGETS
529 # =============
530
531 clean:
532         @$(call echo_green,Making $@...)
533         @find . -type f \
534                 \( -name 'core' -o -name '*.bak' -o -name '*~' \
535                 -o -name '*.o'  -o -name '*.a' -o -name .depend \) -print \
536                 | xargs rm -f
537         @rm -f tools/mkimage tools/envcrc
538         @rm -f lib_bootstrap/*.o
539         @rm -f lib_bootstrap/*.a
540         @rm -f bootstrap bootstrap.bin tuboot.bin u-boot.lzimg u-boot.bin.lzma bootstrap.map
541
542 clobber: clean
543         @$(call echo_green,Making $@...)
544         @find . -type f \( -name .depend \
545                 -o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
546                 -print0 \
547                 | xargs -0 rm -f
548         @rm -f $(OBJS) *.bak include/version_autogenerated.h
549         @rm -fr *.*~
550         @rm -f u-boot u-boot.map u-boot.hex $(ALL)
551         @rm -f tools/crc32.c tools/environment.c
552         @rm -f include/asm/proc include/asm/arch include/asm
553
554 distclean: clobber unconfig