2 # Copyright (C) 2016 Piotr Dymacz <piotr@dymacz.pl>
4 # (C) Copyright 2000-2006 Wolfgang Denk,
5 # DENX Software Engineering, wd@denx.de.
7 # SPDX-License-Identifier: GPL-2.0
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
17 MKCONFIG = $(BUILD_TOPDIR)/u-boot/mkconfig
18 MKIMAGE = $(BUILD_TOPDIR)/u-boot/tools/mkimage
19 LZMA = $(BUILD_TOPDIR)/host_util/lzma/lzma
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"
25 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)"-clean"
28 # ===============================================================
30 TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
33 # Some variables passed as arguments in cmd
35 CONFIG_MAX_UBOOT_SIZE = $(IMG_SIZE)
36 export CONFIG_MAX_UBOOT_SIZE
41 export COMPRESSED_UBOOT
45 CONFIG_SKIP_LOWLEVEL_INIT = 1
46 export CONFIG_SKIP_LOWLEVEL_INIT
49 ifneq ($(DEVICE_VENDOR),)
50 DEVICE_VENDOR = $(DEVICE_VENDOR)
54 # Never use LZMA compression
55 # for a RAM version of image
56 ifdef CONFIG_SKIP_LOWLEVEL_INIT
57 unexport COMPRESSED_UBOOT
62 $(error "CROSS_COMPILE is not defined!")
67 $(error "STAGING_DIR is not defined!")
77 # =======================
78 # CUSTOM HELPER FUNCTIONS
79 # =======================
82 echo -e "\e[92m$(1)\e[0m"
86 echo -e "\e[91m$(1)\e[0m"
90 echo -e "\e[93m$(1)\e[0m"
94 U-Boot $(strip $(subst ",,$(U_BOOT_VERSION)))
100 @echo "$(1): `wc -c < $(strip $(2))` Bytes"
106 len=$$((5 - ($$(expr length $(1))/8))); \
107 tab=`printf '%*s' "$$len" | tr ' ' "\t"`; \
108 echo -ne "#define $(strip $(1))$${tab}" >> include/config.h; \
109 echo -e '$(strip $(2))' >> include/config.h
114 echo -e '#undef $(strip $(1))' >> include/config.h
119 echo -e '#include <$(strip $(1))>' >> include/config.h
124 $(if $(1),$(strip $(1)),OEM/Unknown)
129 $(if $(1),$(strip $(1)),4)
132 # $(1): vendor, board name/model
134 # $(3): default FLASH size in MB
135 # $(4): reset button GPIO number
136 # $(5): 1 if reset button is active low
139 $(call echo_green,Preparing configuration for target: $@)
142 $(call echo_yellow, Device vendor/model:\t$(call board_name,$(1)))
143 $(if $(DEVICE_VENDOR), \
144 $(call echo_yellow, Custom recovery web:\tyes ($(DEVICE_VENDOR))), \
145 $(call echo_yellow, Custom recovery web:\tno) \
148 $(if $(CONFIG_MAX_UBOOT_SIZE), \
149 $(call echo_yellow, Image size limit:\t$$(($(CONFIG_MAX_UBOOT_SIZE) / 1024)) KB),
150 $(call echo_yellow, Image size limit:\tnot specified)
153 $(call echo_yellow, Default FLASH size:\t$(call flash_size,$(3)) MB)
156 $(call echo_yellow, GPIO reset button:\t$(strip $(4))), \
157 $(call echo_yellow, GPIO reset button:\tnot specified) \
160 $(if $(filter $(5),1),
161 $(call echo_yellow, Button active low:\tyes), \
162 $(call echo_yellow, Button active low:\tno) \
165 $(if $(filter $(COMPRESSED_UBOOT),1), \
166 $(call echo_yellow, LZMA compression:\tyes), \
167 $(call echo_yellow, LZMA compression:\tno) \
170 $(if $(filter $(CONFIG_SKIP_LOWLEVEL_INIT),1), \
171 $(call echo_yellow, RAM-loadable only:\tyes), \
172 $(call echo_yellow, RAM-loadable only:\tno) \
175 $(if $(2),$(call define_add,CONFIG_HOSTNAME,u-boot_$(strip $(2))))
177 $(if $(4),$(call define_add,CONFIG_GPIO_RESET_BTN,$(strip $(4))))
178 $(if $(filter $(5),1),$(call define_add,CONFIG_GPIO_RESET_BTN_ACTIVE_LOW,1))
179 $(if $(CONFIG_MAX_UBOOT_SIZE), \
180 $(call define_add,CONFIG_MAX_UBOOT_SIZE,$(CONFIG_MAX_UBOOT_SIZE))
181 $(call define_add,CONFIG_MAX_UBOOT_SIZE_HEX,$(shell printf '0x%X' $(CONFIG_MAX_UBOOT_SIZE)))
184 $(if $(filter $(CONFIG_SKIP_LOWLEVEL_INIT),1), \
185 $(call define_add,CONFIG_SKIP_LOWLEVEL_INIT,1) \
187 $(if $(filter $(CONFIG_SKIP_LOWLEVEL_INIT),1), \
188 $(call undef_add,COMPRESSED_UBOOT) \
192 $(call define_add,SOC_TYPE,$(6)) \
195 $(call define_add,CONFIG_BOARD_CUSTOM_STRING,$(call board_name,$(1)))
196 $(call define_add,CONFIG_DEFAULT_FLASH_SIZE_IN_MB,$(call flash_size,$(3)))
201 # ===============================================================
203 # First, check if configuration was done
204 ifneq (include/config.mk, $(wildcard include/config.mk))
205 all install u-boot u-boot.srec depend dep:
206 $(error "System was not configured!")
208 # Load ARCH, BOARD, and CPU configuration
209 include include/config.mk
210 export ARCH CPU BOARD VENDOR SOC
212 # Load other configuration
213 include $(TOPDIR)/config.mk
215 # ===============================================================
216 # U-Boot objects....order is important (i.e. start must be first)
217 OBJS = cpu/$(CPU)/start.o
219 LIBS = lib_generic/libgeneric.a
220 LIBS += common/libcommon.a
222 LIBS += lib_$(ARCH)/lib$(ARCH).a
223 LIBS += drivers/libdrivers.a
228 LIBS_SHARED = board/$(BOARDDIR)/lib$(BOARD).a
229 LIBS_SHARED += httpd/libhttpd.a
231 LIBS_SHARED += cpu/$(CPU)/$(SOC)/lib$(SOC).a
233 LIBS_SHARED += cpu/$(CPU)/lib$(CPU).a
235 ifdef COMPRESSED_UBOOT
236 OBJS_BOOTSTRAP = cpu/$(CPU)/start_bootstrap.o
237 LIBS_BOOTSTRAP = lib_bootstrap/libbootstrap.a
238 PHONY_LIBS = $(LIBS_BOOTSTRAP) $(LIBS_SHARED)
240 PHONY_LIBS = $(LIBS) $(LIBS_SHARED)
242 .PHONY: $(PHONY_LIBS)
245 PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
247 # The "tools" are needed early, so put this first
248 # Don't include stuff already done in $(LIBS)
253 # ===============================================================
255 ALL = u-boot.srec u-boot.bin System.map
257 ifdef COMPRESSED_UBOOT
258 all: $(ALL) tuboot.bin
260 all: $(ALL) u-boot.img
264 $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
267 $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
270 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
272 u-boot.img: u-boot.bin
274 $(call echo_green,Preparing regular U-Boot image $@...)
275 $(MKIMAGE) -A $(ARCH) -T firmware -C none -a $(TEXT_BASE) \
276 -e 0 -n '$(call ih_name)' -d $< $@
279 $(OBJDUMP) -d $< > $@
281 u-boot: fsdata depend version $(SUBDIRS) $(OBJS) $(LIBS) $(LIBS_SHARED) $(LDSCRIPT)
282 UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) $(LIBS_SHARED) | \
283 sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p' | \
285 $(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
286 --start-group $(LIBS) $(LIBS_SHARED) \
287 --end-group $(PLATFORM_LIBS) \
288 -Map u-boot.map -o u-boot
291 $(MAKE) -C `dirname $@`
294 $(MAKE) -C `dirname $@`
299 # For LZMA compressed image
300 ifdef COMPRESSED_UBOOT
301 tuboot.bin: System.map bootstrap.bin u-boot.lzimg
303 $(call echo_green,Merging bootstrap.bin with u-boot.lzimg...)
304 $(call echo_size, Bootstrap size,bootstrap.bin)
305 $(call echo_size, LZMA image size,u-boot.lzimg)
306 @cat bootstrap.bin > $@
307 @cat u-boot.lzimg >> $@
308 $(call echo_size, Total image size,$@)
310 u-boot.lzimg: lzma_host $(obj)u-boot.bin System.map
312 @rm -rf u-boot.bin.lzma
313 @$(call echo_green,Compressing U-Boot image $<...)
314 @$(LZMA) --best --keep $(obj)u-boot.bin
315 $(call echo_green,Preparing LZMA compressed U-Boot image $@...)
316 $(MKIMAGE) -A $(ARCH) -T firmware -C lzma \
317 -a 0x$(shell grep "T _start" $(TOPDIR)/System.map | \
318 awk '{ printf "%s", $$1 }') \
319 -e 0x$(shell grep "T _start" $(TOPDIR)/System.map | \
320 awk '{ printf "%s", $$1 }') \
321 -n '$(call ih_name)' -d $(obj)u-boot.bin.lzma $@
323 bootstrap.bin: bootstrap
324 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
326 bootstrap: depend version $(SUBDIRS) $(OBJS_BOOTSTRAP) $(LIBS_BOOTSTRAP) $(LIBS_SHARED) $(LDSCRIPT_BOOTSTRAP)
327 UNDEF_SYM=`$(OBJDUMP) -x $(LIBS_BOOTSTRAP) | \
328 sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p' | \
330 $(LD) $(LDFLAGS_BOOTSTRAP) $$UNDEF_SYM $(OBJS_BOOTSTRAP) \
331 --start-group $(LIBS_BOOTSTRAP) $(LIBS_SHARED) \
332 --end-group $(PLATFORM_LIBS) \
333 -Map bootstrap.map -o bootstrap
336 $(MAKE) -C `dirname $@`
340 $(call echo_green,Building lzma host utility...)
341 $(MAKE) -C $(BUILD_TOPDIR)/host_util/lzma -f makefile.gcc all
342 endif # ifdef COMPRESSED_UBOOT
345 @echo -n "#define U_BOOT_VERSION \"U-Boot $(U_BOOT_VERSION)\"" > $(VERSION_FILE)
348 $(call echo_green,Preparing web server files...)
350 cd httpd && ./vendors/makefsdatac $(DEVICE_VENDOR)
353 @for dir in $(SUBDIRS); do $(MAKE) -C $$dir .depend; done
357 grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
359 endif # include/config.mk
361 # =====================
362 # COMMON/SHARED TARGETS
363 # =====================
366 @$(call echo_green,Removing configuration...)
367 @rm -f include/config.h include/config.mk board/*/config.tmp
371 @$(call include_add,soc/soc_list.h)
372 @$(call define_add,CONFIG_BUILD_DATE_UTC,$(shell date -u +"%Y-%m-%d"))
374 ar933x_common: unconfig config_common
375 @$(call define_add,CFG_AG7240_NMACS,2)
376 @$(call define_add,CFG_ATHRS26_PHY,1)
377 @$(call define_add,CONFIG_MACH_HORNET,1)
379 ar934x_common: unconfig config_common
380 @$(call define_add,CONFIG_WASP,1)
381 @$(call define_add,CONFIG_WASP_SUPPORT,1)
383 qca953x_common: unconfig config_common
384 @$(call define_add,CONFIG_ATHEROS,1)
385 @$(call define_add,CONFIG_MACH_QCA953x,1)
388 @$(call define_add,CONFIG_LSDK_KERNEL,1)
390 # =============================
391 # TARGETS IN ALPHABETICAL ORDER
392 # =============================
394 8devices_carambola2: ar933x_common
395 @$(call config_init,8devices Carambola 2,carambola-v2,16,11,1,QCA_AR9331_SOC)
396 @$(call define_add,CONFIG_FOR_8DEVICES_CARAMBOLA2,1)
397 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
399 alfa-network_ap121f: ar933x_common
400 @$(call config_init,ALFA Network AP121F,ap121f,16,12,1,QCA_AR9331_SOC)
401 @$(call define_add,CONFIG_FOR_ALFA_NETWORK_AP121F,1)
402 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
404 alfa-network_hornet-ub: ar933x_common
405 @$(call config_init,ALFA Network Hornet-UB,hornet-ub,8,12,1,QCA_AR9331_SOC)
406 @$(call define_add,CONFIG_FOR_ALFA_NETWORK_HORNET_UB,1)
407 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
409 alfa-network_n5q: ar934x_common
410 @$(call config_init,ALFA Network N5Q,n5q,16,11,1,QCA_AR9344_SOC)
411 @$(call define_add,CONFIG_FOR_ALFA_NETWORK_N5Q,1)
412 @$(call define_add,CFG_ATHRS27_PHY,1)
413 @$(call define_add,CFG_AG7240_NMACS,2)
414 @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
416 alfa-network_r36a: qca953x_common
417 @$(call config_init,ALFA Network R36A,r36a,16,2,1,QCA_QCA9531_SOC)
418 @$(call define_add,CONFIG_FOR_ALFA_NETWORK_R36A,1)
419 @$(call define_add,CFG_ATHRS27_PHY,1)
420 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
421 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
423 alfa-network_tube2h: ar933x_common
424 @$(call config_init,ALFA Network Tube2H,tube2h,8,12,1,QCA_AR9331_SOC)
425 @$(call define_add,CONFIG_FOR_ALFA_NETWORK_TUBE2H,1)
426 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
428 comfast_cf-e314n: qca953x_common
429 @$(call config_init,Comfast CF-E314N,cf-e314n,16,17,1,QCA_QCA9531_SOC)
430 @$(call define_add,CONFIG_FOR_COMFAST_CF_E314N,1)
431 @$(call define_add,CFG_ATHRS27_PHY,1)
432 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
433 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
435 comfast_cf-e320n_v2: qca953x_common
436 @$(call config_init,Comfast CF-E320N v2,cf-e320n-v2,16,17,1,QCA_QCA9531_SOC)
437 @$(call define_add,CONFIG_FOR_COMFAST_CF_E320N_V2,1)
438 @$(call define_add,CFG_ATHRS27_PHY,1)
439 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
440 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
442 comfast_cf-e520n: qca953x_common
443 @$(call config_init,Comfast CF-E520N,cf-e520n,8,17,1,QCA_QCA9531_SOC)
444 @$(call define_add,CONFIG_FOR_COMFAST_CF_E520N,1)
445 @$(call define_add,CFG_ATHRS27_PHY,1)
446 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
447 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
449 comfast_cf-e530n: qca953x_common
450 @$(call config_init,Comfast CF-E530N,cf-e530n,8,17,1,QCA_QCA9531_SOC)
451 @$(call define_add,CONFIG_FOR_COMFAST_CF_E530N,1)
452 @$(call define_add,CONFIG_USB,1)
453 @$(call define_add,CFG_ATHRS27_PHY,1)
454 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
455 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
457 creatcomm-technology_d3321: ar933x_common
458 @$(call config_init,CreatComm Technology D3321,d3321,8,12,1,QCA_AR9331_SOC)
459 @$(call define_add,CONFIG_FOR_CREATCOMM_D3321,1)
460 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
462 d-link_dir-505_a1: ar933x_common
463 @$(call config_init,D-Link DIR-505 A1,dir-505-a1,8,11,1,QCA_AR1311_SOC)
464 @$(call define_add,CONFIG_FOR_DLINK_DIR505_A1,1)
465 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
467 dragino_ms14: ar933x_common
468 @$(call config_init,Dragino MS14/N,ms14,16,11,1,QCA_AR9331_SOC)
469 @$(call define_add,CONFIG_FOR_DRAGINO_MS14,1)
470 @$(call define_add,WEBFAILSAFE_DISABLE_ART_UPGRADE,1)
471 @$(call define_add,WEBFAILSAFE_DISABLE_UBOOT_UPGRADE,1)
472 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
474 engenius_ens202ext: ar934x_common
475 @$(call config_init,EnGenius ENS202EXT,ens202ext,16,1,1,QCA_AR9341_SOC)
476 @$(call define_add,CONFIG_FOR_ENGENIUS_ENS202EXT,1)
477 @$(call define_add,CFG_ATHRS27_PHY,1)
478 @$(call define_add,CFG_AG7240_NMACS,2)
479 @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
481 gainstrong_oolite_v1_dev: ar933x_common
482 @$(call config_init,Gainstrong Oolite v1 (dev board),oolite-v1,16,11,,QCA_AR9331_SOC)
483 @$(call define_add,CONFIG_FOR_GS_OOLITE_V1_DEV,1)
484 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
486 gl-inet_6416: ar933x_common
487 @$(call config_init,GL.iNet 6416,glinet-6416,8,11,,QCA_AR9331_SOC)
488 @$(call define_add,CONFIG_FOR_GLINET_6416,1)
489 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
491 gl-inet_gl-ar150: ar933x_common
492 @$(call config_init,GL.iNet GL-AR150,gl-ar150,16,11,,QCA_AR9331_SOC)
493 @$(call define_add,CONFIG_FOR_GLINET_GL_AR150,1)
494 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
496 gl-inet_gl-ar300: ar934x_common
497 @$(call config_init,GL.iNet GL-AR300,gl-ar300,16,16,1,QCA_AR9344_SOC)
498 @$(call define_add,CONFIG_FOR_GLINET_GL_AR300,1)
499 @$(call define_add,CFG_ATHRS27_PHY,1)
500 @$(call define_add,CFG_AG7240_NMACS,2)
501 @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
503 gl-inet_gl-ar300m-lite: qca953x_common
504 @$(call config_init,GL.iNet GL-AR300M Lite,gl-ar300m-lite,16,3,1,QCA_QCA9531_SOC)
505 @$(call define_add,CONFIG_FOR_GLINET_GL_AR300M_LITE,1)
506 @$(call define_add,CFG_ATHRS27_PHY,1)
507 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
508 @$(call define_add,CONFIG_PCI,1)
509 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
511 gl-inet_gl-ar750: qca953x_common
512 @$(call config_init,GL.iNet GL-AR750,gl-ar750,16,3,1,QCA_QCA9531_SOC)
513 @$(call define_add,CONFIG_FOR_GLINET_GL_AR750,1)
514 @$(call define_add,CFG_ATHRS27_PHY,1)
515 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
516 @$(call define_add,CONFIG_PCI,1)
517 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
519 gl-inet_gl-usb150: ar933x_common
520 @$(call config_init,GL.iNet GL-USB150,gl-usb150,16,11,,QCA_AR9331_SOC)
521 @$(call define_add,CONFIG_FOR_GLINET_GL_USB150,1)
522 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
524 p2w_cpe505n: qca953x_common
525 @$(call config_init,P&W CPE505N,cpe505n,16,17,1,QCA_QCA9531_SOC)
526 @$(call define_add,CONFIG_FOR_P2W_CPE505N,1)
527 @$(call define_add,CFG_ATHRS27_PHY,1)
528 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
529 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
531 p2w_r602n: qca953x_common
532 @$(call config_init,P&W R602N,r602n,16,17,1,QCA_QCA9531_SOC)
533 @$(call define_add,CONFIG_FOR_P2W_R602N,1)
534 @$(call define_add,CONFIG_USB,1)
535 @$(call define_add,CFG_ATHRS27_PHY,1)
536 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
537 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
539 tp-link_tl-mr10u_v1: ar933x_common lsdk_kernel
540 @$(call config_init,TP-Link TL-MR10U v1,tl-mr10u-v1,4,11,,QCA_AR9331_SOC)
541 @$(call define_add,CONFIG_FOR_TPLINK_MR10U_V1,1)
542 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
544 tp-link_tl-mr13u_v1: ar933x_common lsdk_kernel
545 @$(call config_init,TP-Link TL-MR13U v1,tl-mr13u-v1,4,11,,QCA_AR9331_SOC)
546 @$(call define_add,CONFIG_FOR_TPLINK_MR13U_V1,1)
547 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
549 tp-link_tl-mr22u_v1: qca953x_common lsdk_kernel
550 @$(call config_init,TP-Link TL-MR22U v1,tl-mr22u-v1,8,12,,QCA_QCA9531_SOC)
551 @$(call define_add,CONFIG_FOR_TPLINK_MR22U_V1,1)
552 @$(call define_add,CONFIG_USB,1)
553 @$(call define_add,CFG_ATHRS27_PHY,1)
554 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
555 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
557 tp-link_tl-mr3020_v1: ar933x_common lsdk_kernel
558 @$(call config_init,TP-Link TL-MR3020 v1,tl-mr3020-v1,4,11,,QCA_AR9331_SOC)
559 @$(call define_add,CONFIG_FOR_TPLINK_MR3020_V1,1)
560 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
562 tp-link_tl-mr3040_v1v2: ar933x_common lsdk_kernel
563 @$(call config_init,TP-Link TL-MR3040 v1/v2,tl-mr3040-v1v2,4,11,,QCA_AR9331_SOC)
564 @$(call define_add,CONFIG_FOR_TPLINK_MR3040_V1V2,1)
565 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
567 tp-link_tl-mr3220_v2: ar933x_common lsdk_kernel
568 @$(call config_init,TP-Link TL-MR3220 v2,tl-mr3220-v2,4,11,,QCA_AR9331_SOC)
569 @$(call define_add,CONFIG_FOR_TPLINK_MR3220_V2,1)
570 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
572 tp-link_tl-mr3420_v2: ar934x_common lsdk_kernel
573 @$(call config_init,TP-Link TL-MR3420 v2,tl-mr3420-v2,4,17,1,QCA_AR9341_SOC)
574 @$(call define_add,CONFIG_FOR_TPLINK_MR3420_V2,1)
575 @$(call define_add,CFG_ATHRS27_PHY,1)
576 @$(call define_add,CFG_AG7240_NMACS,2)
577 @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
579 tp-link_tl-mr3420_v3: qca953x_common lsdk_kernel
580 @$(call config_init,TP-Link TL-MR3420 v3,tl-mr3420-v3,4,12,1,QCA_QCA9531_SOC)
581 @$(call define_add,CONFIG_FOR_TPLINK_MR3420_V3,1)
582 @$(call define_add,CONFIG_USB,1)
583 @$(call define_add,CFG_ATHRS27_PHY,1)
584 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
585 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
587 tp-link_tl-mr6400_v1v2: qca953x_common lsdk_kernel
588 @$(call config_init,TP-Link TL-MR6400 v1/v2,tl-mr6400-v1v2,8,12,1,QCA_QCA9531_SOC)
589 @$(call define_add,CONFIG_FOR_TPLINK_MR6400_V1V2,1)
590 @$(call define_add,CONFIG_USB,1)
591 @$(call define_add,CONFIG_QCA_ETH_PHY_SWAP,1)
592 @$(call define_add,CFG_ATHRS27_PHY,1)
593 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
594 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
596 tp-link_tl-wa801nd_v2: ar934x_common lsdk_kernel
597 @$(call config_init,TP-Link TL-WA801ND v2,tl-wa801nd-v2,4,17,1,QCA_AR9341_SOC)
598 @$(call define_add,CONFIG_FOR_TPLINK_WA801ND_V2,1)
599 @$(call define_add,CFG_ATHRS27_PHY,1)
600 @$(call define_add,CFG_AG7240_NMACS,2)
601 @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
603 tp-link_tl-wa830re_v2: ar934x_common lsdk_kernel
604 @$(call config_init,TP-Link TL-WA830RE v2,tl-wa830re-v2,4,17,1,QCA_AR9341_SOC)
605 @$(call define_add,CONFIG_FOR_TPLINK_WA830RE_V2,1)
606 @$(call define_add,CFG_ATHRS27_PHY,1)
607 @$(call define_add,CFG_AG7240_NMACS,2)
608 @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
610 tp-link_tl-wa850re_v2: qca953x_common lsdk_kernel
611 @$(call config_init,TP-Link TL-WA850RE v2,tl-wa850re-v2,4,17,1,QCA_QCA9533_SOC)
612 @$(call define_add,CONFIG_FOR_TPLINK_WA850RE_V2,1)
613 @$(call define_add,CFG_ATHRS27_PHY,1)
614 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
615 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
617 tp-link_tl-wdr3500_v1: ar934x_common lsdk_kernel
618 @$(call config_init,TP-Link TL-WDR3500 v1,tl-wdr3500-v1,8,16,1,QCA_AR9344_SOC)
619 @$(call define_add,CONFIG_FOR_TPLINK_WDR3500_V1,1)
620 @$(call define_add,CFG_ATHRS27_PHY,1)
621 @$(call define_add,CFG_AG7240_NMACS,2)
622 @$(call define_add,CONFIG_PCI,1)
623 @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
625 tp-link_tl-wdr3600_v1: ar934x_common lsdk_kernel
626 @$(call config_init,TP-Link TL-WDR3600 v1,tl-wdr3600-v1,8,16,1,QCA_AR9344_SOC)
627 @$(call define_add,CONFIG_FOR_TPLINK_WDR3600_V1,1)
628 @$(call define_add,CFG_ATHRS17_PHY,1)
629 @$(call define_add,CFG_AG7240_NMACS,1)
630 @$(call define_add,CONFIG_PCI,1)
631 @$(call define_add,CFG_DUAL_PHY_SUPPORT,1)
632 @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
634 tp-link_tl-wdr43x0_v1: ar934x_common lsdk_kernel
635 @$(call config_init,TP-Link TL-WDR43x0 v1,tl-wdr43x0-v1,8,16,1,QCA_AR9344_SOC)
636 @$(call define_add,CONFIG_FOR_TPLINK_WDR43X0_V1,1)
637 @$(call define_add,CFG_ATHRS17_PHY,1)
638 @$(call define_add,CFG_AG7240_NMACS,1)
639 @$(call define_add,CONFIG_PCI,1)
640 @$(call define_add,CFG_DUAL_PHY_SUPPORT,1)
641 @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
643 tp-link_tl-wr1041n_v2: ar934x_common lsdk_kernel
644 @$(call config_init,TP-Link TL-WR1041N v2,tl-wr1041n-v2,4,14,1,QCA_AR9342_SOC)
645 @$(call define_add,CONFIG_FOR_TPLINK_WR1041N_V2,1)
646 @$(call define_add,CFG_ATHRS17_PHY,1)
647 @$(call define_add,CFG_AG7240_NMACS,1)
648 @$(call define_add,CFG_DUAL_PHY_SUPPORT,1)
649 @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
651 tp-link_tl-wr703n_v1: ar933x_common lsdk_kernel
652 @$(call config_init,TP-Link TL-WR703N v1,tl-wr703n-v1,4,11,,QCA_AR9331_SOC)
653 @$(call define_add,CONFIG_FOR_TPLINK_WR703N_V1,1)
654 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
656 tp-link_tl-wr710n_v1: ar933x_common lsdk_kernel
657 @$(call config_init,TP-Link TL-WR710N v1,tl-wr710n-v1,8,11,,QCA_AR9331_SOC)
658 @$(call define_add,CONFIG_FOR_TPLINK_WR710N_V1,1)
659 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
661 tp-link_tl-wr720n_v3_CN: ar933x_common lsdk_kernel
662 @$(call config_init,TP-Link TL-WR720N v3 CN,tl-wr720n-v3,4,11,,QCA_AR9331_SOC)
663 @$(call define_add,CONFIG_FOR_TPLINK_WR720N_V3,1)
664 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
666 tp-link_tl-wr740n_v4: ar933x_common lsdk_kernel
667 @$(call config_init,TP-Link TL-WR74xN/D v4,tl-wr74xnd-v4,4,11,,QCA_AR9331_SOC)
668 @$(call define_add,CONFIG_FOR_TPLINK_WR740N_V4,1)
669 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
671 tp-link_tl-wr802n_v1: qca953x_common lsdk_kernel
672 @$(call config_init,TP-Link TL-WR802N v1,tl-wr802n-v1,4,12,1,QCA_QCA9533_SOC)
673 @$(call define_add,CONFIG_FOR_TPLINK_WR802N_V1,1)
674 @$(call define_add,CFG_ATHRS27_PHY,1)
675 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
676 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
678 tp-link_tl-wr810n_v1: qca953x_common lsdk_kernel
679 @$(call config_init,TP-Link TL-WR810N v1,tl-wr810n-v1,8,12,1,QCA_QCA9531_SOC)
680 @$(call define_add,CONFIG_FOR_TPLINK_WR810N_V1,1)
681 @$(call define_add,CONFIG_USB,1)
682 @$(call define_add,CFG_ATHRS27_PHY,1)
683 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
684 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
686 tp-link_tl-wr810n_v2: qca953x_common lsdk_kernel
687 @$(call config_init,TP-Link TL-WR810N v2,tl-wr810n-v2,8,12,1,QCA_QCA9533_SOC)
688 @$(call define_add,CONFIG_FOR_TPLINK_WR810N_V2,1)
689 @$(call define_add,CFG_ATHRS27_PHY,1)
690 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
691 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
693 tp-link_tl-wr820n_v1_CN: qca953x_common lsdk_kernel
694 @$(call config_init,TP-Link TL-WR820N v1 CN,tl-wr820n-v1,4,12,1,QCA_QCA9531_SOC)
695 @$(call define_add,CONFIG_FOR_TPLINK_WR820N_V1_CN,1)
696 @$(call define_add,CONFIG_USB,1)
697 @$(call define_add,CFG_ATHRS27_PHY,1)
698 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
699 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
701 tp-link_tl-wr841n_v10: qca953x_common lsdk_kernel
702 @$(call config_init,TP-Link TL-WR841N/D v10,tl-wr841nd-v10,4,12,1,QCA_QCA9533_SOC)
703 @$(call define_add,CONFIG_FOR_TPLINK_WR841N_V10,1)
704 @$(call define_add,CFG_ATHRS27_PHY,1)
705 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
706 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
708 tp-link_tl-wr841n_v11: qca953x_common lsdk_kernel
709 @$(call config_init,TP-Link TL-WR841N/D v11,tl-wr841nd-v11,4,12,1,QCA_QCA9533_SOC)
710 @$(call define_add,CONFIG_FOR_TPLINK_WR841N_V11,1)
711 @$(call define_add,CFG_ATHRS27_PHY,1)
712 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
713 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
715 tp-link_tl-wr841n_v8: ar934x_common lsdk_kernel
716 @$(call config_init,TP-Link TL-WR841N/D v8,tl-wr841nd-v8,4,17,1,QCA_AR9341_SOC)
717 @$(call define_add,CONFIG_FOR_TPLINK_WR841N_V8,1)
718 @$(call define_add,CFG_ATHRS27_PHY,1)
719 @$(call define_add,CFG_AG7240_NMACS,2)
720 @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
722 tp-link_tl-wr841n_v9: qca953x_common lsdk_kernel
723 @$(call config_init,TP-Link TL-WR841N/D v9,tl-wr841nd-v9,4,12,1,QCA_QCA9533_SOC)
724 @$(call define_add,CONFIG_FOR_TPLINK_WR841N_V9,1)
725 @$(call define_add,CFG_ATHRS27_PHY,1)
726 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
727 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
729 tp-link_tl-wr842n_v3: qca953x_common lsdk_kernel
730 @$(call config_init,TP-Link TL-WR842N/D v3,tl-wr842nd-v3,16,1,1,QCA_QCA9531_SOC)
731 @$(call define_add,CONFIG_FOR_TPLINK_WR842N_V3,1)
732 @$(call define_add,CONFIG_USB,1)
733 @$(call define_add,CFG_ATHRS27_PHY,1)
734 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
735 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
737 tp-link_tl-wr902ac_v1: qca953x_common lsdk_kernel
738 @$(call config_init,TP-Link TL-WR902AC,tl-wr902ac,8,3,1,QCA_QCA9531_SOC)
739 @$(call define_add,CONFIG_FOR_TPLINK_WR902AC_V1,1)
740 @$(call define_add,CONFIG_USB,1)
741 @$(call define_add,CFG_ATHRS27_PHY,1)
742 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
743 @$(call define_add,CONFIG_PCI,1)
744 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
746 unwireddevices_unwired-one: ar933x_common
747 @$(call config_init,Unwired Devices Unwired One,unwired-one,16,11,1,QCA_AR9331_SOC)
748 @$(call define_add,CONFIG_FOR_UNWIRED_DEVICES_UNWIRED_ONE,1)
749 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
751 village-telco_mesh-potato_v2: ar933x_common
752 @$(call config_init,Village Telco Mesh Potato 2,mesh-potato-v2,16,11,1,QCA_AR9331_SOC)
753 @$(call define_add,CONFIG_FOR_VILLAGE_TELCO_MP2,1)
754 @$(call define_add,WEBFAILSAFE_DISABLE_ART_UPGRADE,1)
755 @$(call define_add,WEBFAILSAFE_DISABLE_UBOOT_UPGRADE,1)
756 @$(MKCONFIG) -a ap121 mips mips ap121 ar7240 ar7240
758 wallys_dr531: qca953x_common
759 @$(call config_init,Wallys DR531,dr531,8,17,1,QCA_QCA9531_SOC)
760 @$(call define_add,CONFIG_FOR_WALLYS_DR531,1)
761 @$(call define_add,CONFIG_USB,1)
762 @$(call define_add,CFG_ATHRS27_PHY,1)
763 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
764 @$(call define_add,CONFIG_PCI,1)
765 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
767 whqx_e600g_v2: qca953x_common
768 @$(call config_init,WHQX E600G v2,e600g-v2,16,17,1,QCA_QCA9531_SOC)
769 @$(call define_add,CONFIG_FOR_WHQX_E600G_V2,1)
770 @$(call define_add,CONFIG_USB,1)
771 @$(call define_add,CFG_ATHRS27_PHY,1)
772 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
773 @$(call define_add,CONFIG_PCI,1)
774 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
776 whqx_e600gac_v2: qca953x_common
777 @$(call config_init,WHQX E600GAC v2,e600gac-v2,16,17,1,QCA_QCA9531_SOC)
778 @$(call define_add,CONFIG_FOR_WHQX_E600GAC_V2,1)
779 @$(call define_add,CONFIG_USB,1)
780 @$(call define_add,CFG_ATHRS27_PHY,1)
781 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
782 @$(call define_add,CONFIG_PCI,1)
783 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
785 yuncore_ap90q: qca953x_common
786 @$(call config_init,YunCore AP90Q,ap90q,16,17,1,QCA_QCA9531_SOC)
787 @$(call define_add,CONFIG_FOR_YUNCORE_AP90Q,1)
788 @$(call define_add,CFG_ATHRS27_PHY,1)
789 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
790 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
792 yuncore_cpe830: qca953x_common
793 @$(call config_init,YunCore CPE830,cpe830,16,17,1,QCA_QCA9531_SOC)
794 @$(call define_add,CONFIG_FOR_YUNCORE_CPE830,1)
795 @$(call define_add,CFG_ATHRS27_PHY,1)
796 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
797 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
799 yuncore_cpe870: ar934x_common
800 @$(call config_init,YunCore CPE870,cpe870,8,16,1,QCA_AR9341_SOC)
801 @$(call define_add,CONFIG_FOR_YUNCORE_CPE870,1)
802 @$(call define_add,CFG_ATHRS27_PHY,1)
803 @$(call define_add,CFG_AG7240_NMACS,2)
804 @$(MKCONFIG) -a db12x mips mips db12x ar7240 ar7240
806 zbtlink_zbt-we1526: qca953x_common
807 @$(call config_init,Zbtlink ZBT-WE1526,zbt-we1526,16,17,1,QCA_QCA9531_SOC)
808 @$(call define_add,CONFIG_FOR_ZBTLINK_ZBT_WE1526,1)
809 @$(call define_add,CONFIG_USB,1)
810 @$(call define_add,CFG_ATHRS27_PHY,1)
811 @$(call define_add,CFG_ATH_GMAC_NMACS,2)
812 @$(MKCONFIG) -a ap143 mips mips ap143 ar7240 ar7240
819 @$(call echo_green,Making $@...)
821 \( -name 'core' -o -name '*.bak' -o -name '*~' \
822 -o -name '*.o' -o -name '*.a' -o -name .depend \) -print \
824 @rm -f tools/mkimage tools/envcrc
825 @rm -f lib_bootstrap/*.o
826 @rm -f lib_bootstrap/*.a
827 @rm -f bootstrap bootstrap.bin tuboot.bin u-boot.lzimg u-boot.bin.lzma bootstrap.map
830 @$(call echo_green,Removing lzma host utility...)
831 @$(MAKE) -C $(BUILD_TOPDIR)/host_util/lzma -f makefile.gcc clean
834 @$(call echo_green,Making $@...)
835 @find . -type f \( -name .depend \
836 -o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
839 @rm -f $(OBJS) *.bak include/version_autogenerated.h
841 @rm -f u-boot u-boot.map u-boot.hex $(ALL)
842 @rm -f tools/crc32.c tools/environment.c
843 @rm -f include/asm/proc include/asm/arch include/asm
845 distclean: clobber unconfig