2 # (C) Copyright 2000-2006
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 # See file CREDITS for list of people who contributed to this
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 EXTRAVERSION = -$(shell git rev-parse --short=8 HEAD)
28 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
29 VERSION_FILE = include/version_autogenerated.h
31 HOSTARCH := $(shell uname -m | \
39 HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
40 sed -e 's/\(cygwin\).*/cygwin/')
42 export HOSTARCH HOSTOS
44 # Deal with colliding definitions from tcsh etc.
47 #########################################################################
49 TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
52 ifdef COMPRESSED_UBOOT
53 ifndef CONFIG_SKIP_LOWLEVEL_INIT
55 export export COMPRESSED_UBOOT
59 ifeq (include/config.mk,$(wildcard include/config.mk))
60 # load ARCH, BOARD, and CPU configuration
61 include include/config.mk
62 export ARCH CPU BOARD VENDOR SOC
64 ifeq ($(HOSTARCH),ppc)
68 CROSS_COMPILE = powerpc-linux-
71 CROSS_COMPILE = arm-linux-
74 ifeq ($(HOSTARCH),i386)
77 CROSS_COMPILE = i386-linux-
81 CROSS_COMPILE = mips-linux-
84 CROSS_COMPILE = nios-elf-
87 CROSS_COMPILE = nios2-elf-
90 CROSS_COMPILE = m68k-elf-
92 ifeq ($(ARCH),microblaze)
95 ifeq ($(ARCH),blackfin)
96 CROSS_COMPILE = bfin-elf-
103 # load other configuration
104 include $(TOPDIR)/config.mk
107 #########################################################################
108 # U-Boot objects....order is important (i.e. start must be first)
109 OBJS = cpu/$(CPU)/start.o
111 ifdef COMPRESSED_UBOOT
112 ifndef CONFIG_SKIP_LOWLEVEL_INIT
113 OBJS_BOOTSTRAP = cpu/$(CPU)/start_bootstrap.o
117 LIBS = lib_generic/libgeneric.a
118 LIBS += common/libcommon.a
119 LIBS += board/$(BOARDDIR)/lib$(BOARD).a
120 LIBS += cpu/$(CPU)/lib$(CPU).a
123 LIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).a
126 LIBS += lib_$(ARCH)/lib$(ARCH).a
127 LIBS += drivers/libdrivers.a
130 LIBS += httpd/libhttpd.a
133 ifdef COMPRESSED_UBOOT
134 ifndef CONFIG_SKIP_LOWLEVEL_INIT
135 LIBS_BOOTSTRAP = lib_bootstrap/libbootstrap.a
136 LIBS_BOOTSTRAP += board/$(BOARDDIR)/lib$(BOARD).a
137 LIBS_BOOTSTRAP += cpu/$(CPU)/lib$(CPU).a
138 LIBS_BOOTSTRAP += cpu/$(CPU)/$(SOC)/lib$(SOC).a
144 ifdef COMPRESSED_UBOOT
145 ifndef CONFIG_SKIP_LOWLEVEL_INIT
146 .PHONY : $(LIBS_BOOTSTRAP)
151 PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
153 # The "tools" are needed early, so put this first
154 # Don't include stuff already done in $(LIBS)
159 #########################################################################
160 #########################################################################
162 ALL = u-boot.srec u-boot.bin System.map
164 ifdef COMPRESSED_UBOOT
165 ifndef CONFIG_SKIP_LOWLEVEL_INIT
166 all: $(ALL) tuboot.bin
168 all: $(ALL) u-boot.img
171 all: $(ALL) u-boot.img
175 $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
178 $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
181 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
183 u-boot.img: u-boot.bin
184 @/bin/echo -e "\e[32m> Preparing U-Boot image \"u-boot.img\"...\e[0m"
185 ./tools/mkimage -A $(ARCH) -T firmware -C none \
186 -a $(TEXT_BASE) -e 0 \
187 -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
188 sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
192 $(OBJDUMP) -d $< > $@
194 u-boot: depend version $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
195 UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
196 $(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
197 --start-group $(LIBS) --end-group $(PLATFORM_LIBS) \
198 -Map u-boot.map -o u-boot
201 $(MAKE) -C `dirname $@`
206 ifdef COMPRESSED_UBOOT
207 ifndef CONFIG_SKIP_LOWLEVEL_INIT
208 LZMA = $(BUILD_TOPDIR)/host_util/lzma
210 tuboot.bin: System.map bootstrap.bin u-boot.lzimg
211 @cat bootstrap.bin > $@
212 @cat u-boot.lzimg >> $@
214 u-boot.lzimg: $(obj)u-boot.bin System.map
215 @rm -rf u-boot.bin.lzma
216 $(LZMA) --best --keep $(obj)u-boot.bin
217 @/bin/echo -e "\e[32m> Preparing compressed U-Boot image \"u-boot.lzimg\"...\e[0m"
218 ./tools/mkimage -A mips -T firmware -C lzma \
219 -a 0x$(shell grep "T _start" $(TOPDIR)/System.map | awk '{ printf "%s", $$1 }') \
220 -e 0x$(shell grep "T _start" $(TOPDIR)/System.map | awk '{ printf "%s", $$1 }') \
221 -n 'u-boot image' -d $(obj)u-boot.bin.lzma $@
223 bootstrap.bin: bootstrap
224 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
226 bootstrap: depend version $(SUBDIRS) $(OBJS_BOOTSTRAP) $(LIBS_BOOTSTRAP) $(LDSCRIPT_BOOTSTRAP)
227 UNDEF_SYM=`$(OBJDUMP) -x $(LIBS_BOOTSTRAP) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
228 $(LD) $(LDFLAGS_BOOTSTRAP) $$UNDEF_SYM $(OBJS_BOOTSTRAP) \
229 --start-group $(LIBS_BOOTSTRAP) --end-group $(PLATFORM_LIBS) \
230 -Map bootstrap.map -o bootstrap
233 $(MAKE) -C `dirname $@`
238 @echo -n "#define U_BOOT_VERSION \"U-Boot " > $(VERSION_FILE); \
239 echo -n "$(U_BOOT_VERSION)" >> $(VERSION_FILE); \
240 echo "\"" >> $(VERSION_FILE)
243 $(MAKE) -C tools/gdb || exit 1
246 @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
249 ctags -w `find $(SUBDIRS) include \
250 lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \
251 fs/cramfs fs/fat fs/fdos fs/jffs2 \
252 net disk rtc dtt drivers drivers/sk98lin common \
253 \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
256 etags -a `find $(SUBDIRS) include \
257 lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \
258 fs/cramfs fs/fat fs/fdos fs/jffs2 \
259 net disk rtc dtt drivers drivers/sk98lin common \
260 \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
264 grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
267 #########################################################################
269 all install u-boot u-boot.srec depend dep:
270 @echo "System not configured - see README" >&2
274 #########################################################################
277 @rm -f include/config.h include/config.mk board/*/config.tmp
279 #========================================================================
281 #========================================================================
282 #########################################################################
283 ## MIPS32 AR7100 (24K)
284 #########################################################################
287 @echo "/* Temporary solution */" >> include/config.h
288 @echo "/* AR933x */" >> include/config.h
289 @echo "#define QCA_AR9330_SOC 0x00001" >> include/config.h
290 @echo "#define QCA_AR9331_SOC 0x00002" >> include/config.h
291 @echo "#define QCA_AR933X_SOC (QCA_AR9330_SOC | QCA_AR9331_SOC)" >> include/config.h
292 @echo "/* AR934x */" >> include/config.h
293 @echo "#define QCA_AR9341_SOC 0x00010" >> include/config.h
294 @echo "#define QCA_AR9342_SOC 0x00020" >> include/config.h
295 @echo "#define QCA_AR9344_SOC 0x00040" >> include/config.h
296 @echo "#define QCA_AR934X_SOC (QCA_AR9341_SOC | QCA_AR9342_SOC | QCA_AR9344_SOC)" >> include/config.h
297 @echo "/* QCA953x */" >> include/config.h
298 @echo "#define QCA_QCA9531_SOC 0x00100" >> include/config.h
299 @echo "#define QCA_QCA9533_SOC 0x00200" >> include/config.h
300 @echo "#define QCA_QCA953X_SOC (QCA_QCA9531_SOC | QCA_QCA9533_SOC)" >> include/config.h
301 @echo "/* QCA956x */" >> include/config.h
302 @echo "#define QCA_QCA9561_SOC 0x01000" >> include/config.h
303 @echo "#define QCA_QCA9563_SOC 0x02000" >> include/config.h
304 @echo "#define QCA_QCA956X_SOC (QCA_QCA9561_SOC | QCA_QCA9563_SOC)" >> include/config.h
305 @echo "/* QCA955x */" >> include/config.h
306 @echo "#define QCA_QCA9557_SOC 0x10000" >> include/config.h
307 @echo "#define QCA_QCA9558_SOC 0x20000" >> include/config.h
308 @echo "#define QCA_QCA955X_SOC (QCA_QCA9557_SOC | QCA_QCA9558_SOC)" >> include/config.h
309 @echo "" >> include/config.h
311 ifdef CONFIG_BOOTDELAY
312 @echo "#define CONFIG_BOOTDELAY "$(CONFIG_BOOTDELAY) >> include/config.h
315 ifdef CONFIG_MAX_UBOOT_SIZE_KB
316 @echo "#define CONFIG_MAX_UBOOT_SIZE_KB "$(CONFIG_MAX_UBOOT_SIZE_KB) >> include/config.h
320 @echo "#define CFG_PLL_FREQ "$(CFG_PLL_FREQ) >> include/config.h
323 ifdef DISABLE_CONSOLE_OUTPUT
324 @echo "#define CONFIG_SILENT_CONSOLE 1" >> include/config.h
327 ifdef CONFIG_SKIP_LOWLEVEL_INIT
328 @echo "#define CONFIG_SKIP_LOWLEVEL_INIT 1" >> include/config.h
329 @echo "#undef COMPRESSED_UBOOT" >> include/config.h
332 @echo "#define CONFIG_DELAY_TO_AUTORUN_HTTPD 3" >> include/config.h
333 @echo "#define CONFIG_DELAY_TO_AUTORUN_CONSOLE 5" >> include/config.h
334 @echo "#define CONFIG_DELAY_TO_AUTORUN_NETCONSOLE 7" >> include/config.h
336 # max delay time for button pressing
337 @echo "#define CONFIG_MAX_BUTTON_PRESSING 10" >> include/config.h
339 # don't show info about console (in, out, err...)
340 @echo "#define CFG_CONSOLE_INFO_QUIET" >> include/config.h
342 hornet_common_config : common_config
343 @echo "#define SOC_TYPE QCA_AR933X_SOC" >> include/config.h
344 @echo "#define CONFIG_MACH_HORNET 1" >> include/config.h
346 wr703n_config : unconfig hornet_common_config
347 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-WR703N at:' `date` '\e[0m'
348 @echo "#define CONFIG_FOR_TPLINK_WR703N_V1 1" >> include/config.h
349 @echo "#define GPIO_SYS_LED_BIT 27" >> include/config.h
350 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
351 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
352 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h
353 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-WR703N\"" >> include/config.h
355 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
357 wr720n_v3_CH_config : unconfig hornet_common_config
358 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-WR720N v3 CH at:' `date` '\e[0m'
359 @echo "#define CONFIG_FOR_TPLINK_WR720N_V3 1" >> include/config.h
360 @echo "#define GPIO_SYS_LED_BIT 27" >> include/config.h
361 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
362 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
363 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h
364 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-WR720N v3 CH\"" >> include/config.h
366 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
368 wr710n_config : unconfig hornet_common_config
369 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-WR710N at:' `date` '\e[0m'
370 @echo "#define CONFIG_FOR_TPLINK_WR710N_V1 1" >> include/config.h
371 @echo "#define GPIO_SYS_LED_BIT 27" >> include/config.h
372 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
373 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
374 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 8" >> include/config.h
375 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-WR710N\"" >> include/config.h
377 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
379 mr3020_config : unconfig hornet_common_config
380 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-MR3020 at:' `date`.'\e[0m'
381 @echo "#define CONFIG_FOR_TPLINK_MR3020_V1 1" >> include/config.h
382 @echo "#define GPIO_INTERNET_LED_BIT 27" >> include/config.h
383 @echo "#define GPIO_INTERNET_LED_ON 0" >> include/config.h
384 @echo "#define GPIO_WPS_LED_BIT 26" >> include/config.h
385 @echo "#define GPIO_WPS_LED_ON 0" >> include/config.h
386 @echo "#define GPIO_WLAN_LED_BIT 0" >> include/config.h
387 @echo "#define GPIO_WLAN_LED_ON 1" >> include/config.h
388 @echo "#define GPIO_ETH_LED_BIT 17" >> include/config.h
389 @echo "#define GPIO_ETH_LED_ON 0" >> include/config.h
390 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
391 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h
392 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-MR3020\"" >> include/config.h
394 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
396 mr3040_config : unconfig hornet_common_config
397 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-MR3040 at:' `date` '\e[0m'
398 @echo "#define CONFIG_FOR_TPLINK_MR3040_V1V2 1" >> include/config.h
399 @echo "#define GPIO_INTERNET_LED_BIT 27" >> include/config.h
400 @echo "#define GPIO_INTERNET_LED_ON 0" >> include/config.h
401 @echo "#define GPIO_WLAN_LED_BIT 26" >> include/config.h
402 @echo "#define GPIO_WLAN_LED_ON 0" >> include/config.h
403 @echo "#define GPIO_ETH_LED_BIT 17" >> include/config.h
404 @echo "#define GPIO_ETH_LED_ON 0" >> include/config.h
405 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
406 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h
407 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-MR3040\"" >> include/config.h
409 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
411 mr10u_config : unconfig hornet_common_config
412 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-MR10U at:' `date` '\e[0m'
413 @echo "#define CONFIG_FOR_TPLINK_MR10U_V1 1" >> include/config.h
414 @echo "#define GPIO_SYS_LED_BIT 27" >> include/config.h
415 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
416 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
417 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h
418 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-MR10U\"" >> include/config.h
420 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
422 mr13u_config : unconfig hornet_common_config
423 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-MR13U at:' `date` '\e[0m'
424 @echo "#define CONFIG_FOR_TPLINK_MR13U_V1 1" >> include/config.h
425 @echo "#define GPIO_SYS_LED_BIT 27" >> include/config.h
426 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
427 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
428 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h
429 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-MR13U\"" >> include/config.h
431 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
433 wr740n_v4_config : unconfig hornet_common_config
434 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-WR740N v4 at:' `date` '\e[0m'
435 @echo "#define CONFIG_FOR_TPLINK_WR740N_V4 1" >> include/config.h
436 @echo "#define GPIO_SYS_LED_BIT 27" >> include/config.h
437 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
438 @echo "#define GPIO_WLAN_LED_BIT 0" >> include/config.h
439 @echo "#define GPIO_WLAN_LED_ON 1" >> include/config.h
440 @echo "#define GPIO_LAN1_LED_BIT 14" >> include/config.h
441 @echo "#define GPIO_LAN1_LED_ON 1" >> include/config.h
442 @echo "#define GPIO_LAN2_LED_BIT 15" >> include/config.h
443 @echo "#define GPIO_LAN2_LED_ON 1" >> include/config.h
444 @echo "#define GPIO_LAN3_LED_BIT 16" >> include/config.h
445 @echo "#define GPIO_LAN3_LED_ON 1" >> include/config.h
446 @echo "#define GPIO_LAN4_LED_BIT 17" >> include/config.h
447 @echo "#define GPIO_LAN4_LED_ON 0" >> include/config.h
448 @echo "#define GPIO_INTERNET_LED_BIT 13" >> include/config.h
449 @echo "#define GPIO_INTERNET_LED_ON 1" >> include/config.h
450 @echo "#define GPIO_QSS_LED_BIT 1" >> include/config.h
451 @echo "#define GPIO_QSS_LED_ON 1" >> include/config.h
452 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
453 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h
454 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-WR74xN/D v4\"" >> include/config.h
456 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
458 mr3220_v2_config : unconfig hornet_common_config
459 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-MR3220 v2 at:' `date` '\e[0m'
460 @echo "#define CONFIG_FOR_TPLINK_MR3220_V2 1" >> include/config.h
461 @echo "#define GPIO_SYS_LED_BIT 27" >> include/config.h
462 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
463 @echo "#define GPIO_WLAN_LED_BIT 0" >> include/config.h
464 @echo "#define GPIO_WLAN_LED_ON 1" >> include/config.h
465 @echo "#define GPIO_LAN1_LED_BIT 14" >> include/config.h
466 @echo "#define GPIO_LAN1_LED_ON 1" >> include/config.h
467 @echo "#define GPIO_LAN2_LED_BIT 15" >> include/config.h
468 @echo "#define GPIO_LAN2_LED_ON 1" >> include/config.h
469 @echo "#define GPIO_LAN3_LED_BIT 16" >> include/config.h
470 @echo "#define GPIO_LAN3_LED_ON 1" >> include/config.h
471 @echo "#define GPIO_LAN4_LED_BIT 17" >> include/config.h
472 @echo "#define GPIO_LAN4_LED_ON 0" >> include/config.h
473 @echo "#define GPIO_INTERNET_LED_BIT 13" >> include/config.h
474 @echo "#define GPIO_INTERNET_LED_ON 1" >> include/config.h
475 @echo "#define GPIO_QSS_LED_BIT 1" >> include/config.h
476 @echo "#define GPIO_QSS_LED_ON 1" >> include/config.h
477 @echo "#define GPIO_USB_LED_BIT 26" >> include/config.h
478 @echo "#define GPIO_USB_LED_ON 1" >> include/config.h
479 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
480 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h
481 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-MR3220 v2\"" >> include/config.h
483 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
485 dir505_config : unconfig hornet_common_config
486 @/bin/echo -e '\e[32m> Configuring for D-Link DIR-505 at:' `date` '\e[0m'
487 @echo "#define CONFIG_FOR_DLINK_DIR505_A1 1" >> include/config.h
488 @echo "#define GPIO_SYS_LED_BIT 27" >> include/config.h
489 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
491 # we will use WPS button instead of reset
492 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
493 @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h
495 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 8" >> include/config.h
496 @echo "#define BOARD_CUSTOM_STRING \"D-Link DIR-505\"" >> include/config.h
498 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
500 gs_oolite_v1_dev_config : unconfig hornet_common_config
501 @/bin/echo -e '\e[32m> Configuring for GS-Oolite v1 with dev board at:' `date` '\e[0m'
502 @echo "#define CONFIG_FOR_GS_OOLITE_V1_DEV 1" >> include/config.h
503 @echo "#define GPIO_SYS_LED_BIT 27" >> include/config.h
504 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
505 @echo "#define GPIO_WAN_LED_BIT 17" >> include/config.h
506 @echo "#define GPIO_WAN_LED_ON 0" >> include/config.h
507 @echo "#define GPIO_LAN1_LED_BIT 13" >> include/config.h
508 @echo "#define GPIO_LAN1_LED_ON 0" >> include/config.h
509 @echo "#define GPIO_LAN2_LED_BIT 15" >> include/config.h
510 @echo "#define GPIO_LAN2_LED_ON 0" >> include/config.h
511 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
512 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 16" >> include/config.h
513 @echo "#define BOARD_CUSTOM_STRING \"Gainstrong GS-Oolite v1\"" >> include/config.h
515 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
517 black_swift_board_config : unconfig hornet_common_config
518 @echo '======= Configuring for Black Swift board (128K compressed) at:' `date` '======='
519 @echo "#define CONFIG_FOR_BLACK_SWIFT_BOARD 1" >> include/config.h
520 @echo "#define GPIO_SYS_LED_BIT 27" >> include/config.h
521 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
522 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
523 @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h
524 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 16" >> include/config.h
525 @echo "#define BOARD_CUSTOM_STRING \"Black Swift board\"" >> include/config.h
527 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
529 carambola2_config : unconfig hornet_common_config
530 @/bin/echo -e '\e[32m> Configuring for 8devices Carambola 2 at:' `date` '\e[0m'
531 @echo "#define CONFIG_FOR_8DEVICES_CARAMBOLA2 1" >> include/config.h
533 # Carambola 2 uses uncompressed version
534 @echo "#undef COMPRESSED_UBOOT" >> include/config.h
536 # Carambola 2 uses 40 MHz oscillator
537 @echo "#define CONFIG_40MHZ_XTAL_SUPPORT 1" >> include/config.h
539 @echo "#define GPIO_WLAN_LED_BIT 0" >> include/config.h
540 @echo "#define GPIO_WLAN_LED_ON 0" >> include/config.h
541 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
543 # Carambola 2 development board has RST button pulled up, so it is active at low
544 @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h
546 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 16" >> include/config.h
547 @echo "#define BOARD_CUSTOM_STRING \"8devices Carambola2 v1\"" >> include/config.h
549 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
551 dragino_v2_ms14_config : unconfig hornet_common_config
552 @/bin/echo -e '\e[32m> Configuring for Dragino Dragino v2 (MS14) at:' `date` '\e[0m'
553 @echo "#define CONFIG_FOR_DRAGINO_V2 1" >> include/config.h
554 @echo "#undef COMPRESSED_UBOOT" >> include/config.h
555 @echo "#define GPIO_WLAN_LED_BIT 0" >> include/config.h
556 @echo "#define GPIO_WLAN_LED_ON 1" >> include/config.h
557 @echo "#define GPIO_WAN_LED_BIT 17" >> include/config.h
558 @echo "#define GPIO_WAN_LED_ON 0" >> include/config.h
559 @echo "#define GPIO_LAN_LED_BIT 13" >> include/config.h
560 @echo "#define GPIO_LAN_LED_ON 0" >> include/config.h
561 @echo "#define GPIO_INTERNET_LED_BIT 28" >> include/config.h
562 @echo "#define GPIO_INTERNET_LED_ON 1" >> include/config.h
563 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
564 @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h
565 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 16" >> include/config.h
566 @echo "#define WEBFAILSAFE_DISABLE_ART_UPGRADE 1" >> include/config.h
567 @echo "#define WEBFAILSAFE_DISABLE_UBOOT_UPGRADE 1" >> include/config.h
568 @echo "#define BOARD_CUSTOM_STRING \"Dragino v2 MS14\"" >> include/config.h
570 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
572 villagetelco_mp2_config : unconfig hornet_common_config
573 @/bin/echo -e '\e[32m> Configuring for Village Telco Mesh Potato 2 at:' `date` '\e[0m'
574 @echo "#define CONFIG_FOR_MESH_POTATO_V2 1" >> include/config.h
575 @echo "#undef COMPRESSED_UBOOT" >> include/config.h
576 @echo "#define GPIO_WLAN_LED_BIT 0" >> include/config.h
577 @echo "#define GPIO_WLAN_LED_ON 1" >> include/config.h
578 @echo "#define GPIO_WAN_LED_BIT 17" >> include/config.h
579 @echo "#define GPIO_WAN_LED_ON 0" >> include/config.h
580 @echo "#define GPIO_LAN_LED_BIT 13" >> include/config.h
581 @echo "#define GPIO_LAN_LED_ON 0" >> include/config.h
582 @echo "#define GPIO_INTERNET_LED_BIT 28" >> include/config.h
583 @echo "#define GPIO_INTERNET_LED_ON 1" >> include/config.h
584 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
585 @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h
586 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 16" >> include/config.h
587 @echo "#define WEBFAILSAFE_DISABLE_ART_UPGRADE 1" >> include/config.h
588 @echo "#define WEBFAILSAFE_DISABLE_UBOOT_UPGRADE 1" >> include/config.h
589 @echo "#define BOARD_CUSTOM_STRING \"Village Telco Mesh Potato 2\"" >> include/config.h
591 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
593 gl-inet_config : unconfig hornet_common_config
594 @/bin/echo -e '\e[32m> Configuring for GL.iNet at:' `date` '\e[0m'
595 @echo "#define CONFIG_FOR_GL_INET 1" >> include/config.h
596 @echo "#define GPIO_WLAN_LED_BIT 0" >> include/config.h
597 @echo "#define GPIO_WLAN_LED_ON 1" >> include/config.h
598 @echo "#define GPIO_LAN_LED_BIT 13" >> include/config.h
599 @echo "#define GPIO_LAN_LED_ON 1" >> include/config.h
600 @echo "#define GPIO_RST_BUTTON_BIT 11" >> include/config.h
601 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 8" >> include/config.h
602 @echo "#define BOARD_CUSTOM_STRING \"GL.iNet\"" >> include/config.h
604 @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
606 wasp_common_config : common_config
607 @echo "#define CONFIG_WASP 1" >> include/config.h
608 @echo "#define CONFIG_WASP_SUPPORT 1" >> include/config.h
610 wdr3600_43x0_config : unconfig wasp_common_config
611 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-WDR3600/43x0 at:' `date` '\e[0m'
612 @echo "#define SOC_TYPE QCA_AR9344_SOC" >> include/config.h
613 @echo "#define CONFIG_FOR_TPLINK_WDR3600_WDR43X0_V1 1" >> include/config.h
614 @echo "#define DDR2_32BIT_SUPPORT 1" >> include/config.h
615 @echo "#define CFG_ATHRS17_PHY 1" >> include/config.h
616 @echo "#define CFG_AG7240_NMACS 1" >> include/config.h
617 @echo "#define CFG_DUAL_PHY_SUPPORT 1" >> include/config.h
618 @echo "#define GPIO_SYS_LED_BIT 14" >> include/config.h
619 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
620 @echo "#define GPIO_WLAN_2G_LED_BIT 13" >> include/config.h
621 @echo "#define GPIO_WLAN_2G_LED_ON 0" >> include/config.h
622 @echo "#define GPIO_USB1_LED_BIT 11" >> include/config.h
623 @echo "#define GPIO_USB1_LED_ON 0" >> include/config.h
624 @echo "#define GPIO_USB2_LED_BIT 12" >> include/config.h
625 @echo "#define GPIO_USB2_LED_ON 0" >> include/config.h
626 @echo "#define GPIO_QSS_LED_BIT 15" >> include/config.h
627 @echo "#define GPIO_QSS_LED_ON 0" >> include/config.h
628 @echo "#define GPIO_RST_BUTTON_BIT 16" >> include/config.h
629 @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h
630 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 8" >> include/config.h
631 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-WDR3600/43x0\"" >> include/config.h
633 @./mkconfig -a db12x mips mips db12x ar7240 ar7240
635 wdr3500_config : unconfig wasp_common_config
636 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-WDR3500 at:' `date` '\e[0m'
637 @echo "#define SOC_TYPE QCA_AR9344_SOC" >> include/config.h
638 @echo "#define CONFIG_FOR_TPLINK_WDR3500_V1 1" >> include/config.h
639 @echo "#define DDR2_32BIT_SUPPORT 1" >> include/config.h
640 @echo "#define CFG_ATHRS27_PHY 1" >> include/config.h
641 @echo "#define CFG_AG7240_NMACS 2" >> include/config.h
642 @echo "#define GPIO_SYS_LED_BIT 14" >> include/config.h
643 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
644 @echo "#define GPIO_WLAN_2G_LED_BIT 13" >> include/config.h
645 @echo "#define GPIO_WLAN_2G_LED_ON 0" >> include/config.h
646 @echo "#define GPIO_LAN1_LED_BIT 19" >> include/config.h
647 @echo "#define GPIO_LAN1_LED_ON 0" >> include/config.h
648 @echo "#define GPIO_LAN2_LED_BIT 20" >> include/config.h
649 @echo "#define GPIO_LAN2_LED_ON 0" >> include/config.h
650 @echo "#define GPIO_LAN3_LED_BIT 21" >> include/config.h
651 @echo "#define GPIO_LAN3_LED_ON 0" >> include/config.h
652 @echo "#define GPIO_LAN4_LED_BIT 22" >> include/config.h
653 @echo "#define GPIO_LAN4_LED_ON 0" >> include/config.h
654 @echo "#define GPIO_INTERNET_LED_BIT 18" >> include/config.h
655 @echo "#define GPIO_INTERNET_LED_ON 0" >> include/config.h
656 @echo "#define GPIO_QSS_LED_BIT 15" >> include/config.h
657 @echo "#define GPIO_QSS_LED_ON 0" >> include/config.h
658 @echo "#define GPIO_USB_LED_BIT 11" >> include/config.h
659 @echo "#define GPIO_USB_LED_ON 0" >> include/config.h
660 @echo "#define GPIO_RST_BUTTON_BIT 16" >> include/config.h
661 @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h
662 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 8" >> include/config.h
663 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-WDR3500\"" >> include/config.h
665 @./mkconfig -a db12x mips mips db12x ar7240 ar7240
667 mr3420_v2_config : unconfig wasp_common_config
668 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-MR3420 v2 at:' `date` '\e[0m'
669 @echo "#define SOC_TYPE QCA_AR9341_SOC" >> include/config.h
670 @echo "#define CONFIG_FOR_TPLINK_MR3420_V2 1" >> include/config.h
671 @echo "#define CONFIG_AP123 1" >> include/config.h
672 @echo "#define DDR2_32BIT_SUPPORT 1" >> include/config.h
673 @echo "#define CFG_ATHRS27_PHY 1" >> include/config.h
674 @echo "#define CFG_AG7240_NMACS 2" >> include/config.h
675 @echo "#define GPIO_SYS_LED_BIT 14" >> include/config.h
676 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
677 @echo "#define GPIO_WLAN_LED_BIT 13" >> include/config.h
678 @echo "#define GPIO_WLAN_LED_ON 0" >> include/config.h
679 @echo "#define GPIO_INTERNET_LED_BIT 18" >> include/config.h
680 @echo "#define GPIO_INTERNET_LED_ON 0" >> include/config.h
681 @echo "#define GPIO_LAN1_LED_BIT 19" >> include/config.h
682 @echo "#define GPIO_LAN1_LED_ON 0" >> include/config.h
683 @echo "#define GPIO_LAN2_LED_BIT 20" >> include/config.h
684 @echo "#define GPIO_LAN2_LED_ON 0" >> include/config.h
685 @echo "#define GPIO_LAN3_LED_BIT 21" >> include/config.h
686 @echo "#define GPIO_LAN3_LED_ON 0" >> include/config.h
687 @echo "#define GPIO_LAN4_LED_BIT 12" >> include/config.h
688 @echo "#define GPIO_LAN4_LED_ON 0" >> include/config.h
689 @echo "#define GPIO_USB_LED_BIT 11" >> include/config.h
690 @echo "#define GPIO_USB_LED_ON 0" >> include/config.h
691 @echo "#define GPIO_QSS_LED_BIT 15" >> include/config.h
692 @echo "#define GPIO_QSS_LED_ON 0" >> include/config.h
693 @echo "#define GPIO_RST_BUTTON_BIT 17" >> include/config.h
694 @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h
695 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h
696 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-MR3420 v2\"" >> include/config.h
698 @./mkconfig -a db12x mips mips db12x ar7240 ar7240
700 wr841n_v8_config : unconfig wasp_common_config
701 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-WR841N/D v8 at:' `date` '\e[0m'
702 @echo "#define SOC_TYPE QCA_AR9341_SOC" >> include/config.h
703 @echo "#define CONFIG_FOR_TPLINK_WR841N_V8 1" >> include/config.h
704 @echo "#define CONFIG_AP123 1" >> include/config.h
705 @echo "#define DDR2_32BIT_SUPPORT 1" >> include/config.h
706 @echo "#define CFG_ATHRS27_PHY 1" >> include/config.h
707 @echo "#define CFG_AG7240_NMACS 2" >> include/config.h
708 @echo "#define GPIO_SYS_LED_BIT 14" >> include/config.h
709 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
710 @echo "#define GPIO_WLAN_LED_BIT 13" >> include/config.h
711 @echo "#define GPIO_WLAN_LED_ON 0" >> include/config.h
712 @echo "#define GPIO_INTERNET_LED_BIT 18" >> include/config.h
713 @echo "#define GPIO_INTERNET_LED_ON 0" >> include/config.h
714 @echo "#define GPIO_LAN1_LED_BIT 19" >> include/config.h
715 @echo "#define GPIO_LAN1_LED_ON 0" >> include/config.h
716 @echo "#define GPIO_LAN2_LED_BIT 20" >> include/config.h
717 @echo "#define GPIO_LAN2_LED_ON 0" >> include/config.h
718 @echo "#define GPIO_LAN3_LED_BIT 21" >> include/config.h
719 @echo "#define GPIO_LAN3_LED_ON 0" >> include/config.h
720 @echo "#define GPIO_LAN4_LED_BIT 12" >> include/config.h
721 @echo "#define GPIO_LAN4_LED_ON 0" >> include/config.h
722 @echo "#define GPIO_QSS_LED_BIT 15" >> include/config.h
723 @echo "#define GPIO_QSS_LED_ON 0" >> include/config.h
724 @echo "#define GPIO_RST_BUTTON_BIT 17" >> include/config.h
725 @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h
726 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h
727 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-WR841N/D v8\"" >> include/config.h
729 @./mkconfig -a db12x mips mips db12x ar7240 ar7240
731 wa830re_v2_wa801nd_v2_config : unconfig wasp_common_config
732 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-WA830RE/TL-WA801ND v2 at:' `date` '\e[0m'
733 @echo "#define SOC_TYPE QCA_AR9341_SOC" >> include/config.h
734 @echo "#define CONFIG_FOR_TPLINK_WA830RE_V2_WA801ND_V2 1" >> include/config.h
735 @echo "#define CONFIG_AP123 1" >> include/config.h
736 @echo "#define DDR2_32BIT_SUPPORT 1" >> include/config.h
737 @echo "#define CFG_ATHRS27_PHY 1" >> include/config.h
738 @echo "#define CFG_AG7240_NMACS 2" >> include/config.h
739 @echo "#define GPIO_SYS_LED_BIT 14" >> include/config.h
740 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
741 @echo "#define GPIO_LAN_LED_BIT 18" >> include/config.h
742 @echo "#define GPIO_LAN_LED_ON 0" >> include/config.h
743 @echo "#define GPIO_WLAN_LED_BIT 13" >> include/config.h
744 @echo "#define GPIO_WLAN_LED_ON 0" >> include/config.h
745 @echo "#define GPIO_QSS_LED_BIT 15" >> include/config.h
746 @echo "#define GPIO_QSS_LED_ON 0" >> include/config.h
747 @echo "#define GPIO_RST_BUTTON_BIT 17" >> include/config.h
748 @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h
749 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h
750 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-WA830RE/TL-WA801ND v2\"" >> include/config.h
752 @./mkconfig -a db12x mips mips db12x ar7240 ar7240
754 ap143_common_config : common_config
755 @echo "#define CONFIG_ATHEROS 1" >> include/config.h
756 @echo "#define CONFIG_MACH_QCA953x 1" >> include/config.h
758 tplink_wr820n_CH_config : unconfig ap143_common_config
759 @/bin/echo -e '\e[32m> Configuring for TP-Link TL-WR820N CH at:' `date` '\e[0m'
760 @echo "#define SOC_TYPE QCA_QCA953X_SOC" >> include/config.h
761 @echo "#define CONFIG_FOR_TPLINK_WR820N_CH 1" >> include/config.h
762 @echo "#define CFG_ATHRS27_PHY 1" >> include/config.h
763 @echo "#define CFG_ATH_GMAC_NMACS 2" >> include/config.h
764 @echo "#define DEFAULT_FLASH_SIZE_IN_MB 4" >> include/config.h
765 @echo "#define GPIO_SYS_LED_BIT 13" >> include/config.h
766 @echo "#define GPIO_SYS_LED_ON 0" >> include/config.h
767 @echo "#define GPIO_RST_BUTTON_BIT 12" >> include/config.h
768 @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW 1" >> include/config.h
769 @echo "#define BOARD_CUSTOM_STRING \"TP-Link TL-WR820N CH\"" >> include/config.h
770 @echo "#define CFG_PLL_FREQ CFG_PLL_400_400_200" >> include/config.h
772 @./mkconfig -a ap143 mips mips ap143 ar7240 ar7240
774 #########################################################################
775 #########################################################################
776 #########################################################################
779 @/bin/echo -e "\e[32m> Making $@...\e[0m"
781 \( -name 'core' -o -name '*.bak' -o -name '*~' \
782 -o -name '*.o' -o -name '*.a' -o -name .depend \) -print \
784 @rm -f tools/mkimage tools/envcrc
785 @rm -f lib_bootstrap/*.o
786 @rm -f lib_bootstrap/*.a
787 @rm -f bootstrap bootstrap.bin tuboot.bin u-boot.lzimg u-boot.bin.lzma bootstrap.map
790 @/bin/echo -e "\e[32m> Making $@...\e[0m"
791 @find . -type f \( -name .depend \
792 -o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
795 @rm -f $(OBJS) *.bak tags TAGS include/version_autogenerated.h
797 @rm -f u-boot u-boot.map u-boot.hex $(ALL)
798 @rm -f tools/crc32.c tools/environment.c
799 @rm -f cpu/mpc824x/bedbug_603e.c
800 @rm -f include/asm/proc include/asm/arch include/asm
803 distclean: clobber unconfig
806 F=`basename $(TOPDIR)` ; cd .. ; \
807 gtar --force-local -zcvf `date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
809 #########################################################################