123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- #if !defined(_PCMCIA_SA1100_H)
- # define _PCMCIA_SA1100_H
- #define MECR_SOCKET_0_SHIFT (0)
- #define MECR_SOCKET_1_SHIFT (16)
- #define MECR_BS_MASK (0x1f)
- #define MECR_FAST_MODE_MASK (0x01)
- #define MECR_BSIO_SHIFT (0)
- #define MECR_BSA_SHIFT (5)
- #define MECR_BSM_SHIFT (10)
- #define MECR_FAST_SHIFT (15)
- #define MECR_SET(mecr, sock, shift, mask, bs) \
- ((mecr)=((mecr)&~(((mask)<<(shift))<<\
- ((sock)==0?MECR_SOCKET_0_SHIFT:MECR_SOCKET_1_SHIFT)))|\
- (((bs)<<(shift))<<((sock)==0?MECR_SOCKET_0_SHIFT:MECR_SOCKET_1_SHIFT)))
- #define MECR_GET(mecr, sock, shift, mask) \
- ((((mecr)>>(((sock)==0)?MECR_SOCKET_0_SHIFT:MECR_SOCKET_1_SHIFT))>>\
- (shift))&(mask))
- #define MECR_BSIO_SET(mecr, sock, bs) \
- MECR_SET((mecr), (sock), MECR_BSIO_SHIFT, MECR_BS_MASK, (bs))
- #define MECR_BSIO_GET(mecr, sock) \
- MECR_GET((mecr), (sock), MECR_BSIO_SHIFT, MECR_BS_MASK)
- #define MECR_BSA_SET(mecr, sock, bs) \
- MECR_SET((mecr), (sock), MECR_BSA_SHIFT, MECR_BS_MASK, (bs))
- #define MECR_BSA_GET(mecr, sock) \
- MECR_GET((mecr), (sock), MECR_BSA_SHIFT, MECR_BS_MASK)
- #define MECR_BSM_SET(mecr, sock, bs) \
- MECR_SET((mecr), (sock), MECR_BSM_SHIFT, MECR_BS_MASK, (bs))
- #define MECR_BSM_GET(mecr, sock) \
- MECR_GET((mecr), (sock), MECR_BSM_SHIFT, MECR_BS_MASK)
- #define MECR_FAST_SET(mecr, sock, fast) \
- MECR_SET((mecr), (sock), MECR_FAST_SHIFT, MECR_FAST_MODE_MASK, (fast))
- #define MECR_FAST_GET(mecr, sock) \
- MECR_GET((mecr), (sock), MECR_FAST_SHIFT, MECR_FAST_MODE_MASK)
- static inline unsigned int sa1100_pcmcia_mecr_bs(unsigned int pcmcia_cycle_ns,
- unsigned int cpu_clock_khz){
- unsigned int t = ((pcmcia_cycle_ns * cpu_clock_khz) / 6) - 1000000;
- return (t / 1000000) + (((t % 1000000) == 0) ? 0 : 1);
- }
- static inline unsigned int sa1100_pcmcia_cmd_time(unsigned int cpu_clock_khz,
- unsigned int pcmcia_mecr_bs){
- return (((10000000 * 2) / cpu_clock_khz) * (3 * (pcmcia_mecr_bs + 1))) / 10;
- }
- int sa11xx_drv_pcmcia_add_one(struct soc_pcmcia_socket *skt);
- void sa11xx_drv_pcmcia_ops(struct pcmcia_low_level *ops);
- extern int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr);
- #endif
|