diff options
author | wdenk <wdenk> | 2003-12-07 18:32:37 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2003-12-07 18:32:37 +0000 |
commit | a2663ea4fc9d18cb8000c97ed92c3c668eda8e04 (patch) | |
tree | 9eb328b497d6f482e5571635fa00b1d0cae5b185 | |
parent | ef5a9672c778e22ecb522db625b5df78ea40ed23 (diff) |
* Patches by David Müller, 14 Nov 2003:
- board/mpl/common/common_util.c
* implement support for BZIP2 compressed images
* various cleanups (printf -> puts, ...)
- board/mpl/common/flash.c
* report correct errors to upper layers
* check the erase fail and VPP low bits in status reg
- board/mpl/vcma9/cmd_vcma9.c
- board/mpl/vcma9/flash.c
* various cleanups (printf -> puts, ...)
- common/cmd_usb.c
* fix typo in comment
- cpu/arm920t/usb_ohci.c
* support for S3C2410 is missing in #if line
- drivers/cs8900.c
* reinit some registers in case of error (cable missing, ...)
- fs/fat/fat.c
* support for USB/MMC devices is missing in #if line
- include/configs/MIP405.h
- include/configs/PIP405.h
* enable BZIP2 support
* enlarge malloc space to 1MiB because of BZIP2 support
- include/configs/VCMA9.h
* enable BZIP2 support
* enlarge malloc space to 1MiB because of BZIP2 support
* enable USB support
- lib_arm/armlinux.c
* change calling convention of ARM Linux kernel as
described on http://www.arm.linux.org.uk/developer/booting.php
* Patch by Thomas Lange, 14 Nov 2003:
Split dbau1x00 into dbau1000, dbau1100 and dbau1500 configs to
support all these AMD boards.
* Patch by Thomas Lange, 14 Nov 2003:
Workaround for mips au1x00 physical memory accesses (the au1x00
uses a 36 bit bus internally and cannot access physical memory
directly. Use the uncached SDRAM address instead of the physical
one.)
-rw-r--r-- | CHANGELOG | 40 | ||||
-rw-r--r-- | MAKEALL | 2 | ||||
-rw-r--r-- | Makefile | 18 | ||||
-rw-r--r-- | board/dbau1x00/dbau1x00.c | 29 | ||||
-rw-r--r-- | board/mpl/common/common_util.c | 188 | ||||
-rw-r--r-- | board/mpl/common/flash.c | 29 | ||||
-rw-r--r-- | board/mpl/vcma9/cmd_vcma9.c | 10 | ||||
-rw-r--r-- | board/mpl/vcma9/config.mk | 2 | ||||
-rw-r--r-- | board/mpl/vcma9/flash.c | 22 | ||||
-rw-r--r-- | board/mpl/vcma9/vcma9.c | 4 | ||||
-rw-r--r-- | common/cmd_usb.c | 2 | ||||
-rw-r--r-- | cpu/arm920t/usb_ohci.c | 7 | ||||
-rw-r--r-- | cpu/mips/au1x00_eth.c | 15 | ||||
-rw-r--r-- | drivers/cs8900.c | 39 | ||||
-rw-r--r-- | fs/fat/fat.c | 3 | ||||
-rw-r--r-- | include/asm-mips/addrspace.h | 12 | ||||
-rw-r--r-- | include/configs/MIP405.h | 7 | ||||
-rw-r--r-- | include/configs/PIP405.h | 7 | ||||
-rw-r--r-- | include/configs/VCMA9.h | 30 | ||||
-rw-r--r-- | include/configs/dbau1x00.h | 15 | ||||
-rw-r--r-- | lib_arm/armlinux.c | 6 | ||||
-rw-r--r-- | lib_mips/mips_linux.c | 4 |
22 files changed, 338 insertions, 153 deletions
@@ -2,6 +2,46 @@ Changes since U-Boot 1.0.0: ====================================================================== +* Patches by David Müller, 14 Nov 2003: + - board/mpl/common/common_util.c + * implement support for BZIP2 compressed images + * various cleanups (printf -> puts, ...) + - board/mpl/common/flash.c + * report correct errors to upper layers + * check the erase fail and VPP low bits in status reg + - board/mpl/vcma9/cmd_vcma9.c + - board/mpl/vcma9/flash.c + * various cleanups (printf -> puts, ...) + - common/cmd_usb.c + * fix typo in comment + - cpu/arm920t/usb_ohci.c + * support for S3C2410 is missing in #if line + - drivers/cs8900.c + * reinit some registers in case of error (cable missing, ...) + - fs/fat/fat.c + * support for USB/MMC devices is missing in #if line + - include/configs/MIP405.h + - include/configs/PIP405.h + * enable BZIP2 support + * enlarge malloc space to 1MiB because of BZIP2 support + - include/configs/VCMA9.h + * enable BZIP2 support + * enlarge malloc space to 1MiB because of BZIP2 support + * enable USB support + - lib_arm/armlinux.c + * change calling convention of ARM Linux kernel as + described on http://www.arm.linux.org.uk/developer/booting.php + +* Patch by Thomas Lange, 14 Nov 2003: + Split dbau1x00 into dbau1000, dbau1100 and dbau1500 configs to + support all these AMD boards. + +* Patch by Thomas Lange, 14 Nov 2003: + Workaround for mips au1x00 physical memory accesses (the au1x00 + uses a 36 bit bus internally and cannot access physical memory + directly. Use the uncached SDRAM address instead of the physical + one.) + * Patch by Xue Ligong (Joe), 13 Nov 2003: add Realtek 8019 ethernet driver @@ -157,7 +157,7 @@ LIST_mips4kc="incaip" LIST_mips5kc="purple" -LIST_au1x00="dbau1x00" +LIST_au1x00="dbau1000 dbau1100 dbau1500" LIST_mips="${LIST_mips4kc} ${LIST_mips5kc} ${LIST_au1x00}" @@ -987,10 +987,22 @@ DK1C20_config: unconfig ######################################################################### -## MIPS32 AU1000 +## MIPS32 AU1X00 ######################################################################### -dbau1x00_config : unconfig - @./mkconfig $(@:_config=) mips mips dbau1x00 +dbau1000_config : unconfig + @ >include/config.h + @echo "#define CONFIG_DBAU1000 1" >>include/config.h + @./mkconfig -a dbau1x00 mips mips dbau1x00 + +dbau1100_config : unconfig + @ >include/config.h + @echo "#define CONFIG_DBAU1100 1" >>include/config.h + @./mkconfig -a dbau1x00 mips mips dbau1x00 + +dbau1500_config : unconfig + @ >include/config.h + @echo "#define CONFIG_DBAU1500 1" >>include/config.h + @./mkconfig -a dbau1x00 mips mips dbau1x00 ######################################################################### ######################################################################### diff --git a/board/dbau1x00/dbau1x00.c b/board/dbau1x00/dbau1x00.c index 3b6fcec1c8..8fcbd812a5 100644 --- a/board/dbau1x00/dbau1x00.c +++ b/board/dbau1x00/dbau1x00.c @@ -39,6 +39,13 @@ long int initdram(int board_type) /* In cpu/mips/cpu.c */ void write_one_tlb( int index, u32 pagemask, u32 hi, u32 low0, u32 low1 ); +#ifdef CONFIG_DBAU1100 +#warning "FIXME Check that bcsr is the same as dbau1000 board!" +#endif +#ifdef CONFIG_DBAU1500 +#warning "FIXME Check that bcsr is the same as dbau1000 board!" +#endif + int checkboard (void) { u16 status; @@ -51,14 +58,24 @@ int checkboard (void) proc_id = read_32bit_cp0_register(CP0_PRID); - switch(proc_id>>24){ + switch (proc_id >> 24) { case 0: - puts("Board: Merlot (DbAu1000)\n"); - printf("CPU: Au1000 396 MHz, id: 0x%02x, rev: 0x%02x\n", - (proc_id>>8)&0xFF,proc_id&0xFF); - break; + puts ("Board: Merlot (DbAu1000)\n"); + printf ("CPU: Au1000 396 MHz, id: 0x%02x, rev: 0x%02x\n", + (proc_id >> 8) & 0xFF, proc_id & 0xFF); + break; + case 1: + puts ("Board: DbAu1500\n"); + printf ("CPU: Au1500, id: 0x%02x, rev: 0x%02x\n", + (proc_id >> 8) & 0xFF, proc_id & 0xFF); + break; + case 2: + puts ("Board: DbAu1100\n"); + printf ("CPU: Au1100, id: 0x%02x, rev: 0x%02x\n", + (proc_id >> 8) & 0xFF, proc_id & 0xFF); + break; default: - printf("Unsupported cpu %d, proc_id=0x%x\n",proc_id>>24,proc_id); + printf ("Unsupported cpu %d, proc_id=0x%x\n", proc_id >> 24, proc_id); } #ifdef CONFIG_IDE_PCMCIA /* Enable 3.3 V on slot 0 ( VCC ) diff --git a/board/mpl/common/common_util.c b/board/mpl/common/common_util.c index 30dcdadde0..17871d2a1b 100644 --- a/board/mpl/common/common_util.c +++ b/board/mpl/common/common_util.c @@ -31,6 +31,8 @@ #include <i2c.h> #include <devices.h> #include <pci.h> +#include <malloc.h> +#include <bzlib.h> #ifdef CONFIG_PIP405 #include "../pip405/pip405.h" @@ -41,73 +43,73 @@ #include <405gp_pci.h> #endif -extern int gunzip (void *, int, unsigned char *, int *); -extern int mem_test(unsigned long start, unsigned long ramsize, int quiet); +extern int gunzip(void *, int, uchar *, int *); +extern int mem_test(ulong start, ulong ramsize, int quiet); -#define I2C_BACKUP_ADDR 0x7C00 /* 0x200 bytes for backup */ -#if defined(CONFIG_PIP405) || defined(CONFIG_MIP405) -#define IMAGE_SIZE 0x80000 -#elif defined(CONFIG_VCMA9) -#define IMAGE_SIZE 0x40000 /* ugly, but it works for now */ -#endif +#define I2C_BACKUP_ADDR 0x7C00 /* 0x200 bytes for backup */ +#define IMAGE_SIZE CFG_MONITOR_LEN /* ugly, but it works for now */ extern flash_info_t flash_info[]; /* info for FLASH chips */ static image_header_t header; -int mpl_prg(unsigned long src,unsigned long size) +static int +mpl_prg(uchar *src, ulong size) { - unsigned long start; + ulong start; flash_info_t *info; - int i,rc; + int i, rc; #if defined(CONFIG_PIP405) || defined(CONFIG_MIP405) char *copystr = (char *)src; - unsigned long *magic = (unsigned long *)src; + ulong *magic = (ulong *)src; #endif info = &flash_info[0]; #if defined(CONFIG_PIP405) || defined(CONFIG_MIP405) - if(ntohl(magic[0]) != IH_MAGIC) { - printf("Bad Magic number\n"); + if (ntohl(magic[0]) != IH_MAGIC) { + puts("Bad Magic number\n"); return -1; } /* some more checks before we delete the Flash... */ /* Checking the ISO_STRING prevents to program a * wrong Firmware Image into the flash. */ - i=4; /* skip Magic number */ - while(1) { - if(strncmp(©str[i],"MEV-",4)==0) + i = 4; /* skip Magic number */ + while (1) { + if (strncmp(©str[i], "MEV-", 4) == 0) break; - if(i++>=0x100) { - printf("Firmware Image for unknown Target\n"); + if (i++ >= 0x100) { + puts("Firmware Image for unknown Target\n"); return -1; } } /* we have the ISO STRING, check */ - if(strncmp(©str[i],CONFIG_ISO_STRING,sizeof(CONFIG_ISO_STRING)-1)!=0) { - printf("Wrong Firmware Image: %s\n",©str[i]); + if (strncmp(©str[i], CONFIG_ISO_STRING, sizeof(CONFIG_ISO_STRING)-1) != 0) { + printf("Wrong Firmware Image: %s\n", ©str[i]); return -1; } start = 0 - size; - for(i=info->sector_count-1;i>0;i--) - { + for (i = info->sector_count-1; i > 0; i--) { info->protect[i] = 0; /* unprotect this sector */ - if(start>=info->start[i]) - break; + if (start >= info->start[i]) + break; } /* set-up flash location */ /* now erase flash */ printf("Erasing at %lx (sector %d) (start %lx)\n", start,i,info->start[i]); - flash_erase (info, i, info->sector_count-1); + if ((rc = flash_erase (info, i, info->sector_count-1)) != 0) { + puts("ERROR "); + flash_perror(rc); + return (1); + } + #elif defined(CONFIG_VCMA9) start = 0; - for (i = 0; i <info->sector_count; i++) - { + for (i = 0; i <info->sector_count; i++) { info->protect[i] = 0; /* unprotect this sector */ if (size < info->start[i]) break; @@ -116,73 +118,113 @@ int mpl_prg(unsigned long src,unsigned long size) /* now erase flash */ printf("Erasing at %lx (sector %d) (start %lx)\n", start,0,info->start[0]); - flash_erase (info, 0, i); + if ((rc = flash_erase (info, 0, i)) != 0) { + puts("ERROR "); + flash_perror(rc); + return (1); + } #endif printf("flash erased, programming from 0x%lx 0x%lx Bytes\n",src,size); - if ((rc = flash_write ((uchar *)src, start, size)) != 0) { - puts ("ERROR "); - flash_perror (rc); + if ((rc = flash_write (src, start, size)) != 0) { + puts("ERROR "); + flash_perror(rc); return (1); } - puts ("OK programming done\n"); + puts("OK programming done\n"); return 0; } -int mpl_prg_image(unsigned long ld_addr) +static int +mpl_prg_image(uchar *ld_addr) { - unsigned long data,len,checksum; - image_header_t *hdr=&header; + unsigned long len, checksum; + uchar *data; + image_header_t *hdr = &header; + int rc; + /* Copy header so we can blank CRC field for re-calculation */ memcpy (&header, (char *)ld_addr, sizeof(image_header_t)); if (ntohl(hdr->ih_magic) != IH_MAGIC) { - printf ("Bad Magic Number\n"); + puts("Bad Magic Number\n"); return 1; } print_image_hdr(hdr); if (hdr->ih_os != IH_OS_U_BOOT) { - printf ("No U-Boot Image\n"); + puts("No U-Boot Image\n"); return 1; } if (hdr->ih_type != IH_TYPE_FIRMWARE) { - printf ("No Firmware Image\n"); + puts("No Firmware Image\n"); return 1; } - data = (ulong)&header; + data = (uchar *)&header; len = sizeof(image_header_t); checksum = ntohl(hdr->ih_hcrc); hdr->ih_hcrc = 0; if (crc32 (0, (char *)data, len) != checksum) { - printf ("Bad Header Checksum\n"); + puts("Bad Header Checksum\n"); return 1; } data = ld_addr + sizeof(image_header_t); len = ntohl(hdr->ih_size); - printf ("Verifying Checksum ... "); + puts("Verifying Checksum ... "); if (crc32 (0, (char *)data, len) != ntohl(hdr->ih_dcrc)) { - printf ("Bad Data CRC\n"); + puts("Bad Data CRC\n"); return 1; } - switch (hdr->ih_comp) { - case IH_COMP_NONE: - break; - case IH_COMP_GZIP: - printf (" Uncompressing ... "); - if (gunzip ((void *)(data+0x100000), 0x400000, - (uchar *)data, (int *)&len) != 0) { - printf ("GUNZIP ERROR\n"); + puts("OK\n"); + + if (hdr->ih_comp != IH_COMP_NONE) { + uchar *buf; + /* reserve space for uncompressed image */ + if ((buf = malloc(IMAGE_SIZE)) == NULL) { + puts("Insufficient space for decompression\n"); return 1; } - data+=0x100000; - break; - default: - printf (" Unimplemented compression type %d\n", hdr->ih_comp); - return 1; + + switch (hdr->ih_comp) { + case IH_COMP_GZIP: + puts("Uncompressing (GZIP) ... "); + rc = gunzip ((void *)(buf), IMAGE_SIZE, data, (int *)&len); + if (rc != 0) { + puts("GUNZIP ERROR\n"); + free(buf); + return 1; + } + puts("OK\n"); + break; +#if CONFIG_BZIP2 + case IH_COMP_BZIP2: + puts("Uncompressing (BZIP2) ... "); + { + uint retlen = IMAGE_SIZE; + rc = BZ2_bzBuffToBuffDecompress ((char *)(buf), &retlen, + (char *)data, len, 0, 0); + len = retlen; + } + if (rc != BZ_OK) { + printf ("BUNZIP2 ERROR: %d\n", rc); + free(buf); + return 1; + } + puts("OK\n"); + break; +#endif + default: + printf ("Unimplemented compression type %d\n", hdr->ih_comp); + free(buf); + return 1; + } + + rc = mpl_prg(buf, len); + free(buf); + } else { + rc = mpl_prg(data, len); } - - printf (" OK\n"); - return(mpl_prg(data,len)); + + return(rc); } @@ -199,20 +241,20 @@ void set_backup_values(int overwrite) get_backup_values(&back); if(!overwrite) { if(strncmp(back.signature,"MPL\0",4)==0) { - printf("Not possible to write Backup\n"); + puts("Not possible to write Backup\n"); return; } } memcpy(back.signature,"MPL\0",4); i = getenv_r("serial#",back.serial_name,16); if(i < 0) { - printf("Not possible to write Backup\n"); + puts("Not possible to write Backup\n"); return; } back.serial_name[16]=0; i = getenv_r("ethaddr",back.eth_addr,20); if(i < 0) { - printf("Not possible to write Backup\n"); + puts("Not possible to write Backup\n"); return; } back.eth_addr[20]=0; @@ -334,7 +376,7 @@ void check_env(void) } else { copy_old_env(oldsizes[i]); - printf ("INFO: old environment ajusted, use saveenv\n"); + puts("INFO: old environment ajusted, use saveenv\n"); } } else { @@ -353,23 +395,23 @@ extern char *stdio_names[]; void show_stdio_dev(void) { /* Print information */ - printf ("In: "); + puts("In: "); if (stdio_devices[stdin] == NULL) { - printf ("No input devices available!\n"); + puts("No input devices available!\n"); } else { printf ("%s\n", stdio_devices[stdin]->name); } - printf ("Out: "); + puts("Out: "); if (stdio_devices[stdout] == NULL) { - printf ("No output devices available!\n"); + puts("No output devices available!\n"); } else { printf ("%s\n", stdio_devices[stdout]->name); } - printf ("Err: "); + puts("Err: "); if (stdio_devices[stderr] == NULL) { - printf ("No error devices available!\n"); + puts("No error devices available!\n"); } else { printf ("%s\n", stdio_devices[stderr]->name); } @@ -390,7 +432,7 @@ int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) if (strcmp(argv[2], "floppy") == 0) { char *local_args[3]; extern int do_fdcboot (cmd_tbl_t *, int, int, char *[]); - printf ("\nupdating bootloader image from floppy\n"); + puts("\nupdating bootloader image from floppy\n"); local_args[0] = argv[0]; if(argc==4) { local_args[1] = argv[3]; @@ -415,12 +457,12 @@ int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) ld_addr=load_addr; } printf ("\nupdating bootloader image from memory at %lX\n",ld_addr); - result=mpl_prg_image(ld_addr); + result=mpl_prg_image((uchar *)ld_addr); return result; } if (strcmp(argv[2], "mps") == 0) { - printf ("\nupdating bootloader image from MPS\n"); - result=mpl_prg(src,size); + puts("\nupdating bootloader image from MPS\n"); + result=mpl_prg((uchar *)src,size); return result; } } diff --git a/board/mpl/common/flash.c b/board/mpl/common/flash.c index e56e307160..5f50200b26 100644 --- a/board/mpl/common/flash.c +++ b/board/mpl/common/flash.c @@ -543,7 +543,7 @@ int wait_for_DQ7(flash_info_t *info, int sect) while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) { if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) { printf ("Timeout\n"); - return -1; + return ERR_TIMOUT; } /* show that we're waiting */ if ((now - last) > 1000) { /* every second */ @@ -551,12 +551,12 @@ int wait_for_DQ7(flash_info_t *info, int sect) last = now; } } - return 0; + return ERR_OK; } int intel_wait_for_DQ7(flash_info_t *info, int sect) { - ulong start, now, last; + ulong start, now, last, status; volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *)(info->start[sect]); start = get_timer (0); @@ -564,7 +564,7 @@ int intel_wait_for_DQ7(flash_info_t *info, int sect) while ((addr[0] & (FLASH_WORD_SIZE)0x00800080) != (FLASH_WORD_SIZE)0x00800080) { if ((now = get_timer(start)) > CFG_FLASH_ERASE_TOUT) { printf ("Timeout\n"); - return -1; + return ERR_TIMOUT; } /* show that we're waiting */ if ((now - last) > 1000) { /* every second */ @@ -572,8 +572,11 @@ int intel_wait_for_DQ7(flash_info_t *info, int sect) last = now; } } - addr[0]=(FLASH_WORD_SIZE)0x00500050; - return 0; + status = addr[0] & (FLASH_WORD_SIZE)0x00280028; + /* clear status register */ + addr[0] = (FLASH_WORD_SIZE)0x00500050; + /* check status for block erase fail and VPP low */ + return (status == 0 ? ERR_OK : ERR_NOT_ERASED); } /*----------------------------------------------------------------------- @@ -584,7 +587,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last) volatile FLASH_WORD_SIZE *addr = (FLASH_WORD_SIZE *)(info->start[0]); volatile FLASH_WORD_SIZE *addr2; int flag, prot, sect, l_sect; - int i; + int i, rcode = 0; if ((s_first < 0) || (s_first > s_last)) { @@ -634,7 +637,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last) addr2[0] = (FLASH_WORD_SIZE)0x00500050; /* block erase */ for (i=0; i<50; i++) udelay(1000); /* wait 1 ms */ - wait_for_DQ7(info, sect); + rcode |= wait_for_DQ7(info, sect); } else { if((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL){ @@ -643,7 +646,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last) intel_wait_for_DQ7(info, sect); addr2[0] = (FLASH_WORD_SIZE)0x00200020; /* sector erase */ addr2[0] = (FLASH_WORD_SIZE)0x00D000D0; /* sector erase */ - intel_wait_for_DQ7(info, sect); + rcode |= intel_wait_for_DQ7(info, sect); } else { addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA; @@ -652,7 +655,7 @@ int flash_erase (flash_info_t *info, int s_first, int s_last) addr[ADDR0] = (FLASH_WORD_SIZE)0x00AA00AA; addr[ADDR1] = (FLASH_WORD_SIZE)0x00550055; addr2[0] = (FLASH_WORD_SIZE)0x00300030; /* sector erase */ - wait_for_DQ7(info, sect); + rcode |= wait_for_DQ7(info, sect); } } l_sect = sect; @@ -688,8 +691,10 @@ DONE: addr = (FLASH_WORD_SIZE *)info->start[0]; addr[0] = (FLASH_WORD_SIZE)0x00F000F0; /* reset bank */ - printf (" done\n"); - return 0; + if (!rcode) + printf (" done\n"); + + return rcode; } diff --git a/board/mpl/vcma9/cmd_vcma9.c b/board/mpl/vcma9/cmd_vcma9.c index 8df642d9ba..44b4112554 100644 --- a/board/mpl/vcma9/cmd_vcma9.c +++ b/board/mpl/vcma9/cmd_vcma9.c @@ -61,7 +61,7 @@ int do_vcma9(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 0; } #if defined(CONFIG_DRIVER_CS8900) - if (strcmp(argv[1], "cs8900_eeprom") == 0) { + if (strcmp(argv[1], "cs8900") == 0) { if (strcmp(argv[2], "read") == 0) { uchar addr; ushort data; @@ -102,12 +102,12 @@ int do_vcma9(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) /* write checksum word */ cs8900_e2prom_write(addr, (0 - csum) << 8); } else { - printf("\nplease defined 'ethaddr'\n"); + puts("\nplease defined 'ethaddr'\n"); } } else if (strcmp(argv[2], "dump") == 0) { uchar addr = 0, endaddr, csum; ushort data; - printf("Dump of CS8900 config device: "); + puts("Dump of CS8900 config device: "); cs8900_e2prom_read(addr, &data); if ((data & 0xE000) == 0xA000) { endaddr = (data & 0x00FF) / 2; @@ -119,9 +119,9 @@ int do_vcma9(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } printf("\nChecksum: %s", (csum == 0) ? "ok" : "wrong"); } else { - printf("no valid config found"); + puts("no valid config found"); } - printf("\n"); + puts("\n"); } return 0; diff --git a/board/mpl/vcma9/config.mk b/board/mpl/vcma9/config.mk index 942d42ef6a..3698c2450b 100644 --- a/board/mpl/vcma9/config.mk +++ b/board/mpl/vcma9/config.mk @@ -21,4 +21,4 @@ #TEXT_BASE = 0x30F80000 -TEXT_BASE = 0x33F80000 +TEXT_BASE = 0x33F00000 diff --git a/board/mpl/vcma9/flash.c b/board/mpl/vcma9/flash.c index 829396bfd0..35cf260f6a 100644 --- a/board/mpl/vcma9/flash.c +++ b/board/mpl/vcma9/flash.c @@ -133,23 +133,23 @@ void flash_print_info (flash_info_t *info) switch (info->flash_id & FLASH_VENDMASK) { case (AMD_MANUFACT & FLASH_VENDMASK): - printf("AMD: "); + puts("AMD: "); break; default: - printf("Unknown Vendor "); + puts("Unknown Vendor "); break; } switch (info->flash_id & FLASH_TYPEMASK) { case (AMD_ID_LV400B & FLASH_TYPEMASK): - printf("1x Amd29LV400BB (4Mbit)\n"); + puts("1x Amd29LV400BB (4Mbit)\n"); break; case (AMD_ID_LV800B & FLASH_TYPEMASK): - printf("1x Amd29LV800BB (8Mbit)\n"); + puts("1x Amd29LV800BB (8Mbit)\n"); break; default: - printf("Unknown Chip Type\n"); + puts("Unknown Chip Type\n"); goto Done; break; } @@ -157,17 +157,17 @@ void flash_print_info (flash_info_t *info) printf(" Size: %ld MB in %d Sectors\n", info->size >> 20, info->sector_count); - printf(" Sector Start Addresses:"); + puts(" Sector Start Addresses:"); for (i = 0; i < info->sector_count; i++) { if ((i % 5) == 0) { - printf ("\n "); + puts("\n "); } printf (" %08lX%s", info->start[i], info->protect[i] ? " (RO)" : " "); } - printf ("\n"); + puts("\n"); Done: } @@ -272,16 +272,16 @@ int flash_erase (flash_info_t *info, int s_first, int s_last) goto outahere; } - printf("ok.\n"); + puts("ok.\n"); } else /* it was protected */ { - printf("protected!\n"); + puts("protected!\n"); } } if (ctrlc()) - printf("User Interrupt!\n"); + puts("User Interrupt!\n"); outahere: /* allow flash to settle - wait 10 ms */ diff --git a/board/mpl/vcma9/vcma9.c b/board/mpl/vcma9/vcma9.c index 4664488451..db98553439 100644 --- a/board/mpl/vcma9/vcma9.c +++ b/board/mpl/vcma9/vcma9.c @@ -327,13 +327,13 @@ int last_stage_init(void) /*************************************************************************** * some helping routines */ - +#if !CONFIG_USB_KEYBOARD int overwrite_console(void) { /* return TRUE if console should be overwritten */ return 0; } - +#endif /************************************************************************ * Print VCMA9 Info diff --git a/common/cmd_usb.c b/common/cmd_usb.c index 26b39d09ba..150b106b60 100644 --- a/common/cmd_usb.c +++ b/common/cmd_usb.c @@ -41,7 +41,7 @@ #endif static int usb_stor_curr_dev=-1; /* current device */ -/* somme display routines (info command) */ +/* some display routines (info command) */ char * usb_get_class_desc(unsigned char dclass) { switch(dclass) { diff --git a/cpu/arm920t/usb_ohci.c b/cpu/arm920t/usb_ohci.c index a040c13757..6f4a9f7ae9 100644 --- a/cpu/arm920t/usb_ohci.c +++ b/cpu/arm920t/usb_ohci.c @@ -34,11 +34,16 @@ */ #include <common.h> -/* #include <pci.h> no PCI on the S3C2400 */ +/* #include <pci.h> no PCI on the S3C24X0 */ #ifdef CONFIG_USB_OHCI +#if defined(CONFIG_S3C2400) #include <s3c2400.h> +#elif defined(CONFIG_S3C2410) +#include <s3c2410.h> +#endif + #include <malloc.h> #include <usb.h> #include "usb_ohci.h" diff --git a/cpu/mips/au1x00_eth.c b/cpu/mips/au1x00_eth.c index c23712b25f..ae51b754a3 100644 --- a/cpu/mips/au1x00_eth.c +++ b/cpu/mips/au1x00_eth.c @@ -31,12 +31,24 @@ /* We all use switches, right? ;-) */ #endif +/* I assume ethernet behaves like au1000 */ + #ifdef CONFIG_AU1000 /* Base address differ between cpu:s */ #define ETH0_BASE AU1000_ETH0_BASE #define MAC0_ENABLE AU1000_MAC0_ENABLE #else -#error "Au1100 and Au1500 not supported" +#ifdef CONFIG_AU1100 +#define ETH0_BASE AU1100_ETH0_BASE +#define MAC0_ENABLE AU1100_MAC0_ENABLE +#else +#ifdef CONFIG_AU1500 +#define ETH0_BASE AU1500_ETH0_BASE +#define MAC0_ENABLE AU1500_MAC0_ENABLE +#else +#error "No valid cpu set" +#endif +#endif #endif #include <common.h> @@ -175,6 +187,7 @@ static int au1x00_init(struct eth_device* dev, bd_t * bd){ } /* Put mac addr in little endian */ + /* FIXME Check this for little endian mode */ #define ea eth_get_dev()->enetaddr *mac_addr_high = (ea[5] << 8) | (ea[4] ) ; *mac_addr_low = (ea[3] << 24) | (ea[2] << 16) | diff --git a/drivers/cs8900.c b/drivers/cs8900.c index d35332c830..082434ca28 100644 --- a/drivers/cs8900.c +++ b/drivers/cs8900.c @@ -45,6 +45,7 @@ #if (CONFIG_COMMANDS & CFG_CMD_NET) +#undef DEBUG /* packet page register access functions */ @@ -99,6 +100,20 @@ static void eth_reset (void) /*NOP*/; } +static void eth_reginit (void) +{ + /* receive only error free packets addressed to this card */ + put_reg (PP_RxCTL, PP_RxCTL_IA | PP_RxCTL_Broadcast | PP_RxCTL_RxOK); + /* do not generate any interrupts on receive operations */ + put_reg (PP_RxCFG, 0); + /* do not generate any interrupts on transmit operations */ + put_reg (PP_TxCFG, 0); + /* do not generate any interrupts on buffer operations */ + put_reg (PP_BufCFG, 0); + /* enable transmitter/receiver mode */ + put_reg (PP_LineCTL, PP_LineCTL_Rx | PP_LineCTL_Tx); +} + void cs8900_get_enetaddr (uchar * addr) { int i; @@ -181,21 +196,7 @@ int eth_init (bd_t * bd) put_reg (PP_IA + 2, bd->bi_enetaddr[2] | (bd->bi_enetaddr[3] << 8)); put_reg (PP_IA + 4, bd->bi_enetaddr[4] | (bd->bi_enetaddr[5] << 8)); - /* receive only error free packets addressed to this card */ - put_reg (PP_RxCTL, PP_RxCTL_IA | PP_RxCTL_Broadcast | PP_RxCTL_RxOK); - - /* do not generate any interrupts on receive operations */ - put_reg (PP_RxCFG, 0); - - /* do not generate any interrupts on transmit operations */ - put_reg (PP_TxCFG, 0); - - /* do not generate any interrupts on buffer operations */ - put_reg (PP_BufCFG, 0); - - /* enable transmitter/receiver mode */ - put_reg (PP_LineCTL, PP_LineCTL_Rx | PP_LineCTL_Tx); - + eth_reginit (); return 0; } @@ -215,9 +216,10 @@ extern int eth_rx (void) status = CS8900_RTDATA; /* stat */ rxlen = CS8900_RTDATA; /* len */ +#ifdef DEBUG if (rxlen > PKTSIZE_ALIGN + PKTALIGN) printf ("packet too big!\n"); - +#endif for (addr = (unsigned short *) NetRxPackets[0], i = rxlen >> 1; i > 0; i--) *addr++ = CS8900_RTDATA; @@ -245,10 +247,13 @@ retry: /* Test to see if the chip has allocated memory for the packet */ if ((get_reg (PP_BusSTAT) & PP_BusSTAT_TxRDY) == 0) { /* Oops... this should not happen! */ +#ifdef DEBUG printf ("cs: unable to send packet; retrying...\n"); +#endif for (tmo = get_timer (0) + 5 * CFG_HZ; get_timer (0) < tmo;) /*NOP*/; eth_reset (); + eth_reginit (); goto retry; } @@ -266,7 +271,9 @@ retry: /* nothing */ ; if ((s & (PP_TER_CRS | PP_TER_TxOK)) != PP_TER_TxOK) { +#ifdef DEBUG printf ("\ntransmission error %#x\n", s); +#endif } return 0; diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 29eea4582f..f02c404a8b 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -962,7 +962,8 @@ file_fat_detectfs(void) printf("No current device\n"); return 1; } -#if (CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI) +#if (CONFIG_COMMANDS & CFG_CMD_IDE) || (CONFIG_COMMANDS & CFG_CMD_SCSI) || \ + (CONFIG_COMMANDS & CFG_CMD_USB) || (CONFIG_MMC) printf("Interface: "); switch(cur_dev->if_type) { case IF_TYPE_IDE : printf("IDE"); break; diff --git a/include/asm-mips/addrspace.h b/include/asm-mips/addrspace.h index 0d1bf3246d..1fd00ccba9 100644 --- a/include/asm-mips/addrspace.h +++ b/include/asm-mips/addrspace.h @@ -40,6 +40,18 @@ #define PHYSADDR(a) ((a) & 0x1fffffff) #endif +/* + * Returns the uncached address of a sdram address + */ +#ifndef __ASSEMBLY__ +#ifdef CONFIG_AU1X00 +/* We use a 36 bit physical address map here and + cannot access physical memory directly from core */ +#define UNCACHED_SDRAM(a) (((unsigned long)(a)) | 0x20000000) +#else /* !CONFIG_AU1X00 */ +#define UNCACHED_SDRAM(a) PHYSADDR(a) +#endif /* CONFIG_AU1X00 */ +#endif /* __ASSEMBLY__ */ /* * Map an address to a certain kernel segment */ diff --git a/include/configs/MIP405.h b/include/configs/MIP405.h index 61a799daa4..9c21745c49 100644 --- a/include/configs/MIP405.h +++ b/include/configs/MIP405.h @@ -218,7 +218,7 @@ #define CFG_FLASH_BASE 0xFFF80000 #define CFG_MONITOR_BASE CFG_FLASH_BASE #define CFG_MONITOR_LEN (512 * 1024) /* Reserve 512 kB for Monitor */ -#define CFG_MALLOC_LEN (128 * 1024) /* Reserve 128 kB for malloc() */ +#define CFG_MALLOC_LEN (1024 * 1024) /* Reserve 1024 kB for malloc() */ /* * For booting Linux, the board info and command line data @@ -394,6 +394,11 @@ #endif /************************************************************ + * support BZIP2 compression + ************************************************************/ +#define CONFIG_BZIP2 1 + +/************************************************************ * Ident ************************************************************/ diff --git a/include/configs/PIP405.h b/include/configs/PIP405.h index b9107ccf7c..2cd5726b95 100644 --- a/include/configs/PIP405.h +++ b/include/configs/PIP405.h @@ -204,7 +204,7 @@ #define CFG_FLASH_BASE 0xFFF80000 #define CFG_MONITOR_BASE CFG_FLASH_BASE #define CFG_MONITOR_LEN (512 * 1024) /* Reserve 512 kB for Monitor */ -#define CFG_MALLOC_LEN (128 * 1024) /* Reserve 128 kB for malloc() */ +#define CFG_MALLOC_LEN (1024 * 1024) /* Reserve 1024 kB for malloc() */ /* * For booting Linux, the board info and command line data @@ -371,6 +371,11 @@ #endif /************************************************************ + * support BZIP2 compression + ************************************************************/ +#define CONFIG_BZIP2 1 + +/************************************************************ * Ident ************************************************************/ #define VERSION_TAG "released" diff --git a/include/configs/VCMA9.h b/include/configs/VCMA9.h index 8a09da6880..9ca80ab670 100644 --- a/include/configs/VCMA9.h +++ b/include/configs/VCMA9.h @@ -42,6 +42,7 @@ #define CONFIG_ARM920T 1 /* This is an ARM920T Core */ #define CONFIG_S3C2410 1 /* in a SAMSUNG S3C2410 SoC */ #define CONFIG_VCMA9 1 /* on a MPL VCMA9 Board */ +#define LITTLEENDIAN 1 /* used by usb_ohci.c */ /* input clock of PLL */ #define CONFIG_SYS_CLK_FREQ 12000000/* VCMA9 has 12MHz input clock */ @@ -63,10 +64,13 @@ /*CFG_CMD_NAND |*/ \ CFG_CMD_EEPROM | \ CFG_CMD_I2C | \ - /*CFG_CMD_USB |*/ \ + CFG_CMD_USB | \ CFG_CMD_REGINFO | \ + CFG_CMD_FAT | \ CFG_CMD_DATE | \ CFG_CMD_ELF | \ + CFG_CMD_DHCP | \ + CFG_CMD_PING | \ CFG_CMD_BSP) /* this must be included after the definiton of CONFIG_COMMANDS */ @@ -96,11 +100,11 @@ /* * Size of malloc() pool */ -#define CONFIG_MALLOC_SIZE (CFG_ENV_SIZE + 128*1024) -#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */ +/*#define CONFIG_MALLOC_SIZE (CFG_ENV_SIZE + 128*1024)*/ +#define CFG_GBL_DATA_SIZE 128 /* size in bytes reserved for initial data */ #define CFG_MONITOR_LEN (256 * 1024) -#define CFG_MALLOC_LEN (128 * 1024) +#define CFG_MALLOC_LEN (1024 * 1024) /* BUNZIP2 needs a lot of RAM */ /* * Hardware drivers @@ -119,14 +123,13 @@ /************************************************************ * USB support ************************************************************/ -#if 0 -#define CONFIG_USB_OHCI -#define CONFIG_USB_KEYBOARD -#define CONFIG_USB_STORAGE +#define CONFIG_USB_OHCI 1 +#define CONFIG_USB_KEYBOARD 1 +#define CONFIG_USB_STORAGE 1 +#define CONFIG_DOS_PARTITION 1 /* Enable needed helper functions */ #define CFG_DEVICE_DEREGISTER /* needs device_deregister */ -#endif /************************************************************ * RTC @@ -139,7 +142,11 @@ #define CONFIG_BAUDRATE 9600 -#define CONFIG_BOOTDELAY 3 +#define CONFIG_BOOTDELAY 5 +/* autoboot (do NOT change this set environment variable "bootdelay" to -1 instead) */ +#define CONFIG_BOOT_RETRY_TIME -10 /* feature is avaiable but not enabled */ +#define CONFIG_ZERO_BOOTDELAY_CHECK /* check console even if bootdelay = 0 */ + #define CONFIG_NETMASK 255.255.255.0 #define CONFIG_IPADDR 10.0.0.110 #define CONFIG_SERVERIP 10.0.0.1 @@ -176,6 +183,9 @@ /* valid baudrates */ #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } +/* support BZIP2 compression */ +#define CONFIG_BZIP2 1 + /************************************************************ * Ident ************************************************************/ diff --git a/include/configs/dbau1x00.h b/include/configs/dbau1x00.h index 7aa90b76d8..6f647f2e8b 100644 --- a/include/configs/dbau1x00.h +++ b/include/configs/dbau1x00.h @@ -32,9 +32,20 @@ #define CONFIG_DBAU1X00 1 #define CONFIG_AU1X00 1 /* alchemy series cpu */ +#ifdef CONFIG_DBAU1000 /* Also known as Merlot */ -#define CONFIG_DBAU1000 1 /* board, Hardcoded for now */ -#define CONFIG_AU1000 1 /* cpu, Hardcoded for now */ +#define CONFIG_AU1000 1 +#else +#ifdef CONFIG_DBAU1100 +#define CONFIG_AU1100 1 +#else +#ifdef CONFIG_DBAU1500 +#define CONFIG_AU1500 1 +#else +#error "No valid board set" +#endif +#endif +#endif #define CONFIG_ETHADDR DE:AD:BE:EF:01:01 /* Ethernet address */ diff --git a/lib_arm/armlinux.c b/lib_arm/armlinux.c index 0b3d01e12f..19680b58a5 100644 --- a/lib_arm/armlinux.c +++ b/lib_arm/armlinux.c @@ -83,7 +83,7 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], ulong len = 0, checksum; ulong initrd_start, initrd_end; ulong data; - void (*theKernel) (int zero, int arch); + void (*theKernel)(int zero, int arch, uint params); image_header_t *hdr = &header; bd_t *bd = gd->bd; @@ -91,7 +91,7 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], char *commandline = getenv ("bootargs"); #endif - theKernel = (void (*)(int, int)) ntohl (hdr->ih_ep); + theKernel = (void (*)(int, int, uint))ntohl(hdr->ih_ep); /* * Check if there is an initrd image @@ -244,7 +244,7 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], cleanup_before_linux (); - theKernel (0, bd->bi_arch_number); + theKernel (0, bd->bi_arch_number, bd->bi_boot_params); } diff --git a/lib_mips/mips_linux.c b/lib_mips/mips_linux.c index 0f011980b5..18eafe13de 100644 --- a/lib_mips/mips_linux.c +++ b/lib_mips/mips_linux.c @@ -182,7 +182,7 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], (ulong) theKernel); #endif - linux_params_init (PHYSADDR (gd->bd->bi_boot_params), commandline); + linux_params_init (UNCACHED_SDRAM (gd->bd->bi_boot_params), commandline); #ifdef CONFIG_MEMSIZE_IN_BYTES sprintf (env_buf, "%lu", gd->ram_size); @@ -198,7 +198,7 @@ void do_bootm_linux (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[], linux_env_set ("memsize", env_buf); - sprintf (env_buf, "0x%08X", (uint) PHYSADDR (initrd_start)); + sprintf (env_buf, "0x%08X", (uint) UNCACHED_SDRAM (initrd_start)); linux_env_set ("initrd_start", env_buf); sprintf (env_buf, "0x%X", (uint) (initrd_end - initrd_start)); |