From 9da4bc6d6a38c1c3d850c046d0aee324c1a2e52a Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Sat, 12 Nov 2005 23:56:33 +0100 Subject: [PATCH] pcmcia: remove get_socket callback The .get_socket callback is never used by the PCMCIA core, therefore remove it. Signed-off-by: Dominik Brodowski --- drivers/pcmcia/m8xx_pcmcia.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'drivers/pcmcia/m8xx_pcmcia.c') diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c index 6d9f71cfcb34..a7f27c3dfc24 100644 --- a/drivers/pcmcia/m8xx_pcmcia.c +++ b/drivers/pcmcia/m8xx_pcmcia.c @@ -823,17 +823,6 @@ static int m8xx_get_status(struct pcmcia_socket *sock, unsigned int *value) return 0; } -static int m8xx_get_socket(struct pcmcia_socket *sock, socket_state_t *state) -{ - int lsock = container_of(sock, struct socket_info, socket)->slot; - *state = socket[lsock].state; /* copy the whole structure */ - - dprintk("GetSocket(%d) = flags %#3.3x, Vcc %d, Vpp %d, " - "io_irq %d, csc_mask %#2.2x\n", lsock, state->flags, - state->Vcc, state->Vpp, state->io_irq, state->csc_mask); - return 0; -} - static int m8xx_set_socket(struct pcmcia_socket *sock, socket_state_t *state) { int lsock = container_of(sock, struct socket_info, socket)->slot; @@ -1169,7 +1158,6 @@ static struct pccard_operations m8xx_services = { .init = m8xx_sock_init, .suspend = m8xx_suspend, .get_status = m8xx_get_status, - .get_socket = m8xx_get_socket, .set_socket = m8xx_set_socket, .set_io_map = m8xx_set_io_map, .set_mem_map = m8xx_set_mem_map, -- cgit v1.2.1 From 3b27e9421a1433689704fe0a02e926d4ba971121 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Wed, 7 Dec 2005 12:32:20 +0100 Subject: [PATCH] pcmcia: properly handle static mem, but dynamic io sockets Some PCMCIA sockets have statically mapped memory windows, but dynamically mapped IO windows. Using the "nonstatic" socket library is inpractical for them, as they do neither need a resource database (as we can trust the kernel resource database on m68k and ppc) nor lots of other features of that library. Let them get a small "iodyn" socket library (105 lines of code) instead. Signed-off-by: Dominik Brodowski --- drivers/pcmcia/m8xx_pcmcia.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/pcmcia/m8xx_pcmcia.c') diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c index a7f27c3dfc24..570e4e868b24 100644 --- a/drivers/pcmcia/m8xx_pcmcia.c +++ b/drivers/pcmcia/m8xx_pcmcia.c @@ -1232,7 +1232,7 @@ static int __init m8xx_init(void) socket[i].socket.io_offset = 0; socket[i].socket.pci_irq = i ? 7 : 9; socket[i].socket.ops = &m8xx_services; - socket[i].socket.resource_ops = &pccard_nonstatic_ops; + socket[i].socket.resource_ops = &pccard_iodyn_ops; socket[i].socket.cb_dev = NULL; socket[i].socket.dev.dev = &m8xx_device.dev; } -- cgit v1.2.1 From a94515fa1f1609249dbebcfb93181ad0ba4b285a Mon Sep 17 00:00:00 2001 From: Vitaly Bordug Date: Thu, 8 Dec 2005 13:53:20 -0200 Subject: [PATCH] m8xx_pcmcia: support MAP_AUTOSZ required for CF cards This fixes misconfiguration that could result in odd work of some old CF cards. Signed-off-by: Vitaly Bordug Signed-off-by: Marcelo Tosatti Signed-off-by: Dominik Brodowski --- drivers/pcmcia/m8xx_pcmcia.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/pcmcia/m8xx_pcmcia.c') diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c index 570e4e868b24..ddaab13d21bd 100644 --- a/drivers/pcmcia/m8xx_pcmcia.c +++ b/drivers/pcmcia/m8xx_pcmcia.c @@ -1012,8 +1012,7 @@ static int m8xx_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io) if(io->flags & MAP_WRPROT) reg |= M8XX_PCMCIA_POR_WRPROT; - /*if(io->flags & (MAP_16BIT | MAP_AUTOSZ))*/ - if(io->flags & MAP_16BIT) + if(io->flags & (MAP_16BIT | MAP_AUTOSZ)) reg |= M8XX_PCMCIA_POR_16BIT; if(io->flags & MAP_ACTIVE) -- cgit v1.2.1 From 1371d3be045a6a1a8b828b838069b5fe6e0ab4c6 Mon Sep 17 00:00:00 2001 From: Vitaly Bordug Date: Thu, 8 Dec 2005 13:56:12 -0200 Subject: [PATCH] 8xx PCMCIA: support for MPC885ADS and MPC866ADS This adds PCMCIA support for both MPC885ADS and MPC866ADS. This is established not together with FADS, because 885 does not have io_block_mapping() for BCSR area. Also, some cleanups done both for 885ADS and MBX. Signed-off-by: Vitaly Bordug Signed-off-by: Marcelo Tosatti Signed-off-by: Dominik Brodowski --- drivers/pcmcia/m8xx_pcmcia.c | 97 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 91 insertions(+), 6 deletions(-) (limited to 'drivers/pcmcia/m8xx_pcmcia.c') diff --git a/drivers/pcmcia/m8xx_pcmcia.c b/drivers/pcmcia/m8xx_pcmcia.c index ddaab13d21bd..0e07d9535116 100644 --- a/drivers/pcmcia/m8xx_pcmcia.c +++ b/drivers/pcmcia/m8xx_pcmcia.c @@ -9,6 +9,9 @@ * * Further fixes, v2.6 kernel port * + * + * Some fixes, additions (C) 2005 Montavista Software, Inc. + * * * "The ExCA standard specifies that socket controllers should provide * two IO and five memory windows per socket, which can be independently @@ -97,6 +100,11 @@ MODULE_LICENSE("Dual MPL/GPL"); #endif #endif +#if defined(CONFIG_MPC885ADS) +#define CONFIG_PCMCIA_SLOT_A +#define PCMCIA_GLITCHY_CD +#endif + /* Cyclades ACS uses both slots */ #ifdef CONFIG_PRxK #define CONFIG_PCMCIA_SLOT_A @@ -374,11 +382,80 @@ static int voltage_set(int slot, int vcc, int vpp) } /* first, turn off all power */ - out_be32(&((u32 *)BCSR1), in_be32(&((u32 *)BCSR1)) & ~(BCSR1_PCCVCC_MASK | BCSR1_PCCVPP_MASK)); + out_be32((u32 *)BCSR1, in_be32((u32 *)BCSR1) & ~(BCSR1_PCCVCC_MASK | BCSR1_PCCVPP_MASK)); + + /* enable new powersettings */ + out_be32((u32 *)BCSR1, in_be32((u32 *)BCSR1) | reg); + + return 0; +} + +#define socket_get(_slot_) PCMCIA_SOCKET_KEY_5V + +static void hardware_enable(int slot) +{ + out_be32((u32 *)BCSR1, in_be32((u32 *)BCSR1) & ~BCSR1_PCCEN); +} + +static void hardware_disable(int slot) +{ + out_be32((u32 *)BCSR1, in_be32((u32 *)BCSR1) | BCSR1_PCCEN); +} + +#endif + +/* MPC885ADS Boards */ + +#if defined(CONFIG_MPC885ADS) + +#define PCMCIA_BOARD_MSG "MPC885ADS" + +static int voltage_set(int slot, int vcc, int vpp) +{ + u32 reg = 0; + unsigned *bcsr_io; + + bcsr_io = ioremap(BCSR1, sizeof(unsigned long)); + + switch(vcc) { + case 0: + break; + case 33: + reg |= BCSR1_PCCVCC0; + break; + case 50: + reg |= BCSR1_PCCVCC1; + break; + default: + return 1; + } + + switch(vpp) { + case 0: + break; + case 33: + case 50: + if(vcc == vpp) + reg |= BCSR1_PCCVPP1; + else + return 1; + break; + case 120: + if ((vcc == 33) || (vcc == 50)) + reg |= BCSR1_PCCVPP0; + else + return 1; + default: + return 1; + } + + /* first, turn off all power */ + out_be32(bcsr_io, in_be32(bcsr_io) & ~(BCSR1_PCCVCC_MASK | BCSR1_PCCVPP_MASK)); /* enable new powersettings */ - out_be32(&((u32 *)BCSR1), in_be32(&((u32 *)BCSR1)) | reg); + out_be32(bcsr_io, in_be32(bcsr_io) | reg); + iounmap(bcsr_io); return 0; } @@ -386,12 +463,20 @@ static int voltage_set(int slot, int vcc, int vpp) static void hardware_enable(int slot) { - out_be32(&((u32 *)BCSR1), in_be32(&((u32 *)BCSR1)) & ~BCSR1_PCCEN); + unsigned *bcsr_io; + + bcsr_io = ioremap(BCSR1, sizeof(unsigned long)); + out_be32(bcsr_io, in_be32(bcsr_io) & ~BCSR1_PCCEN); + iounmap(bcsr_io); } static void hardware_disable(int slot) { - out_be32(&((u32 *)BCSR1), in_be32(&((u32 *)BCSR1)) | BCSR1_PCCEN); + unsigned *bcsr_io; + + bcsr_io = ioremap(BCSR1, sizeof(unsigned long)); + out_be32(bcsr_io, in_be32(bcsr_io) | BCSR1_PCCEN); + iounmap(bcsr_io); } #endif @@ -440,10 +525,10 @@ static int voltage_set(int slot, int vcc, int vpp) } /* first, turn off all power */ - out_8(&((u8 *)MBX_CSR2_ADDR), in_8(&((u8 *)MBX_CSR2_ADDR)) & ~(CSR2_VCC_MASK | CSR2_VPP_MASK)); + out_8((u8 *)MBX_CSR2_ADDR, in_8((u8 *)MBX_CSR2_ADDR) & ~(CSR2_VCC_MASK | CSR2_VPP_MASK)); /* enable new powersettings */ - out_8(&((u8 *)MBX_CSR2_ADDR), in_8(&((u8 *)MBX_CSR2_ADDR)) | reg); + out_8((u8 *)MBX_CSR2_ADDR, in_8((u8 *)MBX_CSR2_ADDR) | reg); return 0; } -- cgit v1.2.1