Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11b897cf authored by Manuel Lauss's avatar Manuel Lauss Committed by Ralf Baechle
Browse files

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: default avatarManuel 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: default avatarRalf Baechle <ralf@linux-mips.org>
parent b9b37787
Loading
Loading
Loading
Loading
+7 −25
Original line number Diff line number Diff line
@@ -69,38 +69,20 @@ void __init plat_mem_setup(void)
	iomem_resource.end = IOMEM_RESOURCE_END;
}

#if defined(CONFIG_64BIT_PHYS_ADDR)
#if defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_PCI)
/* This routine should be valid for all Au1x based boards */
phys_t __fixup_bigphys_addr(phys_t phys_addr, phys_t size)
{
	u32 start = (u32)Au1500_PCI_MEM_START;
	u32 end   = (u32)Au1500_PCI_MEM_END;

	/* Don't fixup 36-bit addresses */
	if ((phys_addr >> 32) != 0)
		return phys_addr;

#ifdef CONFIG_PCI
	{
		u32 start = (u32)Au1500_PCI_MEM_START;
		u32 end   = (u32)Au1500_PCI_MEM_END;

	/* Check for PCI memory window */
	if (phys_addr >= start && (phys_addr + size - 1) <= end)
			return (phys_t)
			       ((phys_addr - start) + Au1500_PCI_MEM_START);
	}
#endif

	/*
	 * All Au1xx0 SOCs have a PCMCIA controller.
	 * We setup our 32-bit pseudo addresses to be equal to the
	 * 36-bit addr >> 4, to make it easier to check the address
	 * and fix it.
	 * The PCMCIA socket 0 physical attribute address is 0xF 4000 0000.
	 * The pseudo address we use is 0xF400 0000. Any address over
	 * 0xF400 0000 is a PCMCIA pseudo address.
	 */
	if ((phys_addr >= PCMCIA_ATTR_PSEUDO_PHYS) &&
	    (phys_addr < PCMCIA_PSEUDO_END))
		return (phys_t)(phys_addr << 4);
		return (phys_t)((phys_addr - start) + Au1500_PCI_MEM_START);

	/* default nop */
	return phys_addr;
+12 −12
Original line number Diff line number Diff line
@@ -507,24 +507,24 @@ static int __init db1200_dev_init(void)
		(void __iomem *)KSEG1ADDR(PSC1_PHYS_ADDR) + PSC_SEL_OFFSET);
	wmb();

	db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
				    PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
				    PCMCIA_MEM_PSEUDO_PHYS,
				    PCMCIA_MEM_PSEUDO_PHYS  + 0x00040000 - 1,
				    PCMCIA_IO_PSEUDO_PHYS,
				    PCMCIA_IO_PSEUDO_PHYS   + 0x00001000 - 1,
	db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR,
				    PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
				    PCMCIA_MEM_PHYS_ADDR,
				    PCMCIA_MEM_PHYS_ADDR  + 0x000400000 - 1,
				    PCMCIA_IO_PHYS_ADDR,
				    PCMCIA_IO_PHYS_ADDR   + 0x000010000 - 1,
				    DB1200_PC0_INT,
				    DB1200_PC0_INSERT_INT,
				    /*DB1200_PC0_STSCHG_INT*/0,
				    DB1200_PC0_EJECT_INT,
				    0);

	db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS + 0x00400000,
				    PCMCIA_ATTR_PSEUDO_PHYS + 0x00440000 - 1,
				    PCMCIA_MEM_PSEUDO_PHYS  + 0x00400000,
				    PCMCIA_MEM_PSEUDO_PHYS  + 0x00440000 - 1,
				    PCMCIA_IO_PSEUDO_PHYS   + 0x00400000,
				    PCMCIA_IO_PSEUDO_PHYS   + 0x00401000 - 1,
	db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
				    PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
				    PCMCIA_MEM_PHYS_ADDR  + 0x004000000,
				    PCMCIA_MEM_PHYS_ADDR  + 0x004400000 - 1,
				    PCMCIA_IO_PHYS_ADDR   + 0x004000000,
				    PCMCIA_IO_PHYS_ADDR   + 0x004010000 - 1,
				    DB1200_PC1_INT,
				    DB1200_PC1_INSERT_INT,
				    /*DB1200_PC1_STSCHG_INT*/0,
+12 −12
Original line number Diff line number Diff line
@@ -88,24 +88,24 @@
static int __init db1xxx_dev_init(void)
{
#ifdef DB1XXX_HAS_PCMCIA
	db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
				    PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
				    PCMCIA_MEM_PSEUDO_PHYS,
				    PCMCIA_MEM_PSEUDO_PHYS  + 0x00040000 - 1,
				    PCMCIA_IO_PSEUDO_PHYS,
				    PCMCIA_IO_PSEUDO_PHYS   + 0x00001000 - 1,
	db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR,
				    PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
				    PCMCIA_MEM_PHYS_ADDR,
				    PCMCIA_MEM_PHYS_ADDR  + 0x000400000 - 1,
				    PCMCIA_IO_PHYS_ADDR,
				    PCMCIA_IO_PHYS_ADDR   + 0x000010000 - 1,
				    DB1XXX_PCMCIA_CARD0,
				    DB1XXX_PCMCIA_CD0,
				    /*DB1XXX_PCMCIA_STSCHG0*/0,
				    0,
				    0);

	db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS + 0x00400000,
				    PCMCIA_ATTR_PSEUDO_PHYS + 0x00440000 - 1,
				    PCMCIA_MEM_PSEUDO_PHYS  + 0x00400000,
				    PCMCIA_MEM_PSEUDO_PHYS  + 0x00440000 - 1,
				    PCMCIA_IO_PSEUDO_PHYS   + 0x00400000,
				    PCMCIA_IO_PSEUDO_PHYS   + 0x00401000 - 1,
	db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR + 0x004000000,
				    PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1,
				    PCMCIA_MEM_PHYS_ADDR  + 0x004000000,
				    PCMCIA_MEM_PHYS_ADDR  + 0x004400000 - 1,
				    PCMCIA_IO_PHYS_ADDR   + 0x004000000,
				    PCMCIA_IO_PHYS_ADDR   + 0x004010000 - 1,
				    DB1XXX_PCMCIA_CARD1,
				    DB1XXX_PCMCIA_CD1,
				    /*DB1XXX_PCMCIA_STSCHG1*/0,
+6 −6
Original line number Diff line number Diff line
@@ -30,12 +30,12 @@ static int __init pb1100_dev_init(void)
	int swapped;

	/* PCMCIA. single socket, identical to Pb1500 */
	db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
				    PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
				    PCMCIA_MEM_PSEUDO_PHYS,
				    PCMCIA_MEM_PSEUDO_PHYS  + 0x00040000 - 1,
				    PCMCIA_IO_PSEUDO_PHYS,
				    PCMCIA_IO_PSEUDO_PHYS   + 0x00001000 - 1,
	db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR,
				    PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
				    PCMCIA_MEM_PHYS_ADDR,
				    PCMCIA_MEM_PHYS_ADDR  + 0x000400000 - 1,
				    PCMCIA_IO_PHYS_ADDR,
				    PCMCIA_IO_PHYS_ADDR   + 0x000010000 - 1,
				    AU1100_GPIO11_INT,	 /* card */
				    AU1100_GPIO9_INT,	 /* insert */
				    /*AU1100_GPIO10_INT*/0, /* stschg */
+12 −12
Original line number Diff line number Diff line
@@ -170,24 +170,24 @@ static int __init board_register_devices(void)
{
	int swapped;

	db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS,
				    PCMCIA_ATTR_PSEUDO_PHYS + 0x00040000 - 1,
				    PCMCIA_MEM_PSEUDO_PHYS,
				    PCMCIA_MEM_PSEUDO_PHYS  + 0x00040000 - 1,
				    PCMCIA_IO_PSEUDO_PHYS,
				    PCMCIA_IO_PSEUDO_PHYS   + 0x00001000 - 1,
	db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR,
				    PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1,
				    PCMCIA_MEM_PHYS_ADDR,
				    PCMCIA_MEM_PHYS_ADDR  + 0x000400000 - 1,
				    PCMCIA_IO_PHYS_ADDR,
				    PCMCIA_IO_PHYS_ADDR   + 0x000010000 - 1,
				    PB1200_PC0_INT,
				    PB1200_PC0_INSERT_INT,
				    /*PB1200_PC0_STSCHG_INT*/0,
				    PB1200_PC0_EJECT_INT,
				    0);

	db1x_register_pcmcia_socket(PCMCIA_ATTR_PSEUDO_PHYS + 0x00800000,
				    PCMCIA_ATTR_PSEUDO_PHYS + 0x00840000 - 1,
				    PCMCIA_MEM_PSEUDO_PHYS  + 0x00800000,
				    PCMCIA_MEM_PSEUDO_PHYS  + 0x00840000 - 1,
				    PCMCIA_IO_PSEUDO_PHYS   + 0x00800000,
				    PCMCIA_IO_PSEUDO_PHYS   + 0x00801000 - 1,
	db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR + 0x008000000,
				    PCMCIA_ATTR_PHYS_ADDR + 0x008400000 - 1,
				    PCMCIA_MEM_PHYS_ADDR  + 0x008000000,
				    PCMCIA_MEM_PHYS_ADDR  + 0x008400000 - 1,
				    PCMCIA_IO_PHYS_ADDR   + 0x008000000,
				    PCMCIA_IO_PHYS_ADDR   + 0x008010000 - 1,
				    PB1200_PC1_INT,
				    PB1200_PC1_INSERT_INT,
				    /*PB1200_PC1_STSCHG_INT*/0,
Loading