From 06e2735eb85cbea7cecb3c308d6d078b3651b22c Mon Sep 17 00:00:00 2001 From: Yoshihiro Shimoda Date: Wed, 25 Feb 2009 14:26:52 +0900 Subject: sh: Add system memory registration to PCI for SH4 It is necessary for some pci device driver. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Nobuhiro Iwamatsu --- drivers/pci/pci_sh4.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers') diff --git a/drivers/pci/pci_sh4.c b/drivers/pci/pci_sh4.c index 057b6ddc99f..c7963ed8a8c 100644 --- a/drivers/pci/pci_sh4.c +++ b/drivers/pci/pci_sh4.c @@ -54,6 +54,16 @@ int pci_sh4_init(struct pci_controller *hose) PCI_REGION_IO); hose->region_count++; +#if defined(CONFIG_PCI_SYS_BUS) + /* PCI System Memory space */ + pci_set_region(hose->regions + 2, + CONFIG_PCI_SYS_BUS, + CONFIG_PCI_SYS_PHYS, + CONFIG_PCI_SYS_SIZE, + PCI_REGION_MEM | PCI_REGION_SYS_MEMORY); + hose->region_count++; +#endif + udelay(1000); pci_set_ops(hose, -- cgit v1.2.3 From 06b18163b57e6b0349b0c299222d50e7b1e41e50 Mon Sep 17 00:00:00 2001 From: Yoshihiro Shimoda Date: Wed, 25 Feb 2009 14:26:42 +0900 Subject: sh: Add some register value configurable to PCI of SH7780 Some register value was hardcoded for System memory size 128MB and memory offset 0x08000000. This patch fixed the problem. Signed-off-by: Yoshihiro Shimoda Signed-off-by: Nobuhiro Iwamatsu --- drivers/pci/pci_sh7780.c | 6 +++--- include/configs/r7780mp.h | 3 +++ include/configs/sh7785lcr.h | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/pci/pci_sh7780.c b/drivers/pci/pci_sh7780.c index 7555d96060b..bc06f49e099 100644 --- a/drivers/pci/pci_sh7780.c +++ b/drivers/pci/pci_sh7780.c @@ -85,11 +85,11 @@ int pci_sh7780_init(struct pci_controller *hose) p4_out(SH7780_PCICR_PREFIX, SH7780_PCICR); p4_outw(0x0047, SH7780_PCICMD); - p4_out(0x07F00001, SH7780_PCILSR0); - p4_out(0x08000000, SH7780_PCILAR0); + p4_out(CONFIG_SH7780_PCI_LSR, SH7780_PCILSR0); + p4_out(CONFIG_SH7780_PCI_LAR, SH7780_PCILAR0); p4_out(0x00000000, SH7780_PCILSR1); p4_out(0, SH7780_PCILAR1); - p4_out(0x08000000, SH7780_PCIMBAR0); + p4_out(CONFIG_SH7780_PCI_BAR, SH7780_PCIMBAR0); p4_out(0x00000000, SH7780_PCIMBAR1); p4_out(0xFD000000, SH7780_PCIMBR0); diff --git a/include/configs/r7780mp.h b/include/configs/r7780mp.h index 72a3b5c8b1f..88eb56821f6 100644 --- a/include/configs/r7780mp.h +++ b/include/configs/r7780mp.h @@ -129,6 +129,9 @@ #define CONFIG_PCI #define CONFIG_SH4_PCI #define CONFIG_SH7780_PCI +#define CONFIG_SH7780_PCI_LSR 0x07f00001 +#define CONFIG_SH7780_PCI_LAR CONFIG_SYS_SDRAM_SIZE +#define CONFIG_SH7780_PCI_BAR CONFIG_SYS_SDRAM_SIZE #define CONFIG_PCI_PNP #define CONFIG_PCI_SCAN_SHOW 1 #define __io diff --git a/include/configs/sh7785lcr.h b/include/configs/sh7785lcr.h index b4361caf6ee..94c8d6b790c 100644 --- a/include/configs/sh7785lcr.h +++ b/include/configs/sh7785lcr.h @@ -133,6 +133,9 @@ #define CONFIG_PCI #define CONFIG_SH4_PCI #define CONFIG_SH7780_PCI +#define CONFIG_SH7780_PCI_LSR 0x07f00001 +#define CONFIG_SH7780_PCI_LAR CONFIG_SYS_SDRAM_SIZE +#define CONFIG_SH7780_PCI_BAR CONFIG_SYS_SDRAM_SIZE #define CONFIG_PCI_PNP #define CONFIG_PCI_SCAN_SHOW 1 -- cgit v1.2.3