Rework main Makefiles
[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_KB = $(IMG_SIZE)
36   export CONFIG_MAX_UBOOT_SIZE_KB
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_KB), \
142     $(call echo_yellow,  Image size limit:\t$(CONFIG_MAX_UBOOT_SIZE_KB) 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_KB), \
171     $(call define_add,CONFIG_MAX_UBOOT_SIZE_KB,$(CONFIG_MAX_UBOOT_SIZE_KB))
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_BOOTDELAY,1)
348         @$(call define_add,CONFIG_SILENT_CONSOLE,1)
349         @$(call define_add,CFG_CONSOLE_INFO_QUIET,1)
350         @$(call define_add,CONFIG_MAX_BUTTON_PRESSING,10)
351         @$(call define_add,CONFIG_DELAY_TO_AUTORUN_HTTPD,3)
352         @$(call define_add,CONFIG_DELAY_TO_AUTORUN_CONSOLE,5)
353         @$(call define_add,CONFIG_DELAY_TO_AUTORUN_NETCONSOLE,7)
354
355 ar933x_common: unconfig config_common
356         @$(call define_add,CONFIG_MACH_HORNET,1)
357
358 ar934x_common: unconfig config_common
359         @$(call define_add,CONFIG_WASP,1)
360         @$(call define_add,CONFIG_WASP_SUPPORT,1)
361
362 qca953x_common: unconfig config_common
363         @$(call define_add,CONFIG_ATHEROS,1)
364         @$(call define_add,CONFIG_MACH_QCA953x,1)
365
366 # =============================
367 # TARGETS IN ALPHABETICAL ORDER
368 # =============================
369
370 8devices_carambola2: ar933x_common
371         @$(call config_init,8devices Carambola 2,16,11,1,QCA_AR933X_SOC)
372         @$(call define_add,CONFIG_FOR_8DEVICES_CARAMBOLA2,1)
373         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
374
375 d-link_dir-505: ar933x_common
376         @$(call config_init,D-Link DIR-505,8,11,1,QCA_AR933X_SOC)
377         @$(call define_add,CONFIG_FOR_DLINK_DIR505_A1,1)
378         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
379
380 dragino_v2_ms14: ar933x_common
381         @$(call config_init,Dragino v2 (MS14),16,11,1,QCA_AR933X_SOC)
382         @$(call define_add,CONFIG_FOR_DRAGINO_V2,1)
383         @$(call define_add,WEBFAILSAFE_DISABLE_ART_UPGRADE,1)
384         @$(call define_add,WEBFAILSAFE_DISABLE_UBOOT_UPGRADE,1)
385         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
386
387 gainstrong_oolite_v1_dev: ar933x_common
388         @$(call config_init,Gainstrong Oolite v1 (dev board),16,11,,QCA_AR933X_SOC)
389         @$(call define_add,CONFIG_FOR_GS_OOLITE_V1_DEV,1)
390         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
391
392 gl-innovations_gl-inet-6416: ar933x_common
393         @$(call config_init,GL-Innovations GL.iNet 6416,8,11,,QCA_AR933X_SOC)
394         @$(call define_add,CONFIG_FOR_GL_INET,1)
395         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
396
397 tp-link_tl-mr10u: ar933x_common
398         @$(call config_init,TP-Link TL-MR10U,4,11,,QCA_AR933X_SOC)
399         @$(call define_add,CONFIG_FOR_TPLINK_MR10U_V1,1)
400         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
401
402 tp-link_tl-mr13u: ar933x_common
403         @$(call config_init,TP-Link TL-MR13U,4,11,,QCA_AR933X_SOC)
404         @$(call define_add,CONFIG_FOR_TPLINK_MR13U_V1,1)
405         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
406
407 tp-link_tl-mr3020: ar933x_common
408         @$(call config_init,TP-Link TL-MR3020,4,11,,QCA_AR933X_SOC)
409         @$(call define_add,CONFIG_FOR_TPLINK_MR3020_V1,1)
410         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
411
412 tp-link_tl-mr3040: ar933x_common
413         @$(call config_init,TP-Link TL-MR3040,4,11,,QCA_AR933X_SOC)
414         @$(call define_add,CONFIG_FOR_TPLINK_MR3040_V1V2,1)
415         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
416
417 tp-link_tl-mr3220_v2: ar933x_common
418         @$(call config_init,TP-Link TL-MR3220 v2,4,11,,QCA_AR933X_SOC)
419         @$(call define_add,CONFIG_FOR_TPLINK_MR3220_V2,1)
420         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
421
422 tp-link_tl-mr3420_v2: ar934x_common
423         @$(call config_init,TP-Link TL-MR3420 v2,4,17,1,QCA_AR9341_SOC)
424         @$(call define_add,CONFIG_FOR_TPLINK_MR3420_V2,1)
425         @$(call define_add,CFG_ATHRS27_PHY,1)
426         @$(call define_add,CFG_AG7240_NMACS,2)
427         @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
428
429 tp-link_tl-wa830re_v2_tl-wa801nd_v2: ar934x_common
430         @$(call config_init,TP-Link TL-WA830RE/TL-WA801ND v2,4,17,1,QCA_AR9341_SOC)
431         @$(call define_add,CONFIG_FOR_TPLINK_WA830RE_V2_WA801ND_V2,1)
432         @$(call define_add,CFG_ATHRS27_PHY,1)
433         @$(call define_add,CFG_AG7240_NMACS,2)
434         @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
435
436 tp-link_tl-wdr3500: ar934x_common
437         @$(call config_init,TP-Link TL-WDR3500,8,16,1,QCA_AR9344_SOC)
438         @$(call define_add,CONFIG_FOR_TPLINK_WDR3500_V1,1)
439         @$(call define_add,CFG_ATHRS27_PHY,1)
440         @$(call define_add,CFG_AG7240_NMACS,2)
441         @$(call define_add,CONFIG_PCI,1)
442         @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
443
444 tp-link_tl-wdr3600_tl-43x0: ar934x_common
445         @$(call config_init,TP-Link TL-WDR3600/43x0,8,16,1,QCA_AR9344_SOC)
446         @$(call define_add,CONFIG_FOR_TPLINK_WDR3600_WDR43X0_V1,1)
447         @$(call define_add,CFG_ATHRS17_PHY,1)
448         @$(call define_add,CFG_AG7240_NMACS,1)
449         @$(call define_add,CONFIG_PCI,1)
450         @$(call define_add,CFG_DUAL_PHY_SUPPORT,1)
451         @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
452
453 tp-link_tl-wr703n: ar933x_common
454         @$(call config_init,TP-Link TL-WR703N,4,11,,QCA_AR933X_SOC)
455         @$(call define_add,CONFIG_FOR_TPLINK_WR703N_V1,1)
456         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
457
458 tp-link_tl-wr710n: ar933x_common
459         @$(call config_init,TP-Link TL-WR710N,8,11,,QCA_AR933X_SOC)
460         @$(call define_add,CONFIG_FOR_TPLINK_WR710N_V1,1)
461         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
462
463 tp-link_tl-wr720n_v3_CN: ar933x_common
464         @$(call config_init,TP-Link TL-WR720N v3 CN,4,11,,QCA_AR933X_SOC)
465         @$(call define_add,CONFIG_FOR_TPLINK_WR720N_V3,1)
466         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
467
468 tp-link_tl-wr740n_v4: ar933x_common
469         @$(call config_init,TP-Link TL-WR74xN/D v4,4,11,,QCA_AR933X_SOC)
470         @$(call define_add,CONFIG_FOR_TPLINK_WR740N_V4,1)
471         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
472
473 tp-link_tl-wr802n: qca953x_common
474         @$(call config_init,TP-Link TL-WR802N,4,12,1,QCA_QCA953X_SOC)
475         @$(call define_add,CONFIG_FOR_TPLINK_WR802N,1)
476         @$(call define_add,CFG_ATHRS27_PHY,1)
477         @$(call define_add,CFG_ATH_GMAC_NMACS,2)
478         @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
479
480 tp-link_tl-wr820n_CN: qca953x_common
481         @$(call config_init,TP-Link TL-WR820N CN,4,12,1,QCA_QCA953X_SOC)
482         @$(call define_add,CONFIG_FOR_TPLINK_WR820N_CN,1)
483         @$(call define_add,CFG_ATHRS27_PHY,1)
484         @$(call define_add,CFG_ATH_GMAC_NMACS,2)
485         @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
486
487 tp-link_tl-wr841n_v8: ar934x_common
488         @$(call config_init,TP-Link TL-WR841N/D v8,4,17,1,QCA_AR9341_SOC)
489         @$(call define_add,CONFIG_FOR_TPLINK_WR841N_V8,1)
490         @$(call define_add,CFG_ATHRS27_PHY,1)
491         @$(call define_add,CFG_AG7240_NMACS,2)
492         @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
493
494 tp-link_tl-wr841n_v9: qca953x_common
495         @$(call config_init,TP-Link TL-WR841N/D v9,4,12,1,QCA_QCA953X_SOC)
496         @$(call define_add,CONFIG_FOR_TPLINK_WR841N_V9,1)
497         @$(call define_add,CFG_ATHRS27_PHY,1)
498         @$(call define_add,CFG_ATH_GMAC_NMACS,2)
499         @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
500
501 unwireddevices_unwired-one: ar933x_common
502         @$(call config_init,Black Swift aka Unwired One,16,11,1,QCA_AR933X_SOC)
503         @$(call define_add,CONFIG_FOR_BLACK_SWIFT_BOARD,1)
504         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
505
506 village-telco_mesh-potato_v2: ar933x_common
507         @$(call config_init,Village Telco Mesh Potato 2,16,11,1,QCA_AR933X_SOC)
508         @$(call define_add,CONFIG_FOR_MESH_POTATO_V2,1)
509         @$(call define_add,WEBFAILSAFE_DISABLE_ART_UPGRADE,1)
510         @$(call define_add,WEBFAILSAFE_DISABLE_UBOOT_UPGRADE,1)
511         @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
512
513 wallys_dr531: qca953x_common
514         @$(call config_init,Wallys DR531,8,17,1,QCA_QCA953X_SOC)
515         @$(call define_add,CONFIG_FOR_WALLYS_DR531,1)
516         @$(call define_add,CFG_ATHRS27_PHY,1)
517         @$(call define_add,CFG_ATH_GMAC_NMACS,2)
518         @$(call define_add,CONFIG_PCI,1)
519         @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
520
521 zbtlink_zbt-we1526: qca953x_common
522         @$(call config_init,Zbtlink ZBT-WE1526,16,17,1,QCA_QCA953X_SOC)
523         @$(call define_add,CONFIG_FOR_ZBTLINK_ZBT_WE1526,1)
524         @$(call define_add,CFG_ATHRS27_PHY,1)
525         @$(call define_add,CFG_ATH_GMAC_NMACS,2)
526         @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
527
528 # =============
529 # CLEAN TARGETS
530 # =============
531
532 clean:
533         @$(call echo_green,Making $@...)
534         @find . -type f \
535                 \( -name 'core' -o -name '*.bak' -o -name '*~' \
536                 -o -name '*.o'  -o -name '*.a' -o -name .depend \) -print \
537                 | xargs rm -f
538         @rm -f tools/mkimage tools/envcrc
539         @rm -f lib_bootstrap/*.o
540         @rm -f lib_bootstrap/*.a
541         @rm -f bootstrap bootstrap.bin tuboot.bin u-boot.lzimg u-boot.bin.lzma bootstrap.map
542
543 clobber: clean
544         @$(call echo_green,Making $@...)
545         @find . -type f \( -name .depend \
546                 -o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
547                 -print0 \
548                 | xargs -0 rm -f
549         @rm -f $(OBJS) *.bak include/version_autogenerated.h
550         @rm -fr *.*~
551         @rm -f u-boot u-boot.map u-boot.hex $(ALL)
552         @rm -f tools/crc32.c tools/environment.c
553         @rm -f include/asm/proc include/asm/arch include/asm
554
555 distclean: clobber unconfig