]> git.sur5r.net Git - u-boot/commitdiff
* Patch by Bernhard Kuhn, 28 Oct 2003:
authorwdenk <wdenk>
Fri, 7 Nov 2003 13:42:26 +0000 (13:42 +0000)
committerwdenk <wdenk>
Fri, 7 Nov 2003 13:42:26 +0000 (13:42 +0000)
  Add low boot support for MPC5200

* Fix problem with dual PCMCIA support (NSCU)

* Fix MPC5200 I2C initialization function

CHANGELOG
Makefile
board/icecube/config.mk
board/icecube/icecube.c
common/cmd_ide.c
cpu/mpc5xxx/i2c.c
cpu/mpc5xxx/start.S
include/configs/IceCube.h
include/version.h

index 16d767146e20068e1b93b631f85ed153ca2a6a29..69ddff983847f5f9d13972f6d2da1cdb61801b51 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,14 @@
+======================================================================
+Changes since U-Boot 1.0.0:
+======================================================================
+
+* Patch by Bernhard Kuhn, 28 Oct 2003:
+  Add low boot support for MPC5200
+
+* Fix problem with dual PCMCIA support (NSCU)
+
+* Fix MPC5200 I2C initialization function
+
 ======================================================================
 Changes for U-Boot 1.0.0:
 ======================================================================
index df2dfad5327ae89e38c8ff84d76b732d47d5f42a..ef7e4fcb17e4c72e9e5123bce4f6da9b020e1ebe 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -203,11 +203,21 @@ cmi_mpc5xx_config:        unconfig
 #########################################################################
 ## MPC5xxx Systems
 #########################################################################
-MPC5200LITE            \
-icecube_5200_config    \
-IceCube_5200_config    \
+MPC5200LITE_config             \
+MPC5200LITE_LOWBOOT_config     \
+MPC5200LITE_LOWBOOT08_config   \
+icecube_5200_config            \
+IceCube_5200_config            \
 IceCube_5100_config:           unconfig
        @ >include/config.h
+       @[ -z "$(findstring LOWBOOT,$@)" ] || \
+               { echo "TEXT_BASE = 0xFF000000" >board/icecube/config.tmp ; \
+                 echo "... with LOWBOOT configuration" ; \
+               }
+       @[ -z "$(findstring LOWBOOT08,$@)" ] || \
+               { echo "TEXT_BASE = 0xFF800000" >board/icecube/config.tmp ; \
+                 echo "... with 8 MB flash only" ; \
+               }
        @[ -z "$(findstring 5200,$@)" ] || \
                { echo "#define CONFIG_MPC5200"         >>include/config.h ; \
                  echo "... with MPC5200 processor" ; \
@@ -999,7 +1009,7 @@ clean:
        rm -f tools/gdb/astest tools/gdb/gdbcont tools/gdb/gdbsend
        rm -f tools/env/fw_printenv tools/env/fw_setenv
        rm -f board/cray/L1/bootscript.c board/cray/L1/bootscript.image
-       rm -f board/trab/trab_fkt board/trab/config.tmp
+       rm -f board/trab/trab_fkt board/*/config.tmp
 
 clobber:       clean
        find . -type f \
index 9913cfb486c698afb74102294dbb96b45e251a8f..07b5de1881cc34f71ddec987c09591a950ec88bb 100644 (file)
 #
 
 #
-# IceCube board
+# IceCube board:
 #
+#      Valid values for TEXT_BASE are:
+#
+#      0xFFF00000   boot high (standard configuration)
+#      0xFF000000   boot low for 16 MiB boards
+#      0xFF800000   boot low for  8 MiB boards
+#      0x00100000   boot from RAM (for testing only)
+#
+
+sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp
 
-TEXT_BASE = 0xfff00000
+ifndef TEXT_BASE
+## Standard: boot high
+TEXT_BASE = 0xFFF00000
+## For testing: boot from RAM
 # TEXT_BASE = 0x00100000
+endif
 
 PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -I$(TOPDIR)/board
index 26cce5d0bcf3ae0bb1907666477b2203938df351..1b69d1376f32ae97214b4806ecf10cf9745546e7 100644 (file)
@@ -134,7 +134,7 @@ long int initdram (int board_type)
        *(vu_long *)MPC5XXX_SDRAM_STOP = ((dramsize - 1) >> 15);
 #endif
 
-#else
+#else  /* CFG_RAMBOOT */
 #ifdef CONFIG_MGT5100
        *(vu_long *)MPC5XXX_ADDECR |= (1 << 22); /* Enable SDRAM */
        dramsize = ((*(vu_long *)MPC5XXX_SDRAM_STOP + 1) << 15);
index 21a666644f928ef8984073cdb32ccca5080cd3e8..45f6368a7612489ce09dfd04de9a160baea55961 100644 (file)
@@ -631,6 +631,7 @@ void ide_init (void)
 #ifdef CONFIG_IDE_LED
                int led = (IDE_BUS(i) == 0) ? LED_IDE1 : LED_IDE2;
 #endif
+               ide_dev_desc[i].type=DEV_TYPE_UNKNOWN;
                ide_dev_desc[i].if_type=IF_TYPE_IDE;
                ide_dev_desc[i].dev=i;
                ide_dev_desc[i].part_type=PART_TYPE_UNKNOWN;
@@ -991,11 +992,9 @@ static void ide_ident (block_dev_desc_t *dev_desc)
                if (retries == 0) {
                        do_retry = 1;
                } else {
-                       dev_desc->type=DEV_TYPE_UNKNOWN;
                        return;
                }
 #else
-               dev_desc->type=DEV_TYPE_UNKNOWN;
                return;
 #endif /* CONFIG_AMIGAONEG3SE */
        }
index ea37fb0e68d6cf41f5f1f4476ee5fe07d4d834fc..75c7739d6b9106d78686fd54bb7de53fd186dc30 100644 (file)
@@ -229,9 +229,10 @@ static int mpc_get_fdr(int speed)
 {
        DECLARE_GLOBAL_DATA_PTR;
        static int fdr = -1;
-       static int best_speed = 0;
 
        if (fdr == -1) {
+               ulong best_speed = 0;
+               ulong divider;
                ulong ipb, scl;
                ulong bestmatch = 0xffffffffUL;
                int best_i = 0, best_j = 0, i, j;
@@ -262,8 +263,13 @@ static int mpc_get_fdr(int speed)
                                }
                        }
                }
-               fdr = (best_i & 3) | ((best_i & 4) << 3) | (best_j << 2);
-               printf("%d kHz, ", best_speed / 1000);
+               divider = (best_i & 3) | ((best_i & 4) << 3) | (best_j << 2);
+               if (gd->flags & GD_FLG_RELOC) {
+                       fdr = divider;
+               } else {
+                       printf("%ld kHz, ", best_speed / 1000);
+                       return divider;
+               }
        }
 
        return fdr;
index 0557909e19d42a639d6cabb94523e49cbc5565f4..e0873edbc6ad079b1454d8ddbe8d66eed666bfda 100644 (file)
@@ -103,6 +103,47 @@ boot_cold:
 boot_warm:
        mfmsr   r5                      /* save msr contents            */
 
+#if defined(CFG_LOWBOOT)
+       lis     r4, CFG_DEFAULT_MBAR@h
+       lis     r3,     0x0000FF00@h
+       ori     r3, r3, 0x0000FF00@l
+       stw     r3, 0x4(r4)
+       lis     r3,     0x0000FFFF@h
+       ori     r3, r3, 0x0000FFFF@l
+       stw     r3, 0x8(r4)
+       lis     r3,     0x00047800@h
+       ori     r3, r3, 0x00047800@l
+       stw     r3, 0x300(r4)
+       lis     r3,     0x02010000@h
+       ori     r3, r3, 0x02010000@l
+       stw     r3, 0x54(r4)
+
+#if defined(CFG_LOWBOOT08)
+       lis     r3,     0xff800160@h
+       ori     r3, r3, 0xff800160@l
+#endif
+#if defined(CFG_LOWBOOT16)
+       lis     r3,     0xff000160@h
+       ori     r3, r3, 0xff000160@l
+#endif
+       mtlr    r3
+       blr
+lowboot_reentry:       /* FLASH_BASE + 0x160 */
+       
+       lis     r3,     0x0000FF00@h
+       ori     r3, r3, 0x0000FF00@l
+       stw     r3, 0x4c(r4)
+       lis     r3,     0x0000FFFF@h
+       ori     r3, r3, 0x0000FFFF@l
+       stw     r3, 0x50(r4)
+       lis     r3,     0x00047800@h
+       ori     r3, r3, 0x00047800@l
+       stw     r3, 0x300(r4)
+       lis     r3,     0x02000001@h
+       ori     r3, r3, 0x02000001@l
+       stw     r3, 0x54(r4)
+#endif /* CFG_LOWBOOT */
+       
 #if defined(CFG_DEFAULT_MBAR) && !defined(CFG_RAMBOOT)
        lis     r3, CFG_MBAR@h
        ori     r3, r3, CFG_MBAR@l
index 821d3b9acad028d86afcba3287d1307a1ab9b104..59abaef4a45dfbcaf1661343161c837e4fca5dba 100644 (file)
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
 
+#if (TEXT_BASE == 0xFF000000)          /* Boot low with 16 MB Flash */
+#   define CFG_LOWBOOT         1
+#   define CFG_LOWBOOT16       1
+#endif
+#if (TEXT_BASE == 0xFF800000)          /* Boot low with  8 MB Flash */
+#   define CFG_LOWBOOT         1
+#   define CFG_LOWBOOT08       1
+#endif
+
 /*
  * Autobooting
  */
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds */
-#define CONFIG_BOOTCOMMAND     "bootm 100000"  /* autoboot command */
-#define CONFIG_BOOTARGS                "root=/dev/ram rw"
+
+#define CONFIG_PREBOOT "echo;" \
+       "echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
+       "echo"
+
+#undef CONFIG_BOOTARGS
+
+#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
+       "netdev=eth0\0"                                                 \
+       "nfsargs=setenv bootargs root=/dev/nfs rw "                     \
+               "nfsroot=$(serverip):$(rootpath)\0"                     \
+       "ramargs=setenv bootargs root=/dev/ram rw\0"                    \
+       "addip=setenv bootargs $(bootargs) "                            \
+               "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask)"      \
+               ":$(hostname):$(netdev):off panic=1\0"                  \
+       "flash_nfs=run nfsargs addip;"                                  \
+               "bootm $(kernel_addr)\0"                                \
+       "flash_self=run ramargs addip;"                                 \
+               "bootm $(kernel_addr) $(ramdisk_addr)\0"                \
+       "net_nfs=tftp 200000 $(bootfile);run nfsargs addip;bootm\0"     \
+       "rootpath=/opt/eldk/ppc_82xx\0"                                 \
+       "bootfile=/tftpboot/MPC5200/uImage\0"                           \
+       ""
+
+#define CONFIG_BOOTCOMMAND     "run flash_self"
 
 #if defined(CONFIG_MPC5200)
 /*
 /*
  * Flash configuration
  */
-#define CFG_FLASH_16M          1
-
-#if !defined(CFG_FLASH_16M) /* 8Mb chips support only */
-#define CFG_FLASH_BASE         0xff800000
-#define CFG_FLASH_SIZE         0x00800000
-#define CFG_MAX_FLASH_BANKS    1       /* max num of memory banks      */
-#define CFG_ENV_ADDR           (CFG_FLASH_BASE + 0x740000)
-#else
 #define CFG_FLASH_BASE         0xff000000
 #define CFG_FLASH_SIZE         0x01000000
+#if !defined(CFG_LOWBOOT)
 #define CFG_ENV_ADDR           (CFG_FLASH_BASE + 0x740000 + 0x800000)
-#define CFG_MAX_FLASH_BANKS    2       /* max num of memory banks      */
+#else  /* CFG_LOWBOOT */
+#if defined(CFG_LOWBOOT08)
+#define CFG_ENV_ADDR           (CFG_FLASH_BASE + 0x30000 + 0x800000)
 #endif
+#if defined(CFG_LOWBOOT16)
+#define CFG_ENV_ADDR           (CFG_FLASH_BASE + 0x30000)
+#endif
+#endif /* CFG_LOWBOOT */
+#define CFG_MAX_FLASH_BANKS    2       /* max num of memory banks      */
 
 #define CFG_MAX_FLASH_SECT     128     /* max num of sects on one chip */
 
index b4ee13a40a16fb164a9e06e6088a9516288d1fb2..e61a03cfb296b7368c51a7af28bbac8e32645a11 100644 (file)
@@ -24,6 +24,6 @@
 #ifndef        __VERSION_H__
 #define        __VERSION_H__
 
-#define        U_BOOT_VERSION  "U-Boot 1.0.0"
+#define        U_BOOT_VERSION  "U-Boot 1.0.1"
 
 #endif /* __VERSION_H__ */