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-11-09 16:35:03.000000000 +0100
10 +EXTRAVERSION = -IFX-LXDB
11 U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
12 VERSION_FILE = $(obj)include/version_autogenerated.h
15 # Deal with colliding definitions from tcsh etc.
18 +# Default algorithm form compressing u-boot.bin
21 +COMPRESS_FILE=$(obj)u-boot.img
23 +ifeq ($(COMPRESS),lzma)
24 +COMPRESS_FILE=$(obj)u-boot.limg
26 +ifeq ($(COMPRESS),bz2)
27 +COMPRESS_FILE=$(obj)u-boot.bzimg
29 +ifeq ($(COMPRESS),gzip)
30 +COMPRESS_FILE=$(obj)u-boot.zimg
32 +ifeq ($(COMPRESS),none)
33 +COMPRESS_FILE=$(obj)u-boot.img
37 #########################################################################
39 # U-boot build supports producing a object files to the separate external
41 # U-Boot objects....order is important (i.e. start must be first)
43 OBJS = cpu/$(CPU)/start.o
44 +OBJS_BOOTSTRAP = cpu/$(CPU)/start_bootstrap.o
46 +cpu/$(CPU)/start_bootstrap.S: cpu/$(CPU)/start.S
47 + ln -s start.S cpu/$(CPU)/start_bootstrap.S
50 OBJS += cpu/$(CPU)/start16.o
51 OBJS += cpu/$(CPU)/reset.o
55 OBJS := $(addprefix $(obj),$(OBJS))
56 +OBJS_BOOTSTRAP := $(addprefix $(obj),$(OBJS_BOOTSTRAP))
58 LIBS = lib_generic/libgeneric.a
59 LIBS += board/$(BOARDDIR)/lib$(BOARD).a
63 LIBS := $(addprefix $(obj),$(LIBS))
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
70 +LIBS_BOOTSTRAP := $(addprefix $(obj),$(LIBS_BOOTSTRAP))
73 +.PHONY : $(obj)lib_bootstrap/libbootstrap.a
76 PLATFORM_LIBS += -L $(shell dirname `$(CC) $(CFLAGS) -print-libgcc-file-name`) -lgcc
78 # The "tools" are needed early, so put this first
79 # Don't include stuff already done in $(LIBS)
88 __OBJS := $(subst $(obj),,$(OBJS))
89 __LIBS := $(subst $(obj),,$(LIBS))
90 +__LIBS_BOOTSTRAP := $(subst $(obj),,$(LIBS_BOOTSTRAP))
92 +#__HEAD_OBJS := $(subst $(obj),,$(HEAD_OBJS))
93 +#__HEAD_LIBS := $(subst $(obj),,$(HEAD_LIBS))
95 #########################################################################
96 #########################################################################
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
107 +ifx_bootstrap: $(IFX_BOOTSTRAP)
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
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 $@
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
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"/') \
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"/') \
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"/') \
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"/') \
159 $(obj)u-boot.hex: $(obj)u-boot
160 $(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
162 @@ -243,28 +338,33 @@
163 $(obj)u-boot.bin: $(obj)u-boot
164 $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
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"/') \
173 $(obj)u-boot.dis: $(obj)u-boot
174 $(OBJDUMP) -d $< > $@
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
183 +$(obj)bootstrap.bin: $(obj)bootstrap
184 + $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
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
193 $(MAKE) -C cpu/$(CPU) $(if $(REMOTE_BUILD),$@,$(notdir $@))
196 $(MAKE) -C $(dir $(subst $(obj),,$@))
198 +$(obj)lib_bootstrap/libbootstrap.a:
199 + $(MAKE) -C $(dir $(subst $(obj),,$@))
205 $(obj)System.map: $(obj)u-boot
207 grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
208 - sort > $(obj)System.map
211 +$(obj)System_bootstrap.map: $(obj)bootstrap
213 + grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
216 #########################################################################
218 @@ -2032,7 +2137,20 @@
220 #========================================================================
221 #########################################################################
223 +## Infineon MIPS generic u-boot config
224 +#########################################################################
225 +danube_config: unconfig
226 + @$(MKCONFIG) $(@:_config=) mips mips danube ifx danube
228 +amazon_config: unconfig
229 + @$(MKCONFIG) $(@:_config=) mips mips amazon
232 +incaip2_config: unconfig
233 + @$(MKCONFIG) $(@:_config=) mips mips incaip2
235 +#########################################################################
237 #########################################################################
239 xtract_incaip = $(subst _100MHz,,$(subst _133MHz,,$(subst _150MHz,,$(subst _config,,$1))))
240 @@ -2254,7 +2372,7 @@
242 rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS $(obj)include/version_autogenerated.h
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-11-09 16:35:03.000000000 +0100
257 +#include <LzmaWrapper.h>
258 #include <environment.h>
259 #include <asm/byteorder.h>
262 # define CHUNKSZ (64 * 1024)
265 +#ifndef CFG_HEAD_CODE
267 int gunzip (void *, int, unsigned char *, unsigned long *);
269 static void *zalloc(void *, unsigned, unsigned);
271 #endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
274 +#ifndef CONFIG_REMOVE_GZIP
276 printf (" Uncompressing %s ... ", name);
277 if (gunzip ((void *)ntohl(hdr->ih_load), unc_len,
279 do_reset (cmdtp, flag, argc, argv);
282 +#endif /* CONFIG_REMOVE_GZIP */
285 printf (" Uncompressing %s ... ", name);
289 #endif /* CONFIG_BZIP2 */
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);
298 + do_reset (cmdtp, flag, argc, argv);
301 +#endif /* CONFIG_LZMA */
305 @@ -1176,6 +1193,8 @@
307 #endif /* CFG_CMD_IMLS */
309 +#endif /* ! CFG_HEAD_CODE */
312 print_image_hdr (image_header_t *hdr)
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;
322 printf ("%s %s %s (%s)", arch, os, type, comp);
325 +#ifndef CFG_HEAD_CODE
327 #define ZALLOC_ALIGNMENT 16
329 static void *zalloc(void *x, unsigned items, unsigned size)
330 @@ -1427,3 +1449,5 @@
333 #endif /* CONFIG_LYNXKDI */
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-11-09 16:35:03.000000000 +0100
344 -flash_fill_sect_ranges (ulong addr_first, ulong addr_last,
345 - int *s_first, int *s_last,
347 +flash_fill_sect_ranges(
348 + ulong *addr_first_sect_start,
350 + ulong *addr_last_sect_end,
354 + int *bPartialStart,
357 + unsigned int bPartialErase)
362 s_last [bank] = -1; /* last sector to erase */
365 - for (bank=0,info=&flash_info[0];
366 - (bank < CFG_MAX_FLASH_BANKS) && (addr_first <= addr_last);
368 + for (bank=0, info=&flash_info[0]; (bank < CFG_MAX_FLASH_BANKS) && (addr_first <= addr_last); ++bank, ++info) {
373 b_end = info->start[0] + info->size - 1; /* bank end addr */
374 s_end = info->sector_count - 1; /* last sector */
377 for (sect=0; sect < info->sector_count; ++sect) {
378 ulong end; /* last address in current sect */
380 @@ -238,11 +243,21 @@
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;
390 if (addr_last == end) {
392 + } else if (addr_last >= info->start[sect] && addr_last < end && bPartialErase) {
393 + *addr_last_sect_end = end;
394 + s_last[bank] = sect;
399 if (s_first[bank] >= 0) {
400 if (s_last[bank] < 0) {
401 if (addr_last > b_end) {
403 struct part_info *part;
404 u8 dev_type, dev_num, pnum;
406 + unsigned int bPartialErase = 0;
417 printf ("Usage:\n%s\n", cmdtp->usage);
420 @@ -397,11 +414,117 @@
424 - rcode = flash_sect_erase(addr_first, addr_last);
425 + printf ("Erase Flash from 0x%08lx to 0x%08lx\n", addr_first, addr_last);
427 + bPartialErase = simple_strtoul(argv[3], NULL, 10);
430 + rcode = flash_sect_erase(addr_first, addr_last, bPartialErase);
434 -int flash_sect_erase (ulong addr_first, ulong addr_last)
435 +int flerase_Partial(
436 + ulong addr_first_sect_start,
438 + ulong addr_last_sect_end,
440 + flash_info_t *info,
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;
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);
456 + if (bFirstPartial && bLastPartial && (first_sect == last_sect))
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)
464 + debug("calloc %u FAILED\n", sectMemLen);
468 + memset(pSavedSectMem, 0xff, sectMemLen);
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);
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);
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);
487 + if (bFirstPartial){
488 + if(flash_erase (info, first_sect, first_sect)) {
489 + printf("%s ... Couldn't erase sector %d\n", __FUNCTION__, first_sect);
493 + debug("%s ... erase sector %d done!\n", __FUNCTION__, first_sect);
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);
502 + debug("%s ... erase sector %d done!\n", __FUNCTION__, last_sect);
505 + if (bFirstPartial && bLastPartial && (first_sect == last_sect))
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);
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);
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);
528 + free(pSavedFirstMem);
530 + free(pSavedLastMem);
532 + free(pSavedSectMem);
536 +int flash_sect_erase (ulong addr_first, ulong addr_last, unsigned int bPartialErase)
540 @@ -413,27 +536,66 @@
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
552 + rcode = flash_fill_sect_ranges (
553 + &addr_first_sect_start,
555 + &addr_last_sect_end,
564 if (planned && (rcode == 0)) {
565 - for (bank=0,info=&flash_info[0];
566 - (bank < CFG_MAX_FLASH_BANKS) && (rcode == 0);
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 "
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,
579 - rcode = flash_erase (info, s_first[bank], s_last[bank]);
580 + if(bPartialErase) {
581 + rcode = flerase_Partial(
582 + addr_first_sect_start,
584 + addr_last_sect_end,
593 + //Erase full sectores
595 + s_first[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,
606 + rcode = flash_erase (info, s_first[bank], s_last[bank]);
610 - printf ("Erased %d sectors\n", erased);
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);
617 + printf ("Error: start and/or end address not on sector boundary\n");
620 } else if (rcode == 0) {
621 puts ("Error: start and/or end address"
622 " not on sector boundary\n");
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
634 + rcode = flash_fill_sect_ranges (
635 + &addr_first_sect_start,
637 + &addr_last_sect_end,
652 - erase, 3, 1, do_flerase,
653 + erase, 4, 1, do_flerase,
654 "erase - erase FLASH memory\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-11-09 16:35:03.000000000 +0100
662 extern char * env_name_spec;
664 printf ("Saving Environment to %s...\n", env_name_spec);
667 + if(saveenv() == 0) {
668 +#ifdef UBOOT_ENV_COPY
672 +#endif //UBOOT_ENV_COPY
677 return (saveenv() ? 1 : 0);
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-11-09 16:35:03.000000000 +0100
689 /** U-Boot INIT FUNCTIONS *************************************************/
691 +#ifndef CFG_HEAD_CODE
692 int console_assign (int file, char *devname)
700 +#endif //CFG_HEAD_CODE
701 /* Called before relocation - use serial functions */
702 int console_init_f (void)
706 #endif /* CFG_CONSOLE_IS_IN_ENV || CONFIG_SPLASH_SCREEN */
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)
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-11-09 16:35:03.000000000 +0100
723 device_t *stdio_devices[] = { NULL, NULL, NULL };
724 char *stdio_names[MAX_FILES] = { "stdin", "stdout", "stderr" };
725 +#ifndef CFG_HEAD_CODE
727 #if defined(CONFIG_SPLASH_SCREEN) && !defined(CFG_DEVICE_NULLDEV)
728 #define CFG_DEVICE_NULLDEV 1
733 +#endif //CFG_HEAD_CODE
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-11-09 16:35:03.000000000 +0100
740 * We must allocate a buffer for the environment
742 env_ptr = (env_t *)malloc (CFG_ENV_SIZE);
743 - DEBUGF ("%s[%d] malloced ENV at %p\n", __FUNCTION__,__LINE__,env_ptr);
745 + DEBUGF ("malloc env_ptr error!!\n");
746 + DEBUGF ("%s[%d] malloced ENV at %p\n", __FUNCTION__, __LINE__, env_ptr);
752 env_get_char = env_get_char_memory;
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);
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 @@
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));
770 #ifdef CFG_REDUNDAND_ENVIRONMENT
771 env_ptr->flags = 0xFF;
778 env_relocate_spec ();
781 gd->env_addr = (ulong)&(env_ptr->data);
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-11-09 16:35:03.000000000 +0100
791 #else /* ! ENV_IS_EMBEDDED */
793 env_t *env_ptr = (env_t *)CFG_ENV_ADDR;
795 static env_t *flash_addr = (env_t *)CFG_ENV_ADDR;
797 debug (" %08lX ... %08lX ...",
798 (ulong)&(flash_addr_new->data),
799 sizeof(env_ptr->data)+(ulong)&(flash_addr_new->data));
801 if ((rc = flash_write((char *)env_ptr->data,
802 (ulong)&(flash_addr_new->data),
803 sizeof(env_ptr->data))) ||
805 #endif /* CMD_SAVEENV */
807 #else /* ! CFG_ENV_ADDR_REDUND */
811 #ifdef CONFIG_OMAP2420H4
816 +#ifdef UBOOT_ENV_COPY
817 +int saveenv_copy(void) {
818 + uchar *env_buffer = (char *)env_ptr;
822 + ulong start_addr,end_addr,rootfs_end_addr;
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;
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);
833 + if(rootfs_end_addr >= start_addr)
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);
839 + debug ("Protect off %08lX ... %08lX\n", (ulong)rootfs_end_addr, end_addr);
840 + if (flash_sect_protect (0, rootfs_end_addr, end_addr))
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)
847 + if(strncmp((char *)flash_start,UBOOTCONFIG_COPY_HEADER,sizeof(UBOOTCONFIG_COPY_HEADER)) == 0)
849 + flash_sect_erase(flash_start,flash_start + sizeof(UBOOTCONFIG_COPY_HEADER),1);
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);
860 +#endif //UBOOT_ENV_COPY
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))
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-11-09 16:35:03.000000000 +0100
878 @@ -127,10 +127,15 @@
879 OBJDUMP = $(CROSS_COMPILE)objdump
880 RANLIB = $(CROSS_COMPILE)RANLIB
882 +ifneq (,$(findstring s,$(MAKEFLAGS)))
887 RELFLAGS= $(PLATFORM_RELFLAGS)
888 DBGFLAGS= -g # -DDEBUG
889 OPTFLAGS= -Os #-fomit-frame-pointer
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
899 +LDSCRIPT_BOOTSTRAP := $(TOPDIR)/board/$(BOARDDIR)/u-boot-bootstrap.lds
901 OBJCFLAGS += --gap-fill=0xff
903 gccincdir := $(shell $(CC) -print-file-name=include)
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) \
910 ifneq ($(OBJTREE),$(SRCTREE))
911 CPPFLAGS += -I$(OBJTREE)/include2 -I$(OBJTREE)/include
914 AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS)
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)
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 \
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
929 #########################################################################
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 $@ $<
941 $(CPP) $(AFLAGS) -o $@ $<
943 @@ -229,12 +245,20 @@
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 $@ $<
955 $(CPP) $(AFLAGS) -o $@ $<
957 $(CC) $(AFLAGS) -c -o $@ $<
959 $(CC) $(CFLAGS) -c -o $@ $<
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-11-09 16:35:03.000000000 +0100
969 videomodes.o w83c553f.o \
971 pxa_pcmcia.o mpc8xx_pcmcia.o tqm8xx_pcmcia.o \
973 + rpx_pcmcia.o ifx_sw.o
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-11-09 16:35:03.000000000 +0100
982 #define CP0_CAUSE $13
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
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
1021 * Bitfields in the R[23]000 cp0 status register.
1022 @@ -471,6 +493,14 @@
1023 #define CAUSEF_BD (1 << 31)
1026 + * Bits in the coprocessor 0 EBase register
1028 +#define EBASEB_CPUNUM 0
1029 +#define EBASEF_CPUNUM (0x3ff << EBASEB_CPUNUM)
1030 +#define EBASEB_EXPBASE 12
1031 +#define EBASEF_EXPBASE (0x3ffff << EBASEB_EXPBASE)
1034 * Bits in the coprozessor 0 config register.
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 */
1042 + * Bits in ErrCtl register
1044 +#define ECCB_WST 29
1045 +#define ECCF_WST (0x1 << ECCB_WST)
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-11-09 16:35:03.000000000 +0100
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 */
1058 #define CFG_CMD_ALL 0xFFFFFFFFFFFFFFFFULL /* ALL commands */
1062 CFG_CMD_UNIVERSE | \
1064 + CFG_CMD_DHRYSTONE | \
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-11-09 16:35:03.000000000 +0100
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-11-09 16:35:03.000000000 +0100
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-11-09 16:36:11.000000000 +0100
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);
1097 /* common/flash.c */
1099 #define MT2_MANUFACT 0x002C002C /* alternate MICRON manufacturer ID*/
1100 #define EXCEL_MANUFACT 0x004A004A /* Excel Semiconductor */
1102 - /* Micron Technologies (INTEL compat.) */
1103 +#define EON_ID_EN29LV320B 0x22f9
1104 +#define FLASH_29LV320B 0xE0
1105 +/* Micron Technologies (INTEL compat.) */
1106 #define MT_ID_28F400_T 0x44704470 /* 28F400B3 ID ( 4 M, top boot sector) */
1107 #define MT_ID_28F400_B 0x44714471 /* 28F400B3 ID ( 4 M, bottom boot sect) */
1109 @@ -299,6 +301,10 @@
1110 #define TOSH_ID_FVT160 0xC2 /* TC58FVT160 ID (16 M, top ) */
1111 #define TOSH_ID_FVB160 0x43 /* TC58FVT160 ID (16 M, bottom ) */
1113 +#define MX_ID_29LV320AB 0x22A822A8 /* MXIC MX29LV320AB ID (32 M, bottom ) joelin */
1114 +#define MX_ID_29LV160BB 0x22492249 /* MXIC MX29LV160BB ID (16 M, bottom ) joelin */
1115 +#define MX_ID_29LV640BB 0x22cb22cb /* MXIC MX29LV640BB ID (64 M, bottom ) joelin */
1117 /*-----------------------------------------------------------------------
1118 * Internal FLASH identification codes
1120 @@ -422,6 +428,10 @@
1121 #define FLASH_S29GL064M 0x00F0 /* Spansion S29GL064M-R6 */
1122 #define FLASH_S29GL128N 0x00F1 /* Spansion S29GL128N */
1124 +#define FLASH_29LV320AB 0x00B0 /* MXIC MX29LV320AB( 32M = 4M x 16 ) joelin 10/07/2004*/
1125 +#define FLASH_29LV160BB 0x00B1 /* MXIC MX29LV160BB( 16M = 2M x 16 ) joelin 11/22/2004*/
1126 +#define FLASH_29LV640BB 0x00B2 /* MXIC MX29LV640BB( 64M = 8M x 16 ) liupeng*/
1128 #define FLASH_UNKNOWN 0xFFFF /* unknown flash type */
1131 Index: u-boot-1.1.5/include/image.h
1132 ===================================================================
1133 --- u-boot-1.1.5.orig/include/image.h 2006-10-20 17:54:33.000000000 +0200
1134 +++ u-boot-1.1.5/include/image.h 2009-11-09 16:35:03.000000000 +0100
1136 #define IH_COMP_NONE 0 /* No Compression Used */
1137 #define IH_COMP_GZIP 1 /* gzip Compression Used */
1138 #define IH_COMP_BZIP2 2 /* bzip2 Compression Used */
1139 +#define IH_COMP_LZMA 3 /* lzma Compression Used */
1141 #define IH_MAGIC 0x27051956 /* Image Magic Number */
1142 #define IH_NMLEN 32 /* Image Name Length */
1143 Index: u-boot-1.1.5/include/syscall.h
1144 ===================================================================
1145 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1146 +++ u-boot-1.1.5/include/syscall.h 2009-11-09 16:35:03.000000000 +0100
1148 +#ifndef __MON_SYS_CALL_H__
1149 +#define __MON_SYS_CALL_H__
1151 +#ifndef __ASSEMBLY__
1153 +#include <common.h>
1155 +/* These are declarations of system calls available in C code */
1156 +int mon_getc(void);
1157 +int mon_tstc(void);
1158 +void mon_putc(const char);
1159 +void mon_puts(const char*);
1160 +void mon_printf(const char* fmt, ...);
1161 +void mon_install_hdlr(int, interrupt_handler_t*, void*);
1162 +void mon_free_hdlr(int);
1163 +void *mon_malloc(size_t);
1164 +void mon_free(void*);
1165 +void mon_udelay(unsigned long);
1166 +unsigned long mon_get_timer(unsigned long);
1168 +#endif /* ifndef __ASSEMBLY__ */
1170 +#define NR_SYSCALLS 11 /* number of syscalls */
1174 + * Make sure these functions are in the same order as they
1175 + * appear in the "examples/syscall.S" file !!!
1177 +#define SYSCALL_GETC 0
1178 +#define SYSCALL_TSTC 1
1179 +#define SYSCALL_PUTC 2
1180 +#define SYSCALL_PUTS 3
1181 +#define SYSCALL_PRINTF 4
1182 +#define SYSCALL_INSTALL_HDLR 5
1183 +#define SYSCALL_FREE_HDLR 6
1184 +#define SYSCALL_MALLOC 7
1185 +#define SYSCALL_FREE 8
1186 +#define SYSCALL_UDELAY 9
1187 +#define SYSCALL_GET_TIMER 10
1190 Index: u-boot-1.1.5/ld_uboot.conf
1191 ===================================================================
1192 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1193 +++ u-boot-1.1.5/ld_uboot.conf 2009-11-09 16:35:03.000000000 +0100
1197 + 0xA0B00000 "u-boot.bin" /* Download u-boot image */
1202 +}; /* Start u-boot image */
1203 Index: u-boot-1.1.5/lib_generic/Makefile
1204 ===================================================================
1205 --- u-boot-1.1.5.orig/lib_generic/Makefile 2006-10-20 17:54:33.000000000 +0200
1206 +++ u-boot-1.1.5/lib_generic/Makefile 2009-11-09 16:35:03.000000000 +0100
1208 COBJS = bzlib.o bzlib_crctable.o bzlib_decompress.o \
1209 bzlib_randtable.o bzlib_huffman.o \
1210 crc32.o ctype.o display_options.o ldiv.o \
1211 - string.o vsprintf.o zlib.o
1212 + string.o vsprintf.o zlib.o LzmaDecode.o LzmaWrapper.o
1214 SRCS := $(COBJS:.o=.c)
1215 OBJS := $(addprefix $(obj),$(COBJS))
1216 Index: u-boot-1.1.5/lib_mips/board.c
1217 ===================================================================
1218 --- u-boot-1.1.5.orig/lib_mips/board.c 2006-10-20 17:54:33.000000000 +0200
1219 +++ u-boot-1.1.5/lib_mips/board.c 2009-11-09 16:35:03.000000000 +0100
1222 #include <environment.h>
1224 +#ifdef CFG_BOOTSTRAP_CODE
1225 +//#include <asm/danube.h>
1226 +#undef CONFIG_MICROBZIP2
1228 +#ifdef CONFIG_BZIP2
1232 +#ifdef CONFIG_MICROBZIP2
1233 +#include <micro_bzlib.h>
1237 +#include <LzmaWrapper.h>
1239 +#endif //CFG_BOOTSTRAP_CODE
1241 DECLARE_GLOBAL_DATA_PTR;
1243 -#if ( ((CFG_ENV_ADDR+CFG_ENV_SIZE) < CFG_MONITOR_BASE) || \
1244 +#if ( ((CFG_ENV_ADDR+CFG_ENV_SIZE) < BOOTSTRAP_CFG_MONITOR_BASE) || \
1245 + (CFG_ENV_ADDR >= (BOOTSTRAP_CFG_MONITOR_BASE + CFG_MONITOR_LEN)) ) || \
1246 + defined(CFG_ENV_IS_IN_NVRAM) && defined(CFG_BOOTSTRAP_CODE)
1247 +#define TOTAL_MALLOC_LEN (CFG_MALLOC_LEN + CFG_ENV_SIZE)
1248 +#elif ( ((CFG_ENV_ADDR+CFG_ENV_SIZE) < CFG_MONITOR_BASE) || \
1249 (CFG_ENV_ADDR >= (CFG_MONITOR_BASE + CFG_MONITOR_LEN)) ) || \
1250 defined(CFG_ENV_IS_IN_NVRAM)
1251 #define TOTAL_MALLOC_LEN (CFG_MALLOC_LEN + CFG_ENV_SIZE)
1253 #define TOTAL_MALLOC_LEN CFG_MALLOC_LEN
1258 extern int timer_init(void);
1260 extern int incaip_set_cpuclk(void);
1262 +#ifdef CFG_BOOTSTRAP_CODE
1263 +extern ulong uboot_end_data_bootstrap;
1264 +extern ulong uboot_end_bootstrap;
1265 +#else //CFG_BOOTSTRAP_CODE
1266 extern ulong uboot_end_data;
1267 extern ulong uboot_end;
1268 +#endif //CFG_BOOTSTRAP_CODE
1270 ulong monitor_flash_len;
1272 -const char version_string[] =
1273 - U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
1274 +const char version_string[] = U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
1276 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1277 static char *failed = "*** failed ***\n";
1281 * Begin and End of memory area for malloc(), and current "brk"
1283 static ulong mem_malloc_end;
1284 static ulong mem_malloc_brk;
1288 * The Malloc area is immediately below the monitor copy in DRAM
1290 -static void mem_malloc_init (void)
1292 +#ifdef CFG_BOOTSTRAP_CODE
1293 +static void mem_malloc_init (ulong dest_addr) {
1294 +#else //CFG_BOOTSTRAP_CODE
1295 +static void mem_malloc_init (void) {
1296 ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
1298 +#endif //CFG_BOOTSTRAP_CODE
1299 mem_malloc_end = dest_addr;
1300 mem_malloc_start = dest_addr - TOTAL_MALLOC_LEN;
1301 mem_malloc_brk = mem_malloc_start;
1303 mem_malloc_end - mem_malloc_start);
1306 +#ifdef CFG_BOOTSTRAP_CODE
1307 +void *malloc(unsigned int size) {
1308 + if(size < (mem_malloc_end - mem_malloc_start)) {
1309 + mem_malloc_start += size;
1310 + debug ("malloc : size required = 0x%08lx and pointer = 0x%08lx\n",size,mem_malloc_start - size);
1311 + return (void *)(mem_malloc_start - size);
1316 +void *realloc(void *src,unsigned int size) {
1320 +void free(void *src) {
1323 +#endif //CFG_BOOTSTRAP_CODE
1325 void *sbrk (ptrdiff_t increment)
1327 ulong old = mem_malloc_brk;
1328 @@ -99,42 +143,58 @@
1330 int board_type = 0; /* use dummy arg */
1334 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1335 +#ifdef CONFIG_USE_DDR_RAM
1336 + puts ("DDR-DRAM: ");
1340 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1341 if ((gd->ram_size = initdram (board_type)) > 0) {
1342 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1343 print_size (gd->ram_size, "\n");
1344 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1347 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1349 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1353 +#if !defined(CFG_BOOTSTRAP_CODE) || defined(DEBUG_ENABLE_BOOTSTRAP_PRINTF)
1354 static int display_banner(void)
1357 printf ("\n\n%s\n\n", version_string);
1362 +#ifndef CFG_BOOTSTRAP_CODE
1363 static void display_flash_config(ulong size)
1366 print_size (size, "\n");
1368 +#endif //CFG_BOOTSTRAP_CODE
1371 +#if !defined(CFG_BOOTSTRAP_CODE) || defined(DEBUG_ENABLE_BOOTSTRAP_PRINTF)
1372 static int init_baudrate (void)
1374 +#ifndef CFG_BOOTSTRAP_CODE
1375 char tmp[64]; /* long enough for environment variables */
1376 int i = getenv_r ("baudrate", tmp, sizeof (tmp));
1378 gd->baudrate = (i > 0)
1379 ? (int) simple_strtoul (tmp, NULL, 10)
1382 +#else //CFG_BOOTSTRAP_CODE
1383 + gd->baudrate = CONFIG_BAUDRATE;
1384 +#endif //CFG_BOOTSTRAP_CODE
1391 * Breath some life into the board...
1392 @@ -159,27 +219,49 @@
1393 typedef int (init_fnc_t) (void);
1395 init_fnc_t *init_sequence[] = {
1396 +#ifdef CFG_BOOTSTRAP_CODE
1399 + //env_init, /* initialize environment */
1400 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1401 + init_baudrate, /* initialze baudrate settings */
1402 + serial_init, /* serial communications setup */
1404 + display_banner, /* say that we are here */
1406 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1409 +#else /********** CFG_BOOTSTRAP_CODE **********/
1411 - env_init, /* initialize environment */
1412 -#ifdef CONFIG_INCA_IP
1413 - incaip_set_cpuclk, /* set cpu clock according to environment variable */
1415 init_baudrate, /* initialze baudrate settings */
1416 serial_init, /* serial communications setup */
1418 display_banner, /* say that we are here */
1421 + env_init, /* initialize environment */
1423 +#endif //CFG_BOOTSTRAP_CODE
1426 +#ifdef CFG_BOOTSTRAP_CODE
1427 +extern void bootstrap_relocate_code(ulong addr_sp, gd_t *id, ulong addr);
1429 +void bootstrap_board_init_f(ulong bootflag)
1431 void board_init_f(ulong bootflag)
1436 init_fnc_t **init_fnc_ptr;
1437 - ulong addr, addr_sp, len = (ulong)&uboot_end - CFG_MONITOR_BASE;
1438 +#ifdef CFG_BOOTSTRAP_CODE
1439 + ulong addr, addr_sp, len = (ulong)&uboot_end_bootstrap - BOOTSTRAP_CFG_MONITOR_BASE;
1440 + ulong lzmaImageaddr = 0;
1441 +#else //CFG_BOOTSTRAP_CODE
1442 + ulong addr, addr_sp, len = CFG_MONITOR_LEN;
1443 +#endif //CFG_BOOTSTRAP_CODE
1445 #ifdef CONFIG_PURPLE
1446 void copy_code (ulong);
1447 @@ -219,13 +301,12 @@
1449 addr &= ~(16 * 1024 - 1);
1451 - debug ("Reserving %ldk for U-Boot at: %08lx\n", len >> 10, addr);
1452 + debug ("Reserving %d Bytes for U-Boot at: %08lx\n", len, addr);
1454 /* Reserve memory for malloc() arena.
1456 addr_sp = addr - TOTAL_MALLOC_LEN;
1457 - debug ("Reserving %dk for malloc() at: %08lx\n",
1458 - TOTAL_MALLOC_LEN >> 10, addr_sp);
1459 + debug ("Reserving %d Bytes for malloc() at: %08lx\n", TOTAL_MALLOC_LEN, addr_sp);
1462 * (permanently) allocate a Board Info struct
1463 @@ -234,20 +315,17 @@
1464 addr_sp -= sizeof(bd_t);
1465 bd = (bd_t *)addr_sp;
1467 - debug ("Reserving %d Bytes for Board Info at: %08lx\n",
1468 - sizeof(bd_t), addr_sp);
1469 + debug ("Reserving %d Bytes for Board Info at: %08lx\n", sizeof(bd_t), addr_sp);
1471 addr_sp -= sizeof(gd_t);
1472 id = (gd_t *)addr_sp;
1473 - debug ("Reserving %d Bytes for Global Data at: %08lx\n",
1474 - sizeof (gd_t), addr_sp);
1475 + debug ("Reserving %d Bytes for Global Data at: %08lx\n", sizeof (gd_t), addr_sp);
1477 /* Reserve memory for boot params.
1479 addr_sp -= CFG_BOOTPARAMS_LEN;
1480 bd->bi_boot_params = addr_sp;
1481 - debug ("Reserving %dk for boot params() at: %08lx\n",
1482 - CFG_BOOTPARAMS_LEN >> 10, addr_sp);
1483 + debug ("Reserving %dk for boot params() at: %08lx\n", CFG_BOOTPARAMS_LEN >> 10, addr_sp);
1486 * Finally, we set up a new (bigger) stack.
1487 @@ -279,7 +357,16 @@
1491 +#ifdef CFG_BOOTSTRAP_CODE
1492 + lzmaImageaddr = (ulong)&uboot_end_data_bootstrap;
1493 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1494 + puts("\n BOOTSTRAP: relocate_code start");
1495 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1496 + bootstrap_relocate_code (addr_sp, id, addr);
1497 +#else //CFG_BOOTSTRAP_CODE
1498 + puts("\n relocate_code start");
1499 relocate_code (addr_sp, id, addr);
1500 +#endif //CFG_BOOTSTRAP_CODE
1502 /* NOTREACHED - relocate_code() does not return */
1504 @@ -292,7 +379,110 @@
1506 ************************************************************************
1508 +#ifdef CFG_BOOTSTRAP_CODE
1509 +void bootstrap_board_init_r (gd_t *id, ulong dest_addr) {
1512 + ulong data, len, checksum;
1514 + image_header_t header;
1515 + image_header_t *hdr = &header;
1516 + unsigned int destLen;
1519 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1520 + puts("\n BOOTSTRAP: relocate_code finish.\n");
1521 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1523 + /* initialize malloc() area */
1524 + mem_malloc_init(dest_addr);
1526 + addr = (char *)(BOOTSTRAP_CFG_MONITOR_BASE + ((ulong)&uboot_end_data_bootstrap - dest_addr));
1527 + memmove (&header, (char *)addr, sizeof(image_header_t));
1529 + if (ntohl(hdr->ih_magic) != IH_MAGIC) {
1530 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1531 + printf ("Bad Magic Number at address 0x%08lx\n",addr);
1532 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1536 + data = (ulong)&header;
1537 + len = sizeof(image_header_t);
1539 + checksum = ntohl(hdr->ih_hcrc);
1541 + if (crc32 (0, (unsigned char *)data, len) != checksum) {
1542 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1543 + printf ("Bad Header Checksum\n");
1544 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1548 + data = addr + sizeof(image_header_t);
1549 + len = ntohl(hdr->ih_size);
1550 + len_ptr = (ulong *)data;
1552 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1553 + debug ("Disabling all the interrupts\n");
1554 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1555 + disable_interrupts();
1557 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1558 + debug (" Uncompressing UBoot Image ... \n" );
1559 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1561 + * If we've got less than 4 MB of malloc() space,
1562 + * use slower decompression algorithm which requires
1563 + * at most 2300 KB of memory.
1567 +#ifdef CONFIG_BZIP2
1568 + i = BZ2_bzBuffToBuffDecompress ((char*)ntohl(hdr->ih_load),
1569 + 0x400000, (char *)data, len,
1570 + CFG_MALLOC_LEN < (4096 * 1024), 0);
1572 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1573 + printf ("BUNZIP2 ERROR %d - must RESET board to recover\n", i);
1574 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1577 +#elif CONFIG_MICROBZIP2
1578 + i = micro_bzBuffToBuffDecompress ((char*)ntohl(hdr->ih_load),
1579 + &destLen, (char *)data, len,
1580 + CFG_MALLOC_LEN < (4096 * 1024), 0);
1581 + if (i != RETVAL_OK) {
1582 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1583 + printf ("MICRO_BUNZIP2 ERROR %d - must RESET board to recover\n", i);
1584 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1588 + i = lzma_inflate ((unsigned char *)data, len, (unsigned char*)ntohl(hdr->ih_load), &destLen);
1589 + if (i != LZMA_RESULT_OK) {
1590 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1591 + printf ("LZMA ERROR %d - must RESET board to recover\n", i);
1592 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1596 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1597 + printf ("NONE Compressing u-boot body!!\n");
1598 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1599 + memmove ((void *)ntohl(hdr->ih_load), (uchar *)data, len);
1602 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1603 + debug (" Uncompression completed successfully with destLen %d.\n ",destLen );
1604 + debug ("Head: Jumping to u-boot in the ram at 0x%08lx\n", CFG_MONITOR_BASE);
1605 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1607 + fn = ntohl(hdr->ih_load);
1611 +#else //CFG_BOOTSTRAP_CODE
1612 void board_init_r (gd_t *id, ulong dest_addr)
1619 + puts("\n relocate_code finish.\n");
1622 gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
1624 @@ -321,12 +513,10 @@
1627 addr = (ulong) (cmdtp->cmd) + gd->reloc_off;
1629 - printf ("Command \"%s\": 0x%08lx => 0x%08lx\n",
1630 - cmdtp->name, (ulong) (cmdtp->cmd), addr);
1633 - (int (*)(struct cmd_tbl_s *, int, int, char *[]))addr;
1635 + debug ("Command \"%s\": 0x%08lx => 0x%08lx\n", cmdtp->name, (ulong) (cmdtp->cmd), addr);
1637 + cmdtp->cmd = (int (*)(struct cmd_tbl_s *, int, int, char *[]))addr;
1639 addr = (ulong)(cmdtp->name) + gd->reloc_off;
1640 cmdtp->name = (char *)addr;
1641 @@ -363,7 +553,13 @@
1642 /* initialize malloc() area */
1645 +#if (CONFIG_COMMANDS & CFG_CMD_NAND)
1646 + nand_init(); /* go init the NAND */
1650 + spi_init_f(); /* go init the SPI flash */
1652 /* relocate environment function pointers etc. */
1655 @@ -424,9 +620,12 @@
1657 /* NOTREACHED - no way out of command loop except booting */
1659 +#endif //CFG_BOOTSTRAP_CODE
1663 +#ifdef DEBUG_ENABLE_BOOTSTRAP_PRINTF
1664 puts ("### ERROR ### Please RESET the board ###\n");
1665 +#endif //DEBUG_ENABLE_BOOTSTRAP_PRINTF
1668 Index: u-boot-1.1.5/lib_mips/time.c
1669 ===================================================================
1670 --- u-boot-1.1.5.orig/lib_mips/time.c 2006-10-20 17:54:33.000000000 +0200
1671 +++ u-boot-1.1.5/lib_mips/time.c 2009-11-09 16:35:03.000000000 +0100
1676 +#ifndef CFG_BOOTSTRAP_CODE
1677 +void mdelay (unsigned long msec)
1680 + for(i=0;i<msec;i++)
1690 * This function is derived from PowerPC code (read timebase as long long).
1691 * On MIPS it just returns the timer value.
1692 Index: u-boot-1.1.5/net/eth.c
1693 ===================================================================
1694 --- u-boot-1.1.5.orig/net/eth.c 2006-10-20 17:54:33.000000000 +0200
1695 +++ u-boot-1.1.5/net/eth.c 2009-11-09 16:35:03.000000000 +0100
1697 #include <command.h>
1700 +#if defined(CONFIG_IFX_MIPS)
1701 +# include "ifx_eth.c"
1704 #if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI)
1707 extern int skge_initialize(bd_t*);
1708 extern int tsec_initialize(bd_t*, int, char *);
1709 extern int npe_initialize(bd_t *);
1710 +#if defined(CONFIG_IFX_MIPS)
1711 + IFX_ETH_INITIALIZE_EXTERN
1714 static struct eth_device *eth_devices, *eth_current;
1717 #if defined(CONFIG_RTL8169)
1718 rtl8169_initialize(bis);
1721 +#if defined(CONFIG_IFX_MIPS)
1722 + IFX_ETH_INITIALIZE(bis)
1725 puts ("No ethernet found.\n");
1727 Index: u-boot-1.1.5/tools/mkimage.c
1728 ===================================================================
1729 --- u-boot-1.1.5.orig/tools/mkimage.c 2006-10-20 17:54:33.000000000 +0200
1730 +++ u-boot-1.1.5/tools/mkimage.c 2009-11-09 16:35:03.000000000 +0100
1733 #include <netinet/in.h> /* for host / network byte order conversions */
1735 +#include <sys/types.h>
1736 #include <sys/mman.h>
1737 #include <sys/stat.h>
1740 { IH_COMP_NONE, "none", "uncompressed", },
1741 { IH_COMP_BZIP2, "bzip2", "bzip2 compressed", },
1742 { IH_COMP_GZIP, "gzip", "gzip compressed", },
1743 + { IH_COMP_LZMA, "lzma", "lzma compressed", },
1750 /* We're a bit of paranoid */
1751 -#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__)
1752 +#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__) && !defined(__APPLE__)
1753 (void) fdatasync (ifd);
1757 (void) munmap((void *)ptr, sbuf.st_size);
1759 /* We're a bit of paranoid */
1760 -#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__)
1761 +#if defined(_POSIX_SYNCHRONIZED_IO) && !defined(__sun__) && !defined(__FreeBSD__) && !defined(__APPLE__)
1762 (void) fdatasync (ifd);
1765 Index: u-boot-1.1.5/cpu/mips/cache.S
1766 ===================================================================
1767 --- u-boot-1.1.5.orig/cpu/mips/cache.S 2006-10-20 17:54:33.000000000 +0200
1768 +++ u-boot-1.1.5/cpu/mips/cache.S 2009-11-09 16:35:03.000000000 +0100
1770 #include <asm/mipsregs.h>
1771 #include <asm/addrspace.h>
1772 #include <asm/cacheops.h>
1774 +#if defined(CONFIG_IFX_MIPS)
1775 +# include "danube/ifx_cache.S"
1778 /* 16KB is the maximum size of instruction and data caches on
1783 mtc0 zero, CP0_TAGLO
1784 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CACHE_EXTRA_INVALID_TAG)
1785 + IFX_CACHE_EXTRA_INVALID_TAG
1789 * The caches are probably in an indeterminate state,
1792 icacheopn(a0,a1,a2,a3,121,(Index_Store_Tag_I,Fill))
1794 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CACHE_EXTRA_OPERATION)
1795 + IFX_CACHE_EXTRA_OPERATION
1797 /* To support Orion/R4600, we initialise the data cache in 3 passes.
1801 move a3, t5 # dcacheLineSize
1803 icacheop(a0,a1,a2,a3,Index_Store_Tag_D)
1807 .end mips_cache_reset
1808 Index: u-boot-1.1.5/cpu/mips/config.mk
1809 ===================================================================
1810 --- u-boot-1.1.5.orig/cpu/mips/config.mk 2006-10-20 17:54:33.000000000 +0200
1811 +++ u-boot-1.1.5/cpu/mips/config.mk 2009-11-09 16:35:03.000000000 +0100
1813 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1817 -$(CROSS_COMPILE)as --version|grep "GNU assembler"|awk '{print $$3}'|awk -F . '{print $$2}')
1818 -MIPSFLAGS=$(shell \
1819 -if [ "$v" -lt "14" ]; then \
1820 - echo "-mcpu=4kc"; \
1822 - echo "-march=4kc -mtune=4kc"; \
1825 +ifndef PLATFORM_CPU
1826 +PLATFORM_CPU = mips32
1829 +MIPSFLAGS +=$(call cc-option,-march=$(PLATFORM_CPU) -mtune=$(PLATFORM_CPU),-mcpu=$(PLATFORM_CPU))
1831 +ifeq ($(CROSS_COMPILE_UCLIBC),1)
1832 +ifneq (,$(findstring mipsel,$(CROSS_COMIPLE)))
1838 ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
1845 MIPSFLAGS += $(ENDIANNESS) -mabicalls
1847 Index: u-boot-1.1.5/cpu/mips/cpu.c
1848 ===================================================================
1849 --- u-boot-1.1.5.orig/cpu/mips/cpu.c 2006-10-20 17:54:33.000000000 +0200
1850 +++ u-boot-1.1.5/cpu/mips/cpu.c 2009-11-09 16:35:03.000000000 +0100
1854 #include <command.h>
1855 -#include <asm/inca-ip.h>
1856 +#if defined(CONFIG_INCA_IP)
1857 +# include <asm/inca-ip.h>
1858 +#elif defined(CONFIG_IFX_MIPS)
1859 +# include <asm/danube.h>
1860 +# include "danube/ifx_cpu.c"
1862 #include <asm/mipsregs.h>
1864 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
1866 void (*f)(void) = (void *) 0xbfc00000;
1869 +#elif defined(CONFIG_IFX_MIPS)
1872 fprintf(stderr, "*** reset failed ***\n");
1874 Index: u-boot-1.1.5/cpu/mips/incaip_clock.c
1875 ===================================================================
1876 --- u-boot-1.1.5.orig/cpu/mips/incaip_clock.c 2006-10-20 17:54:33.000000000 +0200
1877 +++ u-boot-1.1.5/cpu/mips/incaip_clock.c 2009-11-09 16:35:03.000000000 +0100
1882 -#include <asm/inca-ip.h>
1884 +#ifdef CONFIG_INCA_IP
1885 +#include <asm/inca-ip.h>
1887 /*******************************************************************************
1894 +#endif /* CONFIG_INCA_IP */
1895 Index: u-boot-1.1.5/cpu/mips/start.S
1896 ===================================================================
1897 --- u-boot-1.1.5.orig/cpu/mips/start.S 2006-10-20 17:54:33.000000000 +0200
1898 +++ u-boot-1.1.5/cpu/mips/start.S 2009-11-09 16:35:03.000000000 +0100
1900 #include <version.h>
1901 #include <asm/regdef.h>
1902 #include <asm/mipsregs.h>
1904 +#if defined(CONFIG_IFX_MIPS)
1905 +# include "danube/ifx_start.S"
1908 #define RVECENT(f,n) \
1915 +#ifdef CFG_BOOTSTRAP_CODE
1916 + .globl _start_bootstrap
1921 +#ifdef CFG_BOOTSTRAP_CODE
1926 RVECENT(reset,0) /* U-boot entry point */
1927 RVECENT(reset,1) /* software reboot */
1928 -#if defined(CONFIG_INCA_IP)
1929 +#if defined(CONFIG_INCA_IP) || defined(CONFIG_INCA_IP2)
1930 .word INFINEON_EBU_BOOTCFG /* EBU init code, fetched during booting */
1931 .word 0x00000000 /* phase of the flash */
1932 +#elif defined(CONFIG_IFX_MIPS) && defined(IFX_EBU_BOOTCFG_DWORD)
1933 + IFX_EBU_BOOTCFG_DWORD
1934 #elif defined(CONFIG_PURPLE)
1935 .word INFINEON_EBU_BOOTCFG /* EBU init code, fetched during booting */
1936 .word INFINEON_EBU_BOOTCFG /* EBU init code, fetched during booting */
1938 * 128 * 8 == 1024 == 0x400
1939 * so this is address R_VEC+0x400 == 0xbfc00400
1941 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_MORE_RESERVED_VECTORS)
1942 + IFX_MORE_RESERVED_VECTORS
1944 #ifdef CONFIG_PURPLE
1947 @@ -205,8 +219,12 @@
1950 #endif /* CONFIG_PURPLE */
1951 +#endif /* CONFIG_IFX_MIPS */
1954 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_RESET_PRECHECK)
1955 + IFX_RESET_PRECHECK
1958 /* Clear watch registers.
1960 @@ -226,6 +244,10 @@
1961 /* CAUSE register */
1962 mtc0 zero, CP0_CAUSE
1964 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CPU_EXTRA_INIT)
1965 + IFX_CPU_EXTRA_INIT
1969 mtc0 zero, CP0_COUNT
1970 mtc0 zero, CP0_COMPARE
1971 @@ -252,12 +274,26 @@
1975 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CPU1_SUPPORT) && defined(IFX_SKIP_LOWLEVEL_INIT)
1976 + IFX_SKIP_LOWLEVEL_INIT
1978 +#ifdef CFG_BOOTSTRAP_CODE
1979 /* Initialize any external memory.
1981 la t9, lowlevel_init
1985 +lowlevel_init_done:
1987 + beq s0, zero, init_cache_0
1990 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CPU1_SUPPORT) && defined(IFX_CPU1_INIT)
1995 /* Initialize caches...
1997 la t9, mips_cache_reset
1998 @@ -266,7 +302,11 @@
2000 /* ... and enable them.
2002 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CACHE_OPER_MODE)
2003 + IFX_CACHE_OPER_MODE
2005 li t0, CONF_CM_CACHABLE_NONCOHERENT
2010 @@ -280,13 +320,38 @@
2011 li t0, CFG_SDRAM_BASE + CFG_INIT_SP_OFFSET
2014 +#if defined(CONFIG_IFX_MIPS) && defined(IFX_CPU1_SUPPORT) && defined(IFX_BOOT_CLEAR)
2018 +#ifdef CFG_BOOTSTRAP_CODE
2019 + la t9, bootstrap_board_init_f
2026 +#ifdef CFG_BOOTSTRAP_CODE
2028 + * void jump_unconditional (addr)
2029 + * This function simply jumps to the location pointed by a0.
2030 + * a0 = target_location
2033 + .globl jump_unconditional
2034 + .ent jump_unconditional
2035 +jump_unconditional:
2039 + .end jump_unconditional
2044 * void relocate_code (addr_sp, gd, addr_moni)
2045 + * void bootstrap_relocate_code (addr_sp, gd, addr_moni)
2047 * This "function" does not return, instead it continues in RAM
2048 * after relocating the monitor code.
2049 @@ -295,12 +360,22 @@
2051 * a2 = destination address
2053 +#ifdef CFG_BOOTSTRAP_CODE
2054 + .globl bootstrap_relocate_code
2055 + .ent bootstrap_relocate_code
2056 +bootstrap_relocate_code:
2058 .globl relocate_code
2062 move sp, a0 /* Set new stack pointer */
2064 +#ifdef CFG_BOOTSTRAP_CODE
2065 + li t0, BOOTSTRAP_CFG_MONITOR_BASE
2067 li t0, CFG_MONITOR_BASE
2070 lw t2, -12(t3) /* t2 <-- uboot_end_data */
2072 @@ -311,7 +386,11 @@
2073 * New GOT-PTR = (old GOT-PTR - CFG_MONITOR_BASE) + Destination Address
2076 +#ifdef CFG_BOOTSTRAP_CODE
2077 + sub gp, BOOTSTRAP_CFG_MONITOR_BASE
2079 sub gp, CFG_MONITOR_BASE
2081 add gp, a2 /* gp now adjusted */
2082 sub t6, gp, t6 /* t6 <-- relocation offset */
2084 @@ -337,12 +416,21 @@
2086 /* Jump to where we've relocated ourselves.
2088 +#ifdef CFG_BOOTSTRAP_CODE
2089 + addi t0, a2, in_ram - _start_bootstrap
2091 addi t0, a2, in_ram - _start
2096 +#ifdef CFG_BOOTSTRAP_CODE
2097 + .word uboot_end_data_bootstrap
2098 + .word uboot_end_bootstrap
2100 .word uboot_end_data
2103 .word num_got_entries
2106 @@ -374,12 +462,19 @@
2107 sw zero, 0(t1) /* delay slot */
2110 +#ifdef CFG_BOOTSTRAP_CODE
2111 + la t9, bootstrap_board_init_r
2116 move a1, a2 /* delay slot */
2118 +#ifdef CFG_BOOTSTRAP_CODE
2119 + .end bootstrap_relocate_code
2125 /* Exception handlers.
2127 @@ -388,3 +483,20 @@
2133 +#ifdef CFG_BOOTSTRAP_CODE
2136 +#endif /* CFG_BOOTSTRAP_CODE */
2140 + /* Additional handlers.
2142 +#if defined(CONFIG_IFX_MIPS)
2143 +#if defined(IFX_MIPS_HANDLER_1)
2144 +ifx_mips_handler_1:
2145 + IFX_MIPS_HANDLER_1
2148 Index: u-boot-1.1.5/tools/Makefile
2149 ===================================================================
2150 --- u-boot-1.1.5.orig/tools/Makefile 2006-10-20 17:54:33.000000000 +0200
2151 +++ u-boot-1.1.5/tools/Makefile 2009-11-09 16:35:03.000000000 +0100
2156 -BIN_FILES = img2srec$(SFX) mkimage$(SFX) envcrc$(SFX) gen_eth_addr$(SFX) bmp_logo$(SFX)
2157 +BIN_FILES = mkimage$(SFX)
2159 OBJ_LINKS = environment.o crc32.o
2160 OBJ_FILES = img2srec.o mkimage.o envcrc.o gen_eth_addr.o bmp_logo.o