]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/gth/pcmcia.c
7 #if defined(CONFIG_CMD_PCMCIA)
11 #if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD)
17 #define PCMCIA_BOARD_MSG "GTH COMPACT FLASH"
19 int pcmcia_voltage_set (int slot
, int vcc
, int vpp
)
24 int pcmcia_hardware_enable (int slot
)
26 volatile immap_t
*immap
;
27 volatile cpm8xx_t
*cp
;
28 volatile pcmconf8xx_t
*pcmp
;
29 volatile sysconf8xx_t
*sysp
;
32 debug ("hardware_enable: GTH Slot %c\n", 'A' + slot
);
34 immap
= (immap_t
*) CONFIG_SYS_IMMR
;
35 sysp
= (sysconf8xx_t
*) (&(((immap_t
*) CONFIG_SYS_IMMR
)->im_siu_conf
));
36 pcmp
= (pcmconf8xx_t
*) (&(((immap_t
*) CONFIG_SYS_IMMR
)->im_pcmcia
));
37 cp
= (cpm8xx_t
*) (&(((immap_t
*) CONFIG_SYS_IMMR
)->im_cpm
));
39 /* clear interrupt state, and disable interrupts */
40 pcmp
->pcmc_pscr
= PCMCIA_MASK (_slot_
);
41 pcmp
->pcmc_per
&= ~PCMCIA_MASK (_slot_
);
44 * Disable interrupts, DMA, and PCMCIA buffers
45 * (isolate the interface) and assert RESET signal
47 debug ("Disable PCMCIA buffers and assert RESET\n");
49 reg
|= __MY_PCMCIA_GCRX_CXRESET
; /* active high */
50 reg
|= __MY_PCMCIA_GCRX_CXOE
; /* active low */
51 PCMCIA_PGCRX (_slot_
) = reg
;
55 * Make sure there is a card in the slot,
56 * then configure the interface.
59 debug ("[%d] %s: PIPR(%p)=0x%x\n",
60 __LINE__
, __FUNCTION__
,
61 &(pcmp
->pcmc_pipr
), pcmp
->pcmc_pipr
);
62 if (pcmp
->pcmc_pipr
& 0x98000000) {
63 printf (" No Card found\n");
67 mask
= PCMCIA_VS1 (slot
) | PCMCIA_VS2 (slot
);
68 reg
= pcmp
->pcmc_pipr
;
69 debug ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n",
71 (reg
& PCMCIA_VS1 (slot
)) ? "n" : "ff",
72 (reg
& PCMCIA_VS2 (slot
)) ? "n" : "ff");
74 debug ("Enable PCMCIA buffers and stop RESET\n");
75 reg
= PCMCIA_PGCRX (_slot_
);
76 reg
&= ~__MY_PCMCIA_GCRX_CXRESET
; /* active high */
77 reg
&= ~__MY_PCMCIA_GCRX_CXOE
; /* active low */
78 PCMCIA_PGCRX (_slot_
) = reg
;
80 udelay (250000); /* some cards need >150 ms to come up :-( */
82 debug ("# hardware_enable done\n");
86 #if defined(CONFIG_CMD_PCMCIA)
87 int pcmcia_hardware_disable(int slot
)
89 return 0; /* No hardware to disable */
93 #endif /* CONFIG_PCMCIA */