/*
- * (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
* They are maximum 64KByte each...
*/
+/* #define DEBUG 1 */
+
/*
* PCMCIA support
*/
/* ------------------------------------------------------------------------- */
-#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[])
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);
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;
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;
}
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);
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;
}
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);
* 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 */
* 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) {
*/
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");
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 */
udelay(250000); /* some cards need >150 ms to come up :-( */
- PCMCIA_DEBUG ("# hardware_enable done\n");
+ debug ("# hardware_enable done\n");
return (0);
}
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));
/* 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 */
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);
* 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 */
* 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);
/* 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);
}
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);
* 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 */
* 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) {
*/
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");
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 */
udelay(250000); /* some cards need >150 ms to come up :-( */
- PCMCIA_DEBUG ("# hardware_enable done\n");
+ debug ("# hardware_enable done\n");
return (0);
}
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));
/* 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 */
/* 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);
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);
* 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 */
/*
* 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);
/* 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);
}
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));
* 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 */
* 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) {
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 */
udelay(250000); /* some cards need >150 ms to come up :-( */
- PCMCIA_DEBUG ("# hardware_enable done\n");
+ debug ("# hardware_enable done\n");
return 0;
}
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);
* 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 */
* 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) {
*/
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");
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",
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 */
udelay(250000); /* some cards need >150 ms to come up :-( */
- PCMCIA_DEBUG ("# hardware_enable done\n");
+ debug ("# hardware_enable done\n");
return (0);
}
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));
/* 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 */
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);
* 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 */
* 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;
/* 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");
#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);
}
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);
}
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);
* 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 */
* 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) {
*/
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");
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"
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 */
udelay(250000); /* some cards need >150 ms to come up :-( */
- PCMCIA_DEBUG ("# hardware_enable done\n");
+ debug ("# hardware_enable done\n");
return (0);
}
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));
/* 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 */
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);
* 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 */
* 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;
/* 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");
#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);
}
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);
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);
}
{
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) {
/* 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);
}
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);
* 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 */
* 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) {
*/
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");
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 */
udelay (250000); /* some cards need >150 ms to come up :-( */
- PCMCIA_DEBUG ("# hardware_enable done\n");
+ debug ("# hardware_enable done\n");
return (0);
}
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);
* 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 */
* 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) {
*/
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");
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 */
udelay(250000); /* some cards need >150 ms to come up :-( */
- PCMCIA_DEBUG ("# hardware_enable done\n");
+ debug ("# hardware_enable done\n");
return (0);
}
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));
/* 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 */
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);
* 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 */
* 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;*/
/* 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_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);
}
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);
}
}