Initial AR9341 support, some changes in makefiles, athrs27 driver
[oweals/u-boot_mod.git] / u-boot / Makefile
1 #
2 # (C) Copyright 2000-2006
3 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 #
5 # See file CREDITS for list of people who contributed to this
6 # project.
7 #
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.
12 #
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.
17 #
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,
21 # MA 02111-1307 USA
22 #
23
24 VERSION                 = 1
25 PATCHLEVEL              = 1
26 SUBLEVEL                = 4
27 EXTRAVERSION    =
28 U_BOOT_VERSION  = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
29 VERSION_FILE    = include/version_autogenerated.h
30
31 HOSTARCH := $(shell uname -m | \
32         sed -e s/i.86/i386/ \
33             -e s/sun4u/sparc64/ \
34             -e s/arm.*/arm/ \
35             -e s/sa110/arm/ \
36             -e s/powerpc/ppc/ \
37             -e s/macppc/ppc/)
38
39 HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
40             sed -e 's/\(cygwin\).*/cygwin/')
41
42 export  HOSTARCH HOSTOS
43
44 # Deal with colliding definitions from tcsh etc.
45 VENDOR=
46
47 #########################################################################
48
49 TOPDIR  := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
50 export  TOPDIR
51
52 ifeq ($(COMPRESSED_UBOOT),1)
53 COMPRESSED_UBOOT = 1
54 export export COMPRESSED_UBOOT
55 endif
56
57 ifeq (include/config.mk,$(wildcard include/config.mk))
58 # load ARCH, BOARD, and CPU configuration
59 include include/config.mk
60 export  ARCH CPU BOARD VENDOR SOC
61 ifndef CROSS_COMPILE
62 ifeq ($(HOSTARCH),ppc)
63 CROSS_COMPILE =
64 else
65 ifeq ($(ARCH),ppc)
66 CROSS_COMPILE = powerpc-linux-
67 endif
68 ifeq ($(ARCH),arm)
69 CROSS_COMPILE = arm-linux-
70 endif
71 ifeq ($(ARCH),i386)
72 ifeq ($(HOSTARCH),i386)
73 CROSS_COMPILE =
74 else
75 CROSS_COMPILE = i386-linux-
76 endif
77 endif
78 ifeq ($(ARCH),mips)
79 CROSS_COMPILE = mips-linux-
80 endif
81 ifeq ($(ARCH),nios)
82 CROSS_COMPILE = nios-elf-
83 endif
84 ifeq ($(ARCH),nios2)
85 CROSS_COMPILE = nios2-elf-
86 endif
87 ifeq ($(ARCH),m68k)
88 CROSS_COMPILE = m68k-elf-
89 endif
90 ifeq ($(ARCH),microblaze)
91 CROSS_COMPILE = mb-
92 endif
93 ifeq ($(ARCH),blackfin)
94 CROSS_COMPILE = bfin-elf-
95 endif
96 endif
97 endif
98
99 export  CROSS_COMPILE
100
101 # load other configuration
102 include $(TOPDIR)/config.mk
103
104
105 #########################################################################
106 # U-Boot objects....order is important (i.e. start must be first)
107 OBJS  = cpu/$(CPU)/start.o
108
109 ifeq ($(COMPRESSED_UBOOT),1)
110 OBJS_BOOTSTRAP  = cpu/$(CPU)/start_bootstrap.o
111 endif
112
113 LIBS  = lib_generic/libgeneric.a
114 LIBS += common/libcommon.a
115 LIBS += board/$(BOARDDIR)/lib$(BOARD).a
116 LIBS += cpu/$(CPU)/lib$(CPU).a
117
118 ifdef SOC
119 LIBS += cpu/$(CPU)/$(SOC)/lib$(SOC).a
120 endif
121
122 LIBS += lib_$(ARCH)/lib$(ARCH).a
123 LIBS += drivers/libdrivers.a
124 LIBS += net/libnet.a
125 LIBS += rtc/librtc.a
126 LIBS += httpd/libhttpd.a
127 LIBS += $(BOARDLIBS)
128
129 ifeq ($(COMPRESSED_UBOOT),1)
130 LIBS_BOOTSTRAP = lib_bootstrap/libbootstrap.a 
131 LIBS_BOOTSTRAP += board/$(BOARDDIR)/lib$(BOARD).a 
132 LIBS_BOOTSTRAP += cpu/$(CPU)/lib$(CPU).a
133 LIBS_BOOTSTRAP += cpu/$(CPU)/$(SOC)/lib$(SOC).a
134 endif
135
136 .PHONY : $(LIBS)
137
138 ifeq ($(COMPRESSED_UBOOT),1)
139 .PHONY : $(LIBS_BOOTSTRAP)
140 endif
141
142 # Add GCC lib
143 PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
144
145 # The "tools" are needed early, so put this first
146 # Don't include stuff already done in $(LIBS)
147 SUBDIRS = tools
148
149 .PHONY : $(SUBDIRS)
150
151 #########################################################################
152 #########################################################################
153
154 ALL = u-boot.srec u-boot.bin System.map
155
156 ifeq ($(COMPRESSED_UBOOT),1)
157 all:            $(ALL) tuboot.bin
158 else
159 all:            $(ALL)
160 endif
161
162 u-boot.hex:     u-boot
163                 $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
164
165 u-boot.srec:    u-boot
166                 $(OBJCOPY) ${OBJCFLAGS} -O srec $< $@
167
168 u-boot.bin:     u-boot
169                 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
170
171 u-boot.img:     u-boot.bin
172                 ./tools/mkimage -A $(ARCH) -T firmware -C none \
173                 -a $(TEXT_BASE) -e 0 \
174                 -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
175                         sed -e 's/"[     ]*$$/ for $(BOARD) board"/') \
176                 -d $< $@
177
178 u-boot.dis:     u-boot
179                 $(OBJDUMP) -d $< > $@
180
181 u-boot:         depend version $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
182                 UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
183                 $(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
184                         --start-group $(LIBS) --end-group $(PLATFORM_LIBS) \
185                         -Map u-boot.map -o u-boot
186
187 $(LIBS):
188                 $(MAKE) -C `dirname $@`
189
190 $(SUBDIRS):
191                 $(MAKE) -C $@ all
192
193 ifeq ($(COMPRESSED_UBOOT),1)
194 LZMA = $(BUILD_TOPDIR)/host_util/lzma
195
196 tuboot.bin:     System.map bootstrap.bin u-boot.lzimg   
197                 @cat bootstrap.bin > $@
198                 @cat u-boot.lzimg >> $@
199
200 u-boot.lzimg: $(obj)u-boot.bin System.map
201                 @rm -rf u-boot.bin.lzma
202                 #$(LZMA) e $(obj)u-boot.bin u-boot.bin.lzma
203                 $(LZMA) --best --keep $(obj)u-boot.bin
204                 ./tools/mkimage -A mips -T firmware -C lzma \
205                 -a 0x$(shell grep "T _start" $(TOPDIR)/System.map | awk '{ printf "%s", $$1 }') \
206                 -e 0x$(shell grep "T _start" $(TOPDIR)/System.map | awk '{ printf "%s", $$1 }') \
207                 -n 'u-boot image' -d $(obj)u-boot.bin.lzma $@
208
209 bootstrap.bin:  bootstrap
210                 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
211
212 bootstrap:      depend version $(SUBDIRS) $(OBJS_BOOTSTRAP) $(LIBS_BOOTSTRAP) $(LDSCRIPT_BOOTSTRAP)
213                 UNDEF_SYM=`$(OBJDUMP) -x $(LIBS_BOOTSTRAP) |sed  -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
214                 $(LD) $(LDFLAGS_BOOTSTRAP) $$UNDEF_SYM $(OBJS_BOOTSTRAP) \
215                         --start-group $(LIBS_BOOTSTRAP) --end-group $(PLATFORM_LIBS) \
216                         -Map bootstrap.map -o bootstrap
217
218 $(LIBS_BOOTSTRAP):
219                 $(MAKE) -C `dirname $@`
220 endif
221
222 version:
223                 @echo -n "#define U_BOOT_VERSION \"U-Boot " > $(VERSION_FILE); \
224                 echo -n "$(U_BOOT_VERSION)" >> $(VERSION_FILE); \
225                 echo "\"" >> $(VERSION_FILE)
226
227 gdbtools:
228                 $(MAKE) -C tools/gdb || exit 1
229
230 depend dep:
231                 @for dir in $(SUBDIRS) ; do $(MAKE) -C $$dir .depend ; done
232
233 tags:
234                 ctags -w `find $(SUBDIRS) include \
235                                 lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \
236                                 fs/cramfs fs/fat fs/fdos fs/jffs2 \
237                                 net disk rtc dtt drivers drivers/sk98lin common \
238                         \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
239
240 etags:
241                 etags -a `find $(SUBDIRS) include \
242                                 lib_generic board/$(BOARDDIR) cpu/$(CPU) lib_$(ARCH) \
243                                 fs/cramfs fs/fat fs/fdos fs/jffs2 \
244                                 net disk rtc dtt drivers drivers/sk98lin common \
245                         \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`
246
247 System.map:     u-boot
248                 @$(NM) $< | \
249                 grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
250                 sort > System.map
251
252 #########################################################################
253 else
254 all install u-boot u-boot.srec depend dep:
255         @echo "System not configured - see README" >&2
256         @ exit 1
257 endif
258
259 #########################################################################
260
261 unconfig:
262         @rm -f include/config.h include/config.mk board/*/config.tmp
263
264 #========================================================================
265 # MIPS
266 #========================================================================
267 #########################################################################
268 ## MIPS32 AR7100 (24K)
269 #########################################################################
270 common_config :
271         @ >include/config.h
272
273 ifdef CONFIG_BOOTDELAY
274         @echo "#define CONFIG_BOOTDELAY "$(CONFIG_BOOTDELAY)   >> include/config.h
275 endif
276
277 ifdef CFG_PLL_FREQ
278         @echo "#define CFG_PLL_FREQ "$(CFG_PLL_FREQ)           >> include/config.h
279 endif
280
281         @echo "#define CONFIG_DELAY_TO_AUTORUN_HTTPD        3" >> include/config.h
282         @echo "#define CONFIG_DELAY_TO_AUTORUN_CONSOLE      5" >> include/config.h
283         @echo "#define CONFIG_DELAY_TO_AUTORUN_NETCONSOLE   7" >> include/config.h
284
285         # max delay time for button pressing
286         @echo "#define CONFIG_MAX_BUTTON_PRESSING          10" >> include/config.h
287
288         # don't show info about console (in, out, err...)
289         @echo "#define CFG_CONSOLE_INFO_QUIET"                 >> include/config.h
290
291 hornet_common_config : common_config
292         @echo "#define CONFIG_AR7240                        1" >> include/config.h
293         @echo "#define CONFIG_MACH_HORNET                   1" >> include/config.h
294         @echo "#define CONFIG_HORNET_1_1_WAR                1" >> include/config.h
295         @echo "#define NEW_DDR_TAP_CAL                      1" >> include/config.h
296
297 wr703n_config : unconfig hornet_common_config
298         @echo '======= Configuring for TP-Link TL-WR703N at:' `date` '======='
299         @echo "#define CONFIG_FOR_TPLINK_WR703N_V1          1" >> include/config.h
300         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
301         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
302         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
303         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
304         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-WR703N\"" >> include/config.h
305         
306         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
307
308 wr720n_v3_CH_config : unconfig hornet_common_config
309         @echo '======= Configuring for TP-Link TL-WR720N v3 CH at:' `date` '======='
310         @echo "#define CONFIG_FOR_TPLINK_WR720N_V3          1" >> include/config.h
311         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
312         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
313         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
314         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
315         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-WR720N v3 CH\"" >> include/config.h
316         
317         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
318
319 wr710n_config : unconfig hornet_common_config
320         @echo '======= Configuring for TP-Link TL-WR710N at:' `date` '======='
321         @echo "#define CONFIG_FOR_TPLINK_WR710N_V1          1" >> include/config.h
322         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
323         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
324         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
325         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             8" >> include/config.h
326         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-WR710N\"" >> include/config.h
327         
328         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
329
330 mr3020_config : unconfig hornet_common_config
331         @echo '======= Configuring for TP-Link TL-MR3020 at:' `date` '======='
332         @echo "#define CONFIG_FOR_TPLINK_MR3020_V1          1" >> include/config.h
333         @echo "#define GPIO_INTERNET_LED_BIT               27" >> include/config.h
334         @echo "#define GPIO_INTERNET_LED_ON                 0" >> include/config.h
335         @echo "#define GPIO_WPS_LED_BIT                    26" >> include/config.h
336         @echo "#define GPIO_WPS_LED_ON                      0" >> include/config.h
337         @echo "#define GPIO_WLAN_LED_BIT                    0" >> include/config.h
338         @echo "#define GPIO_WLAN_LED_ON                     1" >> include/config.h
339         @echo "#define GPIO_ETH_LED_BIT                    17" >> include/config.h
340         @echo "#define GPIO_ETH_LED_ON                      0" >> include/config.h
341         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
342         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
343         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-MR3020\"" >> include/config.h
344         
345         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
346
347 mr3040_config : unconfig hornet_common_config
348         @echo '======= Configuring for TP-Link TL-MR3040 at:' `date` '======='
349         @echo "#define CONFIG_FOR_TPLINK_MR3040_V1V2        1" >> include/config.h
350         @echo "#define GPIO_INTERNET_LED_BIT               27" >> include/config.h
351         @echo "#define GPIO_INTERNET_LED_ON                 0" >> include/config.h
352         @echo "#define GPIO_WLAN_LED_BIT                   26" >> include/config.h
353         @echo "#define GPIO_WLAN_LED_ON                     0" >> include/config.h
354         @echo "#define GPIO_ETH_LED_BIT                    17" >> include/config.h
355         @echo "#define GPIO_ETH_LED_ON                      0" >> include/config.h
356         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
357         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
358         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-MR3040\"" >> include/config.h
359         
360         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
361
362 mr10u_config : unconfig hornet_common_config
363         @echo '======= Configuring for TP-Link TL-MR10U at:' `date` '======='
364         @echo "#define CONFIG_FOR_TPLINK_MR10U_V1           1" >> include/config.h
365         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
366         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
367         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
368         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
369         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-MR10U\"" >> include/config.h
370         
371         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
372
373 mr13u_config : unconfig hornet_common_config
374         @echo '======= Configuring for TP-Link TL-MR13U at:' `date` '======='
375         @echo "#define CONFIG_FOR_TPLINK_MR13U_V1           1" >> include/config.h
376         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
377         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
378         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
379         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
380         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-MR13U\"" >> include/config.h
381         
382         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
383
384 wr740n_v4_config : unconfig hornet_common_config
385         @echo '======= Configuring for TP-Link TL-WR740N v4 at:' `date` '======='
386         @echo "#define CONFIG_FOR_TPLINK_WR740N_V4          1" >> include/config.h
387         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
388         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
389         @echo "#define GPIO_WLAN_LED_BIT                    0" >> include/config.h
390         @echo "#define GPIO_WLAN_LED_ON                     1" >> include/config.h
391         @echo "#define GPIO_LAN1_LED_BIT                   14" >> include/config.h
392         @echo "#define GPIO_LAN1_LED_ON                     1" >> include/config.h
393         @echo "#define GPIO_LAN2_LED_BIT                   15" >> include/config.h
394         @echo "#define GPIO_LAN2_LED_ON                     1" >> include/config.h
395         @echo "#define GPIO_LAN3_LED_BIT                   16" >> include/config.h
396         @echo "#define GPIO_LAN3_LED_ON                     1" >> include/config.h
397         @echo "#define GPIO_LAN4_LED_BIT                   17" >> include/config.h
398         @echo "#define GPIO_LAN4_LED_ON                     0" >> include/config.h
399         @echo "#define GPIO_INTERNET_LED_BIT               13" >> include/config.h
400         @echo "#define GPIO_INTERNET_LED_ON                 1" >> include/config.h
401         @echo "#define GPIO_QSS_LED_BIT                     1" >> include/config.h
402         @echo "#define GPIO_QSS_LED_ON                      1" >> include/config.h
403         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
404         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
405         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-WR74xN/D v4\"" >> include/config.h
406         
407         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
408
409 mr3220_v2_config : unconfig hornet_common_config
410         @echo '======= Configuring for TP-Link TL-MR3220 v2 at:' `date` '======='
411         @echo "#define CONFIG_FOR_TPLINK_MR3220_V2          1" >> include/config.h
412         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
413         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
414         @echo "#define GPIO_WLAN_LED_BIT                    0" >> include/config.h
415         @echo "#define GPIO_WLAN_LED_ON                     1" >> include/config.h
416         @echo "#define GPIO_LAN1_LED_BIT                   14" >> include/config.h
417         @echo "#define GPIO_LAN1_LED_ON                     1" >> include/config.h
418         @echo "#define GPIO_LAN2_LED_BIT                   15" >> include/config.h
419         @echo "#define GPIO_LAN2_LED_ON                     1" >> include/config.h
420         @echo "#define GPIO_LAN3_LED_BIT                   16" >> include/config.h
421         @echo "#define GPIO_LAN3_LED_ON                     1" >> include/config.h
422         @echo "#define GPIO_LAN4_LED_BIT                   17" >> include/config.h
423         @echo "#define GPIO_LAN4_LED_ON                     0" >> include/config.h
424         @echo "#define GPIO_INTERNET_LED_BIT               13" >> include/config.h
425         @echo "#define GPIO_INTERNET_LED_ON                 1" >> include/config.h
426         @echo "#define GPIO_QSS_LED_BIT                     1" >> include/config.h
427         @echo "#define GPIO_QSS_LED_ON                      1" >> include/config.h
428         @echo "#define GPIO_USB_LED_BIT                    26" >> include/config.h
429         @echo "#define GPIO_USB_LED_ON                      1" >> include/config.h
430         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
431         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
432         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-MR3220 v2\"" >> include/config.h
433         
434         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
435
436 dir505_config : unconfig hornet_common_config
437         @echo '======= Configuring for D-Link DIR-505 at:' `date` '======='
438         @echo "#define CONFIG_FOR_DLINK_DIR505_A1           1" >> include/config.h
439         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
440         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
441
442         # we will use WPS button instead of reset
443         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
444         @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW        1" >> include/config.h
445         
446         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             8" >> include/config.h
447         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for DIR-505\"" >> include/config.h
448         
449         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
450
451 carambola2_config : unconfig hornet_common_config
452         @echo '======= Configuring for 8devices Carambola 2 at:' `date` '======='
453         @echo "#define CONFIG_FOR_8DEVICES_CARAMBOLA2       1" >> include/config.h
454
455         # Carambola 2 uses uncompressed version
456         @echo "#undef COMPRESSED_UBOOT"                        >> include/config.h
457
458         # Carambola 2 uses 40 MHz oscillator
459         @echo "#define CONFIG_40MHZ_XTAL_SUPPORT            1" >> include/config.h
460
461         @echo "#define GPIO_WLAN_LED_BIT                    0" >> include/config.h
462         @echo "#define GPIO_WLAN_LED_ON                     0" >> include/config.h
463         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
464
465         # Carambola 2 development board has RST button pulled up, so it is active at low
466         @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW        1" >> include/config.h
467
468         @echo "#define DEFAULT_FLASH_SIZE_IN_MB            16" >> include/config.h
469         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for CARAMBOLA2 v1\"" >> include/config.h
470         
471         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
472
473 wasp_common_config : common_config
474         @echo "#define CONFIG_AR7240                        1" >> include/config.h
475         @echo "#define CONFIG_WASP                          1" >> include/config.h
476         @echo "#define CONFIG_WASP_SUPPORT                  1" >> include/config.h
477
478 wdr3600_43x0_config : unconfig wasp_common_config
479         @echo '======= Configuring for TP-Link TL-WDR3600/43x0 at:' `date` '======='
480         @echo "#define CONFIG_FOR_TPLINK_WDR3600_WDR43X0_V1 1" >> include/config.h
481         @echo "#define DDR2_32BIT_SUPPORT                   1" >> include/config.h
482         @echo "#define CFG_ATHRS17_PHY                      1" >> include/config.h
483         @echo "#define CFG_AG7240_NMACS                     1" >> include/config.h
484         @echo "#define CFG_DUAL_PHY_SUPPORT                 1" >> include/config.h
485         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             8" >> include/config.h
486         @echo "#define BOARD_CUSTOM_STRING                  \"DB120 (AR9344) U-Boot for TL-WDR3600/43x0\"" >> include/config.h
487
488         @./mkconfig -a db12x mips mips db12x ar7240 ar7240
489
490 wr841n_v8_config : unconfig wasp_common_config
491         @echo '======= Configuring for TP-Link TL-WR841N/D at:' `date` '======='
492         @echo "#define CONFIG_FOR_TPLINK_WR841N_V8          1" >> include/config.h
493         @echo "#define CONFIG_AP123                         1" >> include/config.h
494         @echo "#define DDR2_32BIT_SUPPORT                   1" >> include/config.h
495         @echo "#define CFG_ATHRS27_PHY                      1" >> include/config.h
496         @echo "#define CFG_AG7240_NMACS                     2" >> include/config.h
497         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
498         @echo "#define BOARD_CUSTOM_STRING                  \"AP123 (AR9341) U-Boot for TL-WR841N/D v8\"" >> include/config.h
499
500         @./mkconfig -a db12x mips mips db12x ar7240 ar7240
501
502 #########################################################################
503 #########################################################################
504 #########################################################################
505
506 clean:
507         @echo Making $@
508         @find . -type f \
509                 \( -name 'core' -o -name '*.bak' -o -name '*~' \
510                 -o -name '*.o'  -o -name '*.a' -o -name .depend \) -print \
511                 | xargs rm -f
512         @rm -f tools/mkimage tools/envcrc
513         @rm -f lib_bootstrap/*.o
514         @rm -f lib_bootstrap/*.a
515         @rm -f bootstrap bootstrap.bin tuboot.bin u-boot.lzimg u-boot.bin.lzma bootstrap.map
516
517 clobber:        clean
518         @echo Making $@
519         @find . -type f \( -name .depend \
520                 -o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
521                 -print0 \
522                 | xargs -0 rm -f
523         @rm -f $(OBJS) *.bak tags TAGS include/version_autogenerated.h
524         @rm -fr *.*~
525         @rm -f u-boot u-boot.map u-boot.hex $(ALL)
526         @rm -f tools/crc32.c tools/environment.c
527         @rm -f cpu/mpc824x/bedbug_603e.c
528         @rm -f include/asm/proc include/asm/arch include/asm
529
530 mrproper \
531 distclean:      clobber unconfig
532
533 backup:
534         F=`basename $(TOPDIR)` ; cd .. ; \
535         gtar --force-local -zcvf `date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
536
537 #########################################################################