Commit ec03a9f4 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://bk.arm.linux.org.uk/linux-2.6-pcmcia

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 00f0340a 5c26f69d
...@@ -566,7 +566,6 @@ static int ...@@ -566,7 +566,6 @@ static int
au1000_pcmcia_set_mem_map(unsigned int sock, struct pccard_mem_map *map) au1000_pcmcia_set_mem_map(unsigned int sock, struct pccard_mem_map *map)
{ {
unsigned int speed; unsigned int speed;
unsigned long start;
u_long flags; u_long flags;
if(map->map>=MAX_WIN){ if(map->map>=MAX_WIN){
...@@ -588,25 +587,19 @@ au1000_pcmcia_set_mem_map(unsigned int sock, struct pccard_mem_map *map) ...@@ -588,25 +587,19 @@ au1000_pcmcia_set_mem_map(unsigned int sock, struct pccard_mem_map *map)
} }
spin_lock_irqsave(&pcmcia_lock, flags); spin_lock_irqsave(&pcmcia_lock, flags);
start=map->sys_start;
if(map->sys_stop==0)
map->sys_stop=MAP_SIZE-1;
if (map->flags & MAP_ATTRIB) { if (map->flags & MAP_ATTRIB) {
map->sys_start = pcmcia_socket[sock].phys_attr + map->static_start = pcmcia_socket[sock].phys_attr +
map->card_start; map->card_start;
} }
else { else {
map->sys_start = pcmcia_socket[sock].phys_mem + map->static_start = pcmcia_socket[sock].phys_mem +
map->card_start; map->card_start;
} }
map->sys_stop=map->sys_start+(map->sys_stop-start);
pcmcia_socket[sock].mem_map[map->map]=*map; pcmcia_socket[sock].mem_map[map->map]=*map;
spin_unlock_irqrestore(&pcmcia_lock, flags); spin_unlock_irqrestore(&pcmcia_lock, flags);
debug(3, "set_mem_map %d start %x stop %x card_start %x\n", debug(3, "set_mem_map %d start %x card_start %x\n",
map->map, map->sys_start, map->sys_stop, map->map, map->static_start,
map->card_start); map->card_start);
return 0; return 0;
......
...@@ -114,8 +114,6 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag ...@@ -114,8 +114,6 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag
printk(KERN_NOTICE "cs: unable to map card memory!\n"); printk(KERN_NOTICE "cs: unable to map card memory!\n");
return NULL; return NULL;
} }
mem->sys_start = mem->res->start;
mem->sys_stop = mem->res->end;
s->cis_virt = ioremap(mem->res->start, s->map_size); s->cis_virt = ioremap(mem->res->start, s->map_size);
} }
mem->card_start = card_offset; mem->card_start = card_offset;
...@@ -124,7 +122,7 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag ...@@ -124,7 +122,7 @@ set_cis_map(struct pcmcia_socket *s, unsigned int card_offset, unsigned int flag
if (s->features & SS_CAP_STATIC_MAP) { if (s->features & SS_CAP_STATIC_MAP) {
if (s->cis_virt) if (s->cis_virt)
iounmap(s->cis_virt); iounmap(s->cis_virt);
s->cis_virt = ioremap(mem->sys_start, s->map_size); s->cis_virt = ioremap(mem->static_start, s->map_size);
} }
return s->cis_virt; return s->cis_virt;
} }
......
...@@ -1886,11 +1886,6 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle ...@@ -1886,11 +1886,6 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
(*handle)->dev_info, s); (*handle)->dev_info, s);
if (!win->ctl.res) if (!win->ctl.res)
return CS_IN_USE; return CS_IN_USE;
win->ctl.sys_start = win->ctl.res->start;
win->ctl.sys_stop = win->ctl.res->end;
} else {
win->ctl.sys_start = req->Base;
win->ctl.sys_stop = req->Base + req->Size - 1;
} }
(*handle)->state |= CLIENT_WIN_REQ(w); (*handle)->state |= CLIENT_WIN_REQ(w);
...@@ -1912,7 +1907,11 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle ...@@ -1912,7 +1907,11 @@ int pcmcia_request_window(client_handle_t *handle, win_req_t *req, window_handle
s->state |= SOCKET_WIN_REQ(w); s->state |= SOCKET_WIN_REQ(w);
/* Return window handle */ /* Return window handle */
req->Base = win->ctl.sys_start; if (s->features & SS_CAP_STATIC_MAP) {
req->Base = win->ctl.static_start;
} else {
req->Base = win->ctl.res->start;
}
*wh = win; *wh = win;
return CS_SUCCESS; return CS_SUCCESS;
......
...@@ -636,19 +636,17 @@ static int hs_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem) ...@@ -636,19 +636,17 @@ static int hs_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem)
hs_socket_t *sp = container_of(s, struct hs_socket_t, socket); hs_socket_t *sp = container_of(s, struct hs_socket_t, socket);
struct pccard_mem_map *smem; struct pccard_mem_map *smem;
int map = mem->map; int map = mem->map;
unsigned long paddr, size; unsigned long paddr;
#if 0 #if 0
DPRINTK("hs_set_mem_map(sock=%d, map=%d, flags=0x%x, sys_start=0x%08lx, sys_end=0x%08lx, card_start=0x%08x)\n", DPRINTK("hs_set_mem_map(sock=%d, map=%d, flags=0x%x, card_start=0x%08x)\n",
sock, map, mem->flags, mem->sys_start, mem->sys_stop, mem->card_start); sock, map, mem->flags, mem->card_start);
#endif #endif
if (map >= MAX_WIN) if (map >= MAX_WIN)
return -EINVAL; return -EINVAL;
smem = &sp->mem_maps[map]; smem = &sp->mem_maps[map];
size = mem->sys_stop - mem->sys_start + 1;
paddr = sp->mem_base; /* base of Attribute mapping */ paddr = sp->mem_base; /* base of Attribute mapping */
if (!(mem->flags & MAP_ATTRIB)) if (!(mem->flags & MAP_ATTRIB))
paddr += HD64465_PCC_WINDOW; /* base of Common mapping */ paddr += HD64465_PCC_WINDOW; /* base of Common mapping */
...@@ -660,8 +658,7 @@ static int hs_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem) ...@@ -660,8 +658,7 @@ static int hs_set_mem_map(struct pcmcia_socket *s, struct pccard_mem_map *mem)
* queries our fixed mapping. I wish this fact had been * queries our fixed mapping. I wish this fact had been
* documented - Greg Banks. * documented - Greg Banks.
*/ */
mem->sys_start = paddr; mem->static_start = paddr;
mem->sys_stop = paddr + size - 1;
*smem = *mem; *smem = *mem;
......
...@@ -422,7 +422,7 @@ static int i82092aa_init(struct pcmcia_socket *sock) ...@@ -422,7 +422,7 @@ static int i82092aa_init(struct pcmcia_socket *sock)
int i; int i;
struct resource res = { .start = 0, .end = 0x0fff }; struct resource res = { .start = 0, .end = 0x0fff };
pccard_io_map io = { 0, 0, 0, 0, 1 }; pccard_io_map io = { 0, 0, 0, 0, 1 };
pccard_mem_map mem = { .res = &res, .sys_stop = 0x0fff, }; pccard_mem_map mem = { .res = &res, };
enter("i82092aa_init"); enter("i82092aa_init");
...@@ -706,11 +706,15 @@ static int i82092aa_set_io_map(struct pcmcia_socket *socket, struct pccard_io_ma ...@@ -706,11 +706,15 @@ static int i82092aa_set_io_map(struct pcmcia_socket *socket, struct pccard_io_ma
static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_map *mem) static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_map *mem)
{ {
unsigned int sock = container_of(socket, struct socket_info, socket)->number; struct socket_info *sock_info = container_of(socket, struct socket_info, socket);
unsigned int sock = sock_info->number;
struct pci_bus_region region;
unsigned short base, i; unsigned short base, i;
unsigned char map; unsigned char map;
enter("i82092aa_set_mem_map"); enter("i82092aa_set_mem_map");
pcibios_resource_to_bus(sock_info->dev, &region, mem->res);
map = mem->map; map = mem->map;
if (map > 4) { if (map > 4) {
...@@ -719,10 +723,10 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_ ...@@ -719,10 +723,10 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_
} }
if ( (mem->card_start > 0x3ffffff) || (mem->sys_start > mem->sys_stop) || if ( (mem->card_start > 0x3ffffff) || (region.start > region.end) ||
(mem->speed > 1000) ) { (mem->speed > 1000) ) {
leave("i82092aa_set_mem_map: invalid address / speed"); leave("i82092aa_set_mem_map: invalid address / speed");
printk("invalid mem map for socket %i : %lx to %lx with a start of %x \n",sock,mem->sys_start, mem->sys_stop, mem->card_start); printk("invalid mem map for socket %i : %lx to %lx with a start of %x \n",sock,region.start, region.end, mem->card_start);
return -EINVAL; return -EINVAL;
} }
...@@ -731,11 +735,11 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_ ...@@ -731,11 +735,11 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_
indirect_resetbit(sock, I365_ADDRWIN, I365_ENA_MEM(map)); indirect_resetbit(sock, I365_ADDRWIN, I365_ENA_MEM(map));
/* printk("set_mem_map: Setting map %i range to %x - %x on socket %i, speed is %i, active = %i \n",map, mem->sys_start,mem->sys_stop,sock,mem->speed,mem->flags & MAP_ACTIVE); */ /* printk("set_mem_map: Setting map %i range to %x - %x on socket %i, speed is %i, active = %i \n",map, region.start,region.end,sock,mem->speed,mem->flags & MAP_ACTIVE); */
/* write the start address */ /* write the start address */
base = I365_MEM(map); base = I365_MEM(map);
i = (mem->sys_start >> 12) & 0x0fff; i = (region.start >> 12) & 0x0fff;
if (mem->flags & MAP_16BIT) if (mem->flags & MAP_16BIT)
i |= I365_MEM_16BIT; i |= I365_MEM_16BIT;
if (mem->flags & MAP_0WS) if (mem->flags & MAP_0WS)
...@@ -744,7 +748,7 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_ ...@@ -744,7 +748,7 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_
/* write the stop address */ /* write the stop address */
i= (mem->sys_stop >> 12) & 0x0fff; i= (region.end >> 12) & 0x0fff;
switch (to_cycles(mem->speed)) { switch (to_cycles(mem->speed)) {
case 0: case 0:
break; break;
...@@ -763,7 +767,7 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_ ...@@ -763,7 +767,7 @@ static int i82092aa_set_mem_map(struct pcmcia_socket *socket, struct pccard_mem_
/* card start */ /* card start */
i = ((mem->card_start - mem->sys_start) >> 12) & 0x3fff; i = ((mem->card_start - region.start) >> 12) & 0x3fff;
if (mem->flags & MAP_WRPROT) if (mem->flags & MAP_WRPROT)
i |= I365_MEM_WRPROT; i |= I365_MEM_WRPROT;
if (mem->flags & MAP_ATTRIB) { if (mem->flags & MAP_ATTRIB) {
......
...@@ -1159,13 +1159,13 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem) ...@@ -1159,13 +1159,13 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem)
debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, %#5.5lx-%#5.5" debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, %#5.5lx-%#5.5"
"lx, %#5.5x)\n", sock, mem->map, mem->flags, mem->speed, "lx, %#5.5x)\n", sock, mem->map, mem->flags, mem->speed,
mem->sys_start, mem->sys_stop, mem->card_start); mem->res->start, mem->res->end, mem->card_start);
map = mem->map; map = mem->map;
if ((map > 4) || (mem->card_start > 0x3ffffff) || if ((map > 4) || (mem->card_start > 0x3ffffff) ||
(mem->sys_start > mem->sys_stop) || (mem->speed > 1000)) (mem->res->start > mem->res->end) || (mem->speed > 1000))
return -EINVAL; return -EINVAL;
if ((mem->sys_start > 0xffffff) || (mem->sys_stop > 0xffffff)) if ((mem->res->start > 0xffffff) || (mem->res->end > 0xffffff))
return -EINVAL; return -EINVAL;
/* Turn off the window before changing anything */ /* Turn off the window before changing anything */
...@@ -1173,12 +1173,12 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem) ...@@ -1173,12 +1173,12 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem)
i365_bclr(sock, I365_ADDRWIN, I365_ENA_MEM(map)); i365_bclr(sock, I365_ADDRWIN, I365_ENA_MEM(map));
base = I365_MEM(map); base = I365_MEM(map);
i = (mem->sys_start >> 12) & 0x0fff; i = (mem->res->start >> 12) & 0x0fff;
if (mem->flags & MAP_16BIT) i |= I365_MEM_16BIT; if (mem->flags & MAP_16BIT) i |= I365_MEM_16BIT;
if (mem->flags & MAP_0WS) i |= I365_MEM_0WS; if (mem->flags & MAP_0WS) i |= I365_MEM_0WS;
i365_set_pair(sock, base+I365_W_START, i); i365_set_pair(sock, base+I365_W_START, i);
i = (mem->sys_stop >> 12) & 0x0fff; i = (mem->res->end >> 12) & 0x0fff;
switch (to_cycles(mem->speed)) { switch (to_cycles(mem->speed)) {
case 0: break; case 0: break;
case 1: i |= I365_MEM_WS0; break; case 1: i |= I365_MEM_WS0; break;
...@@ -1187,7 +1187,7 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem) ...@@ -1187,7 +1187,7 @@ static int i365_set_mem_map(u_short sock, struct pccard_mem_map *mem)
} }
i365_set_pair(sock, base+I365_W_STOP, i); i365_set_pair(sock, base+I365_W_STOP, i);
i = ((mem->card_start - mem->sys_start) >> 12) & 0x3fff; i = ((mem->card_start - mem->res->start) >> 12) & 0x3fff;
if (mem->flags & MAP_WRPROT) i |= I365_MEM_WRPROT; if (mem->flags & MAP_WRPROT) i |= I365_MEM_WRPROT;
if (mem->flags & MAP_ATTRIB) i |= I365_MEM_REG; if (mem->flags & MAP_ATTRIB) i |= I365_MEM_REG;
i365_set_pair(sock, base+I365_W_OFF, i); i365_set_pair(sock, base+I365_W_OFF, i);
...@@ -1309,7 +1309,7 @@ static int pcic_init(struct pcmcia_socket *s) ...@@ -1309,7 +1309,7 @@ static int pcic_init(struct pcmcia_socket *s)
int i; int i;
struct resource res = { .start = 0, .end = 0x1000 }; struct resource res = { .start = 0, .end = 0x1000 };
pccard_io_map io = { 0, 0, 0, 0, 1 }; pccard_io_map io = { 0, 0, 0, 0, 1 };
pccard_mem_map mem = { .res = &res, .sys_stop = 0x1000, }; pccard_mem_map mem = { .res = &res, };
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
io.map = i; io.map = i;
......
...@@ -502,10 +502,10 @@ static int pd6729_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map ...@@ -502,10 +502,10 @@ static int pd6729_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map
return -EINVAL; return -EINVAL;
} }
if ((mem->sys_start > mem->sys_stop) || (mem->speed > 1000)) { if ((mem->res->start > mem->res->end) || (mem->speed > 1000)) {
printk("pd6729_set_mem_map: invalid address / speed"); printk("pd6729_set_mem_map: invalid address / speed");
/* printk("invalid mem map for socket %i : %lx to %lx with a start of %x\n", /* printk("invalid mem map for socket %i : %lx to %lx with a start of %x\n",
sock, mem->sys_start, mem->sys_stop, mem->card_start); */ sock, mem->res->start, mem->res->end, mem->card_start); */
return -EINVAL; return -EINVAL;
} }
...@@ -515,7 +515,7 @@ static int pd6729_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map ...@@ -515,7 +515,7 @@ static int pd6729_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map
/* write the start address */ /* write the start address */
base = I365_MEM(map); base = I365_MEM(map);
i = (mem->sys_start >> 12) & 0x0fff; i = (mem->res->start >> 12) & 0x0fff;
if (mem->flags & MAP_16BIT) if (mem->flags & MAP_16BIT)
i |= I365_MEM_16BIT; i |= I365_MEM_16BIT;
if (mem->flags & MAP_0WS) if (mem->flags & MAP_0WS)
...@@ -524,7 +524,7 @@ static int pd6729_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map ...@@ -524,7 +524,7 @@ static int pd6729_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map
/* write the stop address */ /* write the stop address */
i= (mem->sys_stop >> 12) & 0x0fff; i= (mem->res->end >> 12) & 0x0fff;
switch (to_cycles(mem->speed)) { switch (to_cycles(mem->speed)) {
case 0: case 0:
break; break;
...@@ -543,11 +543,11 @@ static int pd6729_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map ...@@ -543,11 +543,11 @@ static int pd6729_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map
/* Take care of high byte */ /* Take care of high byte */
indirect_write(socket, PD67_EXT_INDEX, PD67_MEM_PAGE(map)); indirect_write(socket, PD67_EXT_INDEX, PD67_MEM_PAGE(map));
indirect_write(socket, PD67_EXT_DATA, mem->sys_start >> 24); indirect_write(socket, PD67_EXT_DATA, mem->res->start >> 24);
/* card start */ /* card start */
i = ((mem->card_start - mem->sys_start) >> 12) & 0x3fff; i = ((mem->card_start - mem->res->start) >> 12) & 0x3fff;
if (mem->flags & MAP_WRPROT) if (mem->flags & MAP_WRPROT)
i |= I365_MEM_WRPROT; i |= I365_MEM_WRPROT;
if (mem->flags & MAP_ATTRIB) { if (mem->flags & MAP_ATTRIB) {
...@@ -577,7 +577,7 @@ static int pd6729_init(struct pcmcia_socket *sock) ...@@ -577,7 +577,7 @@ static int pd6729_init(struct pcmcia_socket *sock)
int i; int i;
struct resource res = { .end = 0x0fff }; struct resource res = { .end = 0x0fff };
pccard_io_map io = { 0, 0, 0, 0, 1 }; pccard_io_map io = { 0, 0, 0, 0, 1 };
pccard_mem_map mem = { .res = &res, .sys_stop = 0x0fff }; pccard_mem_map mem = { .res = &res, };
pd6729_set_socket(sock, &dead_socket); pd6729_set_socket(sock, &dead_socket);
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
......
...@@ -301,8 +301,6 @@ static int readable(struct pcmcia_socket *s, struct resource *res, cisinfo_t *in ...@@ -301,8 +301,6 @@ static int readable(struct pcmcia_socket *s, struct resource *res, cisinfo_t *in
{ {
int ret = -1; int ret = -1;
s->cis_mem.sys_start = res->start;
s->cis_mem.sys_stop = res->end;
s->cis_mem.res = res; s->cis_mem.res = res;
s->cis_virt = ioremap(res->start, s->map_size); s->cis_virt = ioremap(res->start, s->map_size);
if (s->cis_virt) { if (s->cis_virt) {
...@@ -312,8 +310,6 @@ static int readable(struct pcmcia_socket *s, struct resource *res, cisinfo_t *in ...@@ -312,8 +310,6 @@ static int readable(struct pcmcia_socket *s, struct resource *res, cisinfo_t *in
s->cis_virt = NULL; s->cis_virt = NULL;
destroy_cis_cache(s); destroy_cis_cache(s);
} }
s->cis_mem.sys_start = 0;
s->cis_mem.sys_stop = 0;
s->cis_mem.res = NULL; s->cis_mem.res = NULL;
if ((ret != 0) || (info->Chains == 0)) if ((ret != 0) || (info->Chains == 0))
return 0; return 0;
...@@ -332,8 +328,6 @@ static int checksum(struct pcmcia_socket *s, struct resource *res) ...@@ -332,8 +328,6 @@ static int checksum(struct pcmcia_socket *s, struct resource *res)
map.map = 0; map.map = 0;
map.flags = MAP_ACTIVE; map.flags = MAP_ACTIVE;
map.speed = 0; map.speed = 0;
map.sys_start = res->start;
map.sys_stop = res->end;
map.res = res; map.res = res;
map.card_start = 0; map.card_start = 0;
s->ops->set_mem_map(s, &map); s->ops->set_mem_map(s, &map);
......
...@@ -448,9 +448,7 @@ soc_common_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map ...@@ -448,9 +448,7 @@ soc_common_pcmcia_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map
skt->ops->set_timing(skt); skt->ops->set_timing(skt);
map->sys_stop -= map->sys_start; map->static_start = res->start + map->card_start;
map->sys_stop += res->start + map->card_start;
map->sys_start = res->start + map->card_start;
return 0; return 0;
} }
...@@ -662,6 +660,7 @@ static void soc_pcmcia_cpufreq_unregister(void) ...@@ -662,6 +660,7 @@ static void soc_pcmcia_cpufreq_unregister(void)
int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr) int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, int first, int nr)
{ {
struct skt_dev_info *sinfo; struct skt_dev_info *sinfo;
struct soc_pcmcia_socket *skt;
int ret, i; int ret, i;
down(&soc_pcmcia_sockets_lock); down(&soc_pcmcia_sockets_lock);
...@@ -679,7 +678,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops ...@@ -679,7 +678,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops
* Initialise the per-socket structure. * Initialise the per-socket structure.
*/ */
for (i = 0; i < nr; i++) { for (i = 0; i < nr; i++) {
struct soc_pcmcia_socket *skt = &sinfo->skt[i]; skt = &sinfo->skt[i];
skt->socket.ops = &soc_common_pcmcia_operations; skt->socket.ops = &soc_common_pcmcia_operations;
skt->socket.owner = ops->owner; skt->socket.owner = ops->owner;
...@@ -777,7 +776,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops ...@@ -777,7 +776,7 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops
goto out; goto out;
do { do {
struct soc_pcmcia_socket *skt = &sinfo->skt[i]; skt = &sinfo->skt[i];
del_timer_sync(&skt->poll_timer); del_timer_sync(&skt->poll_timer);
pcmcia_unregister_socket(&skt->socket); pcmcia_unregister_socket(&skt->socket);
......
...@@ -829,15 +829,15 @@ static int tcic_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *m ...@@ -829,15 +829,15 @@ static int tcic_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *m
debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, " debug(1, "SetMemMap(%d, %d, %#2.2x, %d ns, "
"%#5.5lx-%#5.5lx, %#5.5x)\n", psock, mem->map, mem->flags, "%#5.5lx-%#5.5lx, %#5.5x)\n", psock, mem->map, mem->flags,
mem->speed, mem->sys_start, mem->sys_stop, mem->card_start); mem->speed, mem->res->start, mem->res->end, mem->card_start);
if ((mem->map > 3) || (mem->card_start > 0x3ffffff) || if ((mem->map > 3) || (mem->card_start > 0x3ffffff) ||
(mem->sys_start > 0xffffff) || (mem->sys_stop > 0xffffff) || (mem->res->start > 0xffffff) || (mem->res->end > 0xffffff) ||
(mem->sys_start > mem->sys_stop) || (mem->speed > 1000)) (mem->res->start > mem->res->end) || (mem->speed > 1000))
return -EINVAL; return -EINVAL;
tcic_setw(TCIC_ADDR+2, TCIC_ADR2_INDREG | (psock << TCIC_SS_SHFT)); tcic_setw(TCIC_ADDR+2, TCIC_ADR2_INDREG | (psock << TCIC_SS_SHFT));
addr = TCIC_MWIN(psock, mem->map); addr = TCIC_MWIN(psock, mem->map);
base = mem->sys_start; len = mem->sys_stop - mem->sys_start; base = mem->res->start; len = mem->res->end - mem->res->start;
if ((len & (len+1)) || (base & len)) return -EINVAL; if ((len & (len+1)) || (base & len)) return -EINVAL;
if (len == 0x0fff) if (len == 0x0fff)
base = (base >> TCIC_MBASE_HA_SHFT) | TCIC_MBASE_4K_BIT; base = (base >> TCIC_MBASE_HA_SHFT) | TCIC_MBASE_4K_BIT;
...@@ -846,7 +846,7 @@ static int tcic_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *m ...@@ -846,7 +846,7 @@ static int tcic_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *m
tcic_setw(TCIC_ADDR, addr + TCIC_MBASE_X); tcic_setw(TCIC_ADDR, addr + TCIC_MBASE_X);
tcic_setw(TCIC_DATA, base); tcic_setw(TCIC_DATA, base);
mmap = mem->card_start - mem->sys_start; mmap = mem->card_start - mem->res->start;
mmap = (mmap >> TCIC_MMAP_CA_SHFT) & TCIC_MMAP_CA_MASK; mmap = (mmap >> TCIC_MMAP_CA_SHFT) & TCIC_MMAP_CA_MASK;
if (mem->flags & MAP_ATTRIB) mmap |= TCIC_MMAP_REG; if (mem->flags & MAP_ATTRIB) mmap |= TCIC_MMAP_REG;
tcic_setw(TCIC_ADDR, addr + TCIC_MMAP_X); tcic_setw(TCIC_ADDR, addr + TCIC_MMAP_X);
...@@ -870,7 +870,7 @@ static int tcic_init(struct pcmcia_socket *s) ...@@ -870,7 +870,7 @@ static int tcic_init(struct pcmcia_socket *s)
int i; int i;
struct resource res = { .start = 0, .end = 0x1000 }; struct resource res = { .start = 0, .end = 0x1000 };
pccard_io_map io = { 0, 0, 0, 0, 1 }; pccard_io_map io = { 0, 0, 0, 0, 1 };
pccard_mem_map mem = { .res = &res, .sys_stop = 0x1000, }; pccard_mem_map mem = { .res = &res, };
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
io.map = i; io.map = i;
......
...@@ -343,14 +343,17 @@ static int yenta_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io ...@@ -343,14 +343,17 @@ static int yenta_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io
static int yenta_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *mem) static int yenta_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *mem)
{ {
struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket); struct yenta_socket *socket = container_of(sock, struct yenta_socket, socket);
struct pci_bus_region region;
int map; int map;
unsigned char addr, enable; unsigned char addr, enable;
unsigned int start, stop, card_start; unsigned int start, stop, card_start;
unsigned short word; unsigned short word;
pcibios_resource_to_bus(socket->dev, &region, mem->res);
map = mem->map; map = mem->map;
start = mem->sys_start; start = region.start;
stop = mem->sys_stop; stop = region.end;
card_start = mem->card_start; card_start = mem->card_start;
if (map > 4 || start > stop || ((start ^ stop) >> 24) || if (map > 4 || start > stop || ((start ^ stop) >> 24) ||
...@@ -447,7 +450,7 @@ static void yenta_clear_maps(struct yenta_socket *socket) ...@@ -447,7 +450,7 @@ static void yenta_clear_maps(struct yenta_socket *socket)
int i; int i;
struct resource res = { .start = 0, .end = 0x0fff }; struct resource res = { .start = 0, .end = 0x0fff };
pccard_io_map io = { 0, 0, 0, 0, 1 }; pccard_io_map io = { 0, 0, 0, 0, 1 };
pccard_mem_map mem = { .res = &res, .sys_stop = 0x0fff, }; pccard_mem_map mem = { .res = &res, };
yenta_set_socket(&socket->socket, &dead_socket); yenta_set_socket(&socket->socket, &dead_socket);
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
......
...@@ -103,7 +103,7 @@ typedef struct pccard_mem_map { ...@@ -103,7 +103,7 @@ typedef struct pccard_mem_map {
u_char map; u_char map;
u_char flags; u_char flags;
u_short speed; u_short speed;
u_long sys_start, sys_stop; u_long static_start;
u_int card_start; u_int card_start;
struct resource *res; struct resource *res;
} pccard_mem_map; } pccard_mem_map;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment