01a5884dba2f2b7b5f6e7bc379a2628ed2f10e4e
[openwrt/openwrt.git] / package / uboot-ifxmips / patches / 100-ifx.patch
1 Index: u-boot-1.1.5/Makefile
2 ===================================================================
3 --- u-boot-1.1.5.orig/Makefile 2006-10-20 17:54:33.000000000 +0200
4 +++ u-boot-1.1.5/Makefile 2009-10-04 23:06:03.000000000 +0200
5 @@ -24,7 +24,7 @@
6 VERSION = 1
7 PATCHLEVEL = 1
8 SUBLEVEL = 5
9 -EXTRAVERSION =
10 +EXTRAVERSION = -IFX-LXDB
11 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
12 VERSION_FILE = $(obj)include/version_autogenerated.h
13
14 @@ -44,6 +44,25 @@
15 # Deal with colliding definitions from tcsh etc.
16 VENDOR=
17
18 +# Default algorithm form compressing u-boot.bin
19 +ifndef COMPRESS
20 +COMPRESS=none
21 +COMPRESS_FILE=$(obj)u-boot.img
22 +else
23 +ifeq ($(COMPRESS),lzma)
24 +COMPRESS_FILE=$(obj)u-boot.limg
25 +endif
26 +ifeq ($(COMPRESS),bz2)
27 +COMPRESS_FILE=$(obj)u-boot.bzimg
28 +endif
29 +ifeq ($(COMPRESS),gzip)
30 +COMPRESS_FILE=$(obj)u-boot.zimg
31 +endif
32 +ifeq ($(COMPRESS),none)
33 +COMPRESS_FILE=$(obj)u-boot.img
34 +endif
35 +endif
36 +
37 #########################################################################
38 #
39 # U-boot build supports producing a object files to the separate external
40 @@ -164,6 +183,11 @@
41 # U-Boot objects....order is important (i.e. start must be first)
42
43 OBJS = cpu/$(CPU)/start.o
44 +OBJS_BOOTSTRAP = cpu/$(CPU)/start_bootstrap.o
45 +
46 +cpu/$(CPU)/start_bootstrap.S: cpu/$(CPU)/start.S
47 + ln -s start.S cpu/$(CPU)/start_bootstrap.S
48 +
49 ifeq ($(CPU),i386)
50 OBJS += cpu/$(CPU)/start16.o
51 OBJS += cpu/$(CPU)/reset.o
52 @@ -183,6 +207,7 @@
53 endif
54
55 OBJS := $(addprefix $(obj),$(OBJS))
56 +OBJS_BOOTSTRAP := $(addprefix $(obj),$(OBJS_BOOTSTRAP))
57
58 LIBS = lib_generic/libgeneric.a
59 LIBS += board/$(BOARDDIR)/lib$(BOARD).a
60 @@ -206,15 +231,24 @@
61 LIBS += $(BOARDLIBS)
62
63 LIBS := $(addprefix $(obj),$(LIBS))
64 +
65 +LIBS_BOOTSTRAP = lib_bootstrap/libbootstrap.a
66 +LIBS_BOOTSTRAP+= board/$(BOARDDIR)/lib$(BOARD).a
67 +#LIBS_BOOTSTRAP+= board/ifx/libifx.a
68 +LIBS_BOOTSTRAP+= cpu/$(CPU)/lib$(CPU).a
69 +
70 +LIBS_BOOTSTRAP := $(addprefix $(obj),$(LIBS_BOOTSTRAP))
71 +
72 .PHONY : $(LIBS)
73 +.PHONY : $(obj)lib_bootstrap/libbootstrap.a
74
75 # Add GCC lib
76 PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
77
78 # The "tools" are needed early, so put this first
79 # Don't include stuff already done in $(LIBS)
80 + #examples
81 SUBDIRS = tools \
82 - examples \
83 post \
84 post/cpu
85 .PHONY : $(SUBDIRS)
86 @@ -226,14 +260,75 @@
87
88 __OBJS := $(subst $(obj),,$(OBJS))
89 __LIBS := $(subst $(obj),,$(LIBS))
90 +__LIBS_BOOTSTRAP := $(subst $(obj),,$(LIBS_BOOTSTRAP))
91 +
92 +#__HEAD_OBJS := $(subst $(obj),,$(HEAD_OBJS))
93 +#__HEAD_LIBS := $(subst $(obj),,$(HEAD_LIBS))
94
95 #########################################################################
96 #########################################################################
97
98 ALL = $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map $(U_BOOT_NAND)
99 +#IFX_ALL = $(obj)u-boot.ifx $(obj)head.srec $(obj)head.bin $(obj)head $(obj)head.map $(COMPRESS_FILE) $(obj)u-boot.srec
100 +IFX_ALL = $(obj)u-boot.srec $(obj)u-boot.ifx $(obj)u-boot.lzimg $(obj)System.map $(obj)bootstrap.bin $(obj)System_bootstrap.map
101 +IFX_BOOTSTRAP = $(obj)bootstrap.bin
102
103 all: $(ALL)
104
105 +ifx_all: $(IFX_ALL)
106 +
107 +ifx_bootstrap: $(IFX_BOOTSTRAP)
108 +
109 +$(obj)u-boot.ifx: $(obj)bootstrap.bin $(obj)u-boot.lzimg
110 + @cat $(obj)bootstrap.bin > $(obj)u-boot.ifx
111 + @cat $(obj)u-boot.lzimg >> $(obj)u-boot.ifx
112 +
113 +$(obj)u-boot.lzimg: $(obj)u-boot.bin $(obj)System.map
114 + @lzma e $(obj)u-boot.bin $(obj)u-boot.lzma
115 + $(obj)tools/mkimage -A mips -T firmware -C lzma \
116 + -a 0x$(shell grep "T _start" $(obj)System.map | awk '{ printf "%s", $$1 }') \
117 + -e 0x$(shell grep "T _start" $(obj)System.map | awk '{ printf "%s", $$1 }') \
118 + -n 'u-boot image' -d $(obj)u-boot.lzma $@
119 +
120 +$(obj)ld_uboot.img: $(obj)u-boot.ifx $(obj)u-boot.lzimg $(obj)bootstrap.bin
121 + @ cp -f $(obj)u-boot.ifx $(obj)u-boot.bin
122 + @ ./mkbootimg.incaip2 $(obj)ld_uboot.img < ld_uboot.conf
123 +
124 +$(obj)u-boot.zimg: $(obj)u-boot.bin $(obj)System.map
125 + gzip $(obj)u-boot.bin
126 + $(obj)tools/mkimage -A $(ARCH) -T firmware -C gzip \
127 + -a 0x$(shell grep "T _start" $(obj)System.map | awk '{ printf "%s", $$1 }') \
128 + -e 0x$(shell grep "T _start" $(obj)System.map | awk '{ printf "%s", $$1 }') \
129 + -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
130 + sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
131 + -d u-boot.gz $@
132 +
133 +$(obj)u-boot.bzimg: $(obj)u-boot.bin $(obj)System.map
134 + bzip $(obj)u-boot.bin
135 + $(obj)tools/mkimage -A $(ARCH) -T firmware -C bzip2 \
136 + -a 0x$(shell grep "T _start" $(obj)System.map | awk '{ printf "%s", $$1 }') \
137 + -e 0x$(shell grep "T _start" $(obj)System.map | awk '{ printf "%s", $$1 }') \
138 + -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
139 + sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
140 + -d u-boot.bz2 $@
141 +
142 +$(obj)u-boot.limg: $(obj)u-boot.bin $(obj)System.map
143 + @lzma e $(obj)u-boot.bin $(obj)u-boot.lzma
144 + $(obj)tools/mkimage -A $(ARCH) -T firmware -C lzma \
145 + -a 0x$(shell grep "T _start" $(obj)System.map | awk '{ printf "%s", $$1 }') \
146 + -e 0x$(shell grep "T _start" $(obj)System.map | awk '{ printf "%s", $$1 }') \
147 + -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
148 + sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
149 + -d u-boot.lzma $@
150 +
151 +$(obj)u-boot.img: $(obj)u-boot.bin $(obj)System.map
152 + $(obj)tools/mkimage -A $(ARCH) -T firmware -C none \
153 + -a 0x$(shell grep "T _start" $(obj)System.map | awk '{ printf "%s", $$1 }') \
154 + -e 0x$(shell grep "T _start" $(obj)System.map | awk '{ printf "%s", $$1 }') \
155 + -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
156 + sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
157 + -d u-boot.bin $@
158 +
159 $(obj)u-boot.hex: $(obj)u-boot
160 $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
161
162 @@ -243,28 +338,33 @@
163 $(obj)u-boot.bin: $(obj)u-boot
164 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
165
166 -$(obj)u-boot.img: $(obj)u-boot.bin
167 - ./tools/mkimage -A $(ARCH) -T firmware -C none \
168 - -a $(TEXT_BASE) -e 0 \
169 - -n $(shell sed -n -e 's/.*U_BOOT_VERSION//p' $(VERSION_FILE) | \
170 - sed -e 's/"[ ]*$$/ for $(BOARD) board"/') \
171 - -d $< $@
172 -
173 $(obj)u-boot.dis: $(obj)u-boot
174 $(OBJDUMP) -d $< > $@
175
176 -$(obj)u-boot: depend version $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
177 +$(obj)u-boot: depend version $(SUBDIRS) $(OBJS) $(LIBS) $(LDSCRIPT)
178 UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
179 cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
180 --start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
181 -Map u-boot.map -o u-boot
182
183 +$(obj)bootstrap.bin: $(obj)bootstrap
184 + $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
185 +
186 +$(obj)bootstrap : depend version $(SUBDIRS) $(OBJS_BOOTSTRAP) $(LIBS_BOOTSTRAP) $(LDSCRIPT_BOOTSTRAP)
187 + UNDEF_SYM=`$(OBJDUMP) -x $(LIBS_BOOTSTRAP) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
188 + $(LD) $(LDFLAGS_BOOTSTRAP) $$UNDEF_SYM $(OBJS_BOOTSTRAP) \
189 + --start-group $(__LIBS_BOOTSTRAP) --end-group $(PLATFORM_LIBS) \
190 + -Map bootstrap.map -o bootstrap
191 +
192 $(OBJS):
193 $(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))
194
195 $(LIBS):
196 $(MAKE) -C $(dir $(subst $(obj),,$@))
197
198 +$(obj)lib_bootstrap/libbootstrap.a:
199 + $(MAKE) -C $(dir $(subst $(obj),,$@))
200 +
201 $(SUBDIRS):
202 $(MAKE) -C $@ all
203
204 @@ -310,7 +410,12 @@
205 $(obj)System.map: $(obj)u-boot
206 @$(NM) $< | \
207 grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
208 - sort > $(obj)System.map
209 + sort > $@
210 +
211 +$(obj)System_bootstrap.map: $(obj)bootstrap
212 + @$(NM) $< | \
213 + grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
214 + sort > $@
215
216 #########################################################################
217 else
218 @@ -2032,7 +2137,20 @@
219 # MIPS
220 #========================================================================
221 #########################################################################
222 -## MIPS32 4Kc
223 +## Infineon MIPS generic u-boot config
224 +#########################################################################
225 +danube_config: unconfig
226 + @$(MKCONFIG) $(@:_config=) mips mips danube ifx danube
227 +
228 +amazon_config: unconfig
229 + @$(MKCONFIG) $(@:_config=) mips mips amazon
230 +
231 +
232 +incaip2_config: unconfig
233 + @$(MKCONFIG) $(@:_config=) mips mips incaip2
234 +
235 +#########################################################################
236 +## MIPS32 4kc
237 #########################################################################
238
239 xtract_incaip = $(subst _100MHz,,$(subst _133MHz,,$(subst _150MHz,,$(subst _config,,$1))))
240 @@ -2254,7 +2372,7 @@
241 | xargs -0 rm -f
242 rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS $(obj)include/version_autogenerated.h
243 rm -fr $(obj)*.*~
244 - rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
245 + rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL) $(IFX_ALL)
246 rm -f $(obj)tools/crc32.c $(obj)tools/environment.c $(obj)tools/env/crc32.c
247 rm -f $(obj)tools/inca-swap-bytes $(obj)cpu/mpc824x/bedbug_603e.c
248 rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm
249 Index: u-boot-1.1.5/common/cmd_bootm.c
250 ===================================================================
251 --- u-boot-1.1.5.orig/common/cmd_bootm.c 2006-10-20 17:54:33.000000000 +0200
252 +++ u-boot-1.1.5/common/cmd_bootm.c 2009-10-04 23:06:03.000000000 +0200
253 @@ -31,6 +31,7 @@
254 #include <malloc.h>
255 #include <zlib.h>
256 #include <bzlib.h>
257 +#include <LzmaWrapper.h>
258 #include <environment.h>
259 #include <asm/byteorder.h>
260
261 @@ -79,6 +80,8 @@
262 # define CHUNKSZ (64 * 1024)
263 #endif
264
265 +#ifndef CFG_HEAD_CODE
266 +
267 int gunzip (void *, int, unsigned char *, unsigned long *);
268
269 static void *zalloc(void *, unsigned, unsigned);
270 @@ -341,6 +344,7 @@
271 #endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
272 }
273 break;
274 +#ifndef CONFIG_REMOVE_GZIP
275 case IH_COMP_GZIP:
276 printf (" Uncompressing %s ... ", name);
277 if (gunzip ((void *)ntohl(hdr->ih_load), unc_len,
278 @@ -350,6 +354,7 @@
279 do_reset (cmdtp, flag, argc, argv);
280 }
281 break;
282 +#endif /* CONFIG_REMOVE_GZIP */
283 #ifdef CONFIG_BZIP2
284 case IH_COMP_BZIP2:
285 printf (" Uncompressing %s ... ", name);
286 @@ -369,6 +374,18 @@
287 }
288 break;
289 #endif /* CONFIG_BZIP2 */
290 +#ifdef CONFIG_LZMA
291 + case IH_COMP_LZMA:
292 + printf (" Uncompressing %s ... ", name);
293 + i = lzma_inflate ((unsigned char *)data, len, (unsigned char*)ntohl(hdr->ih_load), &unc_len);
294 + if (i != LZMA_RESULT_OK) {
295 + printf ("LZMA ERROR %d - must RESET board to recover\n", i);
296 + SHOW_BOOT_PROGRESS (-6);
297 + udelay(100000);
298 + do_reset (cmdtp, flag, argc, argv);
299 + }
300 + break;
301 +#endif /* CONFIG_LZMA */
302 default:
303 if (iflag)
304 enable_interrupts();
305 @@ -1176,6 +1193,8 @@
306 );
307 #endif /* CFG_CMD_IMLS */
308
309 +#endif /* ! CFG_HEAD_CODE */
310 +
311 void
312 print_image_hdr (image_header_t *hdr)
313 {
314 @@ -1270,12 +1289,15 @@
315 case IH_COMP_NONE: comp = "uncompressed"; break;
316 case IH_COMP_GZIP: comp = "gzip compressed"; break;
317 case IH_COMP_BZIP2: comp = "bzip2 compressed"; break;
318 + case IH_COMP_LZMA: comp = "lzma compressed"; break;
319 default: comp = "unknown compression"; break;
320 }
321
322 printf ("%s %s %s (%s)", arch, os, type, comp);
323 }
324
325 +#ifndef CFG_HEAD_CODE
326 +
327 #define ZALLOC_ALIGNMENT 16
328
329 static void *zalloc(void *x, unsigned items, unsigned size)
330 @@ -1427,3 +1449,5 @@
331 }
332
333 #endif /* CONFIG_LYNXKDI */
334 +
335 +#endif /* ! CFG_HEAD_CODE */
336 Index: u-boot-1.1.5/common/cmd_flash.c
337 ===================================================================
338 --- u-boot-1.1.5.orig/common/cmd_flash.c 2006-10-20 17:54:33.000000000 +0200
339 +++ u-boot-1.1.5/common/cmd_flash.c 2009-10-04 23:06:03.000000000 +0200
340 @@ -196,9 +196,17 @@
341 }
342
343 static int
344 -flash_fill_sect_ranges (ulong addr_first, ulong addr_last,
345 - int *s_first, int *s_last,
346 - int *s_count )
347 +flash_fill_sect_ranges(
348 + ulong *addr_first_sect_start,
349 + ulong addr_first,
350 + ulong *addr_last_sect_end,
351 + ulong addr_last,
352 + int *s_first,
353 + int *s_last,
354 + int *bPartialStart,
355 + int *bPartialEnd,
356 + int *s_count,
357 + unsigned int bPartialErase)
358 {
359 flash_info_t *info;
360 ulong bank;
361 @@ -211,9 +219,7 @@
362 s_last [bank] = -1; /* last sector to erase */
363 }
364
365 - for (bank=0,info=&flash_info[0];
366 - (bank < CFG_MAX_FLASH_BANKS) && (addr_first <= addr_last);
367 - ++bank, ++info) {
368 + for (bank=0, info=&flash_info[0]; (bank < CFG_MAX_FLASH_BANKS) && (addr_first <= addr_last); ++bank, ++info) {
369 ulong b_end;
370 int sect;
371 short s_end;
372 @@ -225,7 +231,6 @@
373 b_end = info->start[0] + info->size - 1; /* bank end addr */
374 s_end = info->sector_count - 1; /* last sector */
375
376 -
377 for (sect=0; sect < info->sector_count; ++sect) {
378 ulong end; /* last address in current sect */
379
380 @@ -238,11 +243,21 @@
381
382 if (addr_first == info->start[sect]) {
383 s_first[bank] = sect;
384 + } else if (addr_first > info->start[sect] && addr_first <= end && bPartialErase) {
385 + *addr_first_sect_start = info->start[sect];
386 + s_first[bank] = sect;
387 + *bPartialStart = 1;
388 }
389 +
390 if (addr_last == end) {
391 s_last[bank] = sect;
392 + } else if (addr_last >= info->start[sect] && addr_last < end && bPartialErase) {
393 + *addr_last_sect_end = end;
394 + s_last[bank] = sect;
395 + *bPartialEnd = 1;
396 }
397 }
398 +
399 if (s_first[bank] >= 0) {
400 if (s_last[bank] < 0) {
401 if (addr_last > b_end) {
402 @@ -316,6 +331,8 @@
403 struct part_info *part;
404 u8 dev_type, dev_num, pnum;
405 #endif
406 + unsigned int bPartialErase = 0;
407 +
408 int rcode = 0;
409
410 if (argc < 2) {
411 @@ -369,7 +386,7 @@
412 }
413 #endif
414
415 - if (argc != 3) {
416 + if (argc != 4) {
417 printf ("Usage:\n%s\n", cmdtp->usage);
418 return 1;
419 }
420 @@ -397,11 +414,117 @@
421 return 1;
422 }
423
424 - rcode = flash_sect_erase(addr_first, addr_last);
425 + printf ("Erase Flash from 0x%08lx to 0x%08lx\n", addr_first, addr_last);
426 + if(argc == 4) {
427 + bPartialErase = simple_strtoul(argv[3], NULL, 10);
428 + }
429 +
430 + rcode = flash_sect_erase(addr_first, addr_last, bPartialErase);
431 return rcode;
432 }
433
434 -int flash_sect_erase (ulong addr_first, ulong addr_last)
435 +int flerase_Partial(
436 + ulong addr_first_sect_start,
437 + ulong addr_first,
438 + ulong addr_last_sect_end,
439 + ulong addr_last,
440 + flash_info_t *info,
441 + int first_sect,
442 + int last_sect,
443 + int bFirstPartial,
444 + int bLastPartial) {
445 + unsigned int firstMemLen = 0;
446 + unsigned int lastMemLen = 0;
447 + unsigned int sectMemLen = 0;
448 + uchar *pSavedFirstMem = NULL;
449 + uchar *pSavedLastMem = NULL;
450 + uchar *pSavedSectMem = NULL;
451 + int bSectPartial = 0;
452 + int rt_code = 0;
453 +
454 + debug("%s ... 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%p, %d, %d, %d, %d\n", __FUNCTION__, addr_first_sect_start, addr_first, addr_last_sect_end, addr_last, info, first_sect, last_sect, bFirstPartial, bLastPartial);
455 +
456 + if (bFirstPartial && bLastPartial && (first_sect == last_sect))
457 + {
458 + ulong b_end = info->start[0] + info->size - 1;
459 + ulong end = (first_sect == (info->sector_count - 1)) ? b_end : info->start[first_sect + 1] - 1;
460 + sectMemLen = end - info->start[first_sect] + 1;
461 + pSavedSectMem = (uchar *)calloc(sectMemLen, sizeof(char));
462 + if (pSavedSectMem == NULL)
463 + {
464 + debug("calloc %u FAILED\n", sectMemLen);
465 + rt_code = 1;
466 + goto ret;
467 + }
468 + memset(pSavedSectMem, 0xff, sectMemLen);
469 + bSectPartial = 1;
470 + memcpy(pSavedSectMem, (uchar *)addr_first_sect_start, addr_first - addr_first_sect_start);
471 + memcpy(pSavedSectMem + (addr_last - info->start[first_sect]) + 1, addr_last + 1, end - addr_last);
472 + }
473 + else
474 + {
475 + if (bFirstPartial){
476 + firstMemLen = addr_first - addr_first_sect_start + 1;
477 + pSavedFirstMem = (uchar *)calloc(firstMemLen,sizeof(char));
478 + memcpy(pSavedFirstMem,(uchar *)addr_first_sect_start,firstMemLen - 1);
479 + }
480 + if (bLastPartial){
481 + lastMemLen = addr_last_sect_end - addr_last + 1;
482 + pSavedLastMem = (uchar *)calloc(lastMemLen,sizeof(char));
483 + memcpy(pSavedLastMem,(uchar *)addr_last + 1,lastMemLen - 1);
484 + }
485 + }
486 +
487 + if (bFirstPartial){
488 + if(flash_erase (info, first_sect, first_sect)) {
489 + printf("%s ... Couldn't erase sector %d\n", __FUNCTION__, first_sect);
490 + rt_code = 1;
491 + goto ret;
492 + }
493 + debug("%s ... erase sector %d done!\n", __FUNCTION__, first_sect);
494 + }
495 +
496 + if (bLastPartial && first_sect != last_sect){
497 + if(flash_erase (info, last_sect, last_sect)) {
498 + printf("%s ... Couldn't erase sector %d\n", __FUNCTION__, last_sect);
499 + rt_code = 1;
500 + goto ret;
501 + }
502 + debug("%s ... erase sector %d done!\n", __FUNCTION__, last_sect);
503 + }
504 +
505 + if (bFirstPartial && bLastPartial && (first_sect == last_sect))
506 + {
507 + flash_write(pSavedSectMem, (uchar *)addr_first_sect_start, sectMemLen);
508 + debug("flash_write from 0x%08x with len %u\n", addr_first_sect_start, sectMemLen);
509 + }
510 + else
511 + {
512 + if (bFirstPartial){
513 + if(flash_write(pSavedFirstMem,(uchar *)addr_first_sect_start,firstMemLen - 1)) {
514 + printf("%s ... Couldn't write at 0x%08lx length %d\n", __FUNCTION__, addr_first_sect_start,firstMemLen - 1);
515 + rt_code = 1;
516 + goto ret;
517 + }
518 + }
519 + if (bLastPartial){
520 + if(flash_write(pSavedLastMem,(uchar *)addr_last + 1,lastMemLen - 1)) {
521 + printf("%s ... Couldn't write at 0x%08lx length %d\n", __FUNCTION__, addr_last, lastMemLen - 1);
522 + rt_code = 1;
523 + }
524 + }
525 + }
526 +ret:
527 + if (bFirstPartial)
528 + free(pSavedFirstMem);
529 + if (bLastPartial)
530 + free(pSavedLastMem);
531 + if (bSectPartial)
532 + free(pSavedSectMem);
533 + return rt_code;
534 +}
535 +
536 +int flash_sect_erase (ulong addr_first, ulong addr_last, unsigned int bPartialErase)
537 {
538 flash_info_t *info;
539 ulong bank;
540 @@ -413,27 +536,66 @@
541 int erased = 0;
542 int planned;
543 int rcode = 0;
544 -
545 - rcode = flash_fill_sect_ranges (addr_first, addr_last,
546 - s_first, s_last, &planned );
547 + int bPartialStart = 0; // Start sector has to be erased partially
548 + int bPartialEnd = 0; // End sector has to be erased partially
549 + ulong addr_first_sect_start = 0;// Sector start address of location addr_start
550 + ulong addr_last_sect_end = 0; // Sector end address of location addr_last
551 +
552 + rcode = flash_fill_sect_ranges (
553 + &addr_first_sect_start,
554 + addr_first,
555 + &addr_last_sect_end,
556 + addr_last,
557 + s_first,
558 + s_last,
559 + &bPartialStart,
560 + &bPartialEnd,
561 + &planned,
562 + bPartialErase );
563
564 if (planned && (rcode == 0)) {
565 - for (bank=0,info=&flash_info[0];
566 - (bank < CFG_MAX_FLASH_BANKS) && (rcode == 0);
567 - ++bank, ++info) {
568 + for (bank=0, info=&flash_info[0]; (bank < CFG_MAX_FLASH_BANKS) && (rcode == 0); ++bank, ++info) {
569 + ulong b_end = info->start[0] + info->size - 1; /* bank end addr */
570 if (s_first[bank]>=0) {
571 - erased += s_last[bank] - s_first[bank] + 1;
572 - debug ("Erase Flash from 0x%08lx to 0x%08lx "
573 - "in Bank # %ld ",
574 - info->start[s_first[bank]],
575 - (s_last[bank] == info->sector_count) ?
576 - info->start[0] + info->size - 1:
577 - info->start[s_last[bank]+1] - 1,
578 - bank+1);
579 - rcode = flash_erase (info, s_first[bank], s_last[bank]);
580 + if(bPartialErase) {
581 + rcode = flerase_Partial(
582 + addr_first_sect_start,
583 + addr_first,
584 + addr_last_sect_end,
585 + addr_last,
586 + info,
587 + s_first[bank],
588 + s_last[bank],
589 + bPartialStart,
590 + bPartialEnd);
591 + }
592 +
593 + //Erase full sectores
594 + if (bPartialStart)
595 + s_first[bank] += 1;
596 + if (bPartialEnd)
597 + s_last[bank] -= 1;
598 + if (s_last[bank] >= s_first[bank]) {
599 + erased += s_last[bank] - s_first[bank] + 1;
600 + debug ("Erase Flash from 0x%08lx to 0x%08lx in Bank # %ld ",
601 + info->start[s_first[bank]],
602 + (s_last[bank] == info->sector_count) ?
603 + info->start[0] + info->size - 1:
604 + info->start[s_last[bank]+1] - 1,
605 + bank + 1);
606 + rcode = flash_erase (info, s_first[bank], s_last[bank]);
607 + }
608 }
609 }
610 - printf ("Erased %d sectors\n", erased);
611 +
612 + if (erased && !bPartialErase) {
613 + printf ("Erased %d sectors\n", erased);
614 + } else if (bPartialErase){
615 + printf ("Partial erased from 0x%08lx to 0x%08lx\n", addr_first, addr_last);
616 + } else {
617 + printf ("Error: start and/or end address not on sector boundary\n");
618 + rcode = 1;
619 + }
620 } else if (rcode == 0) {
621 puts ("Error: start and/or end address"
622 " not on sector boundary\n");
623 @@ -629,8 +791,22 @@
624 int protected, i;
625 int planned;
626 int rcode;
627 -
628 - rcode = flash_fill_sect_ranges( addr_first, addr_last, s_first, s_last, &planned );
629 + int bPartialStart = 0; // Start sector has to be erased partially
630 + int bPartialEnd = 0; // End sector has to be erased partially
631 + ulong addr_first_sect_start = 0;// Sector start address of location addr_start
632 + ulong addr_last_sect_end = 0; // Sector end address of location addr_last
633 +
634 + rcode = flash_fill_sect_ranges (
635 + &addr_first_sect_start,
636 + addr_first,
637 + &addr_last_sect_end,
638 + addr_last,
639 + s_first,
640 + s_last,
641 + &bPartialStart,
642 + &bPartialEnd,
643 + &planned,
644 + 1 );
645
646 protected = 0;
647
648 @@ -690,7 +866,7 @@
649 );
650
651 U_BOOT_CMD(
652 - erase, 3, 1, do_flerase,
653 + erase, 4, 1, do_flerase,
654 "erase - erase FLASH memory\n",
655 "start end\n"
656 " - erase FLASH from addr 'start' to addr 'end'\n"
657 Index: u-boot-1.1.5/common/cmd_nvedit.c
658 ===================================================================
659 --- u-boot-1.1.5.orig/common/cmd_nvedit.c 2006-10-20 17:54:33.000000000 +0200
660 +++ u-boot-1.1.5/common/cmd_nvedit.c 2009-10-04 23:06:03.000000000 +0200
661 @@ -540,8 +540,19 @@
662 extern char * env_name_spec;
663
664 printf ("Saving Environment to %s...\n", env_name_spec);
665 -
666 +#if 1
667 + if(saveenv() == 0) {
668 +#ifdef UBOOT_ENV_COPY
669 + saveenv_copy();
670 +#else
671 + ;
672 +#endif //UBOOT_ENV_COPY
673 + } else
674 + return 1;
675 + return 0;
676 +#else
677 return (saveenv() ? 1 : 0);
678 +#endif
679 }
680
681
682 Index: u-boot-1.1.5/common/console.c
683 ===================================================================
684 --- u-boot-1.1.5.orig/common/console.c 2006-10-20 17:54:33.000000000 +0200
685 +++ u-boot-1.1.5/common/console.c 2009-10-04 23:06:03.000000000 +0200
686 @@ -324,7 +324,7 @@
687 #endif
688
689 /** U-Boot INIT FUNCTIONS *************************************************/
690 -
691 +#ifndef CFG_HEAD_CODE
692 int console_assign (int file, char *devname)
693 {
694 int flag, i;
695 @@ -357,7 +357,7 @@
696
697 return -1;
698 }
699 -
700 +#endif //CFG_HEAD_CODE
701 /* Called before relocation - use serial functions */
702 int console_init_f (void)
703 {
704 @@ -392,6 +392,7 @@
705 }
706 #endif /* CFG_CONSOLE_IS_IN_ENV || CONFIG_SPLASH_SCREEN */
707
708 +#ifndef CFG_HEAD_CODE
709 #ifdef CFG_CONSOLE_IS_IN_ENV
710 /* Called after the relocation - use desired console functions */
711 int console_init_r (void)
712 @@ -570,3 +571,4 @@
713 }
714
715 #endif /* CFG_CONSOLE_IS_IN_ENV */
716 +#endif //CFG_HEAD_CODE
717 Index: u-boot-1.1.5/common/devices.c
718 ===================================================================
719 --- u-boot-1.1.5.orig/common/devices.c 2006-10-20 17:54:33.000000000 +0200
720 +++ u-boot-1.1.5/common/devices.c 2009-10-04 23:06:03.000000000 +0200
721 @@ -39,6 +39,7 @@
722 list_t devlist = 0;
723 device_t *stdio_devices[] = { NULL, NULL, NULL };
724 char *stdio_names[MAX_FILES] = { "stdin", "stdout", "stderr" };
725 +#ifndef CFG_HEAD_CODE
726
727 #if defined(CONFIG_SPLASH_SCREEN) && !defined(CFG_DEVICE_NULLDEV)
728 #define CFG_DEVICE_NULLDEV 1
729 @@ -214,3 +215,5 @@
730
731 return 0;
732 }
733 +#endif //CFG_HEAD_CODE
734 +
735 Index: u-boot-1.1.5/common/env_common.c
736 ===================================================================
737 --- u-boot-1.1.5.orig/common/env_common.c 2006-10-20 17:54:33.000000000 +0200
738 +++ u-boot-1.1.5/common/env_common.c 2009-10-04 23:06:03.000000000 +0200
739 @@ -219,7 +219,9 @@
740 * We must allocate a buffer for the environment
741 */
742 env_ptr = (env_t *)malloc (CFG_ENV_SIZE);
743 - DEBUGF ("%s[%d] malloced ENV at %p\n", __FUNCTION__,__LINE__,env_ptr);
744 + if(!env_ptr)
745 + DEBUGF ("malloc env_ptr error!!\n");
746 + DEBUGF ("%s[%d] malloced ENV at %p\n", __FUNCTION__, __LINE__, env_ptr);
747 #endif
748
749 /*
750 @@ -227,6 +229,10 @@
751 */
752 env_get_char = env_get_char_memory;
753
754 + //leejack
755 + DEBUGF ("%s[%d] gd->env_valid=%d\n", __FUNCTION__, __LINE__, gd->env_valid);
756 + DEBUGF ("%s[%d] CFG_ENV_SIZE=%d\n", __FUNCTION__, __LINE__, CFG_ENV_SIZE);
757 +
758 if (gd->env_valid == 0) {
759 #if defined(CONFIG_GTH) || defined(CFG_ENV_IS_NOWHERE) /* Environment not changable */
760 puts ("Using default environment\n\n");
761 @@ -242,18 +248,17 @@
762 }
763
764 memset (env_ptr, 0, sizeof(env_t));
765 - memcpy (env_ptr->data,
766 - default_environment,
767 - sizeof(default_environment));
768 + memcpy (env_ptr->data, default_environment, sizeof(default_environment));
769 +
770 #ifdef CFG_REDUNDAND_ENVIRONMENT
771 env_ptr->flags = 0xFF;
772 #endif
773 env_crc_update ();
774 gd->env_valid = 1;
775 - }
776 - else {
777 + } else {
778 env_relocate_spec ();
779 }
780 +
781 gd->env_addr = (ulong)&(env_ptr->data);
782
783 #ifdef CONFIG_AMIGAONEG3SE
784 Index: u-boot-1.1.5/common/env_flash.c
785 ===================================================================
786 --- u-boot-1.1.5.orig/common/env_flash.c 2006-10-20 17:54:33.000000000 +0200
787 +++ u-boot-1.1.5/common/env_flash.c 2009-10-04 23:06:03.000000000 +0200
788 @@ -66,7 +66,6 @@
789 #endif
790
791 #else /* ! ENV_IS_EMBEDDED */
792 -
793 env_t *env_ptr = (env_t *)CFG_ENV_ADDR;
794 #ifdef CMD_SAVEENV
795 static env_t *flash_addr = (env_t *)CFG_ENV_ADDR;
796 @@ -201,6 +200,7 @@
797 debug (" %08lX ... %08lX ...",
798 (ulong)&(flash_addr_new->data),
799 sizeof(env_ptr->data)+(ulong)&(flash_addr_new->data));
800 +
801 if ((rc = flash_write((char *)env_ptr->data,
802 (ulong)&(flash_addr_new->data),
803 sizeof(env_ptr->data))) ||
804 @@ -256,7 +256,6 @@
805 #endif /* CMD_SAVEENV */
806
807 #else /* ! CFG_ENV_ADDR_REDUND */
808 -
809 int env_init(void)
810 {
811 #ifdef CONFIG_OMAP2420H4
812 @@ -280,6 +279,52 @@
813
814 #ifdef CMD_SAVEENV
815
816 +#ifdef UBOOT_ENV_COPY
817 +int saveenv_copy(void) {
818 + uchar *env_buffer = (char *)env_ptr;
819 + char *kernel_addr;
820 + char *rootfs_addr;
821 + char *rootfs_size;
822 + ulong start_addr,end_addr,rootfs_end_addr;
823 + ulong flash_start;
824 +
825 + kernel_addr = getenv("f_kernel_addr");
826 + end_addr = simple_strtoul(kernel_addr,NULL,16) - 1;
827 + start_addr = end_addr - CFG_ENV_SIZE - sizeof(UBOOTCONFIG_COPY_HEADER) + 1;
828 +
829 + rootfs_addr = getenv("f_rootfs_addr");
830 + rootfs_size = getenv("f_rootfs_size");
831 + rootfs_end_addr = simple_strtoul(rootfs_addr,NULL,16) + simple_strtoul(rootfs_size,NULL,16);
832 +
833 + if(rootfs_end_addr >= start_addr)
834 + {
835 + printf("Can not copy the environment at 0x%08lx as no space left.\nf_kernel_addr = 0x%08lx while rootfs_end_addr = 0x%08lx\n",start_addr,end_addr,rootfs_end_addr);
836 + return 1;
837 + }
838 +
839 + debug ("Protect off %08lX ... %08lX\n", (ulong)rootfs_end_addr, end_addr);
840 + if (flash_sect_protect (0, rootfs_end_addr, end_addr))
841 + return 1;
842 +
843 + //delete the old environment copy, if found
844 + flash_start = rootfs_end_addr;
845 + while(flash_start + sizeof(UBOOTCONFIG_COPY_HEADER) + ENV_SIZE < end_addr)
846 + {
847 + if(strncmp((char *)flash_start,UBOOTCONFIG_COPY_HEADER,sizeof(UBOOTCONFIG_COPY_HEADER)) == 0)
848 + {
849 + flash_sect_erase(flash_start,flash_start + sizeof(UBOOTCONFIG_COPY_HEADER),1);
850 + }
851 + flash_start += 1;
852 + }
853 + flash_sect_erase(start_addr,end_addr,1);
854 + flash_write(UBOOTCONFIG_COPY_HEADER,start_addr,sizeof(UBOOTCONFIG_COPY_HEADER));
855 + flash_write(env_buffer,start_addr + sizeof(UBOOTCONFIG_COPY_HEADER), CFG_ENV_SIZE);
856 + flash_sect_protect (1, rootfs_end_addr, end_addr);
857 + printf("saved copy of the env at 0x%08lx\n",start_addr);
858 + return 0;
859 +}
860 +#endif //UBOOT_ENV_COPY
861 +
862 int saveenv(void)
863 {
864 int len, rc;
865 @@ -331,7 +376,7 @@
866 return 1;
867
868 puts ("Erasing Flash...");
869 - if (flash_sect_erase (flash_sect_addr, end_addr))
870 + if (flash_sect_erase (flash_sect_addr, end_addr, 1))
871 return 1;
872
873 puts ("Writing to Flash... ");
874 Index: u-boot-1.1.5/config.mk
875 ===================================================================
876 --- u-boot-1.1.5.orig/config.mk 2006-10-20 17:54:33.000000000 +0200
877 +++ u-boot-1.1.5/config.mk 2009-10-04 23:32:51.000000000 +0200
878 @@ -127,10 +127,15 @@
879 OBJDUMP = $(CROSS_COMPILE)objdump
880 RANLIB = $(CROSS_COMPILE)RANLIB
881
882 +ifneq (,$(findstring s,$(MAKEFLAGS)))
883 +ARFLAGS = cr
884 +else
885 ARFLAGS = crv
886 +endif
887 RELFLAGS= $(PLATFORM_RELFLAGS)
888 DBGFLAGS= -g # -DDEBUG
889 OPTFLAGS= -Os #-fomit-frame-pointer
890 +OWRT_FLAGS?=
891 ifndef LDSCRIPT
892 #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
893 ifeq ($(CONFIG_NAND_U_BOOT),y)
894 @@ -139,12 +144,15 @@
895 LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
896 endif
897 endif
898 +
899 +LDSCRIPT_BOOTSTRAP := $(TOPDIR)/board/$(BOARDDIR)/u-boot-bootstrap.lds
900 +
901 OBJCFLAGS += --gap-fill=0xff
902
903 gccincdir := $(shell $(CC) -print-file-name=include)
904
905 -CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \
906 - -D__KERNEL__ -DTEXT_BASE=$(TEXT_BASE) \
907 +CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) $(OWRT_FLAGS) \
908 + -D__KERNEL__ -DUBOOT_RAM_TEXT_BASE=$(UBOOT_RAM_TEXT_BASE) \
909
910 ifneq ($(OBJTREE),$(SRCTREE))
911 CPPFLAGS += -I$(OBJTREE)/include2 -I$(OBJTREE)/include
912 @@ -180,7 +188,8 @@
913
914 AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS)
915
916 -LDFLAGS += -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
917 +LDFLAGS += -Bstatic -T $(LDSCRIPT) -Ttext $(UBOOT_RAM_TEXT_BASE) $(PLATFORM_LDFLAGS)
918 +LDFLAGS_BOOTSTRAP += -Bstatic -T $(LDSCRIPT_BOOTSTRAP) -Ttext $(BOOTSTRAP_TEXT_BASE) $(PLATFORM_LDFLAGS)
919
920 # Location of a usable BFD library, where we define "usable" as
921 # "built for ${HOST}, supports ${TARGET}". Sensible values are
922 @@ -214,12 +223,19 @@
923 export CONFIG_SHELL HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE \
924 AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP \
925 MAKE
926 -export TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS
927 +export UBOOT_RAM_TEXT_BASE BOOTSTRAP_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS AFLAGS
928
929 #########################################################################
930
931 ifndef REMOTE_BUILD
932
933 +%_bootstrap.s: %_bootstrap.S
934 + $(CPP) $(AFLAGS) -DCFG_BOOTSTRAP_CODE -o $@ $<
935 +%_bootstrap.o: %_bootstrap.S
936 + $(CC) $(AFLAGS) -DCFG_BOOTSTRAP_CODE -c -o $@ $<
937 +%_bootstrap.o: %_bootstrap.c
938 + $(CC) $(CFLAGS) -DCFG_BOOTSTRAP_CODE -c -o $@ $<
939 +
940 %.s: %.S
941 $(CPP) $(AFLAGS) -o $@ $<
942 %.o: %.S
943 @@ -229,12 +245,20 @@
944
945 else
946
947 +$(obj)%_bootstrap.s: %_bootstrap.S
948 + $(CPP) $(AFLAGS) -DCFG_BOOTSTRAP_CODE -o $@ $<
949 +$(obj)%_bootstrap.o: %_bootstrap.S
950 + $(CC) $(AFLAGS) -DCFG_BOOTSTRAP_CODE -c -o $@ $<
951 +$(obj)%_bootstrap.o: %_bootstrap.c
952 + $(CC) $(CFLAGS) -DCFG_BOOTSTRAP_CODE -c -o $@ $<
953 +
954 $(obj)%.s: %.S
955 $(CPP) $(AFLAGS) -o $@ $<
956 $(obj)%.o: %.S
957 $(CC) $(AFLAGS) -c -o $@ $<
958 $(obj)%.o: %.c
959 $(CC) $(CFLAGS) -c -o $@ $<
960 +
961 endif
962
963 #########################################################################
964 Index: u-boot-1.1.5/drivers/Makefile
965 ===================================================================
966 --- u-boot-1.1.5.orig/drivers/Makefile 2006-10-20 17:54:33.000000000 +0200
967 +++ u-boot-1.1.5/drivers/Makefile 2009-10-04 23:06:03.000000000 +0200
968 @@ -50,7 +50,7 @@
969 videomodes.o w83c553f.o \
970 ks8695eth.o \
971 pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o \
972 - rpx_pcmcia.o
973 + rpx_pcmcia.o ifx_sw.o
974
975 SRCS := $(COBJS:.o=.c)
976 OBJS := $(addprefix $(obj),$(COBJS))
977 Index: u-boot-1.1.5/include/asm-mips/mipsregs.h
978 ===================================================================
979 --- u-boot-1.1.5.orig/include/asm-mips/mipsregs.h 2006-10-20 17:54:33.000000000 +0200
980 +++ u-boot-1.1.5/include/asm-mips/mipsregs.h 2009-10-04 23:06:03.000000000 +0200
981 @@ -48,6 +48,7 @@
982 #define CP0_CAUSE $13
983 #define CP0_EPC $14
984 #define CP0_PRID $15
985 +#define CP0_EBASE $15,1
986 #define CP0_CONFIG $16
987 #define CP0_LLADDR $17
988 #define CP0_WATCHLO $18
989 @@ -330,11 +331,32 @@
990 # define KSU_USER 0x00000010
991 # define KSU_SUPERVISOR 0x00000008
992 # define KSU_KERNEL 0x00000000
993 +#ifdef CONFIG_DANUBE /* MIPS 24KE */
994 +/* bits 5 & 6 & 7: reserved */
995 +/* bits 8~15: IM0~7 */
996 +/* bits 16: reserved */
997 +#define ST0_CEE 0x00020000
998 +/* bits 18: always 0 */
999 +#define ST0_NMI 0x00080000
1000 +#define ST0_SR 0x00100000
1001 +#define ST0_TS 0x00200000
1002 +#define ST0_BEV 0x00400000
1003 +/* bits 23: reserved */
1004 +#define ST0_MX 0x01000000
1005 +#define ST0_RE 0x02000000
1006 +#define ST0_FR 0x04000000
1007 +#define ST0_RP 0x08000000
1008 +#define ST0_CU0 0x10000000
1009 +#define ST0_CU1 0x20000000
1010 +#define ST0_CU2 0x40000000
1011 +#define ST0_CU3 0x80000000
1012 +#else
1013 #define ST0_UX 0x00000020
1014 #define ST0_SX 0x00000040
1015 #define ST0_KX 0x00000080
1016 #define ST0_DE 0x00010000
1017 #define ST0_CE 0x00020000
1018 +#endif
1019
1020 /*
1021 * Bitfields in the R[23]000 cp0 status register.
1022 @@ -471,6 +493,14 @@
1023 #define CAUSEF_BD (1 << 31)
1024
1025 /*
1026 + * Bits in the coprocessor 0 EBase register
1027 + */
1028 +#define EBASEB_CPUNUM 0
1029 +#define EBASEF_CPUNUM (0x3ff << EBASEB_CPUNUM)
1030 +#define EBASEB_EXPBASE 12
1031 +#define EBASEF_EXPBASE (0x3ffff << EBASEB_EXPBASE)
1032 +
1033 +/*
1034 * Bits in the coprozessor 0 config register.
1035 */
1036 #define CONF_CM_CACHABLE_NO_WA 0
1037 @@ -544,4 +574,10 @@
1038 #define CEB_KERNEL 2 /* Count events in kernel mode EXL = ERL = 0 */
1039 #define CEB_EXL 1 /* Count events with EXL = 1, ERL = 0 */
1040
1041 +/*
1042 + * Bits in ErrCtl register
1043 + */
1044 +#define ECCB_WST 29
1045 +#define ECCF_WST (0x1 << ECCB_WST)
1046 +
1047 #endif /* _ASM_MIPSREGS_H */
1048 Index: u-boot-1.1.5/include/cmd_confdefs.h
1049 ===================================================================
1050 --- u-boot-1.1.5.orig/include/cmd_confdefs.h 2006-10-20 17:54:33.000000000 +0200
1051 +++ u-boot-1.1.5/include/cmd_confdefs.h 2009-10-04 23:06:03.000000000 +0200
1052 @@ -94,6 +94,7 @@
1053 #define CFG_CMD_EXT2 0x1000000000000000ULL /* EXT2 Support */
1054 #define CFG_CMD_SNTP 0x2000000000000000ULL /* SNTP support */
1055 #define CFG_CMD_DISPLAY 0x4000000000000000ULL /* Display support */
1056 +#define CFG_CMD_DHRYSTONE 0x8000000000000000ULL /* Dhrystone benchmark support */
1057
1058 #define CFG_CMD_ALL 0xFFFFFFFFFFFFFFFFULL /* ALL commands */
1059
1060 @@ -141,6 +142,7 @@
1061 CFG_CMD_SPI | \
1062 CFG_CMD_UNIVERSE | \
1063 CFG_CMD_USB | \
1064 + CFG_CMD_DHRYSTONE | \
1065 CFG_CMD_VFD )
1066
1067 /* Default configuration
1068 Index: u-boot-1.1.5/include/config.h
1069 ===================================================================
1070 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1071 +++ u-boot-1.1.5/include/config.h 2009-10-04 23:06:04.000000000 +0200
1072 @@ -0,0 +1,2 @@
1073 +/* Automatically generated - do not edit */
1074 +#include <configs/danube.h>
1075 Index: u-boot-1.1.5/include/config.mk
1076 ===================================================================
1077 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1078 +++ u-boot-1.1.5/include/config.mk 2009-10-04 23:06:04.000000000 +0200
1079 @@ -0,0 +1,5 @@
1080 +ARCH = mips
1081 +CPU = mips
1082 +BOARD = danube
1083 +VENDOR = ifx
1084 +SOC = danube
1085 Index: u-boot-1.1.5/include/flash.h
1086 ===================================================================
1087 --- u-boot-1.1.5.orig/include/flash.h 2006-10-20 17:54:33.000000000 +0200
1088 +++ u-boot-1.1.5/include/flash.h 2009-10-04 23:06:03.000000000 +0200
1089 @@ -79,7 +79,7 @@
1090 extern unsigned long flash_init (void);
1091 extern void flash_print_info (flash_info_t *);
1092 extern int flash_erase (flash_info_t *, int, int);
1093 -extern int flash_sect_erase (ulong addr_first, ulong addr_last);
1094 +extern int flash_sect_erase (ulong addr_first, ulong addr_last, unsigned int bPartialErase);
1095 extern int flash_sect_protect (int flag, ulong addr_first, ulong addr_last);
1096
1097 /* common/flash.c */
1098 @@ -299,6 +299,10 @@
1099 #define TOSH_ID_FVT160 0xC2 /* TC58FVT160 ID (16 M, top ) */
1100 #define TOSH_ID_FVB160 0x43 /* TC58FVT160 ID (16 M, bottom ) */
1101
1102 +#define MX_ID_29LV320AB 0x22A822A8 /* MXIC MX29LV320AB ID (32 M, bottom ) joelin */
1103 +#define MX_ID_29LV160BB 0x22492249 /* MXIC MX29LV160BB ID (16 M, bottom ) joelin */
1104 +#define MX_ID_29LV640BB 0x22cb22cb /* MXIC MX29LV640BB ID (64 M, bottom ) joelin */
1105 +
1106 /*-----------------------------------------------------------------------
1107 * Internal FLASH identification codes
1108 *
1109 @@ -422,6 +426,10 @@
1110 #define FLASH_S29GL064M 0x00F0 /* Spansion S29GL064M-R6 */
1111 #define FLASH_S29GL128N 0x00F1 /* Spansion S29GL128N */
1112
1113 +#define FLASH_29LV320AB 0x00B0 /* MXIC MX29LV320AB( 32M = 4M x 16 ) joelin 10/07/2004*/
1114 +#define FLASH_29LV160BB 0x00B1 /* MXIC MX29LV160BB( 16M = 2M x 16 ) joelin 11/22/2004*/
1115 +#define FLASH_29LV640BB 0x00B2 /* MXIC MX29LV640BB( 64M = 8M x 16 ) liupeng*/
1116 +
1117 #define FLASH_UNKNOWN 0xFFFF /* unknown flash type */
1118
1119
1120 Index: u-boot-1.1.5/include/image.h
1121 ===================================================================
1122 --- u-boot-1.1.5.orig/include/image.h 2006-10-20 17:54:33.000000000 +0200
1123 +++ u-boot-1.1.5/include/image.h 2009-10-04 23:06:03.000000000 +0200
1124 @@ -132,6 +132,7 @@
1125 #define IH_COMP_NONE 0 /* No Compression Used */
1126 #define IH_COMP_GZIP 1 /* gzip Compression Used */
1127 #define IH_COMP_BZIP2 2 /* bzip2 Compression Used */
1128 +#define IH_COMP_LZMA 3 /* lzma Compression Used */
1129
1130 #define IH_MAGIC 0x27051956 /* Image Magic Number */
1131 #define IH_NMLEN 32 /* Image Name Length */
1132 Index: u-boot-1.1.5/include/syscall.h
1133 ===================================================================
1134 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1135 +++ u-boot-1.1.5/include/syscall.h 2009-10-04 23:06:03.000000000 +0200
1136 @@ -0,0 +1,42 @@
1137 +#ifndef __MON_SYS_CALL_H__
1138 +#define __MON_SYS_CALL_H__
1139 +
1140 +#ifndef __ASSEMBLY__
1141 +
1142 +#include <common.h>
1143 +
1144 +/* These are declarations of system calls available in C code */
1145 +int mon_getc(void);
1146 +int mon_tstc(void);
1147 +void mon_putc(const char);
1148 +void mon_puts(const char*);
1149 +void mon_printf(const char* fmt, ...);
1150 +void mon_install_hdlr(int, interrupt_handler_t*, void*);
1151 +void mon_free_hdlr(int);
1152 +void *mon_malloc(size_t);
1153 +void mon_free(void*);
1154 +void mon_udelay(unsigned long);
1155 +unsigned long mon_get_timer(unsigned long);
1156 +
1157 +#endif /* ifndef __ASSEMBLY__ */
1158 +
1159 +#define NR_SYSCALLS 11 /* number of syscalls */
1160 +
1161 +
1162 +/*
1163 + * Make sure these functions are in the same order as they
1164 + * appear in the "examples/syscall.S" file !!!
1165 + */
1166 +#define SYSCALL_GETC 0
1167 +#define SYSCALL_TSTC 1
1168 +#define SYSCALL_PUTC 2
1169 +#define SYSCALL_PUTS 3
1170 +#define SYSCALL_PRINTF 4
1171 +#define SYSCALL_INSTALL_HDLR 5
1172 +#define SYSCALL_FREE_HDLR 6
1173 +#define SYSCALL_MALLOC 7
1174 +#define SYSCALL_FREE 8
1175 +#define SYSCALL_UDELAY 9
1176 +#define SYSCALL_GET_TIMER 10
1177 +
1178 +#endif
1179 Index: u-boot-1.1.5/ld_uboot.conf
1180 ===================================================================
1181 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1182 +++ u-boot-1.1.5/ld_uboot.conf 2009-10-04 23:06:03.000000000 +0200
1183 @@ -0,0 +1,8 @@
1184 +TAG_DWNLD()
1185 +{
1186 + 0xA0B00000 "u-boot.bin" /* Download u-boot image */
1187 +};
1188 +TAG_START()
1189 +{
1190 + 0xA0B00000
1191 +}; /* Start u-boot image */
1192 Index: u-boot-1.1.5/lib_generic/Makefile
1193 ===================================================================
1194 --- u-boot-1.1.5.orig/lib_generic/Makefile 2006-10-20 17:54:33.000000000 +0200
1195 +++ u-boot-1.1.5/lib_generic/Makefile 2009-10-04 23:06:03.000000000 +0200
1196 @@ -28,7 +28,7 @@
1197 COBJS = bzlib.o bzlib_crctable.o bzlib_decompress.o \
1198 bzlib_randtable.o bzlib_huffman.o \
1199 crc32.o ctype.o display_options.o ldiv.o \
1200 - string.o vsprintf.o zlib.o
1201 + string.o vsprintf.o zlib.o LzmaDecode.o LzmaWrapper.o
1202
1203 SRCS := $(COBJS:.o=.c)
1204 OBJS := $(addprefix $(obj),$(COBJS))
1205 Index: u-boot-1.1.5/lib_mips/board.c
1206 ===================================================================
1207 --- u-boot-1.1.5.orig/lib_mips/board.c 2006-10-20 17:54:33.000000000 +0200
1208 +++ u-boot-1.1.5/lib_mips/board.c 2009-10-04 23:06:03.000000000 +0200
1209 @@ -29,9 +29,30 @@
1210 #include <net.h>
1211 #include <environment.h>
1212
1213 +#ifdef CFG_BOOTSTRAP_CODE
1214 +//#include <asm/danube.h>
1215 +#undef CONFIG_MICROBZIP2
1216 +
1217 +#ifdef CONFIG_BZIP2
1218 +#include <bzlib.h>
1219 +#endif
1220 +
1221 +#ifdef CONFIG_MICROBZIP2
1222 +#include <micro_bzlib.h>
1223 +#endif
1224 +
1225 +#ifdef CONFIG_LZMA
1226 +#include <LzmaWrapper.h>
1227 +#endif
1228 +#endif //CFG_BOOTSTRAP_CODE
1229 +
1230 DECLARE_GLOBAL_DATA_PTR;
1231
1232 -#if ( ((CFG_ENV_ADDR+CFG_ENV_SIZE) < CFG_MONITOR_BASE) || \
1233 +#if ( ((CFG_ENV_ADDR+CFG_ENV_SIZE) < BOOTSTRAP_CFG_MONITOR_BASE) || \
1234 + (CFG_ENV_ADDR >= (BOOTSTRAP_CFG_MONITOR_BASE + CFG_MONITOR_LEN)) ) || \
1235 + defined(CFG_ENV_IS_IN_NVRAM) && defined(CFG_BOOTSTRAP_CODE)
1236 +#define TOTAL_MALLOC_LEN (CFG_MALLOC_LEN + CFG_ENV_SIZE)
1237 +#elif ( ((CFG_ENV_ADDR+CFG_ENV_SIZE) < CFG_MONITOR_BASE) || \
1238 (CFG_ENV_ADDR >= (CFG_MONITOR_BASE + CFG_MONITOR_LEN)) ) || \
1239 defined(CFG_ENV_IS_IN_NVRAM)
1240 #define TOTAL_MALLOC_LEN (CFG_MALLOC_LEN + CFG_ENV_SIZE)
1241 @@ -39,21 +60,24 @@
1242 #define TOTAL_MALLOC_LEN CFG_MALLOC_LEN
1243 #endif
1244
1245 -#undef DEBUG
1246 -
1247 extern int timer_init(void);
1248 -
1249 extern int incaip_set_cpuclk(void);
1250
1251 +#ifdef CFG_BOOTSTRAP_CODE
1252 +extern ulong uboot_end_data_bootstrap;
1253 +extern ulong uboot_end_bootstrap;
1254 +#else //CFG_BOOTSTRAP_CODE
1255 extern ulong uboot_end_data;
1256 extern ulong uboot_end;
1257 +#endif //CFG_BOOTSTRAP_CODE
1258
1259 ulong monitor_flash_len;
1260
1261 -const char version_string[] =
1262 - U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
1263 +const char version_string[] = U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
1264
1265 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1266 static char *failed = "*** failed ***\n";
1267 +#endif
1268
1269 /*
1270 * Begin and End of memory area for malloc(), and current "brk"
1271 @@ -62,14 +86,15 @@
1272 static ulong mem_malloc_end;
1273 static ulong mem_malloc_brk;
1274
1275 -
1276 /*
1277 * The Malloc area is immediately below the monitor copy in DRAM
1278 */
1279 -static void mem_malloc_init (void)
1280 -{
1281 +#ifdef CFG_BOOTSTRAP_CODE
1282 +static void mem_malloc_init (ulong dest_addr) {
1283 +#else //CFG_BOOTSTRAP_CODE
1284 +static void mem_malloc_init (void) {
1285 ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
1286 -
1287 +#endif //CFG_BOOTSTRAP_CODE
1288 mem_malloc_end = dest_addr;
1289 mem_malloc_start = dest_addr - TOTAL_MALLOC_LEN;
1290 mem_malloc_brk = mem_malloc_start;
1291 @@ -79,6 +104,25 @@
1292 mem_malloc_end - mem_malloc_start);
1293 }
1294
1295 +#ifdef CFG_BOOTSTRAP_CODE
1296 +void *malloc(unsigned int size) {
1297 + if(size < (mem_malloc_end - mem_malloc_start)) {
1298 + mem_malloc_start += size;
1299 + debug ("malloc : size required = 0x%08lx and pointer = 0x%08lx\n",size,mem_malloc_start - size);
1300 + return (void *)(mem_malloc_start - size);
1301 + }
1302 + return NULL;
1303 +}
1304 +
1305 +void *realloc(void *src,unsigned int size) {
1306 + return NULL;
1307 +}
1308 +
1309 +void free(void *src) {
1310 + return;
1311 +}
1312 +#endif //CFG_BOOTSTRAP_CODE
1313 +
1314 void *sbrk (ptrdiff_t increment)
1315 {
1316 ulong old = mem_malloc_brk;
1317 @@ -99,42 +143,58 @@
1318 #else
1319 int board_type = 0; /* use dummy arg */
1320 #endif
1321 - puts ("DRAM: ");
1322
1323 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1324 +#ifdef CONFIG_USE_DDR_RAM
1325 + puts ("DDR-DRAM: ");
1326 +#else
1327 + puts ("DRAM: ");
1328 +#endif
1329 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1330 if ((gd->ram_size = initdram (board_type)) > 0) {
1331 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1332 print_size (gd->ram_size, "\n");
1333 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1334 return (0);
1335 }
1336 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1337 puts (failed);
1338 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1339 return (1);
1340 }
1341
1342 +#if !defined(CFG_BOOTSTRAP_CODE) || defined(DEBUG_ENABLE_BOOTSTRAP_PRINTF)
1343 static int display_banner(void)
1344 {
1345 -
1346 printf ("\n\n%s\n\n", version_string);
1347 return (0);
1348 }
1349 +#endif
1350
1351 +#ifndef CFG_BOOTSTRAP_CODE
1352 static void display_flash_config(ulong size)
1353 {
1354 puts ("Flash: ");
1355 print_size (size, "\n");
1356 }
1357 +#endif //CFG_BOOTSTRAP_CODE
1358
1359 -
1360 +#if !defined(CFG_BOOTSTRAP_CODE) || defined(DEBUG_ENABLE_BOOTSTRAP_PRINTF)
1361 static int init_baudrate (void)
1362 {
1363 +#ifndef CFG_BOOTSTRAP_CODE
1364 char tmp[64]; /* long enough for environment variables */
1365 int i = getenv_r ("baudrate", tmp, sizeof (tmp));
1366
1367 gd->baudrate = (i > 0)
1368 ? (int) simple_strtoul (tmp, NULL, 10)
1369 : CONFIG_BAUDRATE;
1370 -
1371 +#else //CFG_BOOTSTRAP_CODE
1372 + gd->baudrate = CONFIG_BAUDRATE;
1373 +#endif //CFG_BOOTSTRAP_CODE
1374 return (0);
1375 }
1376 -
1377 +#endif
1378
1379 /*
1380 * Breath some life into the board...
1381 @@ -159,27 +219,49 @@
1382 typedef int (init_fnc_t) (void);
1383
1384 init_fnc_t *init_sequence[] = {
1385 +#ifdef CFG_BOOTSTRAP_CODE
1386 + //fuse_prg,
1387 + //timer_init,
1388 + //env_init, /* initialize environment */
1389 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1390 + init_baudrate, /* initialze baudrate settings */
1391 + serial_init, /* serial communications setup */
1392 + console_init_f,
1393 + display_banner, /* say that we are here */
1394 + checkboard,
1395 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1396 + init_func_ram,
1397 + NULL,
1398 +#else /********** CFG_BOOTSTRAP_CODE **********/
1399 timer_init,
1400 - env_init, /* initialize environment */
1401 -#ifdef CONFIG_INCA_IP
1402 - incaip_set_cpuclk, /* set cpu clock according to environment variable */
1403 -#endif
1404 init_baudrate, /* initialze baudrate settings */
1405 serial_init, /* serial communications setup */
1406 console_init_f,
1407 display_banner, /* say that we are here */
1408 checkboard,
1409 init_func_ram,
1410 + env_init, /* initialize environment */
1411 NULL,
1412 +#endif //CFG_BOOTSTRAP_CODE
1413 };
1414
1415 +#ifdef CFG_BOOTSTRAP_CODE
1416 +extern void bootstrap_relocate_code(ulong addr_sp, gd_t *id, ulong addr);
1417
1418 +void bootstrap_board_init_f(ulong bootflag)
1419 +#else
1420 void board_init_f(ulong bootflag)
1421 +#endif
1422 {
1423 gd_t gd_data, *id;
1424 bd_t *bd;
1425 init_fnc_t **init_fnc_ptr;
1426 - ulong addr, addr_sp, len = (ulong)&uboot_end - CFG_MONITOR_BASE;
1427 +#ifdef CFG_BOOTSTRAP_CODE
1428 + ulong addr, addr_sp, len = (ulong)&uboot_end_bootstrap - BOOTSTRAP_CFG_MONITOR_BASE;
1429 + ulong lzmaImageaddr = 0;
1430 +#else //CFG_BOOTSTRAP_CODE
1431 + ulong addr, addr_sp, len = CFG_MONITOR_LEN;
1432 +#endif //CFG_BOOTSTRAP_CODE
1433 ulong *s;
1434 #ifdef CONFIG_PURPLE
1435 void copy_code (ulong);
1436 @@ -219,13 +301,12 @@
1437 addr -= len;
1438 addr &= ~(16 * 1024 - 1);
1439
1440 - debug ("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);
1441 + debug ("Reserving %d Bytes for U-Boot at: %08lx\n", len, addr);
1442
1443 /* Reserve memory for malloc() arena.
1444 */
1445 addr_sp = addr - TOTAL_MALLOC_LEN;
1446 - debug ("Reserving %dk for malloc() at: %08lx\n",
1447 - TOTAL_MALLOC_LEN >> 10, addr_sp);
1448 + debug ("Reserving %d Bytes for malloc() at: %08lx\n", TOTAL_MALLOC_LEN, addr_sp);
1449
1450 /*
1451 * (permanently) allocate a Board Info struct
1452 @@ -234,20 +315,17 @@
1453 addr_sp -= sizeof(bd_t);
1454 bd = (bd_t *)addr_sp;
1455 gd->bd = bd;
1456 - debug ("Reserving %d Bytes for Board Info at: %08lx\n",
1457 - sizeof(bd_t), addr_sp);
1458 + debug ("Reserving %d Bytes for Board Info at: %08lx\n", sizeof(bd_t), addr_sp);
1459
1460 addr_sp -= sizeof(gd_t);
1461 id = (gd_t *)addr_sp;
1462 - debug ("Reserving %d Bytes for Global Data at: %08lx\n",
1463 - sizeof (gd_t), addr_sp);
1464 + debug ("Reserving %d Bytes for Global Data at: %08lx\n", sizeof (gd_t), addr_sp);
1465
1466 /* Reserve memory for boot params.
1467 */
1468 addr_sp -= CFG_BOOTPARAMS_LEN;
1469 bd->bi_boot_params = addr_sp;
1470 - debug ("Reserving %dk for boot params() at: %08lx\n",
1471 - CFG_BOOTPARAMS_LEN >> 10, addr_sp);
1472 + debug ("Reserving %dk for boot params() at: %08lx\n", CFG_BOOTPARAMS_LEN >> 10, addr_sp);
1473
1474 /*
1475 * Finally, we set up a new (bigger) stack.
1476 @@ -279,7 +357,16 @@
1477 copy_code(addr);
1478 #endif
1479
1480 +#ifdef CFG_BOOTSTRAP_CODE
1481 + lzmaImageaddr = (ulong)&uboot_end_data_bootstrap;
1482 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1483 + puts("\n BOOTSTRAP: relocate_code start");
1484 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1485 + bootstrap_relocate_code (addr_sp, id, addr);
1486 +#else //CFG_BOOTSTRAP_CODE
1487 + puts("\n relocate_code start");
1488 relocate_code (addr_sp, id, addr);
1489 +#endif //CFG_BOOTSTRAP_CODE
1490
1491 /* NOTREACHED - relocate_code() does not return */
1492 }
1493 @@ -292,7 +379,110 @@
1494 *
1495 ************************************************************************
1496 */
1497 +#ifdef CFG_BOOTSTRAP_CODE
1498 +void bootstrap_board_init_r (gd_t *id, ulong dest_addr) {
1499 + int i;
1500 + ulong addr;
1501 + ulong data, len, checksum;
1502 + ulong *len_ptr;
1503 + image_header_t header;
1504 + image_header_t *hdr = &header;
1505 + unsigned int destLen;
1506 + int (*fn)(void);
1507 +
1508 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1509 + puts("\n BOOTSTRAP: relocate_code finish.\n");
1510 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1511 +
1512 + /* initialize malloc() area */
1513 + mem_malloc_init(dest_addr);
1514 +
1515 + addr = (char *)(BOOTSTRAP_CFG_MONITOR_BASE + ((ulong)&uboot_end_data_bootstrap - dest_addr));
1516 + memmove (&header, (char *)addr, sizeof(image_header_t));
1517 +
1518 + if (ntohl(hdr->ih_magic) != IH_MAGIC) {
1519 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1520 + printf ("Bad Magic Number at address 0x%08lx\n",addr);
1521 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1522 + return;
1523 + }
1524
1525 + data = (ulong)&header;
1526 + len = sizeof(image_header_t);
1527 +
1528 + checksum = ntohl(hdr->ih_hcrc);
1529 + hdr->ih_hcrc = 0;
1530 + if (crc32 (0, (unsigned char *)data, len) != checksum) {
1531 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1532 + printf ("Bad Header Checksum\n");
1533 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1534 + return;
1535 + }
1536 +
1537 + data = addr + sizeof(image_header_t);
1538 + len = ntohl(hdr->ih_size);
1539 + len_ptr = (ulong *)data;
1540 +
1541 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1542 + debug ("Disabling all the interrupts\n");
1543 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1544 + disable_interrupts();
1545 +
1546 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1547 + debug (" Uncompressing UBoot Image ... \n" );
1548 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1549 + /*
1550 + * If we've got less than 4 MB of malloc() space,
1551 + * use slower decompression algorithm which requires
1552 + * at most 2300 KB of memory.
1553 + */
1554 + destLen = 0x0;
1555 +
1556 +#ifdef CONFIG_BZIP2
1557 + i = BZ2_bzBuffToBuffDecompress ((char*)ntohl(hdr->ih_load),
1558 + 0x400000, (char *)data, len,
1559 + CFG_MALLOC_LEN < (4096 * 1024), 0);
1560 + if (i != BZ_OK) {
1561 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1562 + printf ("BUNZIP2 ERROR %d - must RESET board to recover\n", i);
1563 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1564 + return;
1565 + }
1566 +#elif CONFIG_MICROBZIP2
1567 + i = micro_bzBuffToBuffDecompress ((char*)ntohl(hdr->ih_load),
1568 + &destLen, (char *)data, len,
1569 + CFG_MALLOC_LEN < (4096 * 1024), 0);
1570 + if (i != RETVAL_OK) {
1571 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1572 + printf ("MICRO_BUNZIP2 ERROR %d - must RESET board to recover\n", i);
1573 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1574 + return;
1575 + }
1576 +#elif CONFIG_LZMA
1577 + i = lzma_inflate ((unsigned char *)data, len, (unsigned char*)ntohl(hdr->ih_load), &destLen);
1578 + if (i != LZMA_RESULT_OK) {
1579 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1580 + printf ("LZMA ERROR %d - must RESET board to recover\n", i);
1581 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1582 + return;
1583 + }
1584 +#else
1585 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1586 + printf ("NONE Compressing u-boot body!!\n");
1587 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1588 + memmove ((void *)ntohl(hdr->ih_load), (uchar *)data, len);
1589 + destLen = len;
1590 +#endif
1591 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1592 + debug (" Uncompression completed successfully with destLen %d.\n ",destLen );
1593 + debug ("Head: Jumping to u-boot in the ram at 0x%08lx\n", CFG_MONITOR_BASE);
1594 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1595 +
1596 + fn = ntohl(hdr->ih_load);
1597 + (*fn)();
1598 + hang ();
1599 +}
1600 +#else //CFG_BOOTSTRAP_CODE
1601 void board_init_r (gd_t *id, ulong dest_addr)
1602 {
1603 cmd_tbl_t *cmdtp;
1604 @@ -305,6 +495,8 @@
1605 bd_t *bd;
1606 int i;
1607
1608 + puts("\n relocate_code finish.\n");
1609 +
1610 gd = id;
1611 gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
1612
1613 @@ -321,12 +513,10 @@
1614 ulong addr;
1615
1616 addr = (ulong) (cmdtp->cmd) + gd->reloc_off;
1617 -#if 0
1618 - printf ("Command \"%s\": 0x%08lx => 0x%08lx\n",
1619 - cmdtp->name, (ulong) (cmdtp->cmd), addr);
1620 -#endif
1621 - cmdtp->cmd =
1622 - (int (*)(struct cmd_tbl_s *, int, int, char *[]))addr;
1623 +
1624 + debug ("Command \"%s\": 0x%08lx => 0x%08lx\n", cmdtp->name, (ulong) (cmdtp->cmd), addr);
1625 +
1626 + cmdtp->cmd = (int (*)(struct cmd_tbl_s *, int, int, char *[]))addr;
1627
1628 addr = (ulong)(cmdtp->name) + gd->reloc_off;
1629 cmdtp->name = (char *)addr;
1630 @@ -363,7 +553,13 @@
1631 /* initialize malloc() area */
1632 mem_malloc_init();
1633 malloc_bin_reloc();
1634 +#if (CONFIG_COMMANDS & CFG_CMD_NAND)
1635 + nand_init(); /* go init the NAND */
1636 +#endif
1637
1638 +#ifdef CONFIG_SPI
1639 + spi_init_f(); /* go init the SPI flash */
1640 +#endif
1641 /* relocate environment function pointers etc. */
1642 env_relocate();
1643
1644 @@ -424,9 +620,12 @@
1645
1646 /* NOTREACHED - no way out of command loop except booting */
1647 }
1648 +#endif //CFG_BOOTSTRAP_CODE
1649
1650 void hang (void)
1651 {
1652 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1653 puts ("### ERROR ### Please RESET the board ###\n");
1654 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1655 for (;;);
1656 }
1657 Index: u-boot-1.1.5/lib_mips/time.c
1658 ===================================================================
1659 --- u-boot-1.1.5.orig/lib_mips/time.c 2006-10-20 17:54:33.000000000 +0200
1660 +++ u-boot-1.1.5/lib_mips/time.c 2009-10-04 23:06:03.000000000 +0200
1661 @@ -80,6 +80,19 @@
1662 /*NOP*/;
1663 }
1664
1665 +#ifndef CFG_BOOTSTRAP_CODE
1666 +void mdelay (unsigned long msec)
1667 +{
1668 + int i,j;
1669 + for(i=0;i<msec;i++)
1670 + {
1671 + udelay(1000);
1672 +
1673 + }
1674 +
1675 +}
1676 +#endif
1677 +
1678 /*
1679 * This function is derived from PowerPC code (read timebase as long long).
1680 * On MIPS it just returns the timer value.
1681 Index: u-boot-1.1.5/net/eth.c
1682 ===================================================================
1683 --- u-boot-1.1.5.orig/net/eth.c 2006-10-20 17:54:33.000000000 +0200
1684 +++ u-boot-1.1.5/net/eth.c 2009-10-04 23:06:03.000000000 +0200
1685 @@ -25,6 +25,9 @@
1686 #include <command.h>
1687 #include <net.h>
1688 #include <miiphy.h>
1689 +#if defined(CONFIG_IFX_MIPS)
1690 +# include "ifx_eth.c"
1691 +#endif
1692
1693 #if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI)
1694
1695 @@ -54,6 +57,9 @@
1696 extern int skge_initialize(bd_t*);
1697 extern int tsec_initialize(bd_t*, int, char *);
1698 extern int npe_initialize(bd_t *);
1699 +#if defined(CONFIG_IFX_MIPS)
1700 + IFX_ETH_INITIALIZE_EXTERN
1701 +#endif
1702
1703 static struct eth_device *eth_devices, *eth_current;
1704
1705 @@ -235,7 +241,9 @@
1706 #if defined(CONFIG_RTL8169)
1707 rtl8169_initialize(bis);
1708 #endif
1709 -
1710 +#if defined(CONFIG_IFX_MIPS)
1711 + IFX_ETH_INITIALIZE(bis)
1712 +#endif
1713 if (!eth_devices) {
1714 puts ("No ethernet found.\n");
1715 } else {
1716 Index: u-boot-1.1.5/tools/mkimage.c
1717 ===================================================================
1718 --- u-boot-1.1.5.orig/tools/mkimage.c 2006-10-20 17:54:33.000000000 +0200
1719 +++ u-boot-1.1.5/tools/mkimage.c 2009-10-04 23:06:03.000000000 +0200
1720 @@ -28,6 +28,7 @@
1721 #ifndef __WIN32__
1722 #include <netinet/in.h> /* for host / network byte order conversions */
1723 #endif
1724 +#include <sys/types.h>
1725 #include <sys/mman.h>
1726 #include <sys/stat.h>
1727 #include <time.h>
1728 @@ -138,6 +139,7 @@
1729 { IH_COMP_NONE, "none", "uncompressed", },
1730 { IH_COMP_BZIP2, "bzip2", "bzip2 compressed", },
1731 { IH_COMP_GZIP, "gzip", "gzip compressed", },
1732 + { IH_COMP_LZMA, "lzma", "lzma compressed", },
1733 { -1, "", "", },
1734 };
1735
1736 @@ -445,7 +447,7 @@
1737 }
1738
1739 /* We're a bit of paranoid */
1740 -#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__)
1741 +#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__) && !defined(__APPLE__)
1742 (void) fdatasync (ifd);
1743 #else
1744 (void) fsync (ifd);
1745 @@ -495,7 +497,7 @@
1746 (void) munmap((void *)ptr, sbuf.st_size);
1747
1748 /* We're a bit of paranoid */
1749 -#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__)
1750 +#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__) && !defined(__APPLE__)
1751 (void) fdatasync (ifd);
1752 #else
1753 (void) fsync (ifd);
1754 Index: u-boot-1.1.5/cpu/mips/cache.S
1755 ===================================================================
1756 --- u-boot-1.1.5.orig/cpu/mips/cache.S 2006-10-20 17:54:33.000000000 +0200
1757 +++ u-boot-1.1.5/cpu/mips/cache.S 2009-10-04 23:06:03.000000000 +0200
1758 @@ -29,7 +29,9 @@
1759 #include <asm/mipsregs.h>
1760 #include <asm/addrspace.h>
1761 #include <asm/cacheops.h>
1762 -
1763 +#if defined(CONFIG_IFX_MIPS)
1764 +# include "danube/ifx_cache.S"
1765 +#endif
1766
1767 /* 16KB is the maximum size of instruction and data caches on
1768 * MIPS 4K.
1769 @@ -155,6 +157,9 @@
1770 */
1771
1772 mtc0 zero, CP0_TAGLO
1773 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CACHE_EXTRA_INVALID_TAG)
1774 + IFX_CACHE_EXTRA_INVALID_TAG
1775 +#endif
1776
1777 /*
1778 * The caches are probably in an indeterminate state,
1779 @@ -171,6 +176,9 @@
1780 move a1, a2
1781 icacheopn(a0,a1,a2,a3,121,(Index_Store_Tag_I,Fill))
1782
1783 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CACHE_EXTRA_OPERATION)
1784 + IFX_CACHE_EXTRA_OPERATION
1785 +#else
1786 /* To support Orion/R4600, we initialise the data cache in 3 passes.
1787 */
1788
1789 @@ -200,6 +208,7 @@
1790 move a3, t5 # dcacheLineSize
1791 move a1, a2
1792 icacheop(a0,a1,a2,a3,Index_Store_Tag_D)
1793 +#endif
1794
1795 j ra
1796 .end mips_cache_reset
1797 Index: u-boot-1.1.5/cpu/mips/config.mk
1798 ===================================================================
1799 --- u-boot-1.1.5.orig/cpu/mips/config.mk 2006-10-20 17:54:33.000000000 +0200
1800 +++ u-boot-1.1.5/cpu/mips/config.mk 2009-10-04 23:06:03.000000000 +0200
1801 @@ -20,20 +20,26 @@
1802 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1803 # MA 02111-1307 USA
1804 #
1805 -v=$(shell \
1806 -$(CROSS_COMPILE)as --version|grep "GNU assembler"|awk '{print $$3}'|awk -F . '{print $$2}')
1807 -MIPSFLAGS=$(shell \
1808 -if [ "$v" -lt "14" ]; then \
1809 - echo "-mcpu=4kc"; \
1810 -else \
1811 - echo "-march=4kc -mtune=4kc"; \
1812 -fi)
1813
1814 +ifndef PLATFORM_CPU
1815 +PLATFORM_CPU = mips32
1816 +endif
1817 +
1818 +MIPSFLAGS +=$(call cc-option,-march=$(PLATFORM_CPU) -mtune=$(PLATFORM_CPU),-mcpu=$(PLATFORM_CPU))
1819 +
1820 +ifeq ($(CROSS_COMPILE_UCLIBC),1)
1821 +ifneq (,$(findstring mipsel,$(CROSS_COMIPLE)))
1822 +ENDIANNESS = -el
1823 +else
1824 +ENDIANNESS = -eb
1825 +endif
1826 +else
1827 ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
1828 ENDIANNESS = -EL
1829 else
1830 ENDIANNESS = -EB
1831 endif
1832 +endif
1833
1834 MIPSFLAGS += $(ENDIANNESS) -mabicalls
1835
1836 Index: u-boot-1.1.5/cpu/mips/cpu.c
1837 ===================================================================
1838 --- u-boot-1.1.5.orig/cpu/mips/cpu.c 2006-10-20 17:54:33.000000000 +0200
1839 +++ u-boot-1.1.5/cpu/mips/cpu.c 2009-10-04 23:06:03.000000000 +0200
1840 @@ -23,7 +23,12 @@
1841
1842 #include <common.h>
1843 #include <command.h>
1844 -#include <asm/inca-ip.h>
1845 +#if defined(CONFIG_INCA_IP)
1846 +# include <asm/inca-ip.h>
1847 +#elif defined(CONFIG_IFX_MIPS)
1848 +# include <asm/danube.h>
1849 +# include "danube/ifx_cpu.c"
1850 +#endif
1851 #include <asm/mipsregs.h>
1852
1853 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
1854 @@ -34,6 +39,8 @@
1855 void (*f)(void) = (void *) 0xbfc00000;
1856
1857 f();
1858 +#elif defined(CONFIG_IFX_MIPS)
1859 + IFX_CPU_RESET;
1860 #endif
1861 fprintf(stderr, "*** reset failed ***\n");
1862 return 0;
1863 Index: u-boot-1.1.5/cpu/mips/incaip_clock.c
1864 ===================================================================
1865 --- u-boot-1.1.5.orig/cpu/mips/incaip_clock.c 2006-10-20 17:54:33.000000000 +0200
1866 +++ u-boot-1.1.5/cpu/mips/incaip_clock.c 2009-10-04 23:06:03.000000000 +0200
1867 @@ -22,8 +22,9 @@
1868 */
1869
1870 #include <common.h>
1871 -#include <asm/inca-ip.h>
1872
1873 +#ifdef CONFIG_INCA_IP
1874 +#include <asm/inca-ip.h>
1875
1876 /*******************************************************************************
1877 *
1878 @@ -114,3 +115,5 @@
1879
1880 return 0;
1881 }
1882 +
1883 +#endif /* CONFIG_INCA_IP */
1884 Index: u-boot-1.1.5/cpu/mips/start.S
1885 ===================================================================
1886 --- u-boot-1.1.5.orig/cpu/mips/start.S 2006-10-20 17:54:33.000000000 +0200
1887 +++ u-boot-1.1.5/cpu/mips/start.S 2009-10-04 23:06:03.000000000 +0200
1888 @@ -27,7 +27,9 @@
1889 #include <version.h>
1890 #include <asm/regdef.h>
1891 #include <asm/mipsregs.h>
1892 -
1893 +#if defined(CONFIG_IFX_MIPS)
1894 +# include "danube/ifx_start.S"
1895 +#endif
1896
1897 #define RVECENT(f,n) \
1898 b f; nop
1899 @@ -36,15 +38,24 @@
1900 li k0,bev
1901
1902 .set noreorder
1903 -
1904 +#ifdef CFG_BOOTSTRAP_CODE
1905 + .globl _start_bootstrap
1906 +#else
1907 .globl _start
1908 +#endif
1909 .text
1910 +#ifdef CFG_BOOTSTRAP_CODE
1911 +_start_bootstrap:
1912 +#else
1913 _start:
1914 +#endif
1915 RVECENT(reset,0) /* U-boot entry point */
1916 RVECENT(reset,1) /* software reboot */
1917 -#if defined(CONFIG_INCA_IP)
1918 +#if defined(CONFIG_INCA_IP) || defined(CONFIG_INCA_IP2)
1919 .word INFINEON_EBU_BOOTCFG /* EBU init code, fetched during booting */
1920 .word 0x00000000 /* phase of the flash */
1921 +#elif defined(CONFIG_IFX_MIPS) && defined(IFX_EBU_BOOTCFG_DWORD)
1922 + IFX_EBU_BOOTCFG_DWORD
1923 #elif defined(CONFIG_PURPLE)
1924 .word INFINEON_EBU_BOOTCFG /* EBU init code, fetched during booting */
1925 .word INFINEON_EBU_BOOTCFG /* EBU init code, fetched during booting */
1926 @@ -181,6 +192,9 @@
1927 * 128 * 8 == 1024 == 0x400
1928 * so this is address R_VEC+0x400 == 0xbfc00400
1929 */
1930 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_MORE_RESERVED_VECTORS)
1931 + IFX_MORE_RESERVED_VECTORS
1932 +#else
1933 #ifdef CONFIG_PURPLE
1934 /* 0xbfc00400 */
1935 .word 0xdc870000
1936 @@ -205,8 +219,12 @@
1937 .word 0x00000000
1938 .word 0x00000000
1939 #endif /* CONFIG_PURPLE */
1940 +#endif /* CONFIG_IFX_MIPS */
1941 .align 4
1942 reset:
1943 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_RESET_PRECHECK)
1944 + IFX_RESET_PRECHECK
1945 +#endif
1946
1947 /* Clear watch registers.
1948 */
1949 @@ -226,6 +244,10 @@
1950 /* CAUSE register */
1951 mtc0 zero, CP0_CAUSE
1952
1953 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CPU_EXTRA_INIT)
1954 + IFX_CPU_EXTRA_INIT
1955 +#endif
1956 +
1957 /* Init Timer */
1958 mtc0 zero, CP0_COUNT
1959 mtc0 zero, CP0_COMPARE
1960 @@ -252,12 +274,26 @@
1961 nop
1962 #endif
1963
1964 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CPU1_SUPPORT) && defined(IFX_SKIP_LOWLEVEL_INIT)
1965 + IFX_SKIP_LOWLEVEL_INIT
1966 +#endif
1967 +#ifdef CFG_BOOTSTRAP_CODE
1968 /* Initialize any external memory.
1969 */
1970 la t9, lowlevel_init
1971 jalr t9
1972 nop
1973 +#endif
1974 +lowlevel_init_done:
1975 +
1976 + beq s0, zero, init_cache_0
1977 + nop
1978 +
1979 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CPU1_SUPPORT) && defined(IFX_CPU1_INIT)
1980 + IFX_CPU1_INIT
1981 +#endif
1982
1983 +init_cache_0:
1984 /* Initialize caches...
1985 */
1986 la t9, mips_cache_reset
1987 @@ -266,7 +302,11 @@
1988
1989 /* ... and enable them.
1990 */
1991 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CACHE_OPER_MODE)
1992 + IFX_CACHE_OPER_MODE
1993 +#else
1994 li t0, CONF_CM_CACHABLE_NONCOHERENT
1995 +#endif
1996 mtc0 t0, CP0_CONFIG
1997
1998
1999 @@ -280,13 +320,38 @@
2000 li t0, CFG_SDRAM_BASE + CFG_INIT_SP_OFFSET
2001 la sp, 0(t0)
2002
2003 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CPU1_SUPPORT) && defined(IFX_BOOT_CLEAR)
2004 + IFX_BOOT_CLEAR
2005 +#endif
2006 +
2007 +#ifdef CFG_BOOTSTRAP_CODE
2008 + la t9, bootstrap_board_init_f
2009 +#else
2010 la t9, board_init_f
2011 +#endif
2012 j t9
2013 nop
2014
2015 +#ifdef CFG_BOOTSTRAP_CODE
2016 +/*
2017 + * void jump_unconditional (addr)
2018 + * This function simply jumps to the location pointed by a0.
2019 + * a0 = target_location
2020 + *
2021 + */
2022 + .globl jump_unconditional
2023 + .ent jump_unconditional
2024 +jump_unconditional:
2025 + move t9, a0
2026 + j t9
2027 + nop
2028 + .end jump_unconditional
2029 +
2030 +#endif
2031
2032 /*
2033 * void relocate_code (addr_sp, gd, addr_moni)
2034 + * void bootstrap_relocate_code (addr_sp, gd, addr_moni)
2035 *
2036 * This "function" does not return, instead it continues in RAM
2037 * after relocating the monitor code.
2038 @@ -295,12 +360,22 @@
2039 * a1 = gd
2040 * a2 = destination address
2041 */
2042 +#ifdef CFG_BOOTSTRAP_CODE
2043 + .globl bootstrap_relocate_code
2044 + .ent bootstrap_relocate_code
2045 +bootstrap_relocate_code:
2046 +#else
2047 .globl relocate_code
2048 .ent relocate_code
2049 relocate_code:
2050 +#endif
2051 move sp, a0 /* Set new stack pointer */
2052
2053 +#ifdef CFG_BOOTSTRAP_CODE
2054 + li t0, BOOTSTRAP_CFG_MONITOR_BASE
2055 +#else
2056 li t0, CFG_MONITOR_BASE
2057 +#endif
2058 la t3, in_ram
2059 lw t2, -12(t3) /* t2 <-- uboot_end_data */
2060 move t1, a2
2061 @@ -311,7 +386,11 @@
2062 * New GOT-PTR = (old GOT-PTR - CFG_MONITOR_BASE) + Destination Address
2063 */
2064 move t6, gp
2065 +#ifdef CFG_BOOTSTRAP_CODE
2066 + sub gp, BOOTSTRAP_CFG_MONITOR_BASE
2067 +#else
2068 sub gp, CFG_MONITOR_BASE
2069 +#endif
2070 add gp, a2 /* gp now adjusted */
2071 sub t6, gp, t6 /* t6 <-- relocation offset */
2072
2073 @@ -337,12 +416,21 @@
2074
2075 /* Jump to where we've relocated ourselves.
2076 */
2077 +#ifdef CFG_BOOTSTRAP_CODE
2078 + addi t0, a2, in_ram - _start_bootstrap
2079 +#else
2080 addi t0, a2, in_ram - _start
2081 +#endif
2082 j t0
2083 nop
2084
2085 +#ifdef CFG_BOOTSTRAP_CODE
2086 + .word uboot_end_data_bootstrap
2087 + .word uboot_end_bootstrap
2088 +#else
2089 .word uboot_end_data
2090 .word uboot_end
2091 +#endif
2092 .word num_got_entries
2093
2094 in_ram:
2095 @@ -374,12 +462,19 @@
2096 sw zero, 0(t1) /* delay slot */
2097
2098 move a0, a1
2099 +#ifdef CFG_BOOTSTRAP_CODE
2100 + la t9, bootstrap_board_init_r
2101 +#else
2102 la t9, board_init_r
2103 +#endif
2104 j t9
2105 move a1, a2 /* delay slot */
2106
2107 +#ifdef CFG_BOOTSTRAP_CODE
2108 + .end bootstrap_relocate_code
2109 +#else
2110 .end relocate_code
2111 -
2112 +#endif
2113
2114 /* Exception handlers.
2115 */
2116 @@ -388,3 +483,20 @@
2117
2118 romExcHandle:
2119 b romExcHandle
2120 +
2121 +romEjtagHandle:
2122 +#ifdef CFG_BOOTSTRAP_CODE
2123 + deret
2124 + nop
2125 +#endif /* CFG_BOOTSTRAP_CODE */
2126 +1:
2127 + b 1b
2128 +
2129 + /* Additional handlers.
2130 + */
2131 +#if defined(CONFIG_IFX_MIPS)
2132 +#if defined(IFX_MIPS_HANDLER_1)
2133 +ifx_mips_handler_1:
2134 + IFX_MIPS_HANDLER_1
2135 +#endif
2136 +#endif
2137 Index: u-boot-1.1.5/tools/Makefile
2138 ===================================================================
2139 --- u-boot-1.1.5.orig/tools/Makefile 2006-10-20 17:54:33.000000000 +0200
2140 +++ u-boot-1.1.5/tools/Makefile 2009-10-04 23:06:03.000000000 +0200
2141 @@ -21,7 +21,7 @@
2142 # MA 02111-1307 USA
2143 #
2144
2145 -BIN_FILES = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX)
2146 +BIN_FILES = mkimage$(SFX)
2147
2148 OBJ_LINKS = environment.o crc32.o
2149 OBJ_FILES = img2srec.o mkimage.o envcrc.o gen_eth_addr.o bmp_logo.o