]> www.infradead.org Git - users/rw/ppcboot.git/commitdiff
* "Final" fix for HUSH shell
authorwdenk <wdenk>
Tue, 8 Jan 2002 22:14:15 +0000 (22:14 +0000)
committerwdenk <wdenk>
Tue, 8 Jan 2002 22:14:15 +0000 (22:14 +0000)
* Fix IDE on BAB750 board

CHANGELOG
board/eltec/bab750/w83c553f.c
common/cmd_ide.c
common/hush.c
include/config_BAB750.h
include/config_TQM860L.h

index 60c063045115cf141daa1f40014973d56b51614c..a87313edec3a328f3c5ebbe0bebb567675fc3c3b 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -56,6 +56,10 @@ To do:
 Modifications for 1.1.4:
 ======================================================================
 
+* "Final" fix for HUSH shell
+
+* Fix IDE on BAB750 board
+
 * Patch by Stefan Roese, 07 Jan 2002
   - PPC405GP Ethernet driver: Wait for PHY auto negotiation to complete
 
index d16ba5085e7d649a01eccc5d470001e485479ba6..c4779c5b8a0e2179d1ca312c9800aebe9d1a434b 100644 (file)
@@ -35,7 +35,7 @@
 
 #define EIEIO_SYNC  __asm__ volatile ("eieio;sync")
 
-ulong bus_offset[CFG_IDE_MAXBUS];
+extern ulong ide_bus_offset[CFG_IDE_MAXBUS];
 
 void initialise_pic(void);
 void initialise_dma(void);
@@ -94,9 +94,9 @@ void initialise_w83c553f(void)
        regval &= ~(IDECSR_LEGIRQ | IDECSR_P1EN | IDECSR_P1F16);
        PCI_Write_CFG_Reg(devbusfn, WINDOND_IDECSR, regval, 4);
        
-       bus_offset[0] = PCI_Read_CFG_Reg(devbusfn, PCI_CFG_BASE_ADDRESS_0, 4) & ~1;
+       ide_bus_offset[0] = PCI_Read_CFG_Reg(devbusfn, PCI_CFG_BASE_ADDRESS_0, 4) & ~1;
 #if CFG_IDE_MAXBUS > 1
-       bus_offset[1] = PCI_Read_CFG_Reg(devbusfn, PCI_CFG_BASE_ADDRESS_2, 4) & ~1;
+       ide_bus_offset[1] = PCI_Read_CFG_Reg(devbusfn, PCI_CFG_BASE_ADDRESS_2, 4) & ~1;
 #endif
 
        /*
index b02c33814ba3bb198f969f38213070790e2715e7..711c951bb5270d382eb54b2b1a50a05c9fa53e8d 100644 (file)
@@ -98,7 +98,7 @@ static int pio_mode = CFG_PIO_MODE;
 static int curr_device = -1;
 
 /* Current offset for IDE0 / IDE1 bus access   */
-static ulong bus_offset[CFG_IDE_MAXBUS] = {
+ulong ide_bus_offset[CFG_IDE_MAXBUS] = {
 #if defined(CFG_ATA_IDE0_OFFSET)
        CFG_ATA_IDE0_OFFSET,
 #endif
@@ -107,7 +107,7 @@ static ulong bus_offset[CFG_IDE_MAXBUS] = {
 #endif
 };
 
-#define        ATA_CURR_BASE(dev)      (CFG_ATA_BASE_ADDR+bus_offset[IDE_BUS(dev)])
+#define        ATA_CURR_BASE(dev)      (CFG_ATA_BASE_ADDR+ide_bus_offset[IDE_BUS(dev)])
 
 static int         ide_bus_ok[CFG_IDE_MAXBUS];
 
index 87c61a4408fd37f7a3b3256b949da5d4e088b1f9..446a2395c033a37f3a3f0f99bece04ed72415ba5 100644 (file)
@@ -210,7 +210,7 @@ struct p_context {
        reserved_style w;
        int old_flag;                           /* for figuring out valid reserved words */
        struct p_context *stack;
-       int type;                       /* define type of parser : ";" common or special symbol */
+       int type;                       /* define type of parser : ";$" common or special symbol */
        /* How about quoting status? */
 };
 
@@ -241,6 +241,7 @@ struct child_prog {
        struct pipe *family;            /* pointer back to the child's parent pipe */
 #endif
        int sp;                         /* number of SPECIAL_VAR_SYMBOL */
+       int type;
 };
 
 struct pipe {
@@ -1605,8 +1606,13 @@ static int run_pipe_real(struct pipe *pi)
                        char * str = NULL;
                        
                        str = make_string((child->argv + i));
-                       parse_string_outer(str, FLAG_EXIT_FROM_LOOP |
-                                               FLAG_NOT_PARSE_SEMICOLON);
+                       if ((child->type & FLAG_PARSE_SEMICOLON)) {
+                               parse_string_outer(str, FLAG_EXIT_FROM_LOOP |
+                                                       FLAG_PARSE_SEMICOLON);
+                       } else {
+                               parse_string_outer(str, FLAG_EXIT_FROM_LOOP |
+                                                       FLAG_NOT_PARSE_SEMICOLON);
+                       }
                        free(str);
                        return last_return_code;
                }
@@ -2330,7 +2336,6 @@ static void initialize_context(struct p_context *ctx)
 #ifdef __PPCBOOT__
        ctx->old_flag=0;
 #endif 
-       ctx->type=0;
        done_command(ctx);   /* creates the memory for working child */
 }
 
@@ -2534,6 +2539,7 @@ static int done_command(struct p_context *ctx)
 #endif 
        prog->sp = 0;
        ctx->child = prog;
+       prog->type = ctx->type;
 
        /* but ctx->pipe and ctx->list_head remain unchanged */
        return 0;
@@ -3056,10 +3062,10 @@ int parse_stream_outer(struct in_str *inp, int flag)
        int code;
 #endif
        do {
-               initialize_context(&ctx);
                ctx.type = flag;
+               initialize_context(&ctx);
                update_ifs_map();
-               if ((flag & FLAG_NOT_PARSE_SEMICOLON)) mapset(";", 0);
+               if ((flag & FLAG_NOT_PARSE_SEMICOLON)) mapset(";$", 0);
                inp->promptmode=1;
                rcode = parse_stream(&temp, &ctx, inp, '\n');
 #ifdef __PPCBOOT__             
@@ -3145,7 +3151,7 @@ int parse_file_outer(void)
 #else
        setup_file_in_str(&input);
 #endif
-       rcode = parse_stream_outer(&input, FLAG_PARSE_SEMICOLON);
+       rcode = parse_stream_outer(&input, 0);
        return rcode;
 }
 
@@ -3274,8 +3280,7 @@ int hush_main(int argc, char **argv)
                                {
                                        global_argv = argv+optind;
                                        global_argc = argc-optind;
-                                       opt = parse_string_outer(optarg,
-                                               FLAG_PARSE_SEMICOLON);
+                                       opt = parse_string_outer(optarg, 0);
                                        goto final_return;
                                }
                                break;
index 0699d28ca0accf5ea82429f67cf06284d8310bf7..722bedd0bbc4911ed15333e7f881cd7d0f80f15e 100644 (file)
@@ -12,7 +12,7 @@
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
    suit your needs */
 
 /* first ethernet */
-#define CONFIG_ETHADDR          00:00:5B:00:6E:8A
+#define CONFIG_ETHADDR         00:00:5B:00:6E:8A
 
 #define CONFIG_IPADDR  172.22.2.112
-#define CONFIG_SERVERIP        172.22.2.111
+#define CONFIG_SERVERIP 172.22.2.111
 
 #define CONFIG_ENV_OVERWRITE
 
@@ -70,7 +70,7 @@
 #define CONFIG_75x             1       /* This is a MPC75x             */
 #define CONFIG_BAB750          1       /* ...on an BAB750 board        */
 
-#define CONFIG_BAUDRATE                115200  /* console baudrate = 115kbps   */
+#define CONFIG_BAUDRATE                115200  /* console baudrate = 115kbps   */
 
 #undef CONFIG_WATCHDOG
 
 #undef CONFIG_BOOTARGS
 
 #define CONFIG_BOOTCOMMAND                                                  \
-       "bootp 1000000; "                                                    \
+       "bootp 1000000; "                                                    \
        "setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) "  \
        "ip=$(ipaddr):$(serverip):$(gatewayip):" \
        "$(netmask):$(hostname):eth0:none; "\
-       "bootm" 
+       "bootm"
 
-#define CONFIG_LOADS_ECHO      0       /* echo off for serial download */
-#define        CFG_LOADS_BAUD_CHANGE           /* allow baudrate changes       */
+#define CONFIG_LOADS_ECHO      0       /* echo off for serial download */
+#define CFG_LOADS_BAUD_CHANGE          /* allow baudrate changes       */
 
 #define CONFIG_BOOTP_MASK      (CONFIG_BOOTP_DEFAULT | \
                                 CONFIG_BOOTP_BOOTFILESIZE)
 
-#define CONFIG_COMMANDS  (CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_SCSI | CFG_CMD_IDE | CFG_CMD_DATE | CFG_CMD_FDC)
+#define CONFIG_COMMANDS         (CONFIG_CMD_DFL | CFG_CMD_PCI | CFG_CMD_SCSI | CFG_CMD_IDE | CFG_CMD_DATE | CFG_CMD_FDC)
 
 /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */
 #include <cmd_confdefs.h>
 /*
  * Miscellaneous configurable options
  */
-#define        CFG_LONGHELP                    /* undef to save memory         */
-#define        CFG_PROMPT      "=> "           /* Monitor Command Prompt       */
+#define CFG_LONGHELP                   /* undef to save memory         */
+#define CFG_PROMPT     "=> "           /* Monitor Command Prompt       */
 
 /*
  * choose between COM1 and COM2 as serial console
 #define CONFIG_CONS_INDEX      1
 
 #if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-#define        CFG_CBSIZE      1024            /* Console I/O Buffer Size      */
+#define CFG_CBSIZE     1024            /* Console I/O Buffer Size      */
 #else
-#define        CFG_CBSIZE      256             /* Console I/O Buffer Size      */
+#define CFG_CBSIZE     256             /* Console I/O Buffer Size      */
 #endif
-#define        CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
-#define        CFG_MAXARGS     16              /* max number of command args   */
+#define CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer Size */
+#define CFG_MAXARGS    16              /* max number of command args   */
 #define CFG_BARGSIZE   CFG_CBSIZE      /* Boot Argument Buffer Size    */
 
 #define CFG_MEMTEST_START      0x00000000      /* memtest works on     */
 #define CFG_MEMTEST_END                0x04000000      /* 0 ... 64 MB in DRAM  */
 
-#define CFG_LOAD_ADDR          0x100000        /* default load address */
+#define CFG_LOAD_ADDR          0x100000        /* default load address */
 
-#define CFG_HZ         1000            /* decrementer freq: 1 ms ticks */
+#define CFG_HZ         1000            /* decrementer freq: 1 ms ticks */
 
 #define CFG_BAUDRATE_TABLE    { 9600, 19200, 38400, 57600, 115200, 230400 }
 
   #undef CFG_MEMTEST
 #endif
 
-#define        CFG_MALLOC_LEN          (128 << 10)  /* Reserve 128 kB for malloc() */
+#define CFG_MALLOC_LEN         (128 << 10)  /* Reserve 128 kB for malloc() */
 
 #define CFG_CPU_CLK            266000000
 #define CFG_BUS_CLK            6600000
  * Do NOT change the following table!!! Important mapping information!!
  */
 #ifdef CFG_ADDRESS_MAP_A
-#define CFG_ISA_MEM         0xC0000000
-#define CFG_ISA_IO_BASE_ADDRESS        0x80000000
-#define CFG_ISA_IO          CFG_ISA_IO_BASE_ADDRESS
-#define CFG_PCI_IO_BASE_ADDRESS        0x81000000
-#define CFG_PCI_IO                     CFG_PCI_IO_BASE_ADDRESS
+#define CFG_ISA_MEM            0xC0000000
+#define CFG_ISA_IO_BASE_ADDRESS 0x80000000
+#define CFG_ISA_IO             CFG_ISA_IO_BASE_ADDRESS
+#define CFG_PCI_IO_BASE_ADDRESS 0x81000000
+#define CFG_PCI_IO             CFG_PCI_IO_BASE_ADDRESS
 #else
-#define CFG_ISA_MEM         0xFD000000
-#define CFG_ISA_IO_BASE_ADDRESS        0xFE000000
-#define CFG_ISA_IO          CFG_ISA_IO_BASE_ADDRESS
-#define CFG_PCI_IO_BASE_ADDRESS        0xFE800000
-#define CFG_PCI_IO                     CFG_PCI_IO_BASE_ADDRESS
+#define CFG_ISA_MEM            0xFD000000
+#define CFG_ISA_IO_BASE_ADDRESS 0xFE000000
+#define CFG_ISA_IO             CFG_ISA_IO_BASE_ADDRESS
+#define CFG_PCI_IO_BASE_ADDRESS 0xFE800000
+#define CFG_PCI_IO             CFG_PCI_IO_BASE_ADDRESS
 #endif
 
 /*
  * PCI stuff
  */
-#define CONFIG_PCI             /* include pci support          */
+#define CONFIG_PCI             /* include pci support          */
 #define CONFIG_PCI_HOST PCI_HOST_AUTO
-#define CONFIG_PCI_PNP /* pci plug-and-play                    */
+#define CONFIG_PCI_PNP /* pci plug-and-play                    */
 
 /*
  * Do NOT change the following table!!! Important mapping information!!
  */
 #ifdef CFG_ADDRESS_MAP_A
-#define CFG_PCI_DRAM_OFFSET            0x80000000
+#define CFG_PCI_DRAM_OFFSET    0x80000000
 #define CFG_60X_PCI_MEM_OFFSET 0xC0000000
 #define CFG_60X_PCI_IO_OFFSET  0x80000000
 #define CFG_MIN_PCI_MEMADDR1   0x01010000
 #define CFG_MIN_PCI_MEMADDR2   0x01010000
-#define CFG_PCI_PCI_IOADDR             0x01000000
+#define CFG_PCI_PCI_IOADDR     0x01000000
 #else
-#define CFG_PCI_DRAM_OFFSET            0x00000000
+#define CFG_PCI_DRAM_OFFSET    0x00000000
 #define CFG_60X_PCI_MEM_OFFSET 0x00000000
 #define CFG_60X_PCI_IO_OFFSET  0xFE000000
 #define CFG_MIN_PCI_MEMADDR1   0xF9000000
 #define CFG_MIN_PCI_MEMADDR2   0xFA000000
-#define CFG_PCI_PCI_IOADDR             0x00800000
+#define CFG_PCI_PCI_IOADDR     0x00800000
 #endif
 
-#define CFG_MAX_PCI_DEVICES     32
+#define CFG_MAX_PCI_DEVICES    32
 #define CFG_MAX_PCI_FUNCTIONS  8
 
 /*
 #define CFG_IDE_MAXBUS         1   /* max. 2 IDE busses        */
 #define CFG_IDE_MAXDEVICE      (CFG_IDE_MAXBUS*2) /* max. 2 drives per IDE bus */
 
-#define CFG_ATA_BASE_ADDR      CFG_60X_PCI_IO_OFFSET /* base address */
-#define CFG_ATA_IDE0_OFFSET 0x1F0      /* default ide0 offste */
-#define CFG_ATA_IDE1_OFFSET 0x170      /* default ide1 offset */
-#define CFG_ATA_DATA_OFFSET 0                          /* data reg offset      */
-#define CFG_ATA_REG_OFFSET  0                          /* reg offset */
-#define CFG_ATA_ALT_OFFSET     0x200           /* alternate register offset */
+#define CFG_ATA_BASE_ADDR      CFG_60X_PCI_IO_OFFSET /* base address */
+#define CFG_ATA_IDE0_OFFSET    0x1F0   /* default ide0 offset */
+#define CFG_ATA_IDE1_OFFSET    0x170   /* default ide1 offset */
+#define CFG_ATA_DATA_OFFSET    0       /* data reg offset      */
+#define CFG_ATA_REG_OFFSET     0       /* reg offset */
+#define CFG_ATA_ALT_OFFSET     0x200   /* alternate register offset */
 
-#undef  CONFIG_IDE_PCMCIA      /* no pcmcia interface required */
-#undef  CONFIG_IDE_LED         /* no led for ide supported     */
+#undef CONFIG_IDE_PCMCIA      /* no pcmcia interface required */
+#undef CONFIG_IDE_LED         /* no led for ide supported     */
 
 /*
  * ATAPI support (experimental)
  * SCSI support (experimental) only SYM53C8xx supported
  */
 #define CONFIG_SCSI_SYM53C8XX
-#define CONFIG_SCSI_DEV_ID             0x000F          /* 53c875 */
-#define CFG_SCSI_MAX_LUN               8 /* number of supported LUNs */
-#define CFG_SCSI_MAX_SCSI_ID   15 /* maximum SCSI ID (0..6) */
-#define CFG_SCSI_MAX_DEVICE            CFG_SCSI_MAX_SCSI_ID * CFG_SCSI_MAX_LUN /* maximum Target devices */
+#define CONFIG_SCSI_DEV_ID     0x000F  /* 53c875 */
+#define CFG_SCSI_MAX_LUN       8       /* number of supported LUNs */
+#define CFG_SCSI_MAX_SCSI_ID   15      /* maximum SCSI ID (0..6) */
+#define CFG_SCSI_MAX_DEVICE    CFG_SCSI_MAX_SCSI_ID * CFG_SCSI_MAX_LUN /* maximum Target devices */
 #define CFG_SCSI_SPIN_UP_TIME  2
 #define CFG_SCSI_SCAN_BUS_REVERSE 0
 #define CONFIG_DOS_PARTITION
 #define CONFIG_MAC_PARTITION
 #define CONFIG_ISO_PARTITION
 
-#define CFG_WINBOND_83C553      1           /*has a winbond bridge  */
-#define CFG_USE_WINBOND_IDE     0           /*use winbond 83c553 internal ide controller */
-#define CFG_WINBOND_ISA_CFG_ADDR    0x80005800  /*pci-isa bridge config addr */
-#define CFG_WINBOND_IDE_CFG_ADDR    0x80005900  /*ide config addr */
-#define CFG_NS87308_BADDR_10    1
+#define CFG_WINBOND_83C553     1           /*has a winbond bridge  */
+#define CFG_USE_WINBOND_IDE    0           /*use winbond 83c553 internal ide controller */
+#define CFG_WINBOND_ISA_CFG_ADDR    0x80005800 /*pci-isa bridge config addr */
+#define CFG_WINBOND_IDE_CFG_ADDR    0x80005900 /*ide config addr */
+#define CFG_NS87308_BADDR_10   1
 
-#define CFG_NS_PC87308UL        1           /* Nat Semi super-io controller on ISA bus */
+#define CFG_NS_PC87308UL       1       /* Nat Semi super-io controller on ISA bus */
 
 #define CONFIG_RTC_MK48T59
 
  */
 
 /* do we need the MMU? probably not, but if we do, we must use the BATs */
-#undef  CFG_MMU
+#undef CFG_MMU
 
 #ifdef CFG_MMU
 /* SDRAM */
  * have to be in the first 8 MB of memory, since this is
  * the maximum mapped by the Linux kernel during initialization.
  */
-#define        CFG_BOOTMAPSZ           (8 << 20)  /* Initial Memory map for Linux */
+#define CFG_BOOTMAPSZ          (8 << 20)  /* Initial Memory map for Linux */
 
 /*
  * FLASH organization
  * look in include/mpc74xx.h for the defines used here
  */
 /*#define CFG_L2*/
-#define L2_INIT   (L2CR_L2SIZ_HM | L2CR_L2CLK_3 | L2CR_L2RAM_BURST | \
-                   L2CR_L2OH_5 | L2CR_L2CTL | L2CR_L2WT)
+#define L2_INIT          (L2CR_L2SIZ_HM | L2CR_L2CLK_3 | L2CR_L2RAM_BURST | \
+                  L2CR_L2OH_5 | L2CR_L2CTL | L2CR_L2WT)
 #define L2_ENABLE (L2_INIT | L2CR_L2E)
 
 /*
  *
  * Boot Flags
  */
-#define        BOOTFLAG_COLD   0x01            /* Normal Power-On: Boot from FLASH     */
+#define BOOTFLAG_COLD  0x01            /* Normal Power-On: Boot from FLASH     */
 #define BOOTFLAG_WARM  0x02            /* Software reboot                      */
 
 #endif /* __CONFIG_H */
index 7e498133947f02a76bedfd87adf80eeb398d5806..5e204e4e687d8d185a6da336a31152ae1d081ad5 100644 (file)
@@ -46,7 +46,9 @@
 
 #define        CONFIG_CLOCKS_IN_MHZ    1       /* clocks passsed to Linux in MHz */
 
-#define CONFIG_PREBOOT "echo;echo Type \"run flash_nfs\" to mount root filesystem over NFS;echo"
+#define CONFIG_PREBOOT "echo;" \
+               "echo 'Type \"run flash_nfs\" to mount root filesystem over NFS';" \
+               "echo"
 
 #undef CONFIG_BOOTARGS
 #define CONFIG_BOOTCOMMAND                                                     \