From: Pete P. <pp...@us...> - 2002-03-09 01:40:09
|
Update of /cvsroot/linux-mips/linux/arch/mips/au1000/pb1500 In directory usw-pr-cvs1:/tmp/cvs-serv1543/arch/mips/au1000/pb1500 Modified Files: setup.c Log Message: Added a Pb1500 specific __ioremap_fixup function. Index: setup.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/au1000/pb1500/setup.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- setup.c 15 Feb 2002 19:47:26 -0000 1.2 +++ setup.c 9 Mar 2002 01:40:06 -0000 1.3 @@ -79,6 +79,8 @@ extern struct resource ioport_resource; extern struct resource iomem_resource; +extern phys_t (*__ioremap_fixup)(phys_t phys_addr, phys_t size); +static phys_t pb1500_ioremap_fixup(phys_t phys_addr, phys_t size); void au1500_wbflush(void) { @@ -114,6 +116,7 @@ _machine_restart = au1000_restart; _machine_halt = au1000_halt; _machine_power_off = au1000_power_off; + __ioremap_fixup = pb1500_ioremap_fixup; // IO/MEM resources. set_io_port_base(0); @@ -253,4 +256,20 @@ au_sync(); } #endif +} + +static phys_t pb1500_ioremap_fixup(phys_t phys_addr, phys_t size) +{ + u32 pci_start = (u32)Au1500_PCI_MEM_START; + u32 pci_end = (u32)Au1500_PCI_MEM_END; + + /* Don't fixup 36 bit addresses */ + if ((phys_addr >> 32) != 0) return phys_addr; + + /* check for pci memory window */ + if ((phys_addr >= pci_start) && ((phys_addr + size) < pci_end)) { + return (phys_t)((phys_addr - pci_start) + Au1500_PCI_MEM_START); + } + else + return phys_addr; } |