add support for tl-mr13u
[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
271 hornet_common_config :
272         @ >include/config.h
273         @echo "#define CONFIG_AR7240                        1" >> include/config.h
274         @echo "#define CONFIG_MACH_HORNET                   1" >> include/config.h
275         @echo "#define CONFIG_HORNET_1_1_WAR                1" >> include/config.h
276         @echo "#define NEW_DDR_TAP_CAL                      1" >> include/config.h
277
278 ifdef CONFIG_BOOTDELAY
279         @echo "#define CONFIG_BOOTDELAY "$(CONFIG_BOOTDELAY)   >> include/config.h
280 endif
281
282         @echo "#define CONFIG_DELAY_TO_AUTORUN_HTTPD        3" >> include/config.h
283         @echo "#define CONFIG_DELAY_TO_AUTORUN_CONSOLE      5" >> include/config.h
284         @echo "#define CONFIG_DELAY_TO_AUTORUN_NETCONSOLE   7" >> include/config.h
285
286         # max delay time for button pressing
287         @echo "#define CONFIG_MAX_BUTTON_PRESSING          10" >> include/config.h
288
289         # don't show info about console (in, out, err...)
290         @echo "#define CFG_CONSOLE_INFO_QUIET"                 >> include/config.h
291
292 wr703n_config : unconfig hornet_common_config
293         @echo '======= Configuring for TP-Link TL-WR703N at:' `date` '======='
294         @echo "#define CONFIG_FOR_TPLINK_WR703N_V1          1" >> include/config.h
295         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
296         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
297         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
298         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
299         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-WR703N\"" >> include/config.h
300         
301         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
302
303 wr720n_v3_CH_config : unconfig hornet_common_config
304         @echo '======= Configuring for TP-Link TL-WR720N v3 CH at:' `date` '======='
305         @echo "#define CONFIG_FOR_TPLINK_WR720N_V3          1" >> include/config.h
306         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
307         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
308         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
309         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
310         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-WR720N v3 CH\"" >> include/config.h
311         
312         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
313
314 wr710n_config : unconfig hornet_common_config
315         @echo '======= Configuring for TP-Link TL-WR710N at:' `date` '======='
316         @echo "#define CONFIG_FOR_TPLINK_WR710N_V1          1" >> include/config.h
317         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
318         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
319         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
320         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             8" >> include/config.h
321         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-WR710N\"" >> include/config.h
322         
323         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
324
325 mr3020_config : unconfig hornet_common_config
326         @echo '======= Configuring for TP-Link TL-MR3020 at:' `date` '======='
327         @echo "#define CONFIG_FOR_TPLINK_MR3020_V1          1" >> include/config.h
328         @echo "#define GPIO_INTERNET_LED_BIT               27" >> include/config.h
329         @echo "#define GPIO_INTERNET_LED_ON                 0" >> include/config.h
330         @echo "#define GPIO_WPS_LED_BIT                    26" >> include/config.h
331         @echo "#define GPIO_WPS_LED_ON                      0" >> include/config.h
332         @echo "#define GPIO_WLAN_LED_BIT                    0" >> include/config.h
333         @echo "#define GPIO_WLAN_LED_ON                     1" >> include/config.h
334         @echo "#define GPIO_ETH_LED_BIT                    17" >> include/config.h
335         @echo "#define GPIO_ETH_LED_ON                      0" >> include/config.h
336         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
337         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
338         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-MR3020\"" >> include/config.h
339         
340         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
341
342 mr3040_config : unconfig hornet_common_config
343         @echo '======= Configuring for TP-Link TL-MR3040 at:' `date` '======='
344         @echo "#define CONFIG_FOR_TPLINK_MR3040_V1V2        1" >> include/config.h
345         @echo "#define GPIO_INTERNET_LED_BIT               27" >> include/config.h
346         @echo "#define GPIO_INTERNET_LED_ON                 0" >> include/config.h
347         @echo "#define GPIO_WLAN_LED_BIT                   26" >> include/config.h
348         @echo "#define GPIO_WLAN_LED_ON                     0" >> include/config.h
349         @echo "#define GPIO_ETH_LED_BIT                    17" >> include/config.h
350         @echo "#define GPIO_ETH_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                  \"AP121 (AR9331) U-Boot for TL-MR3040\"" >> include/config.h
354         
355         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
356
357 mr10u_config : unconfig hornet_common_config
358         @echo '======= Configuring for TP-Link TL-MR10U at:' `date` '======='
359         @echo "#define CONFIG_FOR_TPLINK_MR10U_V1           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                  \"AP121 (AR9331) U-Boot for TL-MR10U\"" >> include/config.h
365         
366         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
367
368 mr13u_config : unconfig hornet_common_config
369         @echo '======= Configuring for TP-Link TL-MR13U at:' `date` '======='
370         @echo "#define CONFIG_FOR_TPLINK_MR13U_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             4" >> include/config.h
375         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-MR13U\"" >> include/config.h
376
377         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
378
379
380 wr740n_v4_config : unconfig hornet_common_config
381         @echo '======= Configuring for TP-Link TL-WR740N v4 at:' `date` '======='
382         @echo "#define CONFIG_FOR_TPLINK_WR740N_V4          1" >> include/config.h
383         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
384         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
385         @echo "#define GPIO_WLAN_LED_BIT                    0" >> include/config.h
386         @echo "#define GPIO_WLAN_LED_ON                     1" >> include/config.h
387         @echo "#define GPIO_LAN1_LED_BIT                   14" >> include/config.h
388         @echo "#define GPIO_LAN1_LED_ON                     1" >> include/config.h
389         @echo "#define GPIO_LAN2_LED_BIT                   15" >> include/config.h
390         @echo "#define GPIO_LAN2_LED_ON                     1" >> include/config.h
391         @echo "#define GPIO_LAN3_LED_BIT                   16" >> include/config.h
392         @echo "#define GPIO_LAN3_LED_ON                     1" >> include/config.h
393         @echo "#define GPIO_LAN4_LED_BIT                   17" >> include/config.h
394         @echo "#define GPIO_LAN4_LED_ON                     0" >> include/config.h
395         @echo "#define GPIO_INTERNET_LED_BIT               13" >> include/config.h
396         @echo "#define GPIO_INTERNET_LED_ON                 1" >> include/config.h
397         @echo "#define GPIO_QSS_LED_BIT                     1" >> include/config.h
398         @echo "#define GPIO_QSS_LED_ON                      1" >> include/config.h
399         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
400         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
401         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-WR74xN/D v4\"" >> include/config.h
402         
403         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
404
405 mr3220_v2_config : unconfig hornet_common_config
406         @echo '======= Configuring for TP-Link TL-MR3220 v2 at:' `date` '======='
407         @echo "#define CONFIG_FOR_TPLINK_MR3220_V2          1" >> include/config.h
408         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
409         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
410         @echo "#define GPIO_WLAN_LED_BIT                    0" >> include/config.h
411         @echo "#define GPIO_WLAN_LED_ON                     1" >> include/config.h
412         @echo "#define GPIO_LAN1_LED_BIT                   14" >> include/config.h
413         @echo "#define GPIO_LAN1_LED_ON                     1" >> include/config.h
414         @echo "#define GPIO_LAN2_LED_BIT                   15" >> include/config.h
415         @echo "#define GPIO_LAN2_LED_ON                     1" >> include/config.h
416         @echo "#define GPIO_LAN3_LED_BIT                   16" >> include/config.h
417         @echo "#define GPIO_LAN3_LED_ON                     1" >> include/config.h
418         @echo "#define GPIO_LAN4_LED_BIT                   17" >> include/config.h
419         @echo "#define GPIO_LAN4_LED_ON                     0" >> include/config.h
420         @echo "#define GPIO_INTERNET_LED_BIT               13" >> include/config.h
421         @echo "#define GPIO_INTERNET_LED_ON                 1" >> include/config.h
422         @echo "#define GPIO_QSS_LED_BIT                     1" >> include/config.h
423         @echo "#define GPIO_QSS_LED_ON                      1" >> include/config.h
424         @echo "#define GPIO_USB_LED_BIT                    26" >> include/config.h
425         @echo "#define GPIO_USB_LED_ON                      1" >> include/config.h
426         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
427         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             4" >> include/config.h
428         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for TL-MR3220 v2\"" >> include/config.h
429         
430         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
431
432 dir505_config : unconfig hornet_common_config
433         @echo '======= Configuring for D-Link DIR-505 at:' `date` '======='
434         @echo "#define CONFIG_FOR_DLINK_DIR505_A1           1" >> include/config.h
435         @echo "#define GPIO_SYS_LED_BIT                    27" >> include/config.h
436         @echo "#define GPIO_SYS_LED_ON                      0" >> include/config.h
437
438         # we will use WPS button instead of reset
439         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
440         @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW        1" >> include/config.h
441         
442         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             8" >> include/config.h
443         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for DIR-505\"" >> include/config.h
444         
445         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
446
447 carambola2_config : unconfig hornet_common_config
448         @echo '======= Configuring for 8devices Carambola 2 at:' `date` '======='
449         @echo "#define CONFIG_FOR_8DEVICES_CARAMBOLA2       1" >> include/config.h
450
451         # Carambola 2 uses uncompressed version
452         @echo "#undef COMPRESSED_UBOOT"                        >> include/config.h
453
454         # Carambola 2 uses 40 MHz oscillator
455         @echo "#define CONFIG_40MHZ_XTAL_SUPPORT            1" >> include/config.h
456
457         @echo "#define GPIO_WLAN_LED_BIT                    0" >> include/config.h
458         @echo "#define GPIO_WLAN_LED_ON                     0" >> include/config.h
459         @echo "#define GPIO_RST_BUTTON_BIT                 11" >> include/config.h
460
461         # Carambola 2 development board has RST button pulled up, so it is active at low
462         @echo "#define GPIO_RST_BUTTON_IS_ACTIVE_LOW        1" >> include/config.h
463
464         @echo "#define DEFAULT_FLASH_SIZE_IN_MB            16" >> include/config.h
465         @echo "#define BOARD_CUSTOM_STRING                  \"AP121 (AR9331) U-Boot for CARAMBOLA2 v1\"" >> include/config.h
466         
467         @./mkconfig -a ap121 mips mips ap121 ar7240 ar7240
468
469 db12x_config : unconfig
470         @echo '======= Configuring for TP-Link TL-WDR3600/43x0 at:' `date` '======='
471         @ >include/config.h
472         @echo "#define CONFIG_WASP_SUPPORT                  1" >> include/config.h
473         @echo "#undef CFG_ATHRS26_PHY"                         >> include/config.h
474         @echo "#define DDR2_32BIT_SUPPORT                   1" >> include/config.h
475         @echo "#define CONFIG_AG7240_GE0_IS_CONNECTED       1" >> include/config.h
476         @echo "#define CONFIG_AR7240                        1" >> include/config.h
477         @echo "#define CONFIG_WASP                          1" >> include/config.h
478
479 ifdef CONFIG_BOOTDELAY
480         @echo "#define CONFIG_BOOTDELAY "$(CONFIG_BOOTDELAY)   >> include/config.h
481 endif
482
483         @echo "#define CONFIG_DELAY_TO_AUTORUN_HTTPD        3" >> include/config.h
484         @echo "#define CONFIG_DELAY_TO_AUTORUN_CONSOLE      5" >> include/config.h
485         @echo "#define CONFIG_DELAY_TO_AUTORUN_NETCONSOLE   7" >> include/config.h
486
487         # max delay time for button pressing
488         @echo "#define CONFIG_MAX_BUTTON_PRESSING          10" >> include/config.h
489
490         # don't show info about console (in, out, err...)
491         @echo "#define CFG_CONSOLE_INFO_QUIET"                 >> include/config.h
492
493         @echo "#define CONFIG_ATHRS17_PHY                   1" >> include/config.h
494         @echo "#define CFG_AG7240_NMACS                     1" >> include/config.h
495         @echo "#define DEFAULT_FLASH_SIZE_IN_MB             8" >> include/config.h
496         @echo "#define BOARD_CUSTOM_STRING                  \"DB120 (AR9344) U-Boot for TL-WDR3600/43x0\"" >> include/config.h
497
498         @./mkconfig -a db12x mips mips db12x ar7240 ar7240
499
500 #########################################################################
501 #########################################################################
502 #########################################################################
503
504 clean:
505         @echo Making $@
506         @find . -type f \
507                 \( -name 'core' -o -name '*.bak' -o -name '*~' \
508                 -o -name '*.o'  -o -name '*.a' -o -name .depend \) -print \
509                 | xargs rm -f
510         @rm -f tools/mkimage tools/envcrc
511         @rm -f lib_bootstrap/*.o
512         @rm -f lib_bootstrap/*.a
513         @rm -f bootstrap bootstrap.bin tuboot.bin u-boot.lzimg u-boot.bin.lzma bootstrap.map
514
515 clobber:        clean
516         @echo Making $@
517         @find . -type f \( -name .depend \
518                 -o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
519                 -print0 \
520                 | xargs -0 rm -f
521         @rm -f $(OBJS) *.bak tags TAGS include/version_autogenerated.h
522         @rm -fr *.*~
523         @rm -f u-boot u-boot.map u-boot.hex $(ALL)
524         @rm -f tools/crc32.c tools/environment.c
525         @rm -f cpu/mpc824x/bedbug_603e.c
526         @rm -f include/asm/proc include/asm/arch include/asm
527
528 mrproper \
529 distclean:      clobber unconfig
530
531 backup:
532         F=`basename $(TOPDIR)` ; cd .. ; \
533         gtar --force-local -zcvf `date "+$$F-%Y-%m-%d-%T.tar.gz"` $$F
534
535 #########################################################################