linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ide_cs: Make ide_cs work with the memory space of CF-Cards if IO space is not available
@ 2006-05-11  2:10 Thomas Kleffel (maintech GmbH)
  2006-05-11 15:52 ` Alan Cox
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Kleffel (maintech GmbH) @ 2006-05-11  2:10 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 708 bytes --]

From: Thomas Kleffel <tk@maintech.de>

this patch enables ide_cs to access CF-cards via their common memory
rather than via their IO space.

Signed-off-by: Thomas Kleffel <tk@maintech.de>
---

This patch is against 2.6.17-rc3

The reason why this patch makes sense is that it is pretty easy to build
a CF-Interface out of a simple address/data-bus if you only use common
and attribute memory. Adding the capability to access IO space makes
things more complicated.

If you just want to use CF-Storage cards, access to common and attribute
memory is enough as the IDE registers are available there, as well.

I have submitted a patch to RMK which enables the AT91RM9200's CF
interface to work in that mode.



[-- Attachment #2: ide_cd.mem.patch --]
[-- Type: text/x-patch, Size: 1121 bytes --]

diff -uprN l1/drivers/ide/legacy/ide-cs.c l2/drivers/ide/legacy/ide-cs.c
--- l1/drivers/ide/legacy/ide-cs.c	2006-05-11 00:19:59.000000000 +0200
+++ l2/drivers/ide/legacy/ide-cs.c	2006-05-11 03:38:03.000000000 +0200
@@ -263,6 +263,29 @@ static int ide_config(struct pcmcia_devi
 	    break;
 	}
 
+	if ((cfg->mem.nwin > 0) || (stk->dflt.mem.nwin > 0)) {
+	    win_req_t req;
+	    memreq_t map;
+
+	    cistpl_mem_t *mem = (cfg->mem.nwin) ? &cfg->mem : &stk->dflt.mem;
+	    req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM;
+	    req.Attributes |= WIN_ENABLE;
+	    req.Base = mem->win[0].host_addr;
+	    req.Size = mem->win[0].len;
+
+	    req.AccessSpeed = 0;
+	    if (pcmcia_request_window(&link, &req, &link->win) != 0)
+		goto next_entry;
+	    map.Page = 0; map.CardOffset = mem->win[0].card_addr;
+	    if (pcmcia_map_mem_page(link->win, &map) != 0)
+		goto next_entry;
+
+      	    io_base = (unsigned long) ioremap(req.Base, req.Size);
+    	    ctl_base = io_base + 0x0e;
+
+	    break;
+	}
+
     next_entry:
 	if (cfg->flags & CISTPL_CFTABLE_DEFAULT)
 	    memcpy(&stk->dflt, cfg, sizeof(stk->dflt));

^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: [PATCH] ide_cs: Make ide_cs work with the memory space of CF-Cards if IO space is not available (2nd revision)
@ 2006-05-12 13:24 Iain Barker
  2006-05-14 13:11 ` Thomas Kleffel (maintech GmbH)
  0 siblings, 1 reply; 11+ messages in thread
From: Iain Barker @ 2006-05-12 13:24 UTC (permalink / raw)
  To: David Vrabel, Thomas Kleffel (maintech GmbH)
  Cc: Alan Cox, linux-kernel, linux-pcmcia



Thomas Kleffel (maintech GmbH) wrote:
> +    if(is_mmio) 
> +    	my_outb = outb_mem;
> +    else
> +    	my_outb = outb_io;

David Vrabel wrote:
> Shouldn't you convert ide_cs to use iowrite8 (and friends) instead of
> doing this?


Actually, I think even better to use the primitives from ide-iops.c ?

i.e. the members of default_hwif_iops and default_hwif_mmiops, which
map to the ide_mm_outb and ide_outb functions used by the rest of the
IDE driver code?

- Iain

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-05-14 13:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-11  2:10 [PATCH] ide_cs: Make ide_cs work with the memory space of CF-Cards if IO space is not available Thomas Kleffel (maintech GmbH)
2006-05-11 15:52 ` Alan Cox
2006-05-11 20:34   ` [PATCH] ide_cs: Make ide_cs work with the memory space of CF-Cards if IO space is not available (revised) Thomas Kleffel (maintech GmbH)
2006-05-11 22:10   ` [PATCH] ide_cs: Make ide_cs work with the memory space of CF-Cards if IO space is not available Russell King
2006-05-12  7:38   ` [PATCH] ide_cs: Make ide_cs work with the memory space of CF-Cards if IO space is not available (2nd revision) Thomas Kleffel (maintech GmbH)
2006-05-12  9:18     ` David Vrabel
2006-05-12  9:27       ` Thomas Kleffel (maintech GmbH)
2006-05-12  9:46   ` [PATCH] ide_cs: Make ide_cs work with the memory space of CF-Cards if IO space is not available (3nd revision) Thomas Kleffel (maintech GmbH)
2006-05-14 13:16   ` [PATCH] ide_cs: Make ide_cs work with the memory space of CF-Cards if IO space is not available (4rd revision) Thomas Kleffel (maintech GmbH)
2006-05-12 13:24 [PATCH] ide_cs: Make ide_cs work with the memory space of CF-Cards if IO space is not available (2nd revision) Iain Barker
2006-05-14 13:11 ` Thomas Kleffel (maintech GmbH)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).