]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
* Fix TFTP problems introduced with multiple network interface code master origin
authorwdenk <wdenk>
Fri, 1 Nov 2002 00:38:48 +0000 (00:38 +0000)
committerwdenk <wdenk>
Fri, 1 Nov 2002 00:38:48 +0000 (00:38 +0000)
  (tight loop when trying to load non-existent file, etc.)

* Fix delay problem in modem support code;
  fix HW handshake problem on TRAB

* Implement a real reset (based on a watchdog reset) for s3c2400
  based systems (SMDK2400, TRAB).

* Fix ramdisk problem on ARM: it would try to copy the image onto
  itself, which in some cases caused corruption of the flash contents

* Patch by Guillaume Alexandre, 31 Oct 2002:
  - add support of the dd2 version of the IBM CPC710 (Avignon) chip
  - fix a bus parking problem (system hang)
  - fix i2c eeprom erasure problem

29 files changed:
CHANGELOG
MAKEALL
board/pcippc2/cpc710.h
board/pcippc2/cpc710_init_ram.c
board/pcippc2/i2c.c
board/pcippc2/i2c.h
board/pcippc2/pcippc2.c
board/trab/ppcboot.lds
board/trab/trab.c
board/trab/vfd.c
board/w7o/ppcboot.lds
common/cmd_vfd.c
common/main.c
cpu/arm920t/start.S
cpu/mpc8xx/video.c
cpu/xscale/start.S
include/cmd_confdefs.h
include/configs/LANTEC.h
include/configs/MPC8260ADS.h
include/configs/ep8260.h
include/configs/hymod.h
include/configs/lwmon.h
include/configs/trab.h
include/net.h
include/version.h
lib_arm/armlinux.c
lib_arm/board.c
net/eth.c
net/net.c

index 6e7a161c952563c31cb8edd07592e0d95d29c35f..8c3e7f49eb3082809256da695cdbfb7d3cd915ba 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,7 +1,36 @@
+
+======================================================================
+Note: Version 2.0.0 of PPCBoot, the "Halloween Release",  is the LAST
+      Release of the PPCBoot project. Development is frozen with this
+      version.
+
+      Since PPCBoot is no longer focussed on PowerPC systems only the
+      name has become inappropriate. The project will be continued as
+      "Das U-Boot" (The Universal Booter), see the new project page
+      at SourceForge: http://sourceforge.net/projects/u-boot/
+======================================================================
+
 ======================================================================
-Modifications since 1.2.1:
+Modifications for 2.0.0:
 ======================================================================
 
+* Fix TFTP problems introduced with multiple network interface code
+  (tight loop when trying to load non-existent file, etc.)
+
+* Fix delay problem in modem support code;
+  fix HW handshake problem on TRAB
+
+* Implement a real reset (based on a watchdog reset) for s3c2400
+  based systems (SMDK2400, TRAB).
+
+* Fix ramdisk problem on ARM: it would try to copy the image onto
+  itself, which in some cases caused corruption of the flash contents
+
+* Patch by Guillaume Alexandre, 31 Oct 2002:
+  - add support of the dd2 version of the IBM CPC710 (Avignon) chip
+  - fix a bus parking problem (system hang)
+  - fix i2c eeprom erasure problem
+
 * Shuffle init sequence: do PCMCIA/IDE init after the watchdog POST
   so thatit's done only once during normal startup (saves some secs
   when booting on LWMON)
diff --git a/MAKEALL b/MAKEALL
index c30f1d6d84977348c60657d6ff2593db0c9cdf06..401c543c7173e3397e25313a73c79b202cd2b66c 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -103,7 +103,7 @@ LIST_ARM9="smdk2400 smdk2410 trab"
 LIST_xscale="lubbock cradle csb226"
 
 
-LIST_arm="${LIST_SA} ${LIST_ARM7} ${LIST_ARM9}"
+LIST_arm="${LIST_SA} ${LIST_ARM7} ${LIST_ARM9} ${LIST_xscale}"
 
 
 #----- for now, just run PPC by default -----
index cfae7344bd7acf7a4d8f711d378c5754c8b6dfec..81672709bbeee8f81a502279d0da5390e59e6b27 100644 (file)
 #ifndef _CPC710_H_
 #define _CPC710_H_
 
+/* Revision */
+#define CPC710_TYPE_100        0x80
+#define CPC710_TYPE_100P       0x90
+
 /* System control area */
 #define HW_PHYS_SCA            0xff000000
 
index fecb2ab68e89090345fdb27c22a16316bf6ccf1a..9786159ee01d265ce72cf63bab6547d8bfe37fdd 100644 (file)
@@ -163,6 +163,13 @@ static int cpc710_compute_mcer (
   unsigned int         i;
   cpc710_mem_org_t *   org = 0;
 
+
+  if (! i2c_reset())
+  {
+    puts("Can't reset I2C!\n");
+    hang();
+  } 
+
   if (! cpc710_eeprom_checksum(sdram))
   {
     puts("Invalid EEPROM checksum !\n");
@@ -184,6 +191,7 @@ static int cpc710_compute_mcer (
     return 0;
   }
 
+
   mc |= cpc710_mcer_mem [lines - 18] << 6;
 
   for (i = 0; i < sizeof(cpc710_mem_org) / sizeof(cpc710_mem_org_t); i++)
@@ -236,13 +244,7 @@ static u8 cpc710_eeprom_read (
   u8                   dev = (sdram << 1) | 0xa0;
   u8                   data;
 
-  if (! i2c_write_byte(dev, (u8) offset))
-  {
-    puts("I2C error !\n");
-    hang();
-  }
-
-  if (! i2c_read_byte(& data, dev))
+  if (! i2c_read_byte(& data, dev,offset))
   {
     puts("I2C error !\n");
     hang();
index 25a16b55007d5084cb99ccb4b661d8c5c3fa0679..1cf7b2e297eded9bae1fba89c3945c8697b8e941 100644 (file)
 static void            i2c_start       (void);
 static void            i2c_stop        (void);
 static int             i2c_write       (u8             data);
-static int             i2c_read        (u8 *           data);
+static void            i2c_read        (u8 *           data);
 
 static inline void     i2c_port_start  (void);
-static inline void     i2c_port_stop   (void);
 static inline void     i2c_clock       (unsigned int   val);
 static inline void     i2c_data        (unsigned int   val);
 static inline unsigned int
                        i2c_in          (void);
-static inline void     i2c_wait        (void);
-
 static inline void     i2c_write_bit   (unsigned int   val);
 static inline unsigned int
                        i2c_read_bit    (void);
@@ -49,43 +46,33 @@ static inline void  i2c_udelay      (unsigned int   time);
 
 int i2c_read_byte (
   u8 *                 data,
-  u8                   dev)
+  u8                   dev,
+  u8                   offset)
 {
   int                  err = 0;
 
   i2c_start();
 
+  err = ! i2c_write(dev);
+
   if (! err)
   {
-    err = ! i2c_write(dev | 0x01);
+    err = ! i2c_write(offset);
   }
 
   if (! err)
   {
-    err = ! i2c_read(data);
+    i2c_start();
   }
 
-  i2c_stop();
-
-  return ! err;
-}
-
-int i2c_write_byte (
-  u8                   dev,
-  u8                   data)
-{
-  int                  err = 0;
-
-  i2c_start();
-
   if (! err)
   {
-    err = ! i2c_write(dev);
+    err = ! i2c_write(dev | 0x01);
   }
 
   if (! err)
   {
-    err = ! i2c_write(data);
+    i2c_read(data);
   }
 
   i2c_stop();
@@ -98,7 +85,7 @@ static inline void i2c_udelay (
 {
   int                  v;
 
-  asm volatile("mtdec %0" : : "r" (time * (CFG_BUS_CLK / 4 / 1000000)));
+  asm volatile("mtdec %0" : : "r" (time * ((CFG_BUS_CLK / 4) / 1000000)));
 
   do
   {
@@ -121,14 +108,6 @@ static inline void i2c_port_start (void)
   i2c_udelay(1);
 }
 
-static inline void i2c_port_stop (void)
-{
-  out32(REG(CPC0, GPDIR), in32(REG(CPC0, GPDIR)) & ~(BIT_GPCLK | BIT_GPDATA));
-  iobarrier_rw();
-
-  i2c_udelay(1);
-}
-
 static inline void i2c_clock (
   unsigned int         val)
 {
@@ -165,17 +144,13 @@ static inline void i2c_data (
 
 static inline unsigned int i2c_in (void)
 {
-  unsigned int         val = (in32(REG(CPC0, GPIN)) & BIT_GPDATA) != 0;
+  unsigned int         val = ((in32(REG(CPC0, GPIN)) & BIT_GPDATA) != 0)?1:0;
 
   iobarrier_rw();
 
   return val;
 }
 
-static inline void i2c_wait (void)
-{
-  i2c_udelay(10);
-}
 
   /* Protocol implementation
    */
@@ -183,68 +158,72 @@ static inline void i2c_wait (void)
 static inline void i2c_write_bit (
   unsigned int         val)
 {
-  if (val == 0)
-  {
-    i2c_data(0);
-  }
-
+  i2c_data(val);
+  i2c_udelay(10);
   i2c_clock(1);
-  i2c_wait();
-
+  i2c_udelay(10);
   i2c_clock(0);
-  i2c_wait();
-
-  if (val == 0)
-  {
-    i2c_data(1);
-  }
+  i2c_udelay(10);
 }
 
 static inline unsigned int i2c_read_bit (void)
 {
   unsigned int         val;
 
+  i2c_data(1);
+  i2c_udelay(10);
+
   i2c_clock(1);
-  i2c_wait();
+  i2c_udelay(10);
 
   val = i2c_in();
 
   i2c_clock(0);
-  i2c_wait();
+  i2c_udelay(10);
 
   return val;
 }
 
-static void i2c_start (void)
+unsigned int i2c_reset (void)
 {
+  unsigned int         val;
+  int i;
+
   i2c_port_start();
 
-  i2c_clock(0);
-  i2c_data(1);
+  i=0;
+  do {
+    i2c_udelay(10);
+    i2c_clock(0);
+    i2c_udelay(10);
+    i2c_clock(1);
+    i2c_udelay(10);
+    val = i2c_in();
+    i++;
+  }  while ((i<9)&&(val==0)); 
+  return (val);
+}
 
-  i2c_clock(1);
-  i2c_wait();
 
+static void i2c_start (void)
+{
+  i2c_data(1);
+  i2c_clock(1);
+  i2c_udelay(10);
   i2c_data(0);
-  i2c_wait();
-
+  i2c_udelay(10);
   i2c_clock(0);
-  i2c_wait();
-
-  i2c_data(1);
+  i2c_udelay(10);
 }
 
 static void i2c_stop (void)
 {
   i2c_data(0);
-
+  i2c_udelay(10);
   i2c_clock(1);
-  i2c_wait();
-
+  i2c_udelay(10);
   i2c_data(1);
-  i2c_wait();
-
-  i2c_port_stop();
+  i2c_udelay(10);
 }
 
 static int i2c_write (
@@ -261,7 +240,7 @@ static int i2c_write (
   return i2c_read_bit() == 0;
 }
 
-static int i2c_read (
+static void i2c_read (
   u8 *                 data)
 {
   unsigned int         i;
@@ -274,6 +253,5 @@ static int i2c_read (
   }
 
   *data = val;
-
-  return 1;
+  i2c_write_bit(1); /* NoAck */
 }
index 64d35a1db2f3f729e54b8e372a5b29584e0e66e3..1224b428993264b74779c135200a27f738e1a9a7 100644 (file)
 #include <common.h>
 
 extern int     i2c_read_byte   (u8 *           data,
-                                u8             dev);
-extern int     i2c_write_byte  (u8             dev,
-                                u8             data);
+                                u8             dev,
+                                u8 offset);
+
+extern unsigned int i2c_reset (void);
+
 
 #endif
index 2a44d83060a68fc19359d63f4fde30630c4cae59..7a8bf943e7fd991faf31468a7397a1cc42fd1f4b 100644 (file)
@@ -85,12 +85,17 @@ int board_pre_init (void)
 
        out32 (REG (CPC0, SIOC0), 0x30000000);
 
-       out32 (REG (CPC0, ABCNTL), 0xF0000000);
+       out32 (REG (CPC0, ABCNTL), 0x00000000);
 
        out32 (REG (CPC0, SESR), 0x00000000);
        out32 (REG (CPC0, SEAR), 0x00000000);
 
-       out32 (REG (CPC0, PGCHP), 0x80800040);
+       /* Detect IBM Avignon CPC710 Revision */
+       if ((in32 (REG (CPC0, UCTL)) & 0x000000F0) == CPC710_TYPE_100P)
+               out32 (REG (CPC0, PGCHP), 0xA0000040);
+       else
+               out32 (REG (CPC0, PGCHP), 0x80800040);
+               
 
        out32 (REG (CPC0, ATAS), 0x709C2508);
 
index 567447c787e067c71c1722646da0c01498899a85..9b454e21e417cb420aa914a71fa11a4f6093b318 100644 (file)
@@ -35,7 +35,6 @@ SECTIONS
          cpu/arm920t/start.o   (.text)
          lib_arm/_udivsi3.o    (.text)
          lib_arm/_umodsi3.o    (.text)
-         lib_arm/div0.o        (.text)
          lib_generic/zlib.o    (.text)
          lib_generic/crc32.o   (.text)
          lib_generic/string.o  (.text)
index c66e1beade68428a82387789e8ab4b3db8075ae2..2ab659221a44343baa5eaf8eb70fd5973874f8d7 100644 (file)
@@ -35,8 +35,6 @@ static int key_pressed(void);
 extern void disable_putc(void);
 extern int do_mdm_init; /* defined in common/main.c */
 
-extern int trab_kbd_data []; /* defined in common/main.c */
-
 /*
  * We need a delay of at least 500 us after turning on the VFD clock
  * before we can read any useful information for the CPLD controlling
@@ -85,11 +83,11 @@ int board_init ()
        /*  00,    10,      10,      10,      10,      10,      10      */
        rPFCON = (2<<0) | (2<<2) | (2<<4) | (2<<6) | (2<<8) | (2<<10);
 #ifdef CONFIG_HWFLOW
-       /* do not pull up RXD0, RXD1, TXD0, TXD1 */
-       rPFUP  = (1<<0) | (1<<1) | (1<<2) | (1<<3);
-#else
        /* do not pull up RXD0, RXD1, TXD0, TXD1, CTS0, RTS0 */
        rPFUP  = (1<<0) | (1<<1) | (1<<2) | (1<<3) | (1<<4) | (1<<5);
+#else
+       /* do not pull up RXD0, RXD1, TXD0, TXD1 */
+       rPFUP  = (1<<0) | (1<<1) | (1<<2) | (1<<3);
 #endif
        rPGCON = 0x0;
        rPGUP  = 0x0;
@@ -122,12 +120,8 @@ int board_init ()
                rLCDCON1 = 0x00000B75;
        }
 
-       trab_kbd_data[0] = (*(volatile int *)0x04020000);
-
        mdelay_no_timer (KBD_MDELAY);
 
-       trab_kbd_data[1] = (*(volatile int *)0x04020000);
-
        if (key_pressed()) {
                disable_putc(); /* modem doesn't understand banner etc */
                do_mdm_init = 1;
@@ -164,8 +158,6 @@ int misc_init_r (void)
        uchar *str;
        int i;
        
-       trab_kbd_data[2] = (*(volatile int *)0x04020000);
-
        for (i = 0; i < KEYBD_KEY_NUM; ++i) {
                keybd_env[i] = '0' + ((kbd_data >> i) & 1);
        }
index b550a69a0e83991b4ca7912ee40e60f41226a67e..891461ae2dae8361d796b53b883501c5d8238c2a 100644 (file)
  * MA 02111-1307 USA
  */
 
+/************************************************************************/
+/* ** DEBUG SETTINGS                                                   */
+/************************************************************************/
+
+/* #define DEBUG       */
+
 /************************************************************************/
 /* ** HEADER FILES                                                     */
 /************************************************************************/
 
 #ifdef CONFIG_VFD
 
-/************************************************************************/
-/* ** DEBUG SETTINGS                                                   */
-/************************************************************************/
-
-#undef VFD_DEBUG
-
-#ifdef VFD_DEBUG
-#define DEBUGF(fmt,args...)    printf(fmt ,##args)
-#else
-#define DEBUGF(fmt,args...)
-#endif
-
 /************************************************************************/
 /* ** CONFIG STUFF -- should be moved to board config file             */
 /************************************************************************/
 #define        PAGE_SIZE       4096
 #endif
 
-#define ROT 0x09
-#define BLAU 0x0C
-#define VIOLETT 0X0D
+#define ROT    0x09
+#define BLAU   0x0C
+#define VIOLETT        0X0D
 
 ulong vfdbase;
 ulong frame_buf_size;
 #define frame_buf_offs 4
 
-/* taken from armboot/common/vfd.c by TQS */
+/* taken from armboot/common/vfd.c */
 ulong         adr_vfd_table[112][18][2][4][2];
 unsigned char bit_vfd_table[112][18][2][4][2];
 
@@ -380,9 +374,9 @@ int drv_vfd_init(void)
        rLCDCON5 = 0x00000440;
        rLCDCON1 = 0x00000B75;
 
-       DEBUGF ("LCDSADDR1: %lX\n", rLCDSADDR1);
-       DEBUGF ("LCDSADDR2: %lX\n", rLCDSADDR2);
-       DEBUGF ("LCDSADDR3: %lX\n", rLCDSADDR3);
+       debug ("LCDSADDR1: %lX\n", rLCDSADDR1);
+       debug ("LCDSADDR2: %lX\n", rLCDSADDR2);
+       debug ("LCDSADDR3: %lX\n", rLCDSADDR3);
 
        for(palette=0;palette<=15;palette++)
                (*(volatile unsigned int*)(PALETTE+(palette*4)))=palette;
@@ -412,7 +406,7 @@ ulong vfd_setmem (ulong addr)
        /* Round up to nearest full page */
        size = (frame_buf_size + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
 
-       DEBUGF ("Reserving %ldk for VFD Framebuffer at: %08lx\n", size>>10, addr);
+       debug ("Reserving %ldk for VFD Framebuffer at: %08lx\n", size>>10, addr);
 
        return (size);
 }
index 10ff61f27c5dc86bca2df6ef52dc0f7ded31e713..2ddba5d05850de35b5a53bc2014d778ac3d2b20f 100644 (file)
@@ -58,26 +58,8 @@ SECTIONS
   .plt : { *(.plt) }
   .text      :
   {
-    /* WARNING - the following is hand-optimized to fit within */
-    /* the sector layout of our flash chips!   XXX FIXME XXX   */
-
     cpu/ppc4xx/start.o (.text)
     board/w7o/init.o   (.text)
-    cpu/ppc4xx/kgdb.o  (.text)
-    cpu/ppc4xx/traps.o (.text)
-    cpu/ppc4xx/interrupts.o    (.text)
-    cpu/ppc4xx/serial.o        (.text)
-    cpu/ppc4xx/cpu_init.o      (.text)
-    cpu/ppc4xx/speed.o (.text)
-    cpu/ppc4xx/405gp_enet.o    (.text)
-    common/dlmalloc.o  (.text)
-    lib_generic/crc32.o                (.text)
-    lib_ppc/extable.o  (.text)
-    lib_generic/zlib.o         (.text)
-
-/*    . = env_offset;*/
-/*    common/environment.o(.text)*/
-
     *(.text)
     *(.fixup)
     *(.got1)
index 4a538f954b5cc6f51dca9148fc7695a92bd38a40..d2c63d6e9cd36327d514a549debde50639ebb218 100644 (file)
@@ -42,7 +42,9 @@
 #define VFD_REMOTE_LOGO_BMPNR 1
 #endif
 
-extern void transfer_pic(unsigned char, unsigned char *, int, int);
+extern int transfer_pic(unsigned char, unsigned char *, int, int);
+
+int trab_vfd (ulong bitmap);
 
 int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 {
@@ -55,23 +57,28 @@ int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        bitmap = simple_strtoul(argv[1], NULL, 10);
 
-       switch (bitmap)
-       {
+       return (trab_vfd(bitmap));
+}
+#endif /* CFG_CMD_VFD */
+
+#ifdef CONFIG_VFD
+int trab_vfd (ulong bitmap)
+{
+       switch (bitmap) {
 #ifdef VFD_TEST_LOGO
                case VFD_TEST_LOGO_BMPNR:
                        transfer_pic(1, &vfd_test_logo_bitmap[0],
                                VFD_TEST_LOGO_HEIGHT, VFD_TEST_LOGO_WIDTH);
-                       break;
+                       return 0;
                case VFD_REMOTE_LOGO_BMPNR:
                        transfer_pic(1, &vfd_remote_logo_bitmap[0],
                                VFD_TEST_LOGO_HEIGHT, VFD_TEST_LOGO_WIDTH);
-                       break;
+                       return 0;
 #endif
                default:
                        printf("Unknown bitmap %ld\n", bitmap);
-                       break;
+                       return 1;
        }
-       return 0;
+       /* NOTREACHED */
 }
-
-#endif /* CFG_CMD_VFD */
+#endif /* CONFIG_VFD */
index a8d7c413c40289d08104736a9f2e6e8d1017e099..aef6ba3dbd75a2ca0e184473d34c1c5061bc3e6c 100644 (file)
@@ -63,7 +63,6 @@ static int      retry_time = -1; /* -1 so can call readline before main_loop */
 
 #ifdef CONFIG_MODEM_SUPPORT
 int do_mdm_init = 0;
-int trab_kbd_data[] = {0x666, 0x666, 0x666, };
 extern void mdm_init(void); /* defined in board.c */
 #endif
 
@@ -244,13 +243,26 @@ void main_loop (void)
        char *p;
 #endif
 
+#if defined(CONFIG_VFD) && defined(VFD_TEST_LOGO)
+       ulong bmp = 0;          /* default bitmap */
+       extern int trab_vfd (ulong bitmap);
+
 #ifdef CONFIG_MODEM_SUPPORT
-printf("DEBUG: board_init 0:  kbd_data=%08X -> %01X\n", trab_kbd_data[0], (trab_kbd_data[0] >> 16) & 0xF);
-printf("DEBUG: board_init 1:  kbd_data=%08X -> %01X\n", trab_kbd_data[1], (trab_kbd_data[1] >> 16) & 0xF);
-printf("DEBUG: misc_init_r :  kbd_data=%08X -> %01X\n\n", trab_kbd_data[2], (trab_kbd_data[2] >> 16) & 0xF);
-printf("DEBUG: main_loop:   do_mdm_init=%d\n", do_mdm_init);
        if (do_mdm_init)
+               bmp = 1;        /* alternate bitmap */
+#endif
+       trab_vfd (bmp);
+#endif /* CONFIG_VFD && VFD_TEST_LOGO */
+
+#ifdef CONFIG_MODEM_SUPPORT
+       debug ("DEBUG: main_loop:   do_mdm_init=%d\n", do_mdm_init);
+       if (do_mdm_init) {
+               uchar *str = strdup(getenv("mdm_cmd"));
+               setenv ("preboot", str);  /* set or delete definition */
+               if (str != NULL)
+                       free (str);
                mdm_init(); /* wait for modem connection */
+       }
 #endif  /* CONFIG_MODEM_SUPPORT */
 
 #ifdef CFG_HUSH_PARSER
index 00b3082938a6a907d93f295ba8e98a96dc5f49be..270bb529ba80bd814c4d0da8472d207b530633d8 100644 (file)
@@ -444,6 +444,26 @@ fiq:
        .align  5
 .globl reset_cpu
 reset_cpu:
+#ifdef CONFIG_S3C2400
+       bl      disable_interrupts
+       ldr     r1, _rWTCON
+       ldr     r2, _rWTCNT
+       /* Disable watchdog */
+       mov     r3, #0x0000
+       str     r3, [r1]
+       /* Initialize watchdog timer count register */
+       mov     r3, #0x0001
+       str     r3, [r2]
+       /* Enable watchdog timer; assert reset at timer timeout */
+       mov     r3, #0x0021
+       str     r3, [r1]
+_loop_forever:
+       b       _loop_forever
+_rWTCON:
+       .word   0x15300000
+_rWTCNT:
+       .word   0x15300008
+#else /* ! CONFIG_S3C2400 */
        mov     ip, #0
        mcr     p15, 0, ip, c7, c7, 0           @ invalidate cache
        mcr     p15, 0, ip, c8, c7, 0           @ flush TLB (v4)
@@ -452,3 +472,4 @@ reset_cpu:
        bic     ip, ip, #0x2100                 @ ..v....s........
        mcr     p15, 0, ip, c1, c0, 0           @ ctrl register
        mov     pc, r0
+#endif /* CONFIG_S3C2400 */
index 795ccd5b79cb4a25fe233beb865802e22a84d380..a14e4ddd53d53b285c24a1d7ff50611c4ad310c8 100644 (file)
@@ -837,7 +837,11 @@ static void video_ctrl_init (void *memptr)
 
                debug ("[RRvision] PD3 -> clk output: ");
                immr->im_ioport.iop_pdpar |=   0x1000 ;
+#if 0  /* This is supposed to be an output XXX XXX */
+               immr->im_ioport.iop_pddir |=   0x1000 ;
+#else
                immr->im_ioport.iop_pddir &= ~(0x1000);
+#endif
                udelay (1000);
                debug ("PDPAR=%04X PDDIR=%04X PDDAT=%04X\n",
                        immr->im_ioport.iop_pdpar,
index 8700d1af0e68eccf7ff9b42302c65945ff6e60d9..f0b612071bd75f8408cfb32c93c2a1cf38a67b5b 100644 (file)
@@ -130,7 +130,7 @@ relocate:                           /* relocate ppcboot to RAM          */
        ldr     r2, _armboot_start
        ldr     r3, _armboot_end
        sub     r2, r3, r2              /* r2 <- size of armboot */
-/*     ldr     r1, _uboot_reloc        /* r1 <- destination address        */
+/*     ldr     r1, _uboot_reloc        / * r1 <- destination address        */
        ldr     r1, _TEXT_BASE
        add     r2, r0, r2              /* r2 <- source end address */
 
index 1eb69189cb6e9e41030633498a2f574f21fbecbe..52d3b6094c3ff5dcc3098ec0f20f3bca4f0ca7c6 100644 (file)
                        CFG_CMD_SAVES   | \
                        CFG_CMD_SCSI    | \
                        CFG_CMD_SDRAM   | \
-                       CFG_CMD_USB     )
+                       CFG_CMD_USB     | \
+                       CFG_CMD_VFD     )
 
 /* Default configuration
  */
index 9728f8d13cf527d0e3b574e3cad78648948461af..015e6211103f815b58a27b831d70587965f5c3ca 100644 (file)
                                             & ~CFG_CMD_PCI     \
                                             & ~CFG_CMD_PCMCIA  \
                                             & ~CFG_CMD_SCSI    \
-                                            & ~CFG_CMD_USB     )
+                                            & ~CFG_CMD_USB     \
+                                            & ~CFG_CMD_VFD     )
 
 #if CONFIG_LANTEC >= 2
 #define        CONFIG_RTC_MPC8xx               /* use internal RTC of MPC8xx   */
index d6e81442a2d1f20627c445f874af9448612a257a..67e8eed240d42cd9975963ebe72f8b4051f269cb 100644 (file)
                                 CFG_CMD_PCI    | \
                                 CFG_CMD_PCMCIA | \
                                 CFG_CMD_SCSI   | \
+                                CFG_CMD_VFD    | \
                                 CFG_CMD_USB    ) )
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
index 189ee9d051c961ad1e38c66905d954d0c810c0ee..2288b6af56a793b82f4562ceafe2feb560957e08 100644 (file)
                                        ~CFG_CMD_PCMCIA & \
                                        ~CFG_CMD_SCSI   & \
                                        ~CFG_CMD_USB    & \
+                                       ~CFG_CMD_VFD    & \
                                        ~CFG_CMD_DTT )
 
 /* Where do the internal registers live? */
index eecb429f16665d84d79c2344bd89725c813bf340..eeae055a74bd35180a4c465bf0843b7af45239dc 100644 (file)
                                        CFG_CMD_PCI     | \
                                        CFG_CMD_USB     | \
                                        CFG_CMD_SCSI    | \
+                                       CFG_CMD_VFD     | \
                                        CFG_CMD_DTT     ) )
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
index 1fa63721b6a495fad9d9a36ba6188f425f271aa7..8ae71b73a898a4425c632aafde7de132a4658ebb 100644 (file)
 
 #define CONFIG_BAUDRATE                115200  /* with watchdog >= 38400 needed */
 
-#if 0
-#define CONFIG_BOOTDELAY       -1      /* autoboot disabled            */
-#else
-#define CONFIG_BOOTDELAY       5       /* autoboot after 5 seconds     */
-#endif
+#define CONFIG_BOOTDELAY       1       /* autoboot after 1 second      */
 
 #define        CONFIG_CLOCKS_IN_MHZ    1       /* clocks passsed to Linux in MHz */
 
                                 CFG_POST_USB | \
                                 CFG_POST_SPR)
 
-/*
- * HACK: insert some more variable definitions ;-)
- */
-#define CONFIG_BOOTCOMMAND                                                     \
-       "run flash_self"                                                        \
-       "\0"                                                                    \
+#define CONFIG_BOOTCOMMAND     "run flash_self"
+
+#define        CONFIG_EXTRA_ENV_SETTINGS                                               \
        "kernel_addr=40040000\0"                                                \
        "ramdisk_addr=40100000\0"                                               \
-       "magic_keys=#789\0"                                                     \
-       "key_magic7=24\0key_cmd7=echo ## Taste '7' aktiv ##;echo\0"             \
-       "key_magic8=25\0key_cmd8=echo=## Taste '8' aktiv ##;echo\0"             \
-       "key_magic9=26\0key_cmd9=setenv addfb setenv bootargs \\$(bootargs) "   \
-                       "console=tty0 console=ttyS1,$(baudrate)\0"              \
-       "key_magic#=28\0key_cmd#=setenv addfb setenv bootargs \\$(bootargs) "   \
-                       "console=tty0\0"                                        \
+       "magic_keys=#3\0"                                                       \
+       "key_magic#=28\0"                                                       \
+       "key_cmd#=setenv addfb setenv bootargs \\$(bootargs) console=tty0\0"    \
+       "key_magic3=24\0"                                                       \
+       "key_cmd3=echo *** Entering Test Mode ***;" \
+               "setenv add_misc setenv bootargs \\$(bootargs) testmode\0"      \
        "nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath)\0" \
        "ramargs=setenv bootargs root=/dev/ram rw\0"                            \
        "addfb=setenv bootargs $(bootargs) console=ttyS1,$(baudrate)\0"         \
                "ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off " \
                "panic=1\0"                                                     \
        "add_wdt=setenv bootargs $(bootargs) $(wdt_args)\0"                     \
-       "flash_nfs=run nfsargs;run addip;run add_wdt;run addfb;"                \
+       "flash_nfs=run nfsargs addip add_wdt addfb;"            \
                "bootm $(kernel_addr)\0"                                        \
-       "flash_self=run ramargs;run addip;run add_wdt;run addfb;"               \
+       "flash_self=run ramargs addip add_wdt addfb;"           \
                "bootm $(kernel_addr) $(ramdisk_addr)\0"                        \
-       "net_nfs=tftp 100000 /tftpboot/pImage.lwmon;run nfsargs;run addip;"     \
-               "run add_wdt;run addfb;bootm\0"                                 \
+       "net_nfs=tftp 100000 /tftpboot/pImage.lwmon;"           \
+               "run nfsargs addip add_wdt addfb;bootm\0"       \
        "rootpath=/opt/eldk/ppc_8xx\0"                                          \
        "load=tftp 100000 /tftpboot/ppcboot.bin\0"                              \
        "update=protect off 1:0;era 1:0;cp.b 100000 40000000 $(filesize)\0"     \
-       "wdt_args=wdt_8xx=off"
+       "wdt_args=wdt_8xx=off\0"                                                \
+       "verify=no"
 
 #define CONFIG_LOADS_ECHO      1       /* echo on for serial download  */
 #undef CFG_LOADS_BAUD_CHANGE           /* don't allow baudrate change  */
index 8734c8014ffc341cdbfaa5d9153d1d908cddf3dc..3e323146ff3ab752e6832457d1c63754bed5da19 100644 (file)
                                 CONFIG_COMMANDS_ADD_VFD        )
 #endif
 
-#undef CONFIG_COMMANDS_ADD_HWFLOW
-#undef CONFIG_COMMANDS_ADD_VFD
-
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
 
        "net_load=tftpboot $(loadaddr) $(loadfile)\0" \
        "net_nfs=run net_load nfs_args add_net add_misc;bootm\0" \
        "kernel_addr=00040000\0" \
-       "flash_nfs=run nfs_args add_net add_misc;bootm $(kernel_addr)\0"
+       "flash_nfs=run nfs_args add_net add_misc;bootm $(kernel_addr)\0" \
+       "mdm_init1=ATZ\0" \
+       "mdm_init2=ATS0=1\0" \
+       "mdm_flow_control=rts/cts\0"
 
 #if 0  /* disabled for development */
 #define        CONFIG_AUTOBOOT_KEYED           /* Enable password protection   */
index 9f98cec2c9c3860b1c12043e6358636e241f3524..d4985ca307d798172acd3d6b783576262895933c 100644 (file)
@@ -73,7 +73,7 @@ struct eth_device {
 
 extern int eth_initialize(bd_t *bis);          /* Initialize network subsystem */
 extern int eth_register(struct eth_device* dev);/* Register network device     */
-extern void eth_try_another(void);             /* Change the device            */
+extern void eth_try_another(int first_restart);        /* Change the device            */
 extern struct eth_device *eth_get_dev(void);   /* get the current device MAC   */
 extern void eth_set_enetaddr(int num, char* a);        /* Set new MAC address          */
 #endif
@@ -262,6 +262,9 @@ extern int          NetState;               /* Network loop state           */
 #define NETLOOP_SUCCESS                3
 #define NETLOOP_FAIL           4
 
+#ifdef CONFIG_NET_MULTI
+extern int             NetRestartWrap;         /* Tried all network devices    */
+#endif
 
 typedef enum { BOOTP, RARP, ARP, TFTP, DHCP } proto_t;
 
index 40ea9b1b59ea08b9540a4bafbd73ea5f96dbbeb4..d3e1c80e7859b39f11a97302d7d2e3009b5286b3 100644 (file)
@@ -24,6 +24,6 @@
 #ifndef        __VERSION_H__
 #define        __VERSION_H__
 
-#define        PPCBOOT_VERSION "PPCBoot 1.2.2"
+#define        PPCBOOT_VERSION "PPCBoot 2.0.0"
 
 #endif /* __VERSION_H__ */
index 1db535424eef8aac37d89ff97a5a11e67da9f025..a96fc41a642c57f16e9672ee0c74c8d295307ce9 100644 (file)
@@ -159,10 +159,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
     if (data) {
        initrd_start = data;
        initrd_end   = initrd_start + len;
-       printf ("   Loading Ramdisk to %08lx, end %08lx ... ",
-               initrd_start, initrd_end);
-       memmove ((void *)initrd_start, (void *)data, len);
-       printf ("OK\n");
     } else {
        initrd_start = 0;
        initrd_end = 0;
index 62981feea456e340a6914dba8beacf256fed159e..916817b81a87eab6918a4f790fa03ae6ddd237ec 100644 (file)
@@ -295,7 +295,6 @@ int mdm_init (void)
        static inline void mdm_readline(char *buf, int bufsiz);
        extern void enable_putc(void);
        extern int hwflow_onoff(int);
-       static void delay(void);
 
        enable_putc(); /* enable serial_putc() */
 
@@ -329,10 +328,10 @@ int mdm_init (void)
                } else
                        break; /* no init string - stop modem init */
 
-               delay();
+               udelay(100000);
        }
 
-       delay();
+       udelay(100000);
 
        /* final stage - wait for connect */
        for(;i > 1;) { /* if 'i' > 1 - wait for connection
@@ -380,10 +379,4 @@ static inline void mdm_readline(char *buf, int bufsiz)
                }
        }
 }
-
-static void delay(void)
-{
-       int i = 50000;
-       while(i--);
-}
 #endif /* CONFIG_MODEM_SUPPORT */
index 885c1eb85f04955ccbe0b86411579f3dd81de104..0ab467c28b007a19acf27ad43f8989ef2cad4349 100644 (file)
--- a/net/eth.c
+++ b/net/eth.c
@@ -229,6 +229,7 @@ int eth_init(bd_t *bis)
                if (eth_current->init(eth_current, bis)) {
                        eth_current->state = ETH_STATE_ACTIVE;
 
+                       printf("%s configured\n", eth_current->name);
                        return 1;
                }
 
@@ -236,7 +237,7 @@ int eth_init(bd_t *bis)
                puts ("FAIL\n");
 #endif
 
-               eth_try_another();
+               eth_try_another(0);
        } while (old_current != eth_current);
 
        return 0;
@@ -268,12 +269,24 @@ int eth_rx(void)
        return eth_current->recv(eth_current);
 }
 
-void eth_try_another(void)
+void eth_try_another(int first_restart)
 {
+       static struct eth_device *first_failed = NULL;
+       
        if (!eth_current)
                return;
 
+       if (first_restart)
+       {
+               first_failed = eth_current;
+       }
+
        eth_current = eth_current->next;
+       
+       if (first_failed == eth_current)
+       {
+               NetRestartWrap = 1;
+       }
 }
 
 #endif
index 28af64cebb23cae602d2fe407af3cb949f710074..cc3bec638c006ec83fe103c9c506d6eb78058022 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -97,6 +97,11 @@ unsigned     NetIPID;                /* IP packet ID                         */
 uchar          NetBcastAddr[6] =       /* Ethernet bcast address               */
                        { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
 int            NetState;               /* Network loop state                   */
+#ifdef CONFIG_NET_MULTI
+int            NetRestartWrap = 0;     /* Tried all network devices            */
+static int     NetRestarted = 0;       /* Network loop restarted               */
+static int     NetDevExists = 0;       /* At least one device configured       */
+#endif
 
 char           BootFile[128];          /* Boot File name                       */
 
@@ -123,6 +128,11 @@ NetLoop(proto_t protocol)
 
        bd_t *bd = gd->bd;
 
+#ifdef CONFIG_NET_MULTI
+       NetRestarted = 0;
+       NetDevExists = 0;
+#endif
+
        if (!NetTxPacket) {
                int     i;
 
@@ -154,56 +164,74 @@ restart:
         *      packets and timer events.
         */
 
-       if (protocol == TFTP) {                 /* TFTP */
+       switch (protocol) {
+       case TFTP:
                NetCopyIP(&NetOurIP, &bd->bi_ip_addr);
                NetServerIP     = getenv_IPaddr ("serverip");
                NetOurGatewayIP = getenv_IPaddr ("gatewayip");
                NetOurSubnetMask= getenv_IPaddr ("netmask");
-
-               if (net_check_prereq (protocol) != 0) {
-                       return 0;
-               }
-
-               /* always use ARP to get server ethernet address */
-               ArpTry = 0;
-               ArpRequest ();
-
-#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
-       } else if (protocol == DHCP) {
-               if (net_check_prereq (protocol) != 0) {
-                       return 0;
-               }
-
-               /* Start with a clean slate... */
-               NetOurIP = 0;
-               NetServerIP = 0;
-               DhcpRequest();          /* Basically same as BOOTP */
-
-#endif /* CFG_CMD_DHCP */
-
-       } else {                                /* BOOTP or RARP */
-
+               break;
+       case BOOTP:
+       case RARP:
                /*
                  * initialize our IP addr to 0 in order to accept ANY
                  * IP addr assigned to us by the BOOTP / RARP server
                 */
                NetOurIP = 0;
                NetServerIP = 0;
+               break;
+       default:
+               break;
+       }
 
-               if (net_check_prereq (protocol) != 0) {
-                       return 0;
-               }
+       switch (net_check_prereq (protocol)) {
+       case 1:
+               /* network not configured */
+               return 0;
+
+#ifdef CONFIG_NET_MULTI
+       case 2:
+               /* network device not configured */
+               break;
+#endif /* CONFIG_NET_MULTI */
+
+       case 0:
+#ifdef CONFIG_NET_MULTI
+               NetDevExists = 1;
+#endif
+               switch (protocol) {
+               case TFTP:
+                       /* always use ARP to get server ethernet address */
+                       ArpTry = 0;
+                       ArpRequest ();
+                       break;
 
-               if (protocol == BOOTP) {
+#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
+               case DHCP:
+                       /* Start with a clean slate... */
+                       NetOurIP = 0;
+                       NetServerIP = 0;
+                       DhcpRequest();          /* Basically same as BOOTP */
+                       break;
+#endif /* CFG_CMD_DHCP */
+
+               case BOOTP:
                        BootpTry = 0;
                        BootpRequest ();
-               } else {
-                       RarpTry  = 0;
+                       break;
+
+               case RARP:
+                       RarpTry = 0;
                        RarpRequest ();
+                       break;
+               default:
+                       break;
                }
+
+               NetBootFileXferSize = 0;
+               break;
        }
 
-       NetBootFileXferSize = 0;
 
        /*
         *      Main packet reception loop.  Loop receiving packets until
@@ -250,9 +278,7 @@ restart:
 
                case NETLOOP_RESTART:
 #ifdef CONFIG_NET_MULTI
-                       eth_halt();
-                       eth_try_another();
-                       eth_init(bd);
+                       NetRestarted = 1;
 #endif
                        goto restart;
 
@@ -276,7 +302,6 @@ restart:
 
 /**********************************************************************/
 
-#ifndef CONFIG_NET_MULTI
 static void
 startAgainTimeout(void)
 {
@@ -288,8 +313,6 @@ startAgainHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
 {
        /* Totally ignore the packet */
 }
-#endif
-
 
 void
 NetStartAgain(void)
@@ -298,7 +321,28 @@ NetStartAgain(void)
        NetSetTimeout(10 * CFG_HZ, startAgainTimeout);
        NetSetHandler(startAgainHandler);
 #else
-       NetState = NETLOOP_RESTART;
+       DECLARE_GLOBAL_DATA_PTR;
+
+       eth_halt();
+       eth_try_another(!NetRestarted);
+       eth_init(gd->bd);
+       if (NetRestartWrap)
+       {
+               NetRestartWrap = 0;
+               if (NetDevExists)
+               {
+                       NetSetTimeout(10 * CFG_HZ, startAgainTimeout);
+                       NetSetHandler(startAgainHandler);
+               }
+               else
+               {
+                       NetState = NETLOOP_FAIL;
+               }
+       }
+       else
+       {
+               NetState = NETLOOP_RESTART;
+       }
 #endif
 }
 
@@ -564,7 +608,7 @@ static int net_check_prereq (proto_t protocol)
                            switch (num) {
                            case -1:
                                puts ("*** ERROR: No ethernet found.\n");
-                               break;
+                               return (1);
                            case 0:
                                puts ("*** ERROR: `ethaddr' not set\n");
                                break;
@@ -573,10 +617,13 @@ static int net_check_prereq (proto_t protocol)
                                        num);
                                break;
                            }
+
+                           NetStartAgain ();
+                           return (2);
 #else
                            puts ("*** ERROR: `ethaddr' not set\n");
-#endif
                            return (1);
+#endif
                        }
                        /* Fall through */
        }