mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 22:20:45 +00:00
77efe35fec
Recent changes caused that the HMI10 board now is included in the boards built by MAKEALL, which revealed that compilation for this board has been broken for a long time: ps2ser.c: In function 'ps2ser_init': ps2ser.c:155: error: 'UART_LCR' undeclared (first use in this function) ps2ser.c:155: error: (Each undeclared identifier is reported only once ps2ser.c:155: error: for each function it appears in.) ps2ser.c:156: error: 'UART_DLL' undeclared (first use in this function) ps2ser.c:157: error: 'UART_DLM' undeclared (first use in this function) ps2ser.c:159: error: 'UART_IER' undeclared (first use in this function) ps2ser.c:160: error: 'UART_MCR' undeclared (first use in this function) ps2ser.c:161: error: 'UART_FCR' undeclared (first use in this function) ps2ser.c:162: error: 'UART_FCR_ENABLE_FIFO' undeclared (first use in this function) ps2ser.c:166: error: 'UART_LSR' undeclared (first use in this function) ps2ser.c: In function 'ps2ser_putc': ps2ser.c:198: error: 'UART_LSR' undeclared (first use in this function) ps2ser.c:200: error: 'UART_TX' undeclared (first use in this function) ps2ser.c: In function 'ps2ser_getc_hw': ps2ser.c:224: error: 'UART_LSR' undeclared (first use in this function) ps2ser.c:225: error: 'UART_RX' undeclared (first use in this function) ps2ser.c: In function 'ps2ser_interrupt': ps2ser.c:293: error: 'UART_IIR' undeclared (first use in this function) The board is orphaned, and AFAICT has reached EOL. Drop support for it. Signed-off-by: Wolfgang Denk <wd@denx.de>
162 lines
3.6 KiB
C
162 lines
3.6 KiB
C
#include <common.h>
|
|
#include <mpc8xx.h>
|
|
#include <pcmcia.h>
|
|
|
|
#include "csr.h"
|
|
|
|
#undef CONFIG_PCMCIA
|
|
|
|
#if defined(CONFIG_CMD_PCMCIA)
|
|
#define CONFIG_PCMCIA
|
|
#endif
|
|
|
|
#if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
|
|
#define CONFIG_PCMCIA
|
|
#endif
|
|
|
|
#ifdef CONFIG_PCMCIA
|
|
|
|
/* A lot of this has been taken from the RPX code in this file it works from me.
|
|
I have added the voltage selection for the MBX board. */
|
|
|
|
/* MBX voltage bit in control register #2 */
|
|
#define CR2_VPP12 ((uchar)0x10)
|
|
#define CR2_VPPVDD ((uchar)0x20)
|
|
#define CR2_VDD5 ((uchar)0x40)
|
|
#define CR2_VDD3 ((uchar)0x80)
|
|
|
|
#define PCMCIA_BOARD_MSG "MBX860"
|
|
|
|
int pcmcia_voltage_set (int slot, int vcc, int vpp)
|
|
{
|
|
uchar reg = 0;
|
|
|
|
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) {
|
|
case 0:
|
|
break;
|
|
case 33:
|
|
reg |= CR2_VDD3;
|
|
break;
|
|
case 50:
|
|
reg |= CR2_VDD5;
|
|
break;
|
|
default:
|
|
return 1;
|
|
}
|
|
|
|
switch (vpp) {
|
|
case 0:
|
|
break;
|
|
case 33:
|
|
case 50:
|
|
if (vcc == vpp) {
|
|
reg |= CR2_VPPVDD;
|
|
} else {
|
|
return 1;
|
|
}
|
|
break;
|
|
case 120:
|
|
reg |= CR2_VPP12;
|
|
break;
|
|
default:
|
|
return 1;
|
|
}
|
|
|
|
/* first, turn off all power */
|
|
MBX_CSR2 &= ~(CR2_VDDSEL | CR2_VPPSEL);
|
|
|
|
/* enable new powersettings */
|
|
MBX_CSR2 |= reg;
|
|
debug ("MBX_CSR2 read = 0x%02x\n", MBX_CSR2);
|
|
|
|
return (0);
|
|
}
|
|
|
|
int pcmcia_hardware_enable (int slot)
|
|
{
|
|
volatile immap_t *immap;
|
|
volatile cpm8xx_t *cp;
|
|
volatile pcmconf8xx_t *pcmp;
|
|
volatile sysconf8xx_t *sysp;
|
|
uint reg, mask;
|
|
|
|
debug ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n",
|
|
'A' + slot);
|
|
|
|
udelay (10000);
|
|
|
|
immap = (immap_t *) CONFIG_SYS_IMMR;
|
|
sysp = (sysconf8xx_t *) (&(((immap_t *) CONFIG_SYS_IMMR)->im_siu_conf));
|
|
pcmp = (pcmconf8xx_t *) (&(((immap_t *) CONFIG_SYS_IMMR)->im_pcmcia));
|
|
cp = (cpm8xx_t *) (&(((immap_t *) CONFIG_SYS_IMMR)->im_cpm));
|
|
|
|
/* clear interrupt state, and disable interrupts */
|
|
pcmp->pcmc_pscr = PCMCIA_MASK (_slot_);
|
|
pcmp->pcmc_per &= ~PCMCIA_MASK (_slot_);
|
|
|
|
/*
|
|
* Disable interrupts, DMA, and PCMCIA buffers
|
|
* (isolate the interface) and assert RESET signal
|
|
*/
|
|
debug ("Disable PCMCIA buffers and assert RESET\n");
|
|
reg = 0;
|
|
reg |= __MY_PCMCIA_GCRX_CXRESET; /* active high */
|
|
reg |= __MY_PCMCIA_GCRX_CXOE; /* active low */
|
|
PCMCIA_PGCRX (_slot_) = reg;
|
|
udelay (500);
|
|
|
|
/* remove all power */
|
|
pcmcia_voltage_set (slot, 0, 0);
|
|
/*
|
|
* Make sure there is a card in the slot, then configure the interface.
|
|
*/
|
|
udelay(10000);
|
|
debug ("[%d] %s: PIPR(%p)=0x%x\n",
|
|
__LINE__,__FUNCTION__,
|
|
&(pcmp->pcmc_pipr),pcmp->pcmc_pipr);
|
|
if (pcmp->pcmc_pipr & (0x10000000 >> (slot << 4))) {
|
|
printf (" No Card found\n");
|
|
return (1);
|
|
}
|
|
|
|
/*
|
|
* Power On.
|
|
*/
|
|
mask = PCMCIA_VS1 (_slot_) | PCMCIA_VS2 (_slot_);
|
|
reg = pcmp->pcmc_pipr;
|
|
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) {
|
|
pcmcia_voltage_set (_slot_, 50, 0);
|
|
printf (" 5.0V card found: ");
|
|
} else {
|
|
pcmcia_voltage_set (_slot_, 33, 0);
|
|
printf (" 3.3V card found: ");
|
|
}
|
|
|
|
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 :-( */
|
|
|
|
debug ("# hardware_enable done\n");
|
|
|
|
return (0);
|
|
}
|
|
|
|
#if defined(CONFIG_CMD_PCMCIA)
|
|
int pcmcia_hardware_disable (int slot)
|
|
{
|
|
return 0; /* No hardware to disable */
|
|
}
|
|
#endif
|
|
|
|
#endif /* CONFIG_PCMCIA */
|