]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sh: pci-sh7780: fix pci memory address mask
authorYoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Thu, 27 Nov 2008 09:57:35 +0000 (18:57 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Mon, 22 Dec 2008 09:43:50 +0000 (18:43 +0900)
Fix the problem that cannot work a PCI device when system memory size is
256Mbyte in 29bit address mode.

Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/drivers/pci/pci-sh7780.c

index b2a2bfa3c1bd244397ac17b5749abe2bf25172c5..078dc44d6b08b8a6e5fc2090e832e8f5d6fcb977 100644 (file)
@@ -123,16 +123,14 @@ int __init sh7780_pcic_init(struct sh4_pci_address_map *map)
         * Window0 = map->window0.size @ non-cached area base = SDRAM
         * Window1 = map->window1.size @ cached area base = SDRAM
         */
-       word = ((map->window0.size - 1) & 0x1ff00001) | 0x01;
-       pci_write_reg(0x07f00001, SH4_PCILSR0);
-       word = ((map->window1.size - 1) & 0x1ff00001) | 0x01;
+       word = (CONFIG_MEMORY_SIZE - 0x00100000) | 0x00000001;
+       pci_write_reg(word, SH4_PCILSR0);
        pci_write_reg(0x00000001, SH4_PCILSR1);
        /* Set the values on window 0 PCI config registers */
-       word = P2SEGADDR(map->window0.base);
-       pci_write_reg(0xa8000000, SH4_PCILAR0);
-       pci_write_reg(0x08000000, SH7780_PCIMBAR0);
+       word = (CONFIG_MEMORY_SIZE > 0x08000000) ? 0x10000000 : 0x08000000;
+       pci_write_reg(word | 0xa0000000, SH4_PCILAR0);
+       pci_write_reg(word, SH7780_PCIMBAR0);
        /* Set the values on window 1 PCI config registers */
-       word = P2SEGADDR(map->window1.base);
        pci_write_reg(0x00000000, SH4_PCILAR1);
        pci_write_reg(0x00000000, SH7780_PCIMBAR1);