Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Jordan Crouse" <jordan.crouse@amd.com>
To: "Matej Kupljen" <matej.kupljen@ultra.si>
Cc: "Ulrich Eckhardt" <eckhardt@satorlaser.com>, linux-mips@linux-mips.org
Subject: Re: PCMCIA on AU1200
Date: Tue, 31 Jan 2006 13:49:21 -0700	[thread overview]
Message-ID: <20060131204921.GP31163@cosmic.amd.com> (raw)
In-Reply-To: <1138736513.7884.16.camel@localhost.localdomain>

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

I wasn't aware of any outstanding problems with PCMCIA here, so I went back 
to see if we had any changes laying around for the DB1200, and we did. That
patch is attached.  Basically, we avoid a PCI quirk introduced by the 1550,
and re-adjust some of the ioremap()s and other sundry macros to account
for the fact that the physical address is larger then a u_long.  Also, the
kernel was missing some PB1200 defines, so I threw those in for fun.

> Yes, in the drivers/pcmcia/au1000_generic.c.
> Also, the skt->phys_attr and the skt->phys_mem are set to
> 0xF4000000 and 0xF8000000 respectively and I wonder, where they got
> those values? 

Those are the pseudo values that are fixed up in the appropriately named
__fixup_bigphys_addr to be the actual 36 bit addresses, which are
0xF40000000 and 0xF80000000 respectively.

But other then that, I think that Ulrich is right -the DB board should
just work.  If we *are* depending on a setting from the bootloader, thats
a bug, and should be fixed posthaste.

Ralf and others, let me know if the patch freaks you out.

Jordan
-- 
Jordan Crouse
Senior Linux Engineer
AMD - Personal Connectivity Solutions Group
<www.amd.com/embeddedprocessors>

[-- Attachment #2: pcmcia.patch --]
[-- Type: text/plain, Size: 3619 bytes --]

PATCH:  Misc PCMCIA fixes for DB1200

Signed-off-by:  Jordan Crouse <jordan.crouse@amd.com>
---

 arch/mips/au1000/common/setup.c       |    2 +-
 drivers/pcmcia/au1000_generic.c       |    5 +++--
 include/asm-mips/mach-pb1x00/pb1200.h |    8 ++++++++
 include/pcmcia/cs_types.h             |    5 +++--
 include/pcmcia/ss.h                   |    2 +-
 5 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/arch/mips/au1000/common/setup.c b/arch/mips/au1000/common/setup.c
index eb155c0..fcfe306 100644
--- a/arch/mips/au1000/common/setup.c
+++ b/arch/mips/au1000/common/setup.c
@@ -153,7 +153,7 @@ phys_t __fixup_bigphys_addr(phys_t phys_
 	/* Don't fixup 36 bit addresses */
 	if ((phys_addr >> 32) != 0) return phys_addr;
 
-#ifdef CONFIG_PCI
+#if defined(CONFIG_PCI) && !defined(CONFIG_SOC_AU1200)
 	start = (u32)Au1500_PCI_MEM_START;
 	end = (u32)Au1500_PCI_MEM_END;
 	/* check for pci memory window */
diff --git a/drivers/pcmcia/au1000_generic.c b/drivers/pcmcia/au1000_generic.c
index 971a352..55a46e2 100644
--- a/drivers/pcmcia/au1000_generic.c
+++ b/drivers/pcmcia/au1000_generic.c
@@ -402,7 +402,7 @@ int au1x00_pcmcia_socket_probe(struct de
 		 */
 		if (i == 0) {
 			skt->virt_io = (void *)
-				(ioremap((phys_t)AU1X_SOCK0_IO, 0x1000) -
+				(u32)(ioremap((ioaddr_t)AU1X_SOCK0_IO, 0x1000) -
 				(u32)mips_io_port_base);
 			skt->phys_attr = AU1X_SOCK0_PSEUDO_PHYS_ATTR;
 			skt->phys_mem = AU1X_SOCK0_PSEUDO_PHYS_MEM;
@@ -410,7 +410,7 @@ int au1x00_pcmcia_socket_probe(struct de
 #ifndef CONFIG_MIPS_XXS1500
 		else  {
 			skt->virt_io = (void *)
-				(ioremap((phys_t)AU1X_SOCK1_IO, 0x1000) -
+				(u32)(ioremap((ioaddr_t)AU1X_SOCK1_IO, 0x1000) -
 				(u32)mips_io_port_base);
 			skt->phys_attr = AU1X_SOCK1_PSEUDO_PHYS_ATTR;
 			skt->phys_mem = AU1X_SOCK1_PSEUDO_PHYS_MEM;
@@ -420,6 +420,7 @@ int au1x00_pcmcia_socket_probe(struct de
 		ret = ops->hw_init(skt);
 
 		skt->socket.features = SS_CAP_STATIC_MAP|SS_CAP_PCCARD;
+		skt->socket.resource_ops = &pccard_static_ops;
 		skt->socket.irq_mask = 0;
 		skt->socket.map_size = MAP_SIZE;
 		skt->socket.pci_irq = skt->irq;
diff --git a/include/asm-mips/mach-pb1x00/pb1200.h b/include/asm-mips/mach-pb1x00/pb1200.h
index 409d443..15823eb 100644
--- a/include/asm-mips/mach-pb1x00/pb1200.h
+++ b/include/asm-mips/mach-pb1x00/pb1200.h
@@ -181,6 +181,14 @@ static BCSR * const bcsr = (BCSR *)BCSR_
 #define SET_VCC_VPP(VCC, VPP, SLOT)\
 	((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
 
+/* PCMCIA Db1x00 specific defines */
+#define PCMCIA_MAX_SOCK 1
+#define PCMCIA_NUM_SOCKS (PCMCIA_MAX_SOCK+1)
+
+/* VPP/VCC */
+#define SET_VCC_VPP(VCC, VPP, SLOT)\
+	((((VCC)<<2) | ((VPP)<<0)) << ((SLOT)*8))
+
 #define AU1XXX_SMC91111_PHYS_ADDR	(0x0D000300)
 #define AU1XXX_SMC91111_IRQ			PB1200_ETH_INT
 
diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h
index c1d1629..8e8c20d 100644
--- a/include/pcmcia/cs_types.h
+++ b/include/pcmcia/cs_types.h
@@ -21,9 +21,10 @@
 #include <sys/types.h>
 #endif
 
-#if defined(__arm__) || defined(__mips__)
-/* This (ioaddr_t) is exposed to userspace & hence cannot be changed. */
+#if defined(__arm__)
 typedef u_int   ioaddr_t;
+#elif defined(__mips__)
+typedef unsigned long long ioaddr_t;
 #else
 typedef u_short	ioaddr_t;
 #endif
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 2889a69..b828471 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -99,7 +99,7 @@ typedef struct pccard_mem_map {
     u_char	map;
     u_char	flags;
     u_short	speed;
-    u_long	static_start;
+    ioaddr_t	static_start;
     u_int	card_start;
     struct resource *res;
 } pccard_mem_map;

      reply	other threads:[~2006-01-31 20:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-31 10:39 PCMCIA on AU1200 Matej Kupljen
2006-01-31 10:39 ` Matej Kupljen
2006-01-31 14:03 ` Ulrich Eckhardt
2006-01-31 19:41   ` Matej Kupljen
2006-01-31 20:49     ` Jordan Crouse [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060131204921.GP31163@cosmic.amd.com \
    --to=jordan.crouse@amd.com \
    --cc=eckhardt@satorlaser.com \
    --cc=linux-mips@linux-mips.org \
    --cc=matej.kupljen@ultra.si \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox