MIPS: Alchemy: use 36bit addresses for PCMCIA resources.

On Alchemy the PCMCIA area lies at the end of the chips 36bit system bus
area.  Currently, addresses at the far end of the 32bit area are assumed
to belong to the PCMCIA area and fixed up to the real 36bit address before
being passed to ioremap().

A previous commit enabled 64 bit physical size for the resource datatype on
Alchemy and this allows to use the correct 36bit addresses when registering
the PCMCIA sockets.

This patch removes the 32-to-36bit address fixup and registers the Alchemy
demo board pcmcia socket with the correct 36bit physical addresses.

Tested on DB1200, with a CF card (ide-cs driver) and a 3c589 PCMCIA ethernet
card.

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
To: Linux-MIPS <linux-mips@linux-mips.org>
Cc: Manuel Lauss <manuel.lauss@gmail.com>
Patchwork: http://patchwork.linux-mips.org/patch/994/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
diff --git a/drivers/pcmcia/xxs1500_ss.c b/drivers/pcmcia/xxs1500_ss.c
index 4e36930..61560cd 100644
--- a/drivers/pcmcia/xxs1500_ss.c
+++ b/drivers/pcmcia/xxs1500_ss.c
@@ -56,10 +56,9 @@
 	struct pcmcia_socket	socket;
 	void		*virt_io;
 
-	/* the "pseudo" addresses of the PCMCIA space. */
-	unsigned long	phys_io;
-	unsigned long	phys_attr;
-	unsigned long	phys_mem;
+	phys_addr_t	phys_io;
+	phys_addr_t	phys_attr;
+	phys_addr_t	phys_mem;
 
 	/* previous flags for set_socket() */
 	unsigned int old_flags;
@@ -211,7 +210,6 @@
 {
 	struct xxs1500_pcmcia_sock *sock;
 	struct resource *r;
-	phys_t physio;
 	int ret, irq;
 
 	sock = kzalloc(sizeof(struct xxs1500_pcmcia_sock), GFP_KERNEL);
@@ -225,9 +223,9 @@
 	 * for this socket (usually the 36bit address shifted 4 to the
 	 * right).
 	 */
-	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pseudo-attr");
+	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-attr");
 	if (!r) {
-		dev_err(&pdev->dev, "missing 'pseudo-attr' resource!\n");
+		dev_err(&pdev->dev, "missing 'pcmcia-attr' resource!\n");
 		goto out0;
 	}
 	sock->phys_attr = r->start;
@@ -236,9 +234,9 @@
 	 * pseudo-mem:  The 32bit address of the PCMCIA memory space for
 	 * this socket (usually the 36bit address shifted 4 to the right)
 	 */
-	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pseudo-mem");
+	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-mem");
 	if (!r) {
-		dev_err(&pdev->dev, "missing 'pseudo-mem' resource!\n");
+		dev_err(&pdev->dev, "missing 'pcmcia-mem' resource!\n");
 		goto out0;
 	}
 	sock->phys_mem = r->start;
@@ -247,19 +245,14 @@
 	 * pseudo-io:  The 32bit address of the PCMCIA IO space for this
 	 * socket (usually the 36bit address shifted 4 to the right).
 	 */
-	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pseudo-io");
+	r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pcmcia-io");
 	if (!r) {
-		dev_err(&pdev->dev, "missing 'pseudo-io' resource!\n");
+		dev_err(&pdev->dev, "missing 'pcmcia-io' resource!\n");
 		goto out0;
 	}
 	sock->phys_io = r->start;
 
 
-	/* for io must remap the full 36bit address (for reference see
-	 * alchemy/common/setup.c::__fixup_bigphys_addr)
-	 */
-	physio = ((phys_t)sock->phys_io) << 4;
-
 	/*
 	 * PCMCIA client drivers use the inb/outb macros to access
 	 * the IO registers.  Since mips_io_port_base is added
@@ -268,7 +261,7 @@
 	 * to access the I/O or MEM address directly, without
 	 * going through this "mips_io_port_base" mechanism.
 	 */
-	sock->virt_io = (void *)(ioremap(physio, IO_MAP_SIZE) -
+	sock->virt_io = (void *)(ioremap(sock->phys_io, IO_MAP_SIZE) -
 				 mips_io_port_base);
 
 	if (!sock->virt_io) {