2006-07-10 21:07:28 +00:00
|
|
|
#include <common.h>
|
|
|
|
#include <mpc8xx.h>
|
|
|
|
#include <pcmcia.h>
|
|
|
|
|
|
|
|
#undef CONFIG_PCMCIA
|
|
|
|
|
2007-07-09 23:31:28 +00:00
|
|
|
#if defined(CONFIG_CMD_PCMCIA)
|
2006-07-10 21:07:28 +00:00
|
|
|
#define CONFIG_PCMCIA
|
|
|
|
#endif
|
|
|
|
|
2007-07-09 23:31:28 +00:00
|
|
|
#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
|
2006-07-10 21:07:28 +00:00
|
|
|
#define CONFIG_PCMCIA
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef CONFIG_PCMCIA
|
|
|
|
|
|
|
|
#ifdef CONFIG_ADS
|
|
|
|
#define PCMCIA_BOARD_MSG "ADS"
|
|
|
|
#else
|
|
|
|
#define PCMCIA_BOARD_MSG "FADS"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int pcmcia_voltage_set(int slot, int vcc, int vpp)
|
|
|
|
{
|
|
|
|
u_long reg = 0;
|
|
|
|
|
|
|
|
switch(vpp) {
|
|
|
|
case 0: reg = 0; break;
|
|
|
|
case 50: reg = 1; break;
|
|
|
|
case 120: reg = 2; break;
|
|
|
|
default: return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch(vcc) {
|
|
|
|
case 0: reg = 0; break;
|
|
|
|
#ifdef CONFIG_ADS
|
|
|
|
case 50: reg = BCSR1_PCCVCCON; break;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_FADS
|
|
|
|
case 33: reg = BCSR1_PCCVCC0 | BCSR1_PCCVCC1; break;
|
|
|
|
case 50: reg = BCSR1_PCCVCC1; break;
|
|
|
|
#endif
|
|
|
|
default: return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* first, turn off all power */
|
|
|
|
|
|
|
|
#ifdef CONFIG_ADS
|
|
|
|
*((uint *)BCSR1) |= BCSR1_PCCVCCON;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_FADS
|
|
|
|
*((uint *)BCSR1) &= ~(BCSR1_PCCVCC0 | BCSR1_PCCVCC1);
|
|
|
|
#endif
|
|
|
|
*((uint *)BCSR1) &= ~BCSR1_PCCVPP_MASK;
|
|
|
|
|
|
|
|
/* enable new powersettings */
|
|
|
|
|
|
|
|
#ifdef CONFIG_ADS
|
|
|
|
*((uint *)BCSR1) &= ~reg;
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_FADS
|
|
|
|
*((uint *)BCSR1) |= reg;
|
|
|
|
#endif
|
|
|
|
|
2008-05-20 14:00:29 +00:00
|
|
|
*((uint *)BCSR1) |= reg << 20;
|
2006-07-10 21:07:28 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int pcmcia_hardware_enable(int slot)
|
|
|
|
{
|
|
|
|
*((uint *)BCSR1) &= ~BCSR1_PCCEN;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-07-09 23:31:28 +00:00
|
|
|
#if defined(CONFIG_CMD_PCMCIA)
|
2006-07-10 21:07:28 +00:00
|
|
|
int pcmcia_hardware_disable(int slot)
|
|
|
|
{
|
|
|
|
*((uint *)BCSR1) &= ~BCSR1_PCCEN;
|
|
|
|
return 0;
|
|
|
|
}
|
2007-07-09 23:31:28 +00:00
|
|
|
#endif
|
2006-07-10 21:07:28 +00:00
|
|
|
|
|
|
|
#endif /* CONFIG_PCMCIA */
|