From: wdenk Date: Wed, 30 Oct 2002 00:22:40 +0000 (+0000) Subject: * Shuffle init sequence: do PCMCIA/IDE init after the watchdog POST X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b6d20d17aa015dce89f4d482c03637f824f84632;p=users%2Frw%2Fppcboot.git * Shuffle init sequence: do PCMCIA/IDE init after the watchdog POST so that it's done only once during normal startup (saves some secs when booting on LWMON) * Fix yet another reference to flash code after relocation --- diff --git a/CHANGELOG b/CHANGELOG index 741cef4..6e7a161 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,12 @@ Modifications since 1.2.1: ====================================================================== +* 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) + +* Fix yet another reference to flash code after relocation + * Patch by Mark Rakes, 29 Oct 2002: - Support for Natsemi dp83815 (natsemi.c) - Support for Natsemi dp83820/83821 (ns8382x.c) diff --git a/common/cmd_ide.c b/common/cmd_ide.c index 46f4c35..6cd8a71 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -598,6 +598,8 @@ set_pcmcia_timing (int pmode) volatile pcmconf8xx_t *pcmp = &(immr->im_pcmcia); ulong timings; + PRINTF ("Set timing for PIO Mode %d\n", pmode); + timings = PCMCIA_SHT(pio_config_clk[pmode].t_hold) | PCMCIA_SST(pio_config_clk[pmode].t_setup) | PCMCIA_SL (pio_config_clk[pmode].t_length) @@ -916,8 +918,7 @@ ulong ide_read (int device, ulong blknr, ulong blkcnt, ulong *buffer) } if ((c & ATA_STAT_ERR) == ATA_STAT_ERR) { printf ("No Powersaving mode %X\n", c); - } - else { + } else { c = inb(device,ATA_SECT_CNT); PRINTF("Powersaving %02X\n",c); if(c==0) @@ -948,9 +949,9 @@ ulong ide_read (int device, ulong blknr, ulong blkcnt, ulong *buffer) if(pwrsave) { c = ide_wait (device, IDE_SPIN_UP_TIME_OUT); /* may take up to 4 sec */ pwrsave=0; - } - else + } else { c = ide_wait (device, IDE_TIME_OUT); /* can't take over 500 ms */ + } if ((c&(ATA_STAT_DRQ|ATA_STAT_BUSY|ATA_STAT_ERR)) != ATA_STAT_DRQ) { printf ("Error (no IRQ) dev %d blk %ld: status 0x%02x\n", diff --git a/common/cmd_pcmcia.c b/common/cmd_pcmcia.c index f4ea125..5a79f07 100644 --- a/common/cmd_pcmcia.c +++ b/common/cmd_pcmcia.c @@ -1,5 +1,5 @@ /* - * (C) Copyright 2000 + * (C) Copyright 2000-2002 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * See file CREDITS for list of people who contributed to this @@ -48,6 +48,8 @@ * They are maximum 64KByte each... */ +/* #define DEBUG 1 */ + /* * PCMCIA support */ @@ -101,16 +103,6 @@ const char *indent = "\t "; /* ------------------------------------------------------------------------- */ -#undef DEBUG - -#ifdef DEBUG -#define PCMCIA_DEBUG(fmt,args...) do { printf (fmt ,##args); } while (0) -#else -#define PCMCIA_DEBUG(fmt,args...) -#endif - -/* ------------------------------------------------------------------------- */ - #if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) int do_pinit (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) @@ -148,7 +140,7 @@ int pcmcia_on (void) u_long reg, base; pcmcia_win_t *win; - PCMCIA_DEBUG ("Enable PCMCIA " PCMCIA_SLOT_MSG "\n"); + debug ("Enable PCMCIA " PCMCIA_SLOT_MSG "\n"); /* intialize the fixed memory windows */ win = (pcmcia_win_t *)(&((immap_t *)CFG_IMMR)->im_pcmcia.pcmc_pbr0); @@ -200,7 +192,7 @@ int pcmcia_on (void) break; } - PCMCIA_DEBUG ("MemWin %d: PBR 0x%08lX POR %08lX\n", + debug ("MemWin %d: PBR 0x%08lX POR %08lX\n", i, win->br, win->or); base += CFG_PCMCIA_MEM_SIZE; ++win; @@ -278,7 +270,7 @@ static int check_ide_device (void) int found = 0; int i; - PCMCIA_DEBUG ("PCMCIA MEM: %08X\n", CFG_PCMCIA_MEM_ADDR); + debug ("PCMCIA MEM: %08X\n", CFG_PCMCIA_MEM_ADDR); start = p = (volatile uchar *) CFG_PCMCIA_MEM_ADDR; @@ -291,7 +283,7 @@ static int check_ide_device (void) } len = *p; p += 2; -#ifdef DEBUG +#if defined(DEBUG) && (DEBUG > 1) { volatile uchar *q = p; printf ("\nTuple code %02x length %d\n\tData:", code, len); @@ -316,7 +308,7 @@ static int check_ide_device (void) break; case CISTPL_CONFIG: config_base = (*(p+6) << 8) + (*(p+4)); - PCMCIA_DEBUG ("\n## Config_base = %04x ###\n", config_base); + debug ("\n## Config_base = %04x ###\n", config_base); default: break; } @@ -522,7 +514,7 @@ static int hardware_enable(int slot) volatile sysconf8xx_t *sysp; uint reg, mask; - PCMCIA_DEBUG ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + debug ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); udelay(10000); @@ -548,7 +540,7 @@ static int hardware_enable(int slot) * Disable PCMCIA buffers (isolate the interface) * and assert RESET signal */ - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -569,7 +561,7 @@ static int hardware_enable(int slot) * Make sure there is a card in the slot, then configure the interface. */ udelay(10000); - PCMCIA_DEBUG ("[%d] %s: PIPR(%p)=0x%x\n", + debug ("[%d] %s: PIPR(%p)=0x%x\n", __LINE__,__FUNCTION__, &(pcmp->pcmc_pipr),pcmp->pcmc_pipr); if (pcmp->pcmc_pipr & 0x00001800) { @@ -582,7 +574,7 @@ static int hardware_enable(int slot) */ mask = PCMCIA_VS1(slot) | PCMCIA_VS2(slot); reg = pcmp->pcmc_pipr; - PCMCIA_DEBUG ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", + debug ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", reg, (reg&PCMCIA_VS1(slot))?"n":"ff", (reg&PCMCIA_VS2(slot))?"n":"ff"); @@ -600,7 +592,8 @@ static int hardware_enable(int slot) cp->cp_pbpar &= ~(0x0020 | 0x0010); udelay(500000); #endif - PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + udelay(1000); + 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 */ @@ -608,7 +601,7 @@ static int hardware_enable(int slot) udelay(250000); /* some cards need >150 ms to come up :-( */ - PCMCIA_DEBUG ("# hardware_enable done\n"); + debug ("# hardware_enable done\n"); return (0); } @@ -622,7 +615,7 @@ static int hardware_disable(int slot) volatile pcmconf8xx_t *pcmp; u_long reg; - PCMCIA_DEBUG ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + 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)); @@ -633,7 +626,7 @@ static int hardware_disable(int slot) /* Configure PCMCIA General Control Register */ PCMCIA_PGCRX(_slot_) = 0; - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -653,8 +646,8 @@ static int voltage_set(int slot, int vcc, int vpp) volatile pcmconf8xx_t *pcmp; u_long reg; - PCMCIA_DEBUG ("voltage_set: " \ - PCMCIA_BOARD_MSG \ + 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); @@ -664,7 +657,7 @@ static int voltage_set(int slot, int vcc, int vpp) * Disable PCMCIA buffers (isolate the interface) * and assert RESET signal */ - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -676,7 +669,7 @@ static int voltage_set(int slot, int vcc, int vpp) * 5 Volts Enable and 3 Volts enable, * Turn off all power */ - PCMCIA_DEBUG ("PCMCIA power OFF\n"); + debug ("PCMCIA power OFF\n"); immap->im_ioport.iop_pcpar &= ~(0x0002 | 0x0004); immap->im_ioport.iop_pcso &= ~(0x0002 | 0x0004); immap->im_ioport.iop_pcdat &= ~(0x0002 | 0x0004); @@ -691,28 +684,28 @@ static int voltage_set(int slot, int vcc, int vpp) /* Checking supported voltages */ - PCMCIA_DEBUG ("PIPR: 0x%x --> %s\n", + debug ("PIPR: 0x%x --> %s\n", pcmp->pcmc_pipr, (pcmp->pcmc_pipr & 0x00008000) ? "only 5 V" : "can do 3.3V"); immap->im_ioport.iop_pcdat |= reg; immap->im_ioport.iop_pcdir |= (0x0002 | 0x0004); if (reg) { - PCMCIA_DEBUG ("PCMCIA powered at %sV\n", + debug ("PCMCIA powered at %sV\n", (reg&0x0004) ? "5.0" : "3.3"); } else { - PCMCIA_DEBUG ("PCMCIA powered down\n"); + debug ("PCMCIA powered down\n"); } done: - PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + 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", + debug ("voltage_set: " PCMCIA_BOARD_MSG " Slot %c, DONE\n", slot+'A'); return (0); } @@ -748,11 +741,11 @@ static int hardware_enable(int slot) uchar val; - PCMCIA_DEBUG ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + 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); + debug ("[%d] PIC read: reg_60 = 0x%02x\n", __LINE__, reg); reg &= ~0x10; /* reg |= 0x08; Vpp not needed */ pic_write (0x60, reg); @@ -784,7 +777,7 @@ static int hardware_enable(int slot) * Disable PCMCIA buffers (isolate the interface) * and assert RESET signal */ - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -795,7 +788,7 @@ static int hardware_enable(int slot) * Make sure there is a card in the slot, then configure the interface. */ udelay(10000); - PCMCIA_DEBUG ("[%d] %s: PIPR(%p)=0x%x\n", + debug ("[%d] %s: PIPR(%p)=0x%x\n", __LINE__,__FUNCTION__, &(pcmp->pcmc_pipr),pcmp->pcmc_pipr); if (pcmp->pcmc_pipr & 0x00001800) { @@ -808,7 +801,7 @@ static int hardware_enable(int slot) */ mask = PCMCIA_VS1(slot) | PCMCIA_VS2(slot); reg = pcmp->pcmc_pipr; - PCMCIA_DEBUG ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", + debug ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", reg, (reg&PCMCIA_VS1(slot))?"n":"ff", (reg&PCMCIA_VS2(slot))?"n":"ff"); @@ -827,7 +820,7 @@ static int hardware_enable(int slot) udelay(500000); - PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + 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 */ @@ -835,7 +828,7 @@ static int hardware_enable(int slot) udelay(250000); /* some cards need >150 ms to come up :-( */ - PCMCIA_DEBUG ("# hardware_enable done\n"); + debug ("# hardware_enable done\n"); return (0); } @@ -850,7 +843,7 @@ static int hardware_disable(int slot) u_long reg; uchar val; - PCMCIA_DEBUG ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + 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)); @@ -863,7 +856,7 @@ static int hardware_disable(int slot) /* Configure PCMCIA General Control Register */ PCMCIA_PGCRX(_slot_) = 0; - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -871,7 +864,7 @@ static int hardware_disable(int slot) /* Switch off PCMCIA port in PIC register 0x60 */ reg = pic_read (0x60); - PCMCIA_DEBUG ("[%d] PIC read: reg_60 = 0x%02x\n", __LINE__, reg); + debug ("[%d] PIC read: reg_60 = 0x%02x\n", __LINE__, reg); reg |= 0x10; reg &= ~0x08; pic_write (0x60, reg); @@ -894,8 +887,8 @@ static int voltage_set(int slot, int vcc, int vpp) u_long reg; uchar val; - PCMCIA_DEBUG ("voltage_set: " \ - PCMCIA_BOARD_MSG \ + 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); @@ -905,7 +898,7 @@ static int voltage_set(int slot, int vcc, int vpp) * Disable PCMCIA buffers (isolate the interface) * and assert RESET signal */ - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -915,7 +908,7 @@ static int voltage_set(int slot, int vcc, int vpp) /* * Turn off all power (switch to high impedance) */ - PCMCIA_DEBUG ("PCMCIA power OFF\n"); + debug ("PCMCIA power OFF\n"); val = MAX1604_VCCBHIZ | MAX1604_VPPBHIZ; i2c_init (CFG_I2C_SPEED, CFG_I2C_SLAVE); i2c_write (CFG_I2C_POWER_A_ADDR, 0, 0, &val, 1); @@ -930,27 +923,27 @@ static int voltage_set(int slot, int vcc, int vpp) /* Checking supported voltages */ - PCMCIA_DEBUG ("PIPR: 0x%x --> %s\n", + debug ("PIPR: 0x%x --> %s\n", pcmp->pcmc_pipr, (pcmp->pcmc_pipr & 0x00008000) ? "only 5 V" : "can do 3.3V"); i2c_write (CFG_I2C_POWER_A_ADDR, 0, 0, &val, 1); if (val) { - PCMCIA_DEBUG ("PCMCIA powered at %sV\n", + debug ("PCMCIA powered at %sV\n", (val & MAX1604_VCC_35) ? "3.3" : "5.0"); } else { - PCMCIA_DEBUG ("PCMCIA powered down\n"); + debug ("PCMCIA powered down\n"); } done: - PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + 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", + debug ("voltage_set: " PCMCIA_BOARD_MSG " Slot %c, DONE\n", slot+'A'); return (0); } @@ -977,7 +970,7 @@ static int hardware_enable (int slot) volatile sysconf8xx_t *sysp; uint reg, mask; - PCMCIA_DEBUG ("hardware_enable: GTH Slot %c\n", 'A'+slot); + debug ("hardware_enable: GTH Slot %c\n", 'A'+slot); immap = (immap_t *)CFG_IMMR; sysp = (sysconf8xx_t *)(&(((immap_t *)CFG_IMMR)->im_siu_conf)); @@ -995,7 +988,7 @@ static int hardware_enable (int slot) * Disable PCMCIA buffers (isolate the interface) * and assert RESET signal */ - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -1006,7 +999,7 @@ static int hardware_enable (int slot) * Make sure there is a card in the slot, then configure the interface. */ udelay(10000); - PCMCIA_DEBUG ("[%d] %s: PIPR(%p)=0x%x\n", + debug ("[%d] %s: PIPR(%p)=0x%x\n", __LINE__,__FUNCTION__, &(pcmp->pcmc_pipr),pcmp->pcmc_pipr); if (pcmp->pcmc_pipr & 0x98000000) { @@ -1016,12 +1009,12 @@ static int hardware_enable (int slot) mask = PCMCIA_VS1(slot) | PCMCIA_VS2(slot); reg = pcmp->pcmc_pipr; - PCMCIA_DEBUG ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", + debug ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", reg, (reg&PCMCIA_VS1(slot))?"n":"ff", (reg&PCMCIA_VS2(slot))?"n":"ff"); - PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + 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 */ @@ -1029,7 +1022,7 @@ static int hardware_enable (int slot) udelay(250000); /* some cards need >150 ms to come up :-( */ - PCMCIA_DEBUG ("# hardware_enable done\n"); + debug ("# hardware_enable done\n"); return 0; } @@ -1060,7 +1053,7 @@ static int hardware_enable(int slot) uint reg, pipr, mask; int i; - PCMCIA_DEBUG ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + debug ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); udelay(10000); @@ -1089,7 +1082,7 @@ static int hardware_enable(int slot) * Disable PCMCIA buffers (isolate the interface) * and assert RESET signal */ - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -1100,7 +1093,7 @@ static int hardware_enable(int slot) * Make sure there is a card in the slot, then configure the interface. */ udelay(10000); - PCMCIA_DEBUG ("[%d] %s: PIPR(%p)=0x%x\n", + debug ("[%d] %s: PIPR(%p)=0x%x\n", __LINE__,__FUNCTION__, &(pcmp->pcmc_pipr),pcmp->pcmc_pipr); if (pcmp->pcmc_pipr & 0x00001800) { @@ -1113,7 +1106,7 @@ static int hardware_enable(int slot) */ mask = PCMCIA_VS1(slot) | PCMCIA_VS2(slot); pipr = pcmp->pcmc_pipr; - PCMCIA_DEBUG ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", + debug ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", pipr, (reg&PCMCIA_VS1(slot))?"n":"ff", (reg&PCMCIA_VS2(slot))?"n":"ff"); @@ -1131,7 +1124,7 @@ static int hardware_enable(int slot) puts (" 3.3V card found: "); } - PCMCIA_DEBUG ("\nPB DAT: %08x -> 3.3V %s 5.0V %s VPP_PGM %s VPP_VCC %s\n", + debug ("\nPB DAT: %08x -> 3.3V %s 5.0V %s VPP_PGM %s VPP_VCC %s\n", reg, (reg & TPS2205_VCC3) ? "off" : "on", (reg & TPS2205_VCC5) ? "off" : "on", @@ -1150,7 +1143,7 @@ static int hardware_enable(int slot) udelay (100); } - PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + 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 */ @@ -1158,7 +1151,7 @@ static int hardware_enable(int slot) udelay(250000); /* some cards need >150 ms to come up :-( */ - PCMCIA_DEBUG ("# hardware_enable done\n"); + debug ("# hardware_enable done\n"); return (0); } @@ -1173,7 +1166,7 @@ static int hardware_disable(int slot) volatile pcmconf8xx_t *pcmp; u_long reg; - PCMCIA_DEBUG ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + debug ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); immap = (immap_t *)CFG_IMMR; cp = (cpm8xx_t *)(&(((immap_t *)CFG_IMMR)->im_cpm)); @@ -1185,7 +1178,7 @@ static int hardware_disable(int slot) /* Configure PCMCIA General Control Register */ PCMCIA_PGCRX(_slot_) = 0; - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -1206,8 +1199,8 @@ static int voltage_set(int slot, int vcc, int vpp) volatile pcmconf8xx_t *pcmp; u_long reg; - PCMCIA_DEBUG ("voltage_set: " \ - PCMCIA_BOARD_MSG \ + 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); @@ -1218,7 +1211,7 @@ static int voltage_set(int slot, int vcc, int vpp) * Disable PCMCIA buffers (isolate the interface) * and assert RESET signal */ - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -1230,7 +1223,7 @@ static int voltage_set(int slot, int vcc, int vpp) * 5 Volts Enable and 3 Volts enable, * Turn all power pins to Hi-Z */ - PCMCIA_DEBUG ("PCMCIA power OFF\n"); + debug ("PCMCIA power OFF\n"); cfg_port_B (); /* Enables switch, but all in Hi-Z */ reg = cp->cp_pbdat; @@ -1244,7 +1237,7 @@ static int voltage_set(int slot, int vcc, int vpp) /* Checking supported voltages */ - PCMCIA_DEBUG ("PIPR: 0x%x --> %s\n", + debug ("PIPR: 0x%x --> %s\n", pcmp->pcmc_pipr, (pcmp->pcmc_pipr & 0x00008000) ? "only 5 V" : "can do 3.3V"); @@ -1266,14 +1259,14 @@ static int voltage_set(int slot, int vcc, int vpp) #endif done: - PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + 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", + debug ("voltage_set: " PCMCIA_BOARD_MSG " Slot %c, DONE\n", slot+'A'); return (0); } @@ -1303,7 +1296,7 @@ static void cfg_port_B (void) reg = cp->cp_pbdir & ~(TPS2205_INPUTS); cp->cp_pbdir = reg | TPS2205_OUTPUTS; - PCMCIA_DEBUG ("Set Port B: PAR: %08x DIR: %08x DAT: %08x\n", + debug ("Set Port B: PAR: %08x DIR: %08x DAT: %08x\n", cp->cp_pbpar, cp->cp_pbdir, cp->cp_pbdat); } @@ -1330,7 +1323,7 @@ static int hardware_enable(int slot) ushort sreg; int i; - PCMCIA_DEBUG ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + debug ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); udelay(10000); @@ -1359,7 +1352,7 @@ static int hardware_enable(int slot) * Disable PCMCIA buffers (isolate the interface) * and assert RESET signal */ - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -1370,7 +1363,7 @@ static int hardware_enable(int slot) * Make sure there is a card in the slot, then configure the interface. */ udelay(10000); - PCMCIA_DEBUG ("[%d] %s: PIPR(%p)=0x%x\n", + debug ("[%d] %s: PIPR(%p)=0x%x\n", __LINE__,__FUNCTION__, &(pcmp->pcmc_pipr),pcmp->pcmc_pipr); if (pcmp->pcmc_pipr & 0x00001800) { @@ -1383,7 +1376,7 @@ static int hardware_enable(int slot) */ mask = PCMCIA_VS1(slot) | PCMCIA_VS2(slot); pipr = pcmp->pcmc_pipr; - PCMCIA_DEBUG ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", + debug ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", pipr, (reg&PCMCIA_VS1(slot))?"n":"ff", (reg&PCMCIA_VS2(slot))?"n":"ff"); @@ -1401,7 +1394,7 @@ static int hardware_enable(int slot) puts (" 3.3V card found: "); } - PCMCIA_DEBUG ("\nPC DAT: %04x -> 3.3V %s 5.0V %s\n", + debug ("\nPC DAT: %04x -> 3.3V %s 5.0V %s\n", sreg, ( (sreg & TPS2211_VCCD0) && !(sreg & TPS2211_VCCD1)) ? "on" : "off", (!(sreg & TPS2211_VCCD0) && (sreg & TPS2211_VCCD1)) ? "on" : "off" @@ -1419,7 +1412,7 @@ static int hardware_enable(int slot) udelay (100); } - PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + 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 */ @@ -1427,7 +1420,7 @@ static int hardware_enable(int slot) udelay(250000); /* some cards need >150 ms to come up :-( */ - PCMCIA_DEBUG ("# hardware_enable done\n"); + debug ("# hardware_enable done\n"); return (0); } @@ -1442,7 +1435,7 @@ static int hardware_disable(int slot) volatile pcmconf8xx_t *pcmp; u_long reg; - PCMCIA_DEBUG ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + 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)); @@ -1450,7 +1443,7 @@ static int hardware_disable(int slot) /* Configure PCMCIA General Control Register */ PCMCIA_PGCRX(_slot_) = 0; - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -1476,8 +1469,8 @@ static int voltage_set(int slot, int vcc, int vpp) u_long reg; ushort sreg; - PCMCIA_DEBUG ("voltage_set: " \ - PCMCIA_BOARD_MSG \ + 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); @@ -1488,7 +1481,7 @@ static int voltage_set(int slot, int vcc, int vpp) * Disable PCMCIA buffers (isolate the interface) * and assert RESET signal */ - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -1500,7 +1493,7 @@ static int voltage_set(int slot, int vcc, int vpp) * 5 Volts Enable and 3 Volts enable, * Turn all power pins to Hi-Z */ - PCMCIA_DEBUG ("PCMCIA power OFF\n"); + debug ("PCMCIA power OFF\n"); cfg_ports (); /* Enables switch, but all in Hi-Z */ sreg = immap->im_ioport.iop_pcdat; @@ -1519,7 +1512,7 @@ static int voltage_set(int slot, int vcc, int vpp) /* Checking supported voltages */ - PCMCIA_DEBUG ("PIPR: 0x%x --> %s\n", + debug ("PIPR: 0x%x --> %s\n", pcmp->pcmc_pipr, (pcmp->pcmc_pipr & 0x00008000) ? "only 5 V" : "can do 3.3V"); @@ -1541,14 +1534,14 @@ static int voltage_set(int slot, int vcc, int vpp) #endif done: - PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + 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", + debug ("voltage_set: " PCMCIA_BOARD_MSG " Slot %c, DONE\n", slot+'A'); return (0); } @@ -1575,7 +1568,7 @@ static void cfg_ports (void) immap->im_ioport.iop_pcpar &= ~(TPS2211_OUTPUTS); immap->im_ioport.iop_pcdir |= TPS2211_OUTPUTS; - PCMCIA_DEBUG ("Set Port C: PAR: %04x DIR: %04x DAT: %04x\n", + debug ("Set Port C: PAR: %04x DIR: %04x DAT: %04x\n", immap->im_ioport.iop_pcpar, immap->im_ioport.iop_pcdir, immap->im_ioport.iop_pcdat); @@ -1588,7 +1581,7 @@ static void cfg_ports (void) cp->cp_pbpar &= ~(TPS2211_INPUTS); cp->cp_pbdir &= ~(TPS2211_INPUTS); - PCMCIA_DEBUG ("Set Port B: PAR: %08x DIR: %08x DAT: %08x\n", + debug ("Set Port B: PAR: %08x DIR: %08x DAT: %08x\n", cp->cp_pbpar, cp->cp_pbdir, cp->cp_pbdat); } @@ -1616,7 +1609,7 @@ static int voltage_set (int slot, int vcc, int vpp) { uchar reg = 0; - PCMCIA_DEBUG ("voltage_set: PCMCIA_BOARD_MSG Slot %c, Vcc=%d.%d, Vpp=%d.%d\n", + 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); switch (vcc) { @@ -1655,7 +1648,7 @@ static int voltage_set (int slot, int vcc, int vpp) /* enable new powersettings */ MBX_CSR2 |= reg; - PCMCIA_DEBUG ("MBX_CSR2 read = 0x%02x\n", MBX_CSR2); + debug ("MBX_CSR2 read = 0x%02x\n", MBX_CSR2); return (0); } @@ -1668,7 +1661,7 @@ static int hardware_enable (int slot) volatile sysconf8xx_t *sysp; uint reg, mask; - PCMCIA_DEBUG ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", + debug ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A' + slot); udelay (10000); @@ -1689,7 +1682,7 @@ static int hardware_enable (int slot) * Disable PCMCIA buffers (isolate the interface) * and assert RESET signal */ - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -1702,7 +1695,7 @@ static int hardware_enable (int slot) * 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__, + debug ("[%d] %s: PIPR(%p)=0x%x\n", __LINE__, __FUNCTION__, &(pcmp->pcmc_pipr), pcmp->pcmc_pipr); if (pcmp->pcmc_pipr & 0x00001800) { @@ -1715,7 +1708,7 @@ static int hardware_enable (int slot) */ mask = PCMCIA_VS1 (_slot_) | PCMCIA_VS2 (_slot_); reg = pcmp->pcmc_pipr; - PCMCIA_DEBUG ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", reg, + debug ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", reg, (reg & PCMCIA_VS1 (slot)) ? "n" : "ff", (reg & PCMCIA_VS2 (slot)) ? "n" : "ff"); @@ -1727,7 +1720,7 @@ static int hardware_enable (int slot) printf (" 3.3V card found: "); } - PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + 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 */ @@ -1735,7 +1728,7 @@ static int hardware_enable (int slot) udelay (250000); /* some cards need >150 ms to come up :-( */ - PCMCIA_DEBUG ("# hardware_enable done\n"); + debug ("# hardware_enable done\n"); return (0); } @@ -1764,7 +1757,7 @@ static int hardware_enable(int slot) volatile sysconf8xx_t *sysp; uint reg, mask; - PCMCIA_DEBUG ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + debug ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); udelay(10000); @@ -1790,7 +1783,7 @@ static int hardware_enable(int slot) * Disable PCMCIA buffers (isolate the interface) * and assert RESET signal */ - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -1820,7 +1813,7 @@ static int hardware_enable(int slot) * Make sure there is a card in the slot, then configure the interface. */ udelay(10000); - PCMCIA_DEBUG ("[%d] %s: PIPR(%p)=0x%x\n", + debug ("[%d] %s: PIPR(%p)=0x%x\n", __LINE__,__FUNCTION__, &(pcmp->pcmc_pipr),pcmp->pcmc_pipr); if (pcmp->pcmc_pipr & 0x00001800) { @@ -1833,7 +1826,7 @@ static int hardware_enable(int slot) */ mask = PCMCIA_VS1(slot) | PCMCIA_VS2(slot); reg = pcmp->pcmc_pipr; - PCMCIA_DEBUG ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", + debug ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", reg, (reg&PCMCIA_VS1(slot))?"n":"ff", (reg&PCMCIA_VS2(slot))?"n":"ff"); @@ -1852,7 +1845,7 @@ static int hardware_enable(int slot) cp->cp_pbpar &= ~(0x0020 | 0x0010); udelay(500000); #endif - PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + 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 */ @@ -1860,7 +1853,7 @@ static int hardware_enable(int slot) udelay(250000); /* some cards need >150 ms to come up :-( */ - PCMCIA_DEBUG ("# hardware_enable done\n"); + debug ("# hardware_enable done\n"); return (0); } @@ -1874,7 +1867,7 @@ static int hardware_disable(int slot) volatile pcmconf8xx_t *pcmp; u_long reg; - PCMCIA_DEBUG ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + 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)); @@ -1886,7 +1879,7 @@ static int hardware_disable(int slot) /* Configure PCMCIA General Control Register */ PCMCIA_PGCRX(_slot_) = 0; - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -1906,8 +1899,8 @@ static int voltage_set(int slot, int vcc, int vpp) volatile pcmconf8xx_t *pcmp; u_long reg; - PCMCIA_DEBUG ("voltage_set: " \ - PCMCIA_BOARD_MSG \ + 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); @@ -1917,7 +1910,7 @@ static int voltage_set(int slot, int vcc, int vpp) * Disable PCMCIA buffers (isolate the interface) * and assert RESET signal */ - PCMCIA_DEBUG ("Disable PCMCIA buffers and assert RESET\n"); + 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 */ @@ -1929,7 +1922,7 @@ static int voltage_set(int slot, int vcc, int vpp) * 5 Volts Enable and 3 Volts enable, * Turn off all power */ - PCMCIA_DEBUG ("PCMCIA power OFF\n"); + debug ("PCMCIA power OFF\n"); immap->im_ioport.iop_pcpar &= ~(0x0400); immap->im_ioport.iop_pcso &= ~(0x0400);/* immap->im_ioport.iop_pcdir |= 0x0400;*/ @@ -1950,7 +1943,7 @@ static int voltage_set(int slot, int vcc, int vpp) /* Checking supported voltages */ - PCMCIA_DEBUG ("PIPR: 0x%x --> %s\n", + debug ("PIPR: 0x%x --> %s\n", pcmp->pcmc_pipr, (pcmp->pcmc_pipr & 0x00008000) ? "only 5 V" : "can do 3.3V"); @@ -1961,21 +1954,21 @@ static int voltage_set(int slot, int vcc, int vpp) immap->im_ioport.iop_pcdir |= 0x0200; immap->im_ioport.iop_padir |= 0x0400; if (reg) { - PCMCIA_DEBUG ("PCMCIA powered at %sV\n", + debug ("PCMCIA powered at %sV\n", (reg&0x0400) ? "5.0" : "3.3"); } else { - PCMCIA_DEBUG ("PCMCIA powered down\n"); + debug ("PCMCIA powered down\n"); } done: - PCMCIA_DEBUG ("Enable PCMCIA buffers and stop RESET\n"); + 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", + debug ("voltage_set: " PCMCIA_BOARD_MSG " Slot %c, DONE\n", slot+'A'); return (0); } @@ -2234,9 +2227,9 @@ static int identify (volatile uchar *p) putc ('\n'); for (card=known_cards; *card; ++card) { - PCMCIA_DEBUG ("## Compare against \"%s\"\n", *card); + debug ("## Compare against \"%s\"\n", *card); if (strcmp(*card, id_str) == 0) { /* found! */ - PCMCIA_DEBUG ("## CARD FOUND ##\n"); + debug ("## CARD FOUND ##\n"); return (1); } } diff --git a/lib_ppc/board.c b/lib_ppc/board.c index 1e94188..881810c 100644 --- a/lib_ppc/board.c +++ b/lib_ppc/board.c @@ -542,6 +542,9 @@ void board_init_r (gd_t *id, ulong dest_addr) bd_t *bd; int i; extern void malloc_bin_reloc (void); +#ifndef CFG_ENV_IS_NOWHERE + extern char * env_name_spec; +#endif #ifndef CFG_NO_FLASH ulong flash_size; @@ -588,6 +591,10 @@ void board_init_r (gd_t *id, ulong dest_addr) } #endif } + /* there are some other pointer constants we must deal with */ +#ifndef CFG_ENV_IS_NOWHERE + env_name_spec += gd->reloc_off; +#endif WATCHDOG_RESET (); @@ -803,12 +810,6 @@ void board_init_r (gd_t *id, ulong dest_addr) reset_phy (); #endif -#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) && !(CONFIG_COMMANDS & CFG_CMD_IDE) - WATCHDOG_RESET (); - puts ("PCMCIA:"); - pcmcia_init (); -#endif - #if (CONFIG_COMMANDS & CFG_CMD_KGDB) WATCHDOG_RESET (); puts ("KGDB: "); @@ -853,16 +854,6 @@ void board_init_r (gd_t *id, ulong dest_addr) WATCHDOG_RESET (); -#if (CONFIG_COMMANDS & CFG_CMD_IDE) - WATCHDOG_RESET (); -# ifdef CONFIG_IDE_8xx_PCCARD - puts ("PCMCIA:"); -# else - puts ("IDE: "); -#endif - ide_init (); -#endif /* CFG_CMD_IDE */ - #if (CONFIG_COMMANDS & CFG_CMD_SCSI) WATCHDOG_RESET (); puts ("SCSI: "); @@ -881,6 +872,30 @@ void board_init_r (gd_t *id, ulong dest_addr) eth_initialize (bd); #endif +#ifdef CONFIG_POST + post_run (NULL, POST_RAM | post_bootmode_get(0)); + if (post_bootmode_get(0) & POST_POWERFAIL) { + post_bootmode_clear(); + board_poweroff(); + } +#endif + +#if (CONFIG_COMMANDS & CFG_CMD_PCMCIA) && !(CONFIG_COMMANDS & CFG_CMD_IDE) + WATCHDOG_RESET (); + puts ("PCMCIA:"); + pcmcia_init (); +#endif + +#if (CONFIG_COMMANDS & CFG_CMD_IDE) + WATCHDOG_RESET (); +# ifdef CONFIG_IDE_8xx_PCCARD + puts ("PCMCIA:"); +# else + puts ("IDE: "); +#endif + ide_init (); +#endif /* CFG_CMD_IDE */ + #ifdef CONFIG_LAST_STAGE_INIT WATCHDOG_RESET (); /* @@ -916,14 +931,6 @@ void board_init_r (gd_t *id, ulong dest_addr) } #endif -#ifdef CONFIG_POST - post_run (NULL, POST_RAM | post_bootmode_get(0)); - if (post_bootmode_get(0) & POST_POWERFAIL) { - post_bootmode_clear(); - board_poweroff(); - } -#endif - /* Initialization complete - start the monitor */ /* main_loop() can return to retry autoboot, if so just run it again. */