]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
* Cleanup of 8xx specific #includes, Makefiles, ...
authorwdenk <wdenk>
Sun, 1 Apr 2001 23:35:03 +0000 (23:35 +0000)
committerwdenk <wdenk>
Sun, 1 Apr 2001 23:35:03 +0000 (23:35 +0000)
* Fix console on SCC3 for MPC850 systems
  (Patch by Dr. Bruno Achauer, 31 Mar 2001)
* Work in progress on LWMON board

25 files changed:
CHANGELOG
MAKEALL
Makefile
board/lwmon/eeprom.c
common/cmd_eeprom.c
common/cmd_ide.c
common/cmd_pcmcia.c
common/cmd_reginfo.c
cpu/mpc8260/commproc.c
cpu/mpc8xx/cpu_init.c
cpu/mpc8xx/fec.c
cpu/mpc8xx/serial.c
disk/part.c
include/commproc.h
include/config_CPCI405.h
include/config_GTH.h
include/config_IVML24.h
include/config_IVMS8.h
include/config_SPD823TS.h
include/config_lwmon.h
include/pcmcia.h
include/status_led.h
net/net.c
tools/img2srec.c
tools/mkimage.c

index e49a3b9e0f65c4eca7bea44773ccd26cc59c063b..16393baa5db265b43a15e823a999b121a87386f9 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -61,6 +61,11 @@ To do:
 Modifications for 0.9.0:
 ======================================================================
 
+* Cleanup of 8xx specific #includes, Makefiles, ...
+
+* Fix console on SCC3 for MPC850 systems
+  (Patch by Dr. Bruno Achauer, 31 Mar 2001)
+
 * Added support for DOS partitions
 
 * Fix get_bus_freq() for ppc4xx - returned MHz instead of Hz
diff --git a/MAKEALL b/MAKEALL
index 2d63506b5c75856c9f7d69669c14615f83294a97..c8eff6f2211420949d2760f3a58a041b74bc41c8 100755 (executable)
--- a/MAKEALL
+++ b/MAKEALL
@@ -23,11 +23,13 @@ LIST="$LIST \
        FADS823 FADS850SAR FADS860T ADS860      \
        cogent_mpc8xx                           \
        GENIETV                                 \
-       MBX MBX860T                             \
+       MBX                                     \
        RPXlite                                 \
        GTH                                     \
 "
 
+# MBX860T disabled for now, file `include/config_MBX860T.h' is missing
+
 #########################################################################
 ## PPC4xx Systems
 #########################################################################
index ad19514519078ce0d2f9025e6fb948e97573db7b..a17d5bb02680c02f010675ca59db5c5e121f99ed 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -109,6 +109,14 @@ unconfig:
 ## MPC8xx Systems
 #########################################################################
 
+LANTEC_config  :       unconfig
+       @echo "Configuring for $(@:_config=) Board..." ; \
+       cd include ;                            \
+       echo "ARCH  = ppc"      > config.mk ;   \
+       echo "BOARD = lantec"   >>config.mk ;   \
+       echo "CPU   = mpc8xx"   >>config.mk ;   \
+       echo "#include <config_$(@:_config=).h>" >config.h
+
 TQM823L_config \
 TQM850L_config \
 FPS850L_config \
@@ -142,24 +150,24 @@ SPD823TS_config:  unconfig
        cd include ;                            \
        echo "ARCH  = ppc"      > config.mk ;   \
        echo "BOARD = spd8xx"   >>config.mk ;   \
-       echo "CPU   = mpc8xx"   >>config.mk ;   \
-       echo "#include <config_$(@:_config=).h>" >config.h
+       echo "CPU   = mpc8xx"   >>config.mk ;   \
+       echo "#include <config_$(@:_config=).h>" >config.h
 
 IVMS8_config:  unconfig
        @echo "Configuring for $(@:_config=) Board..." ; \
        cd include ;                            \
        echo "ARCH  = ppc"      > config.mk ;   \
        echo "BOARD = ivms8"    >>config.mk ;   \
-       echo "CPU   = mpc8xx"   >>config.mk ;   \
-       echo "#include <config_$(@:_config=).h>" >config.h
+       echo "CPU   = mpc8xx"   >>config.mk ;   \
+       echo "#include <config_$(@:_config=).h>" >config.h
 
 IVML24_config: unconfig
        @echo "Configuring for $(@:_config=) Board..." ; \
        cd include ;                            \
        echo "ARCH  = ppc"      > config.mk ;   \
        echo "BOARD = ivms8"    >>config.mk ;   \
-       echo "CPU   = mpc8xx"   >>config.mk ;   \
-       echo "#include <config_$(@:_config=).h>" >config.h
+       echo "CPU   = mpc8xx"   >>config.mk ;   \
+       echo "#include <config_$(@:_config=).h>" >config.h
 
 hermes_config  :       unconfig
        @echo "Configuring for $(@:_config=) Board..." ; \
@@ -371,7 +379,7 @@ GTH_config: unconfig
 
 clean:
        rm -f `find . -type f \
-               \( -name 'core' -o -name '*.bak' \
+               \( -name 'core' -o -name '*.bak' -o -name '*~' \
                -o -name '*.o'  -o -name '*.a'  \) -print`
        rm -f examples/hello_world examples/timer
        rm -f tools/img2srec tools/mkimage tools/envcrc tools/gen_eth_addr
@@ -385,6 +393,7 @@ clobber:    clean
        rm -f $(OBJS) *.bak tags
        rm -fr *.*~
        rm -f ppcboot ppcboot.bin ppcboot.elf ppcboot.srec ppcboot.map
+       rm -f tools/crc32.c tools/environment.S
 
 distclean:     clobber unconfig
 
index 56c2ecf919e222268bd236f498f642ea0e9272d9..b7564413a0176df08d280fe35a585f1e331ea5b8 100644 (file)
@@ -298,19 +298,19 @@ void eeprom_read (unsigned offset, uchar *buffer, unsigned cnt)
 #ifndef CONFIG_I2C_X
                blk_num = (offset + i) >> 8;
                blk_off = (offset + i) & 0xFF;
-               write_addr (CFG_EEPROM_ADDR, blk_num);
+               write_addr (CFG_I2C_EEPROM_ADDR, blk_num);
                write_byte (blk_off);
 #else
                blk_num = (offset + i) >> 16;   /* addr selectors */
                blk_off = (offset + i) & 0xFFFF;/* 16-bit address in EEPROM */
 
-               write_addr (CFG_EEPROM_ADDR, blk_num);
+               write_addr (CFG_I2C_EEPROM_ADDR, blk_num);
                write_byte (blk_off >> 8);      /* upper address octet */
                write_byte (blk_off & 0xff);    /* lower address octet */
 #endif /* CONFIG_I2C_X */
 
                send_start ();
-               read_addr  (CFG_EEPROM_ADDR, blk_num);
+               read_addr  (CFG_I2C_EEPROM_ADDR, blk_num);
 
                /* Read data until done or would cross a page boundary.
                 * We must write the address again when changing pages
@@ -343,13 +343,13 @@ void eeprom_write (unsigned offset, uchar *buffer, unsigned cnt)
                blk_num = (offset + i) >> 8;
                blk_off = (offset + i) & 0xFF;
 
-               write_addr (CFG_EEPROM_ADDR, blk_num);
+               write_addr (CFG_I2C_EEPROM_ADDR, blk_num);
                write_byte (blk_off);
 #else
                blk_num = (offset + i) >> 16;   /* addr selectors */
                blk_off = (offset + i) & 0xFFFF;/* 16-bit address in EEPROM */
 
-               write_addr (CFG_EEPROM_ADDR, blk_num);
+               write_addr (CFG_I2C_EEPROM_ADDR, blk_num);
                write_byte (blk_off >> 8);      /* upper address octet */
                write_byte (blk_off & 0xff);    /* lower address octet */
 #endif /* CONFIG_I2C_X */
@@ -375,28 +375,50 @@ void eeprom_write (unsigned offset, uchar *buffer, unsigned cnt)
 /*-----------------------------------------------------------------------
  * Test: Enable Ethernet
  */
-#define CFG_PICIO_ADDR 0x57
 uchar pic_read (uchar reg)
 {
        uchar c;
 
        eeprom_init ();
 
-       write_addr (CFG_PICIO_ADDR, 0);
+       write_addr (CFG_I2C_PICIO_ADDR, 0);
        write_byte (reg);
        send_start ();
-       read_addr  (CFG_PICIO_ADDR, 0);
+       read_addr  (CFG_I2C_PICIO_ADDR, 0);
        c = read_byte(1);
        send_stop  ();
        return (c);
 }
 void pic_write (uchar reg, uchar val)
 {
-       write_addr (CFG_PICIO_ADDR, 0);
+       write_addr (CFG_I2C_PICIO_ADDR, 0);
        write_byte (reg);
        write_byte (val);
        send_stop  ();
 }
 
+/*-----------------------------------------------------------------------
+ * Test:
+ */
+uchar x_i2c_read (uchar addr)
+{
+       uchar c;
+
+       eeprom_init ();
+
+       send_start ();
+       read_addr  (addr, 0);
+       c = read_byte(1);
+       send_stop  ();
+       return (c);
+}
+
+void x_i2c_write (uchar addr, uchar val)
+{
+       write_addr (addr, 0);
+       write_byte (val);
+       send_stop  ();
+}
+
 /*-----------------------------------------------------------------------
  */
index fa4ec7b22b0bdc89dbb5ed6dcd69ea5927430bdd..78859dc7c47678150f8afc236674322cf292e893 100644 (file)
  *
  */
 
-#include <mpc8xx_irq.h>
 #include <ppcboot.h>
 #include <config.h>
 #include <command.h>
-#include <mpc8xx.h>
 
 #if (CONFIG_COMMANDS & CFG_CMD_EEPROM)
 
index a91091de83679c969e739553f99305830e274093..50f9343559e7b3a1b89c1806a69d0f9c36422b6b 100644 (file)
 /*
  * IDE support
  */
-#include <mpc8xx_irq.h>
 #include <ppcboot.h>
 #include <config.h>
 #include <command.h>
 #include <image.h>
 #ifdef CONFIG_IDE_PCMCIA
-#include <pcmcia.h>
+# include <pcmcia.h>
+# ifdef CONFIG_8xx
+#  include <mpc8xx.h>
+# endif
 #endif
 #include <ide.h>
 #include <ata.h>
 #include <cmd_ide.h>
 #include <cmd_disk.h>
 #include <cmd_pcmcia.h>
-#include <mpc8xx.h>
 #ifdef CONFIG_STATUS_LED
-#include <status_led.h>
+# include <status_led.h>
 #endif
 
 /* stdlib.h causes some compatibility problems; should fixe these! -- wd */
index 106978533a2ebd2a3aa2945ab95bc247fcae6c92..2e49fc1e3f86a8d3b62adf1b7c8bf3a40cc75a46 100644 (file)
 /*
  * PCMCIA support
  */
-#include <mpc8xx_irq.h>
 #include <ppcboot.h>
 #include <command.h>
 #include <config.h>
 #include <pcmcia.h>
 #include <cmd_pcmcia.h>
+#if defined(CONFIG_IDE_PCCARD) && defined(CONFIG_8xx)
 #include <mpc8xx.h>
+#endif
 
 #if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) || \
     ((CONFIG_COMMANDS & CFG_CMD_IDE) && defined(CONFIG_IDE_PCCARD))
@@ -97,6 +98,8 @@ const char *indent = "\t   ";
 
 /* ------------------------------------------------------------------------- */
 
+#undef DEBUG
+
 #ifdef DEBUG
 #define        PCMCIA_DEBUG(fmt,args...)       do { printf (fmt ,##args); } while (0)
 #else
@@ -129,6 +132,12 @@ void do_pinit (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
 
 /* ------------------------------------------------------------------------- */
 
+#if defined(CONFIG_LWMON)
+# define  CFG_PCMCIA_TIMING    (PCMCIA_SHT(9) | PCMCIA_SST(3) | PCMCIA_SL(12))
+#else
+# define  CFG_PCMCIA_TIMING    (PCMCIA_SHT(2) | PCMCIA_SST(4) | PCMCIA_SL(9))
+#endif
+
 int pcmcia_on (void)
 {
        int i;
@@ -158,7 +167,7 @@ int pcmcia_on (void)
                                |       PCMCIA_PRS_ATTR
                                |       PCMCIA_SLOT_x
                                |       PCMCIA_PV
-                               |       0x00024480 );   /* fixed access timing */
+                               |       CFG_PCMCIA_TIMING );
                        break;
                    }
 
@@ -168,7 +177,7 @@ int pcmcia_on (void)
                                |       PCMCIA_PRS_IO
                                |       PCMCIA_SLOT_x
                                |       PCMCIA_PV
-                               |       0x00024480 );   /* fixed access timing */
+                               |       CFG_PCMCIA_TIMING );
                        break;
                    }
 
@@ -178,16 +187,17 @@ int pcmcia_on (void)
                                |       PCMCIA_PRS_IO
                                |       PCMCIA_SLOT_x
                                |       PCMCIA_PV
-                               |       0x00024480 );   /* fixed access timing */
+                               |       CFG_PCMCIA_TIMING );
                        break;
                    }
-#endif
+#endif /* CONFIG_IDE_PCCARD */
                default:        /* set to not valid */
                        win->or = 0;
                        break;
                }
 
-               PCMCIA_DEBUG ("MemWin %d: Base 0x%08lX\n", i, base);
+               PCMCIA_DEBUG ("MemWin %d: PBR 0x%08lX  POR %08lX\n",
+                       i, win->br, win->or);
                base += CFG_PCMCIA_MEM_SIZE;
                ++win;
        }
@@ -263,7 +273,7 @@ static int check_ide_device (void)
        int found = 0;
        int i;
 
-       PCMCIA_DEBUG ("PCMCIA MEM: %08lX\n", CFG_PCMCIA_MEM_ADDR);
+       PCMCIA_DEBUG ("PCMCIA MEM: %08X\n", CFG_PCMCIA_MEM_ADDR);
 
        start = p = (volatile uchar *) CFG_PCMCIA_MEM_ADDR;
 
@@ -500,10 +510,11 @@ static int hardware_disable(int slot)
 # endif
 #endif
 
-#ifdef CONFIG_TQM8xxL
+#if defined(CONFIG_TQM8xxL)
 
 #define PCMCIA_BOARD_MSG "TQM8xxL"
 
+
 static int hardware_enable(int slot)
 {
        volatile immap_t        *immap;
@@ -512,7 +523,9 @@ static int hardware_enable(int slot)
        volatile sysconf8xx_t   *sysp;
        uint reg, mask;
 
-       PCMCIA_DEBUG ("hardware_enable: TQM8xxL Slot %c\n", 'A'+slot);
+       PCMCIA_DEBUG ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot);
+
+       udelay(10000);
 
        immap = (immap_t *)CFG_IMMR;
        sysp  = (sysconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_siu_conf));
@@ -610,7 +623,7 @@ static int hardware_disable(int slot)
        volatile pcmconf8xx_t   *pcmp;
        u_long reg;
 
-       PCMCIA_DEBUG ("hardware_disable: TQM8xxL Slot %c\n", 'A'+slot);
+       PCMCIA_DEBUG ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot);
 
        immap = (immap_t *)CFG_IMMR;
        pcmp = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia));
@@ -627,6 +640,8 @@ static int hardware_disable(int slot)
        reg |= __MY_PCMCIA_GCRX_CXOE;           /* active low  */
        PCMCIA_PGCRX(_slot_) = reg;
 
+       udelay(10000);
+
        return (0);
 }
 #endif /* CFG_CMD_PCMCIA */
@@ -639,7 +654,9 @@ static int voltage_set(int slot, int vcc, int vpp)
        volatile pcmconf8xx_t   *pcmp;
        u_long reg;
 
-       PCMCIA_DEBUG ("voltage_set: TQM8xxL Slot %c, Vcc=%d.%d, Vpp=%d.%d\n",
+       PCMCIA_DEBUG ("voltage_set: "   \
+               PCMCIA_BOARD_MSG        \
+               " Slot %c, Vcc=%d.%d, Vpp=%d.%d\n",
                'A'+slot, vcc/10, vcc%10, vpp/10, vcc%10);
 
        immap = (immap_t *)CFG_IMMR;
@@ -696,12 +713,247 @@ done:
        PCMCIA_PGCRX(_slot_) = reg;
        udelay(500);
 
-       PCMCIA_DEBUG ("voltage_set: TQM8xxL Slot %c, DONE\n", slot+'A');
+       PCMCIA_DEBUG ("voltage_set: " PCMCIA_BOARD_MSG " Slot %c, DONE\n",
+               slot+'A');
        return (0);
 }
 
 #endif /* TQM8xxL */
 
+
+/* ---------------------------------------------------------------------------- */
+/* LWMON Board                                                                 */
+/* ---------------------------------------------------------------------------- */
+
+#if defined(CONFIG_LWMON)
+
+#define PCMCIA_BOARD_MSG "LWMON"
+
+/* #define's for MAX1604 Power Switch */
+#define MAX1604_OP_SUS         0x80
+#define MAX1604_VCCBON         0x40
+#define MAX1604_VCC_35         0x20
+#define MAX1604_VCCBHIZ                0x10
+#define MAX1604_VPPBON         0x08
+#define MAX1604_VPPBPBPGM      0x04
+#define MAX1604_VPPBHIZ                0x02
+/* reserved                    0x01    */
+
+extern void x_i2c_write (uchar, uchar);
+
+static int hardware_enable(int slot)
+{
+       volatile immap_t        *immap;
+       volatile cpm8xx_t       *cp;
+       volatile pcmconf8xx_t   *pcmp;
+       volatile sysconf8xx_t   *sysp;
+       uint reg, mask;
+       uchar val;
+
+
+       PCMCIA_DEBUG ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot);
+
+       /* Switch on PCMCIA port in PIC register 0x60 */
+       reg = pic_read  (0x60);
+       PCMCIA_DEBUG ("[%d] PIC read: reg_60 = 0x%02x\n", __LINE__, reg);
+       reg &= ~0x10;
+       /* reg |=  0x08; Vpp not needed */
+       pic_write (0x60, reg);
+#ifdef DEBUG
+       reg = pic_read  (0x60);
+       printf ("[%d] PIC read: reg_60 = 0x%02x\n", __LINE__, reg);
+#endif
+       udelay(10000);
+
+       immap = (immap_t *)CFG_IMMR;
+       sysp  = (sysconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_siu_conf));
+       pcmp  = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia));
+       cp    = (cpm8xx_t *)(&(((immap_t *)CFG_IMMR)->im_cpm));
+
+       /*
+        * Configure SIUMCR to enable PCMCIA port B
+        * (VFLS[0:1] are not used for debugging, we connect FRZ# instead)
+        */
+       sysp->sc_siumcr &= ~SIUMCR_DBGC11;      /* set DBGC to 00 */
+
+       /* clear interrupt state, and disable interrupts */
+       pcmp->pcmc_pscr =  PCMCIA_MASK(_slot_);
+       pcmp->pcmc_per &= ~PCMCIA_MASK(_slot_);
+
+       /* disable interrupts & DMA */
+       PCMCIA_PGCRX(_slot_) = 0;
+
+       /*
+        * Disable PCMCIA buffers (isolate the interface)
+        * and assert RESET signal
+        */
+       PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n");
+       reg  =  PCMCIA_PGCRX(_slot_);
+       reg |=  __MY_PCMCIA_GCRX_CXRESET;       /* active high */
+       reg |=  __MY_PCMCIA_GCRX_CXOE;          /* active low  */
+       PCMCIA_PGCRX(_slot_) = reg;
+       udelay(500);
+
+       /*
+        * Make sure there is a card in the slot, then configure the interface.
+        */
+       udelay(10000);
+       PCMCIA_DEBUG ("[%d] %s: PIPR(%p)=0x%x\n",
+               __LINE__,__FUNCTION__,
+               &(pcmp->pcmc_pipr),pcmp->pcmc_pipr);
+       if (pcmp->pcmc_pipr & 0x00001800) {
+               printf ("   No Card found\n");
+               return (1);
+       }
+
+       /*
+        * Power On.
+        */
+       mask = PCMCIA_VS1(slot) | PCMCIA_VS2(slot);
+       reg  = pcmp->pcmc_pipr;
+       PCMCIA_DEBUG ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n",
+               reg,
+               (reg&PCMCIA_VS1(slot))?"n":"ff",
+               (reg&PCMCIA_VS2(slot))?"n":"ff");
+       if ((reg & mask) == mask) {
+               val = 0;                /* VCCB3/5 = 0 ==> use Vx = 5.0 V */
+               puts (" 5.0V card found: ");
+       } else {
+               val = MAX1604_VCC_35;   /* VCCB3/5 = 1 ==> use Vy = 3.3 V */
+               puts (" 3.3V card found: ");
+       }
+
+       /*  switch VCC on */
+       val |=  MAX1604_OP_SUS | MAX1604_VCCBON; 
+       x_i2c_write (CFG_I2C_POWER_A_ADDR, val);
+
+       udelay(500000);
+
+       PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n");
+       reg  =  PCMCIA_PGCRX(_slot_);
+       reg &= ~__MY_PCMCIA_GCRX_CXRESET;       /* active high */
+       reg &= ~__MY_PCMCIA_GCRX_CXOE;          /* active low  */
+       PCMCIA_PGCRX(_slot_) = reg;
+
+       udelay(250000); /* some cards need >150 ms to come up :-( */
+
+       PCMCIA_DEBUG ("# hardware_enable done\n");
+
+       return (0);
+}
+
+
+
+#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA)
+static int hardware_disable(int slot)
+{
+       volatile immap_t        *immap;
+       volatile pcmconf8xx_t   *pcmp;
+       u_long reg;
+
+       PCMCIA_DEBUG ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot);
+
+       immap = (immap_t *)CFG_IMMR;
+       pcmp = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia));
+
+       /* remove all power, put output in high impedance state */
+       x_i2c_write (CFG_I2C_POWER_A_ADDR, MAX1604_VCCBHIZ | MAX1604_VPPBHIZ);
+
+       /* Configure PCMCIA General Control Register */
+       PCMCIA_PGCRX(_slot_) = 0;
+
+       PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n");
+       reg  =  PCMCIA_PGCRX(_slot_);
+       reg |= __MY_PCMCIA_GCRX_CXRESET;        /* active high */
+       reg |= __MY_PCMCIA_GCRX_CXOE;           /* active low  */
+       PCMCIA_PGCRX(_slot_) = reg;
+
+       /* Switch off PCMCIA port in PIC register 0x60 */
+       reg = pic_read  (0x60);
+       PCMCIA_DEBUG ("[%d] PIC read: reg_60 = 0x%02x\n", __LINE__, reg);
+       reg |=  0x10;
+       reg &= ~0x08;
+       pic_write (0x60, reg);
+#ifdef DEBUG
+       reg = pic_read  (0x60);
+       printf ("[%d] PIC read: reg_60 = 0x%02x\n", __LINE__, reg);
+#endif
+       udelay(10000);
+
+       return (0);
+}
+#endif /* CFG_CMD_PCMCIA */
+
+
+
+static int voltage_set(int slot, int vcc, int vpp)
+{
+       volatile immap_t        *immap;
+       volatile pcmconf8xx_t   *pcmp;
+       u_long reg;
+       uchar val;
+
+       PCMCIA_DEBUG ("voltage_set: "   \
+               PCMCIA_BOARD_MSG        \
+               " Slot %c, Vcc=%d.%d, Vpp=%d.%d\n",
+               'A'+slot, vcc/10, vcc%10, vpp/10, vcc%10);
+
+       immap = (immap_t *)CFG_IMMR;
+       pcmp = (pcmconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_pcmcia));
+       /*
+        * Disable PCMCIA buffers (isolate the interface)
+        * and assert RESET signal
+        */
+       PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n");
+       reg  =  PCMCIA_PGCRX(_slot_);
+       reg |=  __MY_PCMCIA_GCRX_CXRESET;       /* active high */
+       reg |=  __MY_PCMCIA_GCRX_CXOE;          /* active low  */
+       PCMCIA_PGCRX(_slot_) = reg;
+       udelay(500);
+
+       /*
+        * Turn off all power (switch to high impedance)
+        */
+       PCMCIA_DEBUG ("PCMCIA power OFF\n");
+       x_i2c_write (CFG_I2C_POWER_A_ADDR, MAX1604_VCCBHIZ | MAX1604_VPPBHIZ);
+
+       val = 0;
+       switch(vcc) {
+       case  0:                        break;
+       case 33: val = MAX1604_VCC_35;  break;
+       case 50:                        break;
+       default:                        goto done;
+       }
+
+       /* Checking supported voltages */
+
+       PCMCIA_DEBUG ("PIPR: 0x%x --> %s\n",
+               pcmp->pcmc_pipr,
+               (pcmp->pcmc_pipr & 0x00008000) ? "only 5 V" : "can do 3.3V");
+
+       x_i2c_write (CFG_I2C_POWER_A_ADDR, val);
+       if (val) {
+               PCMCIA_DEBUG ("PCMCIA powered at %sV\n",
+                       (val & MAX1604_VCC_35) ? "3.3" : "5.0");
+       } else {
+               PCMCIA_DEBUG ("PCMCIA powered down\n");
+       }
+
+done:
+       PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n");
+       reg  =  PCMCIA_PGCRX(_slot_);
+       reg &= ~__MY_PCMCIA_GCRX_CXRESET;       /* active high */
+       reg &= ~__MY_PCMCIA_GCRX_CXOE;          /* active low  */
+       PCMCIA_PGCRX(_slot_) = reg;
+       udelay(500);
+
+       PCMCIA_DEBUG ("voltage_set: " PCMCIA_BOARD_MSG " Slot %c, DONE\n",
+               slot+'A');
+       return (0);
+}
+
+#endif /* LWMON */
+
 /* ---------------------------------------------------------------------------- */
 /* GTH board by Corelatus AB                                                    */
 /* ---------------------------------------------------------------------------- */
index 74a8dc3c6618f4cf65ff44121470ad4a3f41ee4e..f7c7f6f7815e8f905c5ee5b149d0f596bb9e1d38 100644 (file)
@@ -24,7 +24,9 @@
 #include <ppcboot.h>
 #include <command.h>
 #include <cmd_boot.h>
+#if defined(CONFIG_8xx)
 #include <mpc8xx.h>
+#endif
 
 #if defined(CONFIG_8xx) && (CONFIG_COMMANDS & CFG_CMD_REGINFO)
 
index 04fc9a2412b913fe0a0ae89092304ec9f757d868..0077436c5bc7cf0394ca3f1cde8bf4e9d643a965 100644 (file)
@@ -62,6 +62,7 @@ m8260_cpm_reset(void)
 uint
 m8260_cpm_dpalloc(uint size, uint align)
 {
+       volatile immap_t *immr = (immap_t *)CFG_IMMR;
        uint    retloc;
        uint    align_mask, off;
        uint    savebase;
@@ -86,7 +87,7 @@ m8260_cpm_dpalloc(uint size, uint align)
        retloc = idata->dp_alloc_base;
        idata->dp_alloc_base += size;
 
-       memset((void *)retloc, 0, size);
+       memset((void *)&immr->im_dprambase[retloc], 0, size);
 
        return(retloc);
 }
index 9f0cad3fb710274dbc0d6098184c6e23ef42ebf8..24d9196c6f201a2a800f8856dcb04de5c7343425 100644 (file)
@@ -135,6 +135,9 @@ cpu_init_f (volatile immap_t *immr)
 #if defined(CFG_OR1_REMAP)
     memctl->memc_or1 = CFG_OR1_REMAP;
 #endif
+#if defined(CFG_OR5_REMAP)
+    memctl->memc_or5 = CFG_OR5_REMAP;
+#endif
 
     /* now restrict to preliminary range */
     memctl->memc_br0 = CFG_BR0_PRELIM;
@@ -144,6 +147,10 @@ cpu_init_f (volatile immap_t *immr)
     memctl->memc_or1 = CFG_OR1_PRELIM;
     memctl->memc_br1 = CFG_BR1_PRELIM;
 #endif
+#if (defined(CFG_OR5_PRELIM) && defined(CFG_BR5_PRELIM))
+    memctl->memc_or5 = CFG_OR5_PRELIM;
+    memctl->memc_br5 = CFG_BR5_PRELIM;
+#endif
 
 #if defined(CONFIG_IP860)      /* disable CS0 now that Flash is mapped on CS1 */
     memctl->memc_br0 = 0;
index db99dc2781d380a32ba0059eb732e5164597e326..f004e2ef44dcee39274566e1f2f94a97d546d173 100644 (file)
 #include <net.h>
 #include <command.h>
 
-#ifdef CFG_DISCOVER_PHY
-static void mii_discover_phy(void);
-#endif
-
 #undef ET_DEBUG
 
 #if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(FEC_ENET)
 
+#ifdef CFG_DISCOVER_PHY
+static void mii_discover_phy(void);
+#endif
+
 /* Ethernet Transmit and Receive Buffers */
 #define DBUF_LENGTH  1520
 
index fc1366bba84b1479b1cce8a327f3df492ecd5509..14281c73868d3174fa19f4f7dee7ebe6d744ff2b 100644 (file)
@@ -344,9 +344,17 @@ serial_init (ulong cpu_clock, int baudrate)
        */
        im->im_siu_conf.sc_sdcr = 1;
 
-#if (SCC_INDEX < 2) || !defined(CONFIG_IP860)
+#if (SCC_INDEX == 2) && defined(CONFIG_MPC850)
        /*
-        * Standard configuration for SCC's in on Part A
+        * The MPC850 has SCC3 on Port B
+        */
+       cp->cp_pbpar |=  0x06;
+       cp->cp_pbdir &= ~0x06;
+       cp->cp_pbodr &= ~0x06;
+
+#elif (SCC_INDEX < 2) || !defined(CONFIG_IP860)
+       /*
+        * Standard configuration for SCC's is on Part A
         */
        ip->iop_papar |=  ((3 << (2 * SCC_INDEX)));
        ip->iop_padir &= ~((3 << (2 * SCC_INDEX)));
index 28281fbe24b773d83b472de1df77bf5811bd3301..2da47eb7845fca695d156785e77f0f85fdf3ed9e 100644 (file)
@@ -59,7 +59,9 @@ int get_partition_info (int dev, int part, disk_partition_t *info)
 #ifdef CONFIG_MAC_PARTITION
        case PART_TYPE_MAC:
                if (get_partition_info_mac(dev,part,info) == 0) {
-printf ("## Valid MAC partition found ##\n");
+#ifdef DEBUG
+                       printf ("## Valid MAC partition found ##\n");
+#endif
                        return (0);
                }
                break;
@@ -68,7 +70,9 @@ printf ("## Valid MAC partition found ##\n");
 #ifdef CONFIG_DOS_PARTITION
        case PART_TYPE_DOS:
                if (get_partition_info_dos(dev,part,info) == 0) {
-printf ("## Valid DOS partition found ##\n");
+#ifdef DEBUG
+                       printf ("## Valid DOS partition found ##\n");
+#endif
                        return (0);
                }
                break;
@@ -90,14 +94,18 @@ void print_part (int dev)
        switch (part_type[dev]) {
 #ifdef CONFIG_MAC_PARTITION
        case PART_TYPE_MAC:
-printf ("## Testing for valid MAC partition ##\n");
+#ifdef DEBUG
+               printf ("## Testing for valid MAC partition ##\n");
+#endif
                print_part_header ("MAC", dev);
                print_part_mac (dev);
                return;
 #endif
 #ifdef CONFIG_DOS_PARTITION
        case PART_TYPE_DOS:
-printf ("## Testing for valid DOS partition ##\n");
+#ifdef DEBUG
+               printf ("## Testing for valid DOS partition ##\n");
+#endif
                print_part_header ("DOS", dev);
                print_part_dos (dev);
                return;
index 68e00d09d713719f62157bf509b322d89262f72a..5209823d60b14d42e60f8d8a0a73d194b6d6e41c 100644 (file)
@@ -701,7 +701,10 @@ typedef struct scc_enet {
 
 /***  TQM823L, TQM850L, ETX094  ***************************************/
 
-#if defined(CONFIG_TQM823L) || defined(CONFIG_TQM850L) || defined(CONFIG_ETX094)
+#if defined(CONFIG_TQM823L) || \
+    defined(CONFIG_TQM850L) || \
+    defined(CONFIG_ETX094)  || \
+    defined(CONFIG_LANTEC)
 /* Bits in parallel I/O port registers that have to be set/cleared
  * to configure the pins for SCC2 use.
  */
@@ -723,7 +726,7 @@ typedef struct scc_enet {
  */
 #define SICR_ENET_MASK ((uint)0x0000ff00)
 #define SICR_ENET_CLKRT        ((uint)0x00002600)
-#endif /* CONFIG_TQM823L, CONFIG_TQM850L, CONFIG_ETX094 */
+#endif /* CONFIG_TQM823L, CONFIG_TQM850L, CONFIG_ETX094, CONFIG_LANTEC */
 
 /***  FPS850L  *********************************************************/
 
index 6e3bd2a153ab7289f98e1024203c0cff4f692bb1..4a9dede899c51be5f6712f43d91a9bdc28262167 100644 (file)
@@ -66,6 +66,8 @@
 #if 1
 #define CONFIG_COMMANDS                \
         (CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_IRQ | CFG_CMD_IDE)
+#define CONFIG_MAC_PARTITION
+#define CONFIG_DOS_PARTITION
 #else
 #define CONFIG_COMMANDS                \
        (CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_IRQ)
index 4235f9b27f588fd6c66dac2325f8c23bdb6e5b89..01615fe293b2df5f22513313cb09708b6e2485d0 100644 (file)
@@ -97,6 +97,8 @@
 #endif
 
 #define CONFIG_COMMANDS               (CONFIG_CMD_DFL | CFG_CMD_IDE)
+#define CONFIG_MAC_PARTITION
+#define CONFIG_DOS_PARTITION
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
index 3a37720091b3e11b44edad79d8799c4567333472..2468396635f743545e00dbbc23a3a3968e21fafc 100644 (file)
@@ -59,6 +59,8 @@
 #define        CONFIG_STATUS_LED       1       /* Status LED enabled           */
 
 #define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_IDE)
+#define CONFIG_MAC_PARTITION
+#define CONFIG_DOS_PARTITION
 
 #define CONFIG_BOOTP_MASK \
     ((CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) & ~CONFIG_BOOTP_GATEWAY)
index e3cb02d534c5cef0b6dc47e3a9f0b885179b3791..bcfa573fe3798fd0dd96361a7a14d135ed5a34ec 100644 (file)
@@ -59,6 +59,8 @@
 #define        CONFIG_STATUS_LED       1       /* Status LED enabled           */
 
 #define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_IDE)
+#define CONFIG_MAC_PARTITION
+#define CONFIG_DOS_PARTITION
 
 #define CONFIG_BOOTP_MASK \
     ((CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) & ~CONFIG_BOOTP_GATEWAY)
index e20c8a00f9cfab6fbf7911d6741290af5584e2cf..c8e8093920bb42ee9394a563a347eec7439da478 100644 (file)
@@ -58,6 +58,8 @@
 
 #define CONFIG_COMMANDS \
 ((CONFIG_CMD_DFL & ~(CFG_CMD_FLASH)) | CFG_CMD_IDE) /* no Flash, but IDE */
+#define CONFIG_MAC_PARTITION
+#define CONFIG_DOS_PARTITION
 
 #define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE)
 
index 120584f8d138f89c88bcbf08785325bfe0f26a87..b3256ff72c927415113aa1244663145db42efd75 100644 (file)
@@ -60,7 +60,9 @@
 
 // #define     CONFIG_I2C                      /* I2C support enabled          */
 
-#define CONFIG_COMMANDS                (CONFIG_CMD_DFL | CFG_CMD_EEPROM /*| CFG_CMD_I2C|CFG_CMD_IDE*/)
+#define CONFIG_COMMANDS          (CONFIG_CMD_DFL | CFG_CMD_EEPROM | CFG_CMD_IDE /*|CFG_CMD_I2C*/)
+#define CONFIG_MAC_PARTITION
+#define CONFIG_DOS_PARTITION
 
 #define CONFIG_BOOTP_MASK \
     ((CONFIG_BOOTP_DEFAULT | CONFIG_BOOTP_BOOTFILESIZE) & ~CONFIG_BOOTP_GATEWAY)
  */
 #define        CFG_SDRAM_BASE          0x00000000
 #define CFG_FLASH_BASE         0x40000000
-#ifdef DEBUG
+#if defined(DEBUG) || (CONFIG_COMMANDS & CFG_CMD_IDE)
 #define        CFG_MONITOR_LEN         (256 << 10)     /* Reserve 256 kB for Monitor   */
 #else
 #define        CFG_MONITOR_LEN         (128 << 10)     /* Reserve 128 kB for Monitor   */
  */
 #define CFG_I2C_CLOCK          33000   /* I²C Clock Rate in kHz                */
 
-#define        CFG_EEPROM_ADDR         0x58
+#define CFG_I2C_AUDIO_ADDR     0x28    /* Audio volume control                 */
+#define CFG_I2C_SYSMON_ADDR    0x2E    /* LM87 System Monitor                  */
+#define CFG_I2C_RTC_ADDR       0x51    /* PCF8563 RTC                          */
+#define CFG_I2C_POWER_A_ADDR   0x52    /* PCMCIA/USB power switch, channel A   */
+#define CFG_I2C_POWER_B_ADDR   0x53    /* PCMCIA/USB power switch, channel B   */
+#define CFG_I2C_KEYBD_ADDR     0x56    /* PIC LWE keyboard                     */
+#define CFG_I2C_PICIO_ADDR     0x57    /* PIC IO Expander                      */
+#define        CFG_I2C_EEPROM_ADDR     0x58    /* EEPROM AT24C164                      */
 
 /*-----------------------------------------------------------------------
  * Cache Configuration
  */
 /* EARB, DBGC and DBPC are initialised by the HCW */
 /* => 0x000000C0 */
-#define CFG_SIUMCR     (SIUMCR_BSC | SIUMCR_GB5E)
+#define CFG_SIUMCR     (SIUMCR_GB5E)
+//#define CFG_SIUMCR   (SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
 
 /*-----------------------------------------------------------------------
  * TBSCR - Time Base Status and Control                                11-26
@@ -275,7 +285,7 @@ SCCR_EBDF01 /****    SCCR_EBDF00 ****/      |   SCCR_DFSYNC00 |     \
 #define CFG_PCMCIA_IO_SIZE     ( 64 << 20 )
 
 /*-----------------------------------------------------------------------
- * IDE/ATA stuff
+ * IDE/ATA stuff (Supports IDE harddisk on PCMCIA Adapter)
  *-----------------------------------------------------------------------
  */
 
index 2172b719eaaf24234cfad3b72a91e29f8c40fec9..0f4bc96be710ffc3771f81cf63f6623cb3497022 100644 (file)
@@ -56,6 +56,8 @@
 # define CONFIG_PCMCIA_SLOT_B
 #elif defined(CONFIG_IVMS8) || defined(CONFIG_IVML24)  /* The IVM* use SLOT_A  */
 # define CONFIG_PCMCIA_SLOT_A
+#elif defined(CONFIG_LWMON)            /* The LWMON use SLOT_B         */
+# define CONFIG_PCMCIA_SLOT_B
 #else
 # error "PCMCIA Slot not configured"
 #endif
index b84fa93b852e65c9fe1ff6f2f54d41677dc7ca45..cf1d328ef256a57a8a841019411c8d0b67268d43 100644 (file)
@@ -138,6 +138,22 @@ void status_led_set  (int led, int state);
 # define STATUS_LED_GREEN      1
 # define STATUS_LED_BOOT       2               /* IDE LED used for boot status */
 
+/*****  LANTEC  *********************************************************/
+#elif defined(CONFIG_LANTEC)
+
+# define STATUS_LED_PAR                im_ioport.iop_pdpar
+# define STATUS_LED_DIR                im_ioport.iop_pddir
+# undef  STATUS_LED_ODR
+# define STATUS_LED_DAT                im_ioport.iop_pddat
+
+# define STATUS_LED_BIT                0x1000
+# define STATUS_LED_PERIOD     (CFG_HZ / 2)
+# define STATUS_LED_STATE      STATUS_LED_BLINKING
+
+# define STATUS_LED_ACTIVE     0               /* LED on for bit == 0 */
+
+# define STATUS_LED_BOOT       0               /* LED 0 used for boot status */
+
 /************************************************************************/
 #else
 # error Status LED configuration missing
index 71de54a5ff646a89b4d3594888766fb3f9d735f5..ac5fab8863dbc9793eab0f9bd3a52760c193f52c 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -599,6 +599,7 @@ void copy_filename (uchar *dst, uchar *src, int size)
 {
        if (*src && (*src == '"')) {
                ++src;
+               --size;
        }
 
        while ((--size > 0) && *src && (*src != '"')) {
index 7cf4b7fc90f058c888ab2dd75ee91afb1dbfa0ff..084ea24b050fcaa5fab656c2c92671d2cb1f1d97 100644 (file)
@@ -61,7 +61,7 @@
 #include <unistd.h>
 #include <errno.h>
 
-#ifdef __BEOS__
+#if defined(__BEOS__) || defined(__NetBSD__)
 #include <inttypes.h>
 #endif
 
index 6adf7b77f3da132b60cb07b83065a224fb10ac17..6c869167e27dd98bdf0235ec420ddcc314660027 100644 (file)
 #include <time.h>
 #include <unistd.h>
 
+#if defined(__BEOS__) || defined(__NetBSD__)
+#include <inttypes.h>
+#endif
+
 #include <image.h>
 
 extern int errno;