diff options
43 files changed, 314 insertions, 132 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 58f833c14..ac7572cfc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -607,7 +607,7 @@ Thomas Lange <thomas@corelatus.se> dbau1x00 MIPS32 Au1000 gth2 MIPS32 Au1000 -Vlad Lungu <vlad@comsys.ro> +Vlad Lungu <vlad.lungu@windriver.com> qemu_mips MIPS32 ######################################################################### @@ -424,7 +424,7 @@ $(obj)System.map: $(obj)u-boot # This target actually generates 2 files; autoconf.mk and autoconf.mk.dep. # the dep file is only include in this top level makefile to determine when # to regenerate the autoconf.mk file. -$(obj)include/autoconf.mk: $(obj)include/config.h $(VERSION_FILE) +$(obj)include/autoconf.mk: $(obj)include/config.h @$(XECHO) Generating include/autoconf.mk ; \ set -e ; \ : Generate the dependancies ; \ @@ -623,7 +623,6 @@ The following options need to be configured: CONFIG_CMD_SPI * SPI serial bus support CONFIG_CMD_USB * USB support CONFIG_CMD_VFD * VFD support (TRAB) - CONFIG_CMD_BSP * Board SPecific functions CONFIG_CMD_CDP * Cisco Discover Protocol support CONFIG_CMD_FSL * Microblaze FSL support diff --git a/board/amcc/acadia/config.mk b/board/amcc/acadia/config.mk index af5a46c2a..290415c9d 100644 --- a/board/amcc/acadia/config.mk +++ b/board/amcc/acadia/config.mk @@ -28,7 +28,7 @@ sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp ifndef TEXT_BASE -TEXT_BASE = 0xFFFC0000 +TEXT_BASE = 0xFFF80000 endif ifeq ($(debug),1) diff --git a/board/amcc/yosemite/yosemite.c b/board/amcc/yosemite/yosemite.c index 6ec922ab0..212fab8d0 100644 --- a/board/amcc/yosemite/yosemite.c +++ b/board/amcc/yosemite/yosemite.c @@ -26,6 +26,8 @@ #include <asm/processor.h> #include <asm/io.h> #include <spd_sdram.h> +#include <libfdt.h> +#include <fdt_support.h> DECLARE_GLOBAL_DATA_PTR; @@ -554,3 +556,24 @@ void board_reset(void) /* give reset to BCSR */ *(unsigned char *)(CFG_BCSR_BASE | 0x06) = 0x09; } + +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) +void ft_board_setup(void *blob, bd_t *bd) +{ + u32 val[4]; + int rc; + + ft_cpu_setup(blob, bd); + + /* Fixup NOR mapping */ + val[0] = 0; /* chip select number */ + val[1] = 0; /* always 0 */ + val[2] = gd->bd->bi_flashstart; + val[3] = gd->bd->bi_flashsize; + rc = fdt_find_and_setprop(blob, "/plb/opb/ebc", "ranges", + val, sizeof(val), 1); + if (rc) + printf("Unable to update property NOR mapping, err=%s\n", + fdt_strerror(rc)); +} +#endif /* defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) */ diff --git a/board/qemu-mips/README b/board/qemu-mips/README index 39570b13d..4c1f8edc9 100644 --- a/board/qemu-mips/README +++ b/board/qemu-mips/README @@ -1,4 +1,4 @@ -By Vlad Lungu vlad@comsys.ro 2007-Oct-01 +By Vlad Lungu vlad.lungu@windriver.com 2007-Oct-01 ---------------------------------------- Qemu is a full system emulator. See @@ -9,3 +9,7 @@ Limitations & comments Supports the "-m mips" configuration of qemu: serial,NE2000,IDE. Support is big endian only for now (or at least this is what I tested). Derived from au1x00 with a lot of things cut out. + +Supports emulated flash (patch Jean-Christophe PLAGNIOL-VILLARD) with +recent qemu versions. When using emulated flash, launch with +-pflash <filename> and erase mips_bios.bin. diff --git a/board/qemu-mips/qemu-mips.c b/board/qemu-mips/qemu-mips.c index a6ad7b9ab..68690743d 100644 --- a/board/qemu-mips/qemu-mips.c +++ b/board/qemu-mips/qemu-mips.c @@ -1,6 +1,6 @@ /* * (C) Copyright 2007 - * Vlad Lungu vlad@comsys.ro + * Vlad Lungu vlad.lungu@windriver.com * * See file CREDITS for list of people who contributed to this * project. diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 44f6b9f6e..0d6713236 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -433,17 +433,6 @@ static int fit_check_kernel (const void *fit, int os_noffset, int verify) } show_boot_progress (105); -#ifdef CONFIG_LOGBUFFER -#ifndef CONFIG_ALT_LB_ADDR - kbd=gd->bd; - /* Prevent initrd from overwriting logbuffer */ - if (initrd_high < (kbd->bi_memsize-LOGBUFF_LEN-LOGBUFF_OVERHEAD)) - initrd_high = kbd->bi_memsize-LOGBUFF_LEN-LOGBUFF_OVERHEAD; - debug ("## Logbuffer at 0x%08lX ", kbd->bi_memsize-LOGBUFF_LEN); -#else - debug ("## Logbuffer at 0x%08lX ", CONFIG_ALT_LB_ADDR); -#endif -#endif if (!fit_image_check_target_arch (fit, os_noffset)) { puts ("Unsupported Architecture\n"); show_boot_progress (-105); diff --git a/common/cmd_ide.c b/common/cmd_ide.c index ead7e10d6..cac99d5fe 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -52,10 +52,6 @@ # include <status_led.h> #endif -#ifndef __PPC__ -#include <asm/io.h> -#endif - #ifdef CONFIG_IDE_8xx_DIRECT DECLARE_GLOBAL_DATA_PTR; #endif diff --git a/common/cmd_log.c b/common/cmd_log.c index b9f9ba034..8e04941d6 100644 --- a/common/cmd_log.c +++ b/common/cmd_log.c @@ -66,6 +66,12 @@ static logbuff_t *log; #endif static char *lbuf; +unsigned long __logbuffer_base(void) +{ + return CFG_SDRAM_BASE + gd->bd->bi_memsize - LOGBUFF_LEN; +} +unsigned long logbuffer_base (void) __attribute__((weak, alias("__logbuffer_base"))); + void logbuff_init_ptrs (void) { unsigned long tag, post_word; @@ -75,7 +81,7 @@ void logbuff_init_ptrs (void) log = (logbuff_t *)CONFIG_ALT_LH_ADDR; lbuf = (char *)CONFIG_ALT_LB_ADDR; #else - log = (logbuff_t *)(gd->bd->bi_memsize-LOGBUFF_LEN) - 1; + log = (logbuff_t *)(logbuffer_base ()) - 1; lbuf = (char *)log->buf; #endif diff --git a/common/image.c b/common/image.c index 4a024d4df..f7faf504d 100644 --- a/common/image.c +++ b/common/image.c @@ -93,6 +93,7 @@ static table_entry_t uimage_arch[] = { { IH_ARCH_MIPS64, "mips64", "MIPS 64 Bit", }, { IH_ARCH_NIOS, "nios", "NIOS", }, { IH_ARCH_NIOS2, "nios2", "NIOS II", }, + { IH_ARCH_PPC, "powerpc", "PowerPC", }, { IH_ARCH_PPC, "ppc", "PowerPC", }, { IH_ARCH_S390, "s390", "IBM S390", }, { IH_ARCH_SH, "sh", "SuperH", }, @@ -1021,6 +1022,9 @@ int boot_ramdisk_high (struct lmb *lmb, ulong rd_data, ulong rd_len, initrd_high = ~0; } + /* Prevent initrd from overwriting logbuffer */ + lmb_reserve(lmb, logbuffer_base() - LOGBUFF_OVERHEAD, LOGBUFF_RESERVE); + debug ("## initrd_high = 0x%08lx, copy_to_ram = %d\n", initrd_high, initrd_copy_to_ram); diff --git a/common/main.c b/common/main.c index 21e7afab6..a17b60b3a 100644 --- a/common/main.c +++ b/common/main.c @@ -40,7 +40,7 @@ #include <post.h> -#if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST) +#if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST) || defined(CONFIG_CMDLINE_EDITING) DECLARE_GLOBAL_DATA_PTR; #endif @@ -67,11 +67,9 @@ static int abortboot(int); char console_buffer[CFG_CBSIZE]; /* console I/O buffer */ -#ifndef CONFIG_CMDLINE_EDITING static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen); static char erase_seq[] = "\b \b"; /* erase sequence */ static char tab_seq[] = " "; /* used to expand TABs */ -#endif /* CONFIG_CMDLINE_EDITING */ #ifdef CONFIG_BOOT_RETRY_TIME static uint64_t endtime = 0; /* must be set, default is instant timeout */ @@ -947,11 +945,26 @@ int readline_into_buffer (const char *const prompt, char * buffer) initted = 1; } - puts (prompt); - rc = cread_line(prompt, p, &len); - return rc < 0 ? rc : len; -#else + /* + * History uses a global array which is not + * writable until after relocation to RAM. + * Revert to non-history version if still + * running from flash. + */ + if (gd->flags & GD_FLG_RELOC) { + if (!initted) { + hist_init(); + initted = 1; + } + + puts (prompt); + + rc = cread_line(prompt, p, &len); + return rc < 0 ? rc : len; + + } else { +#endif /* CONFIG_CMDLINE_EDITING */ char * p_buf = p; int n = 0; /* buffer index */ int plen = 0; /* prompt length */ @@ -1047,12 +1060,13 @@ int readline_into_buffer (const char *const prompt, char * buffer) } } } -#endif /* CONFIG_CMDLINE_EDITING */ +#ifdef CONFIG_CMDLINE_EDITING + } +#endif } /****************************************************************************/ -#ifndef CONFIG_CMDLINE_EDITING static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen) { char *s; @@ -1082,7 +1096,6 @@ static char * delete_char (char *buffer, char *p, int *colp, int *np, int plen) (*np)--; return (p); } -#endif /* CONFIG_CMDLINE_EDITING */ /****************************************************************************/ diff --git a/cpu/74xx_7xx/cache.S b/cpu/74xx_7xx/cache.S index a793d799d..3a745cbe0 100644 --- a/cpu/74xx_7xx/cache.S +++ b/cpu/74xx_7xx/cache.S @@ -329,14 +329,28 @@ _GLOBAL(dcache_status) blr /* - * Invalidate L2 cache using L2I and polling L2IP + * Invalidate L2 cache using L2I and polling L2IP or L2I */ _GLOBAL(l2cache_invalidate) sync + mfspr r3, l2cr oris r3, r3, L2CR_L2I@h sync mtspr l2cr, r3 sync + mfspr r3, PVR + sync + rlwinm r3, r3, 16,16,31 + cmpli 0,r3,0x8000 /* 7451, 7441 */ + beq 0,inv_7450 + cmpli 0,r3,0x8001 /* 7455, 7445 */ + beq 0,inv_7450 + cmpli 0,r3,0x8002 /* 7457, 7447 */ + beq 0,inv_7450 + cmpli 0,r3,0x8003 /* 7447A */ + beq 0,inv_7450 + cmpli 0,r3,0x8004 /* 7448 */ + beq 0,inv_7450 invl2: mfspr r3, l2cr andi. r3, r3, L2CR_L2IP @@ -348,6 +362,11 @@ invl2: mtspr l2cr, r3 sync blr +inv_7450: + mfspr r3, l2cr + andis. r3, r3, L2CR_L2I@h + bne inv_7450 + blr /* * Enable L2 cache diff --git a/cpu/arm920t/s3c24x0/usb.c b/cpu/arm920t/s3c24x0/usb.c index ef5d5bf71..421ebb437 100644 --- a/cpu/arm920t/s3c24x0/usb.c +++ b/cpu/arm920t/s3c24x0/usb.c @@ -69,4 +69,4 @@ int usb_cpu_init_fail (void) } # endif /* defined(CONFIG_S3C2400) || defined(CONFIG_S3C2410) */ -#endif /* defined(CONFIG_USB_OHCI) && defined(CFG_USB_OHCI_CPU_INIT) */ +#endif /* defined(CONFIG_USB_OHCI_NEW) && defined(CFG_USB_OHCI_CPU_INIT) */ diff --git a/cpu/mips/cache.S b/cpu/mips/cache.S index 428d251bf..1b0efc34a 100644 --- a/cpu/mips/cache.S +++ b/cpu/mips/cache.S @@ -240,14 +240,16 @@ NESTED(mips_cache_reset, 0, ra) */ move a1, t2 move a2, t4 - bal mips_init_icache + PTR_LA t7, mips_init_icache + jalr t7 /* * then initialize D-cache. */ move a1, t3 move a2, t5 - bal mips_init_dcache + PTR_LA t7, mips_init_dcache + jalr t7 jr RA END(mips_cache_reset) diff --git a/cpu/mpc86xx/cache.S b/cpu/mpc86xx/cache.S index f316b3ec1..2e4ea0239 100644 --- a/cpu/mpc86xx/cache.S +++ b/cpu/mpc86xx/cache.S @@ -338,7 +338,7 @@ _GLOBAL(l2cache_invalidate) invl2: mfspr r3, l2cr - andi. r3, r3, L2CR_L2I@h + andis. r3, r3, L2CR_L2I@h bne invl2 blr diff --git a/cpu/ppc4xx/fdt.c b/cpu/ppc4xx/fdt.c index 02dece0c0..ccc73d5d6 100644 --- a/cpu/ppc4xx/fdt.c +++ b/cpu/ppc4xx/fdt.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2007 + * (C) Copyright 2007-2008 * Stefan Roese, DENX Software Engineering, sr@denx.de. * * See file CREDITS for list of people who contributed to this @@ -27,7 +27,7 @@ #include <asm/cache.h> #include <ppc4xx.h> -#if defined(CONFIG_OF_LIBFDT) +#if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) #include <libfdt.h> #include <libfdt_env.h> #include <fdt_support.h> @@ -35,6 +35,26 @@ DECLARE_GLOBAL_DATA_PTR; +void __ft_board_setup(void *blob, bd_t *bd) +{ + u32 val[4]; + int rc; + + ft_cpu_setup(blob, bd); + + /* Fixup NOR mapping */ + val[0] = 0; /* chip select number */ + val[1] = 0; /* always 0 */ + val[2] = gd->bd->bi_flashstart; + val[3] = gd->bd->bi_flashsize; + rc = fdt_find_and_setprop(blob, "/plb/opb/ebc", "ranges", + val, sizeof(val), 1); + if (rc) + printf("Unable to update property NOR mapping, err=%s\n", + fdt_strerror(rc)); +} +void ft_board_setup(void *blob, bd_t *bd) __attribute__((weak, alias("__ft_board_setup"))); + /* * Fixup all PCIe nodes by setting the device_type property * to "pci-endpoint" instead is "pci" for endpoint ports. @@ -109,4 +129,4 @@ void ft_cpu_setup(void *blob, bd_t *bd) */ fdt_pcie_setup(blob); } -#endif /* CONFIG_OF_LIBFDT */ +#endif /* CONFIG_OF_LIBFDT && CONFIG_OF_BOARD_SETUP */ diff --git a/cpu/ppc4xx/speed.c b/cpu/ppc4xx/speed.c index 05b42fec9..8b4e64a19 100644 --- a/cpu/ppc4xx/speed.c +++ b/cpu/ppc4xx/speed.c @@ -238,7 +238,7 @@ static u8 pll_fbdv_multi_bits[] = { /* values for: 101 - 200 */ 0x78, 0xf1, 0x62, 0xc5, 0x0a, 0x94, 0x28, 0xd0, 0x21, 0xc3, 0x06, 0x8c, 0x18, 0xb0, 0x60, 0xc1, 0x02, 0x84, 0x08, 0x90, - 0x20, 0xc0, 0x01, 0x83, 0x77, 0xff, 0x1f, 0xbf, 0x7f, 0xfe, + 0x20, 0xc0, 0x01, 0x83, 0x07, 0x8f, 0x1f, 0xbf, 0x7f, 0xfe, 0x7d, 0xfa, 0x75, 0xea, 0x55, 0xaa, 0x54, 0xa9, 0x53, 0xa6, 0x4c, 0x99, 0x33, 0xe7, 0x4e, 0x9d, 0x3b, 0xf7, 0x6e, 0xdd, 0x3a, 0xf4, 0x69, 0xd2, 0x25, 0xcb, 0x16, 0xac, 0x58, 0xb1, diff --git a/disk/part.c b/disk/part.c index 3c71208a1..316e25473 100644 --- a/disk/part.c +++ b/disk/part.c @@ -109,44 +109,45 @@ void dev_print (block_dev_desc_t *dev_desc) lbaint_t lba512; #endif - if (dev_desc->type==DEV_TYPE_UNKNOWN) { - puts ("not available\n"); - return; - } - if (dev_desc->if_type==IF_TYPE_SCSI) { - printf ("(%d:%d) ", dev_desc->target,dev_desc->lun); - } - if (dev_desc->if_type==IF_TYPE_IDE) { - printf ("Model: %s Firm: %s Ser#: %s\n", + switch (dev_desc->type) { + case IF_TYPE_SCSI: + printf ("(%d:%d) Vendor: %s Prod.: %s Rev: %s\n", + dev_desc->target,dev_desc->lun, dev_desc->vendor, - dev_desc->revision, - dev_desc->product); - } - if (dev_desc->if_type==IF_TYPE_SATA) { + dev_desc->product, + dev_desc->revision); + break; + case IF_TYPE_IDE: + case IF_TYPE_SATA: printf ("Model: %s Firm: %s Ser#: %s\n", dev_desc->vendor, dev_desc->revision, dev_desc->product); - } else { - printf ("Vendor: %s Prod.: %s Rev: %s\n", - dev_desc->vendor, - dev_desc->product, - dev_desc->revision); + break; + case DEV_TYPE_UNKNOWN: + default: + puts ("not available\n"); + return; } puts (" Type: "); if (dev_desc->removable) puts ("Removable "); switch (dev_desc->type & 0x1F) { - case DEV_TYPE_HARDDISK: puts ("Hard Disk"); - break; - case DEV_TYPE_CDROM: puts ("CD ROM"); - break; - case DEV_TYPE_OPDISK: puts ("Optical Device"); - break; - case DEV_TYPE_TAPE: puts ("Tape"); - break; - default: printf ("# %02X #", dev_desc->type & 0x1F); - break; + case DEV_TYPE_HARDDISK: + puts ("Hard Disk"); + break; + case DEV_TYPE_CDROM: + puts ("CD ROM"); + break; + case DEV_TYPE_OPDISK: + puts ("Optical Device"); + break; + case DEV_TYPE_TAPE: + puts ("Tape"); + break; + default: + printf ("# %02X #", dev_desc->type & 0x1F); + break; } puts ("\n"); if ((dev_desc->lba * dev_desc->blksz)>0L) { @@ -281,20 +282,27 @@ static void print_part_header (const char *type, block_dev_desc_t * dev_desc) { puts ("\nPartition Map for "); switch (dev_desc->if_type) { - case IF_TYPE_IDE: puts ("IDE"); - break; - case IF_TYPE_SATA: puts ("SATA"); - break; - case IF_TYPE_SCSI: puts ("SCSI"); - break; - case IF_TYPE_ATAPI: puts ("ATAPI"); - break; - case IF_TYPE_USB: puts ("USB"); - break; - case IF_TYPE_DOC: puts ("DOC"); - break; - default: puts ("UNKNOWN"); - break; + case IF_TYPE_IDE: + puts ("IDE"); + break; + case IF_TYPE_SATA: + puts ("SATA"); + break; + case IF_TYPE_SCSI: + puts ("SCSI"); + break; + case IF_TYPE_ATAPI: + puts ("ATAPI"); + break; + case IF_TYPE_USB: + puts ("USB"); + break; + case IF_TYPE_DOC: + puts ("DOC"); + break; + default: + puts ("UNKNOWN"); + break; } printf (" device %d -- Partition Type: %s\n\n", dev_desc->dev, type); diff --git a/doc/README.nand-boot-ppc440 b/doc/README.nand-boot-ppc440 index a1c1d8c44..1e9c10264 100644 --- a/doc/README.nand-boot-ppc440 +++ b/doc/README.nand-boot-ppc440 @@ -9,7 +9,7 @@ The PPC440EP(x)/GR(x) cpu's can boot directly from NAND FLASH, completely without NOR FLASH. This can be done by using the NAND boot feature of the 440 NAND flash controller (NDFC). -Here a short desciption of the different boot stages: +Here a short description of the different boot stages: a) IPL (Initial Program Loader, integrated inside CPU) ------------------------------------------------------ diff --git a/include/.gitignore b/include/.gitignore index 03a533ced..ef7dd5fc8 100644 --- a/include/.gitignore +++ b/include/.gitignore @@ -1,7 +1,7 @@ /autoconf.mk* /asm -/asm-blackfin/arch -/asm-ppc/arch +/asm-*/arch +/asm-*/proc /bmp_logo.h /config.h /config.mk diff --git a/include/configs/acadia.h b/include/configs/acadia.h index 3cd5ad62c..bbf726dc6 100644 --- a/include/configs/acadia.h +++ b/include/configs/acadia.h @@ -59,16 +59,16 @@ * Base addresses -- Note these are effective addresses where the * actual resources get mapped (not physical addresses) *----------------------------------------------------------------------*/ -#define CFG_MONITOR_LEN (256 * 1024)/* Reserve 256 kB for Monitor */ -#define CFG_MALLOC_LEN (512 * 1024)/* Reserve 512 kB for malloc() */ - #define CFG_SDRAM_BASE 0x00000000 #define CFG_FLASH_BASE 0xfe000000 -#define CFG_MONITOR_BASE TEXT_BASE #define CFG_CPLD_BASE 0x80000000 #define CFG_NAND_ADDR 0xd0000000 #define CFG_USB_HOST 0xef603000 /* USB OHCI 1.1 controller */ +#define CFG_MONITOR_BASE TEXT_BASE +#define CFG_MONITOR_LEN (0xFFFFFFFF - CFG_MONITOR_BASE + 1) +#define CFG_MALLOC_LEN (512 * 1024)/* Reserve 512 kB for malloc() */ + /*----------------------------------------------------------------------- * Initial RAM & stack pointer *----------------------------------------------------------------------*/ @@ -237,6 +237,7 @@ #define CONFIG_PHY_ADDR 0 /* PHY address */ #define CONFIG_NET_MULTI 1 #define CFG_RX_ETH_BUFFER 16 /* # of rx buffers & descriptors*/ +#define CONFIG_HAS_ETH0 1 #define CONFIG_NETCONSOLE /* include NetConsole support */ @@ -246,6 +247,9 @@ #undef CONFIG_BOOTARGS +#define xstr(s) str(s) +#define str(s) #s + #define CONFIG_EXTRA_ENV_SETTINGS \ "netdev=eth0\0" \ "hostname=acadia\0" \ @@ -268,8 +272,9 @@ "ramdisk_addr=fff20000\0" \ "initrd_high=30000000\0" \ "load=tftp 200000 acadia/u-boot.bin\0" \ - "update=protect off fffc0000 ffffffff;era fffc0000 ffffffff;" \ - "cp.b ${fileaddr} fffc0000 ${filesize};" \ + "update=protect off " xstr(CFG_MONITOR_BASE) " FFFFFFFF;" \ + "era " xstr(CFG_MONITOR_BASE) " FFFFFFFF;" \ + "cp.b ${fileaddr} " xstr(CFG_MONITOR_BASE) " ${filesize};" \ "setenv filesize;saveenv\0" \ "upd=run load update\0" \ "nload=tftp 200000 acadia/u-boot-nand.bin\0" \ @@ -501,4 +506,8 @@ #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */ #endif +/* pass open firmware flat tree */ +#define CONFIG_OF_LIBFDT 1 +#define CONFIG_OF_BOARD_SETUP 1 + #endif /* __CONFIG_H */ diff --git a/include/configs/bamboo.h b/include/configs/bamboo.h index 4ea040bc2..2f0df8ad2 100644 --- a/include/configs/bamboo.h +++ b/include/configs/bamboo.h @@ -291,6 +291,7 @@ #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */ #define CFG_LOADS_BAUD_CHANGE 1 /* allow baudrate change */ +#define CONFIG_HAS_ETH0 #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 0 /* PHY address, See schematics */ #define CONFIG_PHY1_ADDR 1 @@ -426,4 +427,9 @@ #define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */ #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */ #endif + +/* pass open firmware flat tree */ +#define CONFIG_OF_LIBFDT 1 +#define CONFIG_OF_BOARD_SETUP 1 + #endif /* __CONFIG_H */ diff --git a/include/configs/bubinga.h b/include/configs/bubinga.h index 784e7c0f8..cbd74a0d8 100644 --- a/include/configs/bubinga.h +++ b/include/configs/bubinga.h @@ -128,6 +128,7 @@ #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 1 /* PHY address */ +#define CONFIG_HAS_ETH0 #define CONFIG_HAS_ETH1 #define CONFIG_PHY1_ADDR 2 /* EMAC1 PHY address */ #define CONFIG_NET_MULTI 1 @@ -435,4 +436,8 @@ #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */ #endif +/* pass open firmware flat tree */ +#define CONFIG_OF_LIBFDT 1 +#define CONFIG_OF_BOARD_SETUP 1 + #endif /* __CONFIG_H */ diff --git a/include/configs/ebony.h b/include/configs/ebony.h index 88fd7caa7..ba68fd4b9 100644 --- a/include/configs/ebony.h +++ b/include/configs/ebony.h @@ -201,6 +201,7 @@ #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 8 /* PHY address */ +#define CONFIG_HAS_ETH0 #define CONFIG_HAS_ETH1 #define CONFIG_PHY1_ADDR 9 /* EMAC1 PHY address */ #define CONFIG_NET_MULTI 1 @@ -306,4 +307,9 @@ #define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */ #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */ #endif + +/* pass open firmware flat tree */ +#define CONFIG_OF_LIBFDT 1 +#define CONFIG_OF_BOARD_SETUP 1 + #endif /* __CONFIG_H */ diff --git a/include/configs/katmai.h b/include/configs/katmai.h index d2f6b1021..cce883fd8 100644 --- a/include/configs/katmai.h +++ b/include/configs/katmai.h @@ -79,7 +79,7 @@ #define CFG_ACE_BASE 0xfe000000 /* Xilinx ACE controller - Compact Flash */ #define CFG_MONITOR_BASE TEXT_BASE -#define CFG_MONITOR_LEN (0xFFFFFFFF - CFG_MONITOR_LEN + 1) +#define CFG_MONITOR_LEN (0xFFFFFFFF - CFG_MONITOR_BASE + 1) #define CFG_MALLOC_LEN (512 * 1024) /* Reserve 512 kB for malloc */ /*----------------------------------------------------------------------- diff --git a/include/configs/kilauea.h b/include/configs/kilauea.h index f4cf42c31..57cc90a6d 100644 --- a/include/configs/kilauea.h +++ b/include/configs/kilauea.h @@ -490,7 +490,7 @@ * Some Kilauea stuff..., mainly fpga registers */ #define CFG_FPGA_REG_BASE CFG_FPGA_BASE -#define CFG_FPGA_FIFO_BASE (in32(CFG_FPGA_BASE) | (1 << 11)) +#define CFG_FPGA_FIFO_BASE (in32(CFG_FPGA_BASE) | (1 << 10)) /* interrupt */ #define CFG_FPGA_SLIC0_R_DPRAM_INT 0x80000000 diff --git a/include/configs/luan.h b/include/configs/luan.h index af237d9be..37151d31f 100644 --- a/include/configs/luan.h +++ b/include/configs/luan.h @@ -195,6 +195,7 @@ #define CONFIG_LOADS_ECHO 1 /* echo on for serial download */ #define CFG_LOADS_BAUD_CHANGE 1 /* allow baudrate change */ +#define CONFIG_HAS_ETH0 #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 1 #define CONFIG_CIS8201_PHY 1 /* Enable 'special' RGMII mode for Cicada phy */ @@ -306,4 +307,8 @@ #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */ #endif +/* pass open firmware flat tree */ +#define CONFIG_OF_LIBFDT 1 +#define CONFIG_OF_BOARD_SETUP 1 + #endif /* __CONFIG_H */ diff --git a/include/configs/ml401.h b/include/configs/ml401.h index 360e2e11d..7e0df8701 100644 --- a/include/configs/ml401.h +++ b/include/configs/ml401.h @@ -56,9 +56,11 @@ /* ethernet */ #ifdef XILINX_EMAC_BASEADDR #define CONFIG_XILINX_EMAC 1 +#define CFG_ENET #else #ifdef XILINX_EMACLITE_BASEADDR #define CONFIG_XILINX_EMACLITE 1 +#define CFG_ENET #endif #endif #undef ET_DEBUG @@ -70,18 +72,28 @@ #endif /* interrupt controller */ +#ifdef XILINX_INTC_BASEADDR #define CFG_INTC_0 1 #define CFG_INTC_0_ADDR XILINX_INTC_BASEADDR #define CFG_INTC_0_NUM XILINX_INTC_NUM_INTR_INPUTS +#endif /* timer */ +#ifdef XILINX_TIMER_BASEADDR +#if (XILINX_TIMER_IRQ != -1) #define CFG_TIMER_0 1 #define CFG_TIMER_0_ADDR XILINX_TIMER_BASEADDR #define CFG_TIMER_0_IRQ XILINX_TIMER_IRQ #define FREQUENCE XILINX_CLOCK_FREQ #define CFG_TIMER_0_PRELOAD ( FREQUENCE/1000 ) +#endif +#else +#ifdef XILINX_CLOCK_FREQ #define CONFIG_XILINX_CLOCK_FREQ XILINX_CLOCK_FREQ - +#else +#error BAD CLOCK FREQ +#endif +#endif /* FSL */ /* #define CFG_FSL_2 */ /* #define FSL_INTR_2 1 */ @@ -195,7 +207,12 @@ #define CONFIG_CMD_CACHE #define CONFIG_CMD_IRQ #define CONFIG_CMD_MFSL -#define CONFIG_CMD_PING + +#ifndef CFG_ENET + #undef CONFIG_CMD_NET +#else + #define CONFIG_CMD_PING +#endif #if defined(CONFIG_SYSTEMACE) #define CONFIG_CMD_EXT2 diff --git a/include/configs/ocotea.h b/include/configs/ocotea.h index 5a6eb4a37..be2b3ec7e 100644 --- a/include/configs/ocotea.h +++ b/include/configs/ocotea.h @@ -330,4 +330,9 @@ #define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */ #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */ #endif + +/* pass open firmware flat tree */ +#define CONFIG_OF_LIBFDT 1 +#define CONFIG_OF_BOARD_SETUP 1 + #endif /* __CONFIG_H */ diff --git a/include/configs/taihu.h b/include/configs/taihu.h index 7db973676..8a1ff1acb 100644 --- a/include/configs/taihu.h +++ b/include/configs/taihu.h @@ -114,6 +114,7 @@ #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_PHY_ADDR 0x14 /* PHY address */ +#define CONFIG_HAS_ETH0 #define CONFIG_HAS_ETH1 #define CONFIG_PHY1_ADDR 0x10 /* EMAC1 PHY address */ #define CONFIG_NET_MULTI 1 @@ -433,4 +434,8 @@ unsigned char spi_read(void); #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */ #endif +/* pass open firmware flat tree */ +#define CONFIG_OF_LIBFDT 1 +#define CONFIG_OF_BOARD_SETUP 1 + #endif /* __CONFIG_H */ diff --git a/include/configs/taishan.h b/include/configs/taishan.h index 851a7ad40..1879d3852 100644 --- a/include/configs/taishan.h +++ b/include/configs/taishan.h @@ -331,4 +331,9 @@ #define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */ #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */ #endif + +/* pass open firmware flat tree */ +#define CONFIG_OF_LIBFDT 1 +#define CONFIG_OF_BOARD_SETUP 1 + #endif /* __CONFIG_H */ diff --git a/include/configs/walnut.h b/include/configs/walnut.h index f6e99aca7..adc420b9a 100644 --- a/include/configs/walnut.h +++ b/include/configs/walnut.h @@ -92,6 +92,7 @@ #define CONFIG_PHY_ADDR 1 /* PHY address */ #define CFG_RX_ETH_BUFFER 16 /* use 16 rx buffer on 405 emac */ +#define CONFIG_HAS_ETH0 1 #define CONFIG_NETCONSOLE /* include NetConsole support */ #define CONFIG_NET_MULTI /* needed for NetConsole */ @@ -346,4 +347,9 @@ #define CONFIG_KGDB_BAUDRATE 230400 /* speed to run kgdb serial port */ #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */ #endif + +/* pass open firmware flat tree */ +#define CONFIG_OF_LIBFDT 1 +#define CONFIG_OF_BOARD_SETUP 1 + #endif /* __CONFIG_H */ diff --git a/include/configs/xupv2p.h b/include/configs/xupv2p.h index 30fb303c9..c738567a5 100644 --- a/include/configs/xupv2p.h +++ b/include/configs/xupv2p.h @@ -63,9 +63,11 @@ /* ethernet */ #ifdef XILINX_EMAC_BASEADDR #define CONFIG_XILINX_EMAC 1 +#define CFG_ENET #else #ifdef XILINX_EMACLITE_BASEADDR #define CONFIG_XILINX_EMACLITE 1 +#define CFG_ENET #endif #endif #undef ET_DEBUG @@ -77,18 +79,28 @@ #endif /* interrupt controller */ +#ifdef XILINX_INTC_BASEADDR #define CFG_INTC_0 1 #define CFG_INTC_0_ADDR XILINX_INTC_BASEADDR #define CFG_INTC_0_NUM XILINX_INTC_NUM_INTR_INPUTS +#endif /* timer */ +#ifdef XILINX_TIMER_BASEADDR +#if (XILINX_TIMER_IRQ != -1) #define CFG_TIMER_0 1 #define CFG_TIMER_0_ADDR XILINX_TIMER_BASEADDR #define CFG_TIMER_0_IRQ XILINX_TIMER_IRQ #define FREQUENCE XILINX_CLOCK_FREQ #define CFG_TIMER_0_PRELOAD ( FREQUENCE/1000 ) +#endif +#else +#ifdef XILINX_CLOCK_FREQ #define CONFIG_XILINX_CLOCK_FREQ XILINX_CLOCK_FREQ - +#else +#error BAD CLOCK FREQ +#endif +#endif /* * memory layout - Example * TEXT_BASE = 0x3600_0000; @@ -162,7 +174,12 @@ #define CONFIG_CMD_ASKENV #define CONFIG_CMD_CACHE #define CONFIG_CMD_IRQ -#define CONFIG_CMD_PING + +#ifndef CFG_ENET + #undef CONFIG_CMD_NET +#else + #define CONFIG_CMD_PING +#endif #ifdef XILINX_SYSACE_BASEADDR #define CONFIG_CMD_EXT2 diff --git a/include/configs/yosemite.h b/include/configs/yosemite.h index c9323f607..f22e79824 100644 --- a/include/configs/yosemite.h +++ b/include/configs/yosemite.h @@ -139,7 +139,6 @@ #define CFG_KBYTES_SDRAM (128 * 1024) /* 128MB */ #define CFG_SDRAM_BANKS (2) - /*----------------------------------------------------------------------- * I2C *----------------------------------------------------------------------*/ @@ -227,6 +226,7 @@ #define CONFIG_MII 1 /* MII PHY management */ #define CONFIG_NET_MULTI 1 /* required for netconsole */ #define CONFIG_PHY1_ADDR 3 +#define CONFIG_HAS_ETH0 1 /* add support for "ethaddr" */ #define CONFIG_HAS_ETH1 1 /* add support for "eth1addr" */ #define CONFIG_PHY_ADDR 1 /* PHY address, See schematics */ @@ -383,4 +383,8 @@ #define CONFIG_KGDB_SER_INDEX 2 /* which serial port to use */ #endif +/* pass open firmware flat tree */ +#define CONFIG_OF_LIBFDT 1 +#define CONFIG_OF_BOARD_SETUP 1 + #endif /* __CONFIG_H */ diff --git a/include/configs/yucca.h b/include/configs/yucca.h index 1e3571eb4..6f9d3e3c6 100644 --- a/include/configs/yucca.h +++ b/include/configs/yucca.h @@ -541,4 +541,8 @@ /*---------------------------------------------------------------------------*/ +/* pass open firmware flat tree */ +#define CONFIG_OF_LIBFDT 1 +#define CONFIG_OF_BOARD_SETUP 1 + #endif /* __CONFIG_H */ diff --git a/include/logbuff.h b/include/logbuff.h index d41572905..f117c66e3 100644 --- a/include/logbuff.h +++ b/include/logbuff.h @@ -60,6 +60,7 @@ int drv_logbuff_init (void); void logbuff_init_ptrs (void); void logbuff_log(char *msg); void logbuff_reset (void); +unsigned long logbuffer_base (void); #endif /* CONFIG_LOGBUFFER */ diff --git a/lib_generic/crc32.c b/lib_generic/crc32.c index 64f66ed6f..83d1d1d3a 100644 --- a/lib_generic/crc32.c +++ b/lib_generic/crc32.c @@ -14,7 +14,9 @@ #include <stdint.h> #endif +#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) #include <watchdog.h> +#endif #include "zlib.h" #define local static diff --git a/lib_ppc/board.c b/lib_ppc/board.c index 1b8a8721a..bc49ea128 100644 --- a/lib_ppc/board.c +++ b/lib_ppc/board.c @@ -398,6 +398,11 @@ ulong get_effective_memsize(void) ************************************************************************ */ +unsigned long logbuffer_base(void) +{ + return CFG_SDRAM_BASE + get_effective_memsize() - LOGBUFF_LEN; +} + void board_init_f (ulong bootflag) { bd_t *bd; @@ -453,18 +458,7 @@ void board_init_f (ulong bootflag) */ gd->ram_size -= CFG_MEM_TOP_HIDE; -#ifndef CONFIG_MAX_MEM_MAPPED -#define CONFIG_MAX_MEM_MAPPED (256 << 20) -#endif - -#ifndef CONFIG_VERY_BIG_RAM addr = CFG_SDRAM_BASE + get_effective_memsize(); -#else - /* only allow stack below 256M */ - addr = CFG_SDRAM_BASE + - (gd->ram_size > CONFIG_MAX_MEM_MAPPED) ? - CONFIG_MAX_MEM_MAPPED : get_effective_memsize(); -#endif #ifdef CONFIG_LOGBUFFER #ifndef CONFIG_ALT_LB_ADDR diff --git a/tools/env/Makefile b/tools/env/Makefile index ea2d5b5a0..9629ee58e 100644 --- a/tools/env/Makefile +++ b/tools/env/Makefile @@ -26,7 +26,7 @@ include $(TOPDIR)/config.mk SRCS := $(obj)crc32.c fw_env.c fw_env_main.c HEADERS := fw_env.h -CPPFLAGS := -Wall -DUSE_HOSTCC +CPPFLAGS := -Wall -DUSE_HOSTCC -I$(SRCTREE)/include ifeq ($(MTD_VERSION),old) CPPFLAGS += -DMTD_OLD diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index e083a5b11..b8bca91c3 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2000-2003 + * (C) Copyright 2000-2008 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * See file CREDITS for list of people who contributed to this @@ -209,13 +209,14 @@ char *fw_getenv (char *name) * Print the current definition of one, or more, or all * environment variables */ -void fw_printenv (int argc, char *argv[]) +int fw_printenv (int argc, char *argv[]) { char *env, *nxt; int i, n_flag; + int rc = 0; if (env_init ()) - return; + return (-1); if (argc == 1) { /* Print all env variables */ for (env = environment.data; *env; env = nxt + 1) { @@ -223,13 +224,13 @@ void fw_printenv (int argc, char *argv[]) if (nxt >= &environment.data[ENV_SIZE]) { fprintf (stderr, "## Error: " "environment not terminated\n"); - return; + return (-1); } } printf ("%s\n", env); } - return; + return (0); } if (strcmp (argv[1], "-n") == 0) { @@ -239,7 +240,7 @@ void fw_printenv (int argc, char *argv[]) if (argc != 2) { fprintf (stderr, "## Error: " "`-n' option requires exactly one argument\n"); - return; + return (-1); } } else { n_flag = 0; @@ -255,7 +256,7 @@ void fw_printenv (int argc, char *argv[]) if (nxt >= &environment.data[ENV_SIZE]) { fprintf (stderr, "## Error: " "environment not terminated\n"); - return; + return (-1); } } val = envmatch (name, env); @@ -268,9 +269,13 @@ void fw_printenv (int argc, char *argv[]) break; } } - if (!val) + if (!val) { fprintf (stderr, "## Error: \"%s\" not defined\n", name); + rc = -1; + } } + + return (rc); } /* diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h index 58607ded5..248f58c4a 100644 --- a/tools/env/fw_env.h +++ b/tools/env/fw_env.h @@ -1,5 +1,5 @@ /* - * (C) Copyright 2002 + * (C) Copyright 2002-2008 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * See file CREDITS for list of people who contributed to this @@ -47,7 +47,7 @@ "ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; " \ "bootm" -extern void fw_printenv(int argc, char *argv[]); +extern int fw_printenv(int argc, char *argv[]); extern char *fw_getenv (char *name); extern int fw_setenv (int argc, char *argv[]); diff --git a/tools/env/fw_env_main.c b/tools/env/fw_env_main.c index 696e30efd..7f631c449 100644 --- a/tools/env/fw_env_main.c +++ b/tools/env/fw_env_main.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2000 + * (C) Copyright 2000-2008 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * See file CREDITS for list of people who contributed to this @@ -25,15 +25,16 @@ * Command line user interface to firmware (=U-Boot) environment. * * Implements: - * fw_printenv [ name ... ] - * - prints the values of the environment variables - * "name", or the whole environment if no names are - * specified + * fw_printenv [[ -n name ] | [ name ... ]] + * - prints the value of a single environment variable + * "name", the ``name=value'' pairs of one or more + * environment variables "name", or the whole + * environment if no names are specified. * fw_setenv name [ value ... ] * - If a name without any values is given, the variable * with this name is deleted from the environment; * otherwise, all "value" arguments are concatenated, - * separated by sinlge blank characters, and the + * separated by single blank characters, and the * resulting string is assigned to the environment * variable "name" */ @@ -58,16 +59,18 @@ main(int argc, char *argv[]) if (strcmp(cmdname, CMD_PRINTENV) == 0) { - fw_printenv (argc, argv); + if (fw_printenv (argc, argv) != 0) + return (EXIT_FAILURE); - return (EXIT_SUCCESS); + return (EXIT_SUCCESS); } else if (strcmp(cmdname, CMD_SETENV) == 0) { - if (fw_setenv (argc, argv) != 0) - return (EXIT_FAILURE); + if (fw_setenv (argc, argv) != 0) + return (EXIT_FAILURE); + + return (EXIT_SUCCESS); - return (EXIT_SUCCESS); } fprintf (stderr, |