]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
* Misc bug fixes
authorwdenk <wdenk>
Sat, 18 Nov 2000 00:48:35 +0000 (00:48 +0000)
committerwdenk <wdenk>
Sat, 18 Nov 2000 00:48:35 +0000 (00:48 +0000)
* All frequencies in HZ now (internally)
* Add support for BOOTP Domain Name Server Option
* Avoid overflowing the BOOTP vendor extension field

24 files changed:
CHANGELOG
common/board.c
common/cmd_boot.c
include/cmd_confdefs.h
include/config_CPCI405.h
include/config_IVMS8.h
include/config_SM850.h
include/config_SPD823TS.h
include/config_TQM823L.h
include/config_TQM850L.h
include/config_TQM855L.h
include/config_TQM860L.h
include/version.h
mpc8260/cpu.c
mpc8260/interrupts.c
mpc8260/serial_scc.c
mpc8260/serial_smc.c
mpc8260/speed.c
mpc8xx/cpu.c
mpc8xx/interrupts.c
mpc8xx/serial.c
mpc8xx/speed.c
ppc4xx/cpu.c
ppc4xx/start.S

index 384ef0ec84f0d0e4ed2644122dbe5c1653a2165a..eb1656cf38e63ad0c929ef40a7d463bce3d122c5 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -53,9 +53,13 @@ To do:
   (and it uses default address).
 
 ======================================================================
-Modifications since 0.6.2:
+Modifications for 0.6.3:
 ======================================================================
 
+* Misc bug fixes
+
+* All frequencies in HZ now (internally)
+
 * Add support for BOOTP Domain Name Server Option
 
 ======================================================================
index 48dad59f13d8469958c97ea447e8ecdc62996d2f..1b377792ea14c961117fa070943c1533d13de3ee 100644 (file)
@@ -70,20 +70,20 @@ void *sbrk (ptrdiff_t increment)
 char *
 strmhz(char *buf, long hz)
 {
-    int l, n;
+    long l, n;
 #if defined(CFG_CLKS_IN_HZ)
-    int m;
+    long m;
 #endif
 
     n = hz / 1000000L;
 
-    l = sprintf(buf, "%d", n);
+    l = sprintf(buf, "%ld", n);
 
 #if defined(CFG_CLKS_IN_HZ)
     m = (hz % 1000000L) / 1000L;
 
     if (m != 0)
-       sprintf(buf+l, ".%03d", m);
+       sprintf(buf+l, ".%03ld", m);
 #endif
 
     return (buf);
@@ -103,7 +103,7 @@ void
 board_init_f (ulong bootflag)
 {
     bd_t       *bd;
-    ulong      reg, len, clock_mhz;
+    ulong      reg, len;
     int                board_type;
     ulong      addr_moni, addr_sp;
     ulong      dram_size;
@@ -123,17 +123,11 @@ board_init_f (ulong bootflag)
 
 #endif /* CONFIG_8260 */
 
-#if defined(CFG_CLKS_IN_HZ)
-    clock_mhz = idata->cpu_clk;                                /* still in Hz */
-#else
-    clock_mhz = idata->cpu_clk / 1000 / 1000;          /* in MHz */
-#endif
-
     s = getenv ("baudrate");
     baudrate = s ? (int)simple_strtoul(s, NULL, 10) : CONFIG_BAUDRATE;
 
     /* set up serial port */
-    serial_init (clock_mhz, baudrate);
+    serial_init (idata->cpu_clk, baudrate);
 
     /* Initialize the console (before the relocation) */
     console_init_f ();
@@ -148,7 +142,7 @@ board_init_f (ulong bootflag)
 
     printf ("Initializing...\n  CPU:   ");             /* Check CPU            */
 
-    if (checkcpu(clock_mhz) < 0) {
+    if (checkcpu(idata->cpu_clk) < 0) {
        printf (failed);
        hang();
     }
@@ -286,21 +280,25 @@ board_init_f (ulong bootflag)
                s = (*e) ? e+1 : e;
     }
 
-    bd->bi_intfreq  = clock_mhz;               /* Internal Freq, in MHz        */
-    bd->bi_busfreq  = get_bus_freq(clock_mhz); /* Bus Freq,      in MHz        */
-#if defined(CONFIG_8260)
-# if defined(CFG_CLKS_IN_HZ)
+#if defined(CFG_CLKS_IN_HZ)
+    bd->bi_intfreq  = idata->cpu_clk;                  /* Internal Freq, in Hz */
+    bd->bi_busfreq  = get_bus_freq(idata->cpu_clk);    /* Bus Freq,      in Hz */
+# if defined(CONFIG_8260)
     bd->bi_cpmfreq = idata->cpm_clk;
     bd->bi_brgfreq = idata->brg_clk;
     bd->bi_sccfreq = idata->scc_clk;
-    bd->bi_vco = idata->vco_out;
-# else
-    bd->bi_cpmfreq = idata->cpm_clk / 1000 / 1000;
-    bd->bi_brgfreq = idata->brg_clk / 1000 / 1000;
-    bd->bi_sccfreq = idata->scc_clk / 1000 / 1000;
-    bd->bi_vco = idata->vco_out / 1000 / 1000;
-# endif
-#endif /* CONFIG_8260 */
+    bd->bi_vco    = idata->vco_out;
+# endif /* CONFIG_8260 */
+#else
+    bd->bi_intfreq  = idata->cpu_clk / 1000000L;
+    bd->bi_busfreq  = get_bus_freq(idata->cpu_clk) / 1000000L;
+# if defined(CONFIG_8260)
+    bd->bi_cpmfreq = idata->cpm_clk / 1000000L;
+    bd->bi_brgfreq = idata->brg_clk / 1000000L;
+    bd->bi_sccfreq = idata->scc_clk / 1000000L;
+    bd->bi_vco    = idata->vco_out / 1000000L;
+# endif        /* CONFIG_8260 */
+#endif /* CFG_CLKS_IN_HZ */
 
     bd->bi_baudrate = baudrate;                        /* Console Baudrate             */
 
@@ -308,7 +306,7 @@ board_init_f (ulong bootflag)
     strncpy(bd->bi_s_version, "1.2", sizeof(bd->bi_s_version));
     strncpy(bd->bi_r_version, PPCBOOT_VERSION, sizeof(bd->bi_r_version));
 
-    bd->bi_procfreq = bd->bi_intfreq * 1000000; /* Processor Speed, In Hz */
+    bd->bi_procfreq    = idata->cpu_clk; /* Processor Speed, In Hz */
     bd->bi_plb_busfreq = bd->bi_busfreq;
     bd->bi_pci_busfreq = bd->bi_busfreq;
 #endif
index 955511b546b0d86832d4508369f40467e16d2cd0..cfc06f7ae6ff6626572653ca67b09aa3fa881eb4 100644 (file)
@@ -56,8 +56,13 @@ void do_bdinfo (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
        printf ("  immr_base   = 0x%08lx\n",  bd->bi_immr_base  );
 #endif
        printf ("  bootflags   = 0x%08lx\n",  bd->bi_bootflags  );
+#if defined(CFG_CLKS_IN_HZ)
        printf ("  intfreq     = %6s MHz\n",  strmhz(buf, bd->bi_intfreq));
        printf ("  busfreq     = %6s MHz\n",  strmhz(buf, bd->bi_busfreq));
+#else
+       printf ("  intfreq     = %6s MHz\n",  strmhz(buf, bd->bi_intfreq*1000000L));
+       printf ("  busfreq     = %6s MHz\n",  strmhz(buf, bd->bi_busfreq*1000000L));
+#endif /* CFG_CLKS_IN_HZ */
        printf ("  ethaddr     =");
        for (i=0; i<6; ++i) {
                printf ("%c%02X", i ? ':' : ' ', bd->bi_enetaddr[i]);
index abc936787b12b0853f5fd1e6e812f38561ba16b5..6b5ad880b5b78342a8c5b3e44884a47f48f00a36 100644 (file)
@@ -79,7 +79,8 @@
 #define CONFIG_BOOTP_ALL               (~0)
 
 #define CONFIG_BOOTP_DEFAULT           (CONFIG_BOOTP_SUBNETMASK | \
-                                       CONFIG_BOOTP_GATEWAY | \
+                                       CONFIG_BOOTP_GATEWAY     | \
+                                       CONFIG_BOOTP_HOSTNAME    | \
                                        CONFIG_BOOTP_BOOTPATH)
 
 #ifndef CONFIG_BOOTP_MASK
index 915f4b86318a41ba8f4f697759630cbaf3087248..a97b3ceb3b3ff71df9cc1b7aa62a3d81035b38b1 100644 (file)
@@ -59,8 +59,7 @@
                                "nfsaddrs=10.0.0.99:10.0.0.2"
 #else
 #define CONFIG_BOOTARGS                "root=/dev/hda1 "                       \
-   "ip=192.168.2.176:192.168.2.190:192.168.2.79:255.255.255.0: "       \
-   "hda=bswap"
+   "ip=192.168.2.176:192.168.2.190:192.168.2.79:255.255.255.0"
 
 #endif
 
index ca679500f02fa6c03cd66b31ddf65b7f707832c9..c9297bbf6f27abbdd2eb3adb1d374f64042b2f28 100644 (file)
@@ -65,7 +65,7 @@
   (CONFIG_CMD_DFL & ~(CFG_CMD_NET))
 #endif /* 0 */
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_ALL
+#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
index 1a2e24171b4d95b204beec1e12ba68befc51927e..f4bc5727bb3476f2a4da471e104b342d49661b38 100644 (file)
@@ -60,7 +60,7 @@
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_ALL
+#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
index bc91bd03ec7878ebaa5899f74c80d2dc89064aac..f467da5e6686a152f6a0aac2c7bdc59eb95be021 100644 (file)
@@ -59,7 +59,7 @@
 #define CONFIG_COMMANDS \
 ((CONFIG_CMD_DFL & ~(CFG_CMD_FLASH)) | CFG_CMD_IDE) /* no Flash, but IDE */
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_ALL
+#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
index d3aac771d61e3ba0872d375106cdf3e3781a399c..072a1dccbe74b001bceaa97702485d736944251d 100644 (file)
@@ -28,6 +28,8 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#undef TQM8xxL_80MHz                   /* define for 80 MHz CPU only */
+
 /*
  * High Level Configuration Options
  * (easy to change)
 #define        CONFIG_8xx_CONS_SMC1    1       /* Console is on SMC1           */
 #undef CONFIG_8xx_CONS_SMC2
 #undef CONFIG_8xx_CONS_NONE
-#define CONFIG_BAUDRATE                115200
+#define CONFIG_BAUDRATE                115200  /* console baudrate = 115kbps   */
 #if 0
 #define CONFIG_BOOTDELAY       -1      /* autoboot disabled            */
 #else
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
 #endif
-#define CONFIG_BOOTCOMMAND     "bootm 40020000" /* autoboot command    */
 
-#define CONFIG_BOOTARGS                "root=/dev/nfs rw "                     \
-                               "nfsroot=10.0.0.2:/LinuxPPC "           \
-                               "nfsaddrs=10.0.0.99:10.0.0.2"
+#undef CONFIG_BOOTARGS 
+#define CONFIG_BOOTCOMMAND                                                     \
+       "bootp; "                                                               \
+       "setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) "     \
+       "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off; "   \
+       "bootm" 
 
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #undef CFG_LOADS_BAUD_CHANGE           /* don't allow baudrate change  */
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_ALL
+#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
  * the maximum mapped by the Linux kernel during initialization.
  */
 #define        CFG_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
+
 /*-----------------------------------------------------------------------
  * FLASH organization
  */
 
 #define        CFG_FLASH_ENV_OFFSET    0x8000  /*   Offset   of Environment Sector     */
 #define        CFG_FLASH_ENV_SIZE      0x4000  /* Total Size of Environment Sector     */
+
 /*-----------------------------------------------------------------------
  * Cache Configuration
  */
  * PLPRCR - PLL, Low-Power, and Reset Control Register         15-30
  *-----------------------------------------------------------------------
  * Reset PLL lock status sticky bit, timer expired status bit and timer
- * interrupt status bit - leave PLL multiplication factor unchanged !
+ * interrupt status bit
+ *
+ * If this is a 80 MHz CPU, set PLL multiplication factor to 5 (5*16=80)!
  */
+#ifdef TQM8xxL_80MHz   /* for 80 MHz, we use a 16 MHz clock * 5 */
+#define CFG_PLPRCR                                                     \
+               ( (5-1)<<PLPRCR_MF_SHIFT | PLPRCR_TEXPS | PLPRCR_TMIST )
+#else                  /* up to 50 MHz we use a 1:1 clock */
 #define CFG_PLPRCR     (PLPRCR_SPLSS | PLPRCR_TEXPS | PLPRCR_TMIST)
+#endif /* TQM8xxL_80MHz */
 
 /*-----------------------------------------------------------------------
  * SCCR - System Clock and reset Control Register              15-27
  * power management and some other internal clocks
  */
 #define SCCR_MASK      SCCR_EBDF11
+#ifdef TQM8xxL_80MHz   /* for 80 MHz, we use a 16 MHz clock * 5 */
+#define CFG_SCCR       (/* SCCR_TBS  | */ \
+                        SCCR_COM00   | SCCR_DFSYNC00 | SCCR_DFBRG00  | \
+                        SCCR_DFNL000 | SCCR_DFNH000  | SCCR_DFLCD000 | \
+                        SCCR_DFALCD00)
+#else                  /* up to 50 MHz we use a 1:1 clock */
 #define CFG_SCCR       (SCCR_TBS     | \
                         SCCR_COM00   | SCCR_DFSYNC00 | SCCR_DFBRG00  | \
                         SCCR_DFNL000 | SCCR_DFNH000  | SCCR_DFLCD000 | \
                         SCCR_DFALCD00)
+#endif /* TQM8xxL_80MHz */
 
 /*-----------------------------------------------------------------------
  * PCMCIA stuff
index b68d05a308ba55ea6c396fa0cc1fb1c6d7cdc228..3770d5f4ac8b09ec56c9890840abb8883cb8437e 100644 (file)
@@ -28,6 +28,8 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#undef TQM8xxL_80MHz                   /* define for 80 MHz CPU only */
+
 /*
  * High Level Configuration Options
  * (easy to change)
@@ -39,7 +41,7 @@
 #define        CONFIG_8xx_CONS_SMC1    1       /* Console is on SMC1           */
 #undef CONFIG_8xx_CONS_SMC2
 #undef CONFIG_8xx_CONS_NONE
-#define CONFIG_BAUDRATE                115200
+#define CONFIG_BAUDRATE                115200  /* console baudrate = 115kbps   */
 #if 0
 #define CONFIG_BOOTDELAY       -1      /* autoboot disabled            */
 #else
@@ -58,7 +60,7 @@
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_ALL
+#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
  * the maximum mapped by the Linux kernel during initialization.
  */
 #define        CFG_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
+
 /*-----------------------------------------------------------------------
  * FLASH organization
  */
 
 #define        CFG_FLASH_ENV_OFFSET    0x8000  /*   Offset   of Environment Sector     */
 #define        CFG_FLASH_ENV_SIZE      0x4000  /* Total Size of Environment Sector     */
+
 /*-----------------------------------------------------------------------
  * Cache Configuration
  */
  * PLPRCR - PLL, Low-Power, and Reset Control Register         15-30
  *-----------------------------------------------------------------------
  * Reset PLL lock status sticky bit, timer expired status bit and timer
- * interrupt status bit - leave PLL multiplication factor unchanged !
+ * interrupt status bit
+ *
+ * If this is a 80 MHz CPU, set PLL multiplication factor to 5 (5*16=80)!
  */
+#ifdef TQM8xxL_80MHz   /* for 80 MHz, we use a 16 MHz clock * 5 */
+#define CFG_PLPRCR                                                     \
+               ( (5-1)<<PLPRCR_MF_SHIFT | PLPRCR_TEXPS | PLPRCR_TMIST )
+#else                  /* up to 50 MHz we use a 1:1 clock */
 #define CFG_PLPRCR     (PLPRCR_SPLSS | PLPRCR_TEXPS | PLPRCR_TMIST)
+#endif /* TQM8xxL_80MHz */
 
 /*-----------------------------------------------------------------------
  * SCCR - System Clock and reset Control Register              15-27
  * power management and some other internal clocks
  */
 #define SCCR_MASK      SCCR_EBDF11
+#ifdef TQM8xxL_80MHz   /* for 80 MHz, we use a 16 MHz clock * 5 */
+#define CFG_SCCR       (/* SCCR_TBS  | */ \
+                        SCCR_COM00   | SCCR_DFSYNC00 | SCCR_DFBRG00  | \
+                        SCCR_DFNL000 | SCCR_DFNH000  | SCCR_DFLCD000 | \
+                        SCCR_DFALCD00)
+#else                  /* up to 50 MHz we use a 1:1 clock */
 #define CFG_SCCR       (SCCR_TBS     | \
                         SCCR_COM00   | SCCR_DFSYNC00 | SCCR_DFBRG00  | \
                         SCCR_DFNL000 | SCCR_DFNH000  | SCCR_DFLCD000 | \
                         SCCR_DFALCD00)
+#endif /* TQM8xxL_80MHz */
 
 /*-----------------------------------------------------------------------
  * PCMCIA stuff
index 28293c959f7f08e80d6f4bb041c9ab83cf00ca83..c3376238ab5f8a9d17f7edd4b909b623a8c0ceaf 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
-#define        TQM8xxL_80MHz           1       /* define for 80 MHz CPU only */
+#undef TQM8xxL_80MHz                   /* define for 80 MHz CPU only */
 
 /*
  * High Level Configuration Options
 #else
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
 #endif
-#define CONFIG_BOOTCOMMAND     "bootm 40020000" /* autoboot command    */
 
-#define CONFIG_BOOTARGS                "root=/dev/nfs rw "                     \
-                               "nfsroot=10.0.0.2:/LinuxPPC "           \
-                               "nfsaddrs=10.0.0.99:10.0.0.2"
+#undef CONFIG_BOOTARGS 
+#define CONFIG_BOOTCOMMAND                                                     \
+       "bootp; "                                                               \
+       "setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) "     \
+       "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off; "   \
+       "bootm" 
 
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #undef CFG_LOADS_BAUD_CHANGE           /* don't allow baudrate change  */
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_ALL
+#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
  * the maximum mapped by the Linux kernel during initialization.
  */
 #define        CFG_BOOTMAPSZ           (8 << 20)       /* Initial Memory map for Linux */
+
 /*-----------------------------------------------------------------------
  * FLASH organization
  */
 
 #define        CFG_FLASH_ENV_OFFSET    0x8000  /*   Offset   of Environment Sector     */
 #define        CFG_FLASH_ENV_SIZE      0x4000  /* Total Size of Environment Sector     */
+
 /*-----------------------------------------------------------------------
  * Cache Configuration
  */
index 687e86f7cf99599a81899f4b95beedd95eaaf09a..21e081a3085c785b86f628044bc16e8f16c903a0 100644 (file)
@@ -28,6 +28,8 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#undef TQM8xxL_80MHz                   /* define for 80 MHz CPU only */
+
 /*
  * High Level Configuration Options
  * (easy to change)
 #define        CONFIG_8xx_CONS_SMC1    1       /* Console is on SMC1           */
 #undef CONFIG_8xx_CONS_SMC2
 #undef CONFIG_8xx_CONS_NONE
-#define CONFIG_BAUDRATE                115200
+#define CONFIG_BAUDRATE                115200  /* console baudrate = 115kbps   */
 #if 0
 #define CONFIG_BOOTDELAY       -1      /* autoboot disabled            */
 #else
 #define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
 #endif
-#define CONFIG_BOOTCOMMAND     "bootm 40020000" /* autoboot command    */
 
-#define CONFIG_BOOTARGS                "root=/dev/nfs rw "                     \
-                               "nfsroot=10.0.0.2:/LinuxPPC "           \
-                               "nfsaddrs=10.0.0.99:10.0.0.2"
+#undef CONFIG_BOOTARGS 
+#define CONFIG_BOOTCOMMAND                                                     \
+       "bootp; "                                                               \
+       "setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) "     \
+       "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off; "   \
+       "bootm" 
 
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #undef CFG_LOADS_BAUD_CHANGE           /* don't allow baudrate change  */
 
 #undef CONFIG_WATCHDOG                 /* watchdog disabled            */
 
-#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_ALL
+#define CONFIG_BOOTP_MASK      CONFIG_BOOTP_DEFAULT
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
  * PLPRCR - PLL, Low-Power, and Reset Control Register         15-30
  *-----------------------------------------------------------------------
  * Reset PLL lock status sticky bit, timer expired status bit and timer
- * interrupt status bit - leave PLL multiplication factor unchanged !
+ * interrupt status bit
+ *
+ * If this is a 80 MHz CPU, set PLL multiplication factor to 5 (5*16=80)!
  */
+#ifdef TQM8xxL_80MHz   /* for 80 MHz, we use a 16 MHz clock * 5 */
+#define CFG_PLPRCR                                                     \
+               ( (5-1)<<PLPRCR_MF_SHIFT | PLPRCR_TEXPS | PLPRCR_TMIST )
+#else                  /* up to 50 MHz we use a 1:1 clock */
 #define CFG_PLPRCR     (PLPRCR_SPLSS | PLPRCR_TEXPS | PLPRCR_TMIST)
+#endif /* TQM8xxL_80MHz */
 
 /*-----------------------------------------------------------------------
  * SCCR - System Clock and reset Control Register              15-27
  * power management and some other internal clocks
  */
 #define SCCR_MASK      SCCR_EBDF11
+#ifdef TQM8xxL_80MHz   /* for 80 MHz, we use a 16 MHz clock * 5 */
+#define CFG_SCCR       (/* SCCR_TBS  | */ \
+                        SCCR_COM00   | SCCR_DFSYNC00 | SCCR_DFBRG00  | \
+                        SCCR_DFNL000 | SCCR_DFNH000  | SCCR_DFLCD000 | \
+                        SCCR_DFALCD00)
+#else                  /* up to 50 MHz we use a 1:1 clock */
 #define CFG_SCCR       (SCCR_TBS     | \
                         SCCR_COM00   | SCCR_DFSYNC00 | SCCR_DFBRG00  | \
                         SCCR_DFNL000 | SCCR_DFNH000  | SCCR_DFLCD000 | \
                         SCCR_DFALCD00)
+#endif /* TQM8xxL_80MHz */
 
 /*-----------------------------------------------------------------------
  * PCMCIA stuff
index f1402bd458e2508c5c1ced231ff2c5b5d8daf237..be25ab437ea873434c1ae0e46e4ddf1e0222237f 100644 (file)
@@ -24,6 +24,6 @@
 #ifndef        __VERSION_H__
 #define        __VERSION_H__
 
-#define        PPCBOOT_VERSION "ppcboot 0.6.2"
+#define        PPCBOOT_VERSION "ppcboot 0.6.3"
 
 #endif /* __VERSION_H__ */
index f0a71ca48636546c5067e53853fa7653c303455b..f07234ee57f9521383d1a10139f066813010360e 100644 (file)
@@ -169,23 +169,19 @@ do_reset(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
 /* ------------------------------------------------------------------------- */
 
 /*
- * We implement the delay by converting the delay (the number of
- * microseconds to wait) into a number of time base ticks; then we
- * watch the time base until it has incremented by that amount.
+ * Get timebase clock frequency (like cpu_clk in Hz)
+ *
  */
-void
-udelay(unsigned long usec)
+unsigned long get_tbclk (void)
 {
        ulong tbclk;
-       ulong ticks;
        /* Pointer to initial global data area */
        init_data_t *idata =
                (init_data_t *)(CFG_INIT_RAM_ADDR+CFG_INIT_DATA_OFFSET);
 
-       tbclk = (idata->cpu_clk + 3) / 4;
-       ticks = ((usec * ((tbclk + 999) / 1000)) + 999) / 1000;
+       tbclk = (idata->cpu_clk + 3L) / 4L;
 
-       wait_ticks (ticks);
+       return (tbclk);
 }
 
 /* ------------------------------------------------------------------------- */
index 7ef81552ad5c19fd6aa4d7d3900301e7cf4ec50b..5727c2f62119cc7143e63146b3ffd3033fa2aa14 100644 (file)
@@ -31,7 +31,6 @@
 
 /****************************************************************************/
 
-#define        DECREMENTER_TICK        1000    /* 1 ms tick */
 unsigned decrementer_count;            /* count val for 1e6/HZ microseconds */
 
 struct irq_action {
@@ -197,14 +196,10 @@ void
 interrupt_init(bd_t *bd)
 {
     volatile immap_t *immr = (immap_t *)CFG_IMMR;
-    ulong freq;
-
-#if defined(CFG_CLKS_IN_HZ)
-    freq = bd->bi_intfreq / 4;
-#else
-    freq = (bd->bi_intfreq * 1000000) / 4;
-#endif
-    decrementer_count = freq / DECREMENTER_TICK;
+    /* Pointer to initial global data area */
+    init_data_t *idata = (init_data_t *)(CFG_INIT_RAM_ADDR + CFG_INIT_DATA_OFFSET);
+
+    decrementer_count = (idata->cpu_clk / 4) / CFG_HZ;
 
     /* Initialize the default interrupt mapping priorities */
     immr->im_intctl.ic_sicr = 0;
index 70eeaa09e0f1ba173d414260b72d51522ddcd02a..37095a279634e2e51b5a14f80ae54abebb428598 100644 (file)
@@ -193,11 +193,7 @@ serial_setbrg (ulong cpu_clock, int baudrate)
         * truncate - hopefully that will provide a slightly more accurate
         * clock divider.
         */
-#if defined(CFG_CLKS_IN_HZ)
        i = (idata->brg_clk + 15) / 16;
-#else
-       i = ((idata->brg_clk * 1000000) + 15) / 16;
-#endif
 
        i = (i + baudrate - 1) / baudrate;
 
index 8efc733bc57fe45aea810001e8d5de53e4425098..c0ca57b39465849fecd66aad5cdc99536f78920c 100644 (file)
@@ -187,11 +187,7 @@ serial_setbrg (ulong cpu_clock, int baudrate)
         * truncate - hopefully that will provide a slightly more accurate
         * clock divider.
         */
-#if defined(CFG_CLKS_IN_HZ)
        i = (idata->brg_clk + 15) / 16;
-#else
-       i = ((idata->brg_clk * 1000000) + 15) / 16;
-#endif
 
        i = (i + baudrate - 1) / baudrate;
 
index 4bd45dd22ed63f6d13ec99a38ea85ba8cadfeedc..b7053b32106a7035860854587500a3fb3110cb34 100644 (file)
@@ -212,11 +212,7 @@ get_bus_freq(ulong gclk_freq)
     init_data_t *idata = \
        (init_data_t *)(CFG_INIT_RAM_ADDR + CFG_INIT_DATA_OFFSET);
 
-#if defined(CFG_CLKS_IN_HZ)
     return (idata->bus_clk);
-#else
-    return (idata->bus_clk / 1000 / 1000);
-#endif
 }
 
 /* ------------------------------------------------------------------------- */
index f42bbb07bc2460e479dad4b0cbec7bf0337c77ee..c54086d6738b3948f834fcf8d53a69911acd7434 100644 (file)
@@ -347,7 +347,7 @@ void do_reset (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
 /* ------------------------------------------------------------------------- */
 
 /*
- * Get timebase clock frequency
+ * Get timebase clock frequency (like cpu_clk in Hz)
  *
  * See table 15-5 pp. 15-16, and SCCR[RTSEL] pp. 15-27.
  */
index c3167d184852f9c88a346b7cbd95c6406dd3c52a..ff6c32f9d30bc18df40c039b96c8a9d0214e025f 100644 (file)
@@ -95,17 +95,8 @@ void
 interrupt_init (bd_t *bd)
 {
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
-       int freq;
 
-#if defined(CFG_CLKS_IN_HZ)
-       freq = bd->bi_intfreq;
-#else
-       freq = (bd->bi_intfreq * 1000000);
-#endif
-       if (immr->im_clkrst.car_sccr & SCCR_TBS) {
-               freq /= 16;     /* use divide by 16 processor clock */
-       }
-       decrementer_count = freq / CFG_HZ;
+       decrementer_count = get_tbclk() / CFG_HZ;
 
        cpm_interrupt_init();
 
index c63ffd20afe4c5d834d099f56a07e083ee861484..d29a1725b12306f34128f465ff2d597d3bc3c6b7 100644 (file)
@@ -217,12 +217,7 @@ serial_setbrg (ulong cpu_clock, int baudrate)
 #else
        cp->cp_brgc2 =                  /* Console on SMC2 */
 #endif
-#if defined(CFG_CLKS_IN_HZ)
-               ((((cpu_clock/16) / baudrate)-1) << 1)
-#else
-               (((((cpu_clock * 1000000)/16) / baudrate)-1) << 1)
-#endif
-               | CPM_BRG_EN;
+               ((((cpu_clock/16) / baudrate)-1) << 1) | CPM_BRG_EN;
 }
 
 void
index 07dfb6d8ac8d456c8b308113e6a341872b593c18..0c3a34edf76b968b8a676ddb0ff820beb861ea79 100644 (file)
@@ -46,6 +46,7 @@ static __inline__ void set_msr(unsigned long msr)
 
 /*
  * Measure CPU clock speed (core clock GCLK1, GCLK2)
+ *
  * (Approx. GCLK frequency in Hz)
  *
  * Initializes timer 2 and PIT, but disables them before return.
index f22f6671b9b3719da288e6d4b581e8cb4101f83e..3a8b0fef92edb7d176bdfdd858b93752bd1dea9d 100644 (file)
@@ -118,3 +118,21 @@ void do_reset (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
        __asm__ __volatile__(" lis   3, 0x3000
                                mtspr 0x3f2, 3");
 }
+
+
+/*
+ * Get timebase clock frequency
+ */
+unsigned long get_tbclk (void)
+{
+#ifdef CONFIG_PPC405GP
+  PPC405_SYS_INFO sys_info;
+  
+  get_sys_info(&sys_info);
+  return (sys_info.freqProcessor);
+#endif  /* CONFIG_PPC405GP */
+  
+#ifdef CONFIG_IOP480
+  return (66000000);
+#endif  /* CONFIG_IOP480 */
+}
index 035e625aa1231fcbe868ecdc62784561808db50e..dd6af3cc0f7e1082ad452cd4961e4db9683e08f2 100644 (file)
@@ -567,35 +567,6 @@ dcache_status:
        srwi    r3, r3, 31      /* >>31 => select bit 0 */
        blr
 
-/*
- * Delay for a number of microseconds
- * -- Use the BUS timer (assumes 66 MHz) -- FIXME --
- */
-       .globl  udelay
-udelay:
-#ifdef  CONFIG_ADCIOP
-       mulli   r4,r3,66        /* 66 MHz (15ns) -> 1us = 66 * 15ns */
-#endif
-#ifdef  CONFIG_PPC405GP
-       mulli   r4,r3,200       /* 200 MHz (5ns) -> 1us = 200 * 5ns */
-#endif
-1:     mftbu   r5
-       mftb    r6
-       mftbu   r7
-       cmp     0,r5,r7
-       bne     1b              /* Get [synced] base time */
-       addc    r9,r6,r4        /* Compute end time */
-       addze   r8,r5
-2:     mftbu   r5
-       cmp     0,r5,r8
-       blt     2b
-       bgt     3f
-       mftb    r6
-       cmp     0,r6,r9
-       blt     2b
-3:     blr
-        
-
        .globl get_pvr
 get_pvr:
        mfspr   r3, PVR
@@ -998,8 +969,8 @@ ext_bus_cntlr_init:
         addis   r3,0,ext_bus_cntlr_init@h    // store the address of the 
         ori     r3,r3,ext_bus_cntlr_init@l  // ext_bus_cntlr_init functn in r3
 #else
-        addis   r3,0,0x00fe    // store the address of the 
-        ori     r3,r3,0x24f4   // ext_bus_cntlr_init functn in r3
+        addis   r3,0,0xfffd    // store the address of the 
+        ori     r3,r3,0x24ec   // ext_bus_cntlr_init functn in r3
 #endif
         addi    r4,0,14                // set ctr to 10; used to prefetch
         mtctr   r4                     // 10 cache lines to fit this function