diff options
author | Tony Breeds <tony@bakeyournoodle.com> | 2011-11-30 16:39:18 -0500 |
---|---|---|
committer | Josh Boyer <jwboyer@gmail.com> | 2011-12-09 07:47:48 -0500 |
commit | 8115846e1a6c27714de442669694050f8ee35850 (patch) | |
tree | 261ffcfab2c9e657909d9ac8f3f462df514bbe39 /arch/powerpc/sysdev | |
parent | 9fb552967977289f8c50b597f80583616d1fc994 (diff) |
powerpc/44x: pci: Add a want_sdr flag into ppc4xx_pciex_hwops
Currituck doesn't need nor use SDR so aborting the pci setup if there is
no sdr-base would be bad.
Add a flag to ppc4xx_pciex_hwops for the backends to state if they need
SDR and then only complain and abort if they do and it's not found in
the device tree.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
Signed-off-by: Josh Boyer <jwboyer@gmail.com>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r-- | arch/powerpc/sysdev/ppc4xx_pci.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c index 16f5eba6773..95d5eaa0caa 100644 --- a/arch/powerpc/sysdev/ppc4xx_pci.c +++ b/arch/powerpc/sysdev/ppc4xx_pci.c | |||
@@ -647,6 +647,7 @@ static unsigned int ppc4xx_pciex_port_count; | |||
647 | 647 | ||
648 | struct ppc4xx_pciex_hwops | 648 | struct ppc4xx_pciex_hwops |
649 | { | 649 | { |
650 | bool want_sdr; | ||
650 | int (*core_init)(struct device_node *np); | 651 | int (*core_init)(struct device_node *np); |
651 | int (*port_init_hw)(struct ppc4xx_pciex_port *port); | 652 | int (*port_init_hw)(struct ppc4xx_pciex_port *port); |
652 | int (*setup_utl)(struct ppc4xx_pciex_port *port); | 653 | int (*setup_utl)(struct ppc4xx_pciex_port *port); |
@@ -916,6 +917,7 @@ static int ppc440speB_pciex_init_utl(struct ppc4xx_pciex_port *port) | |||
916 | 917 | ||
917 | static struct ppc4xx_pciex_hwops ppc440speA_pcie_hwops __initdata = | 918 | static struct ppc4xx_pciex_hwops ppc440speA_pcie_hwops __initdata = |
918 | { | 919 | { |
920 | .want_sdr = true, | ||
919 | .core_init = ppc440spe_pciex_core_init, | 921 | .core_init = ppc440spe_pciex_core_init, |
920 | .port_init_hw = ppc440speA_pciex_init_port_hw, | 922 | .port_init_hw = ppc440speA_pciex_init_port_hw, |
921 | .setup_utl = ppc440speA_pciex_init_utl, | 923 | .setup_utl = ppc440speA_pciex_init_utl, |
@@ -924,6 +926,7 @@ static struct ppc4xx_pciex_hwops ppc440speA_pcie_hwops __initdata = | |||
924 | 926 | ||
925 | static struct ppc4xx_pciex_hwops ppc440speB_pcie_hwops __initdata = | 927 | static struct ppc4xx_pciex_hwops ppc440speB_pcie_hwops __initdata = |
926 | { | 928 | { |
929 | .want_sdr = true, | ||
927 | .core_init = ppc440spe_pciex_core_init, | 930 | .core_init = ppc440spe_pciex_core_init, |
928 | .port_init_hw = ppc440speB_pciex_init_port_hw, | 931 | .port_init_hw = ppc440speB_pciex_init_port_hw, |
929 | .setup_utl = ppc440speB_pciex_init_utl, | 932 | .setup_utl = ppc440speB_pciex_init_utl, |
@@ -1034,6 +1037,7 @@ static int ppc460ex_pciex_init_utl(struct ppc4xx_pciex_port *port) | |||
1034 | 1037 | ||
1035 | static struct ppc4xx_pciex_hwops ppc460ex_pcie_hwops __initdata = | 1038 | static struct ppc4xx_pciex_hwops ppc460ex_pcie_hwops __initdata = |
1036 | { | 1039 | { |
1040 | .want_sdr = true, | ||
1037 | .core_init = ppc460ex_pciex_core_init, | 1041 | .core_init = ppc460ex_pciex_core_init, |
1038 | .port_init_hw = ppc460ex_pciex_init_port_hw, | 1042 | .port_init_hw = ppc460ex_pciex_init_port_hw, |
1039 | .setup_utl = ppc460ex_pciex_init_utl, | 1043 | .setup_utl = ppc460ex_pciex_init_utl, |
@@ -1181,6 +1185,7 @@ done: | |||
1181 | } | 1185 | } |
1182 | 1186 | ||
1183 | static struct ppc4xx_pciex_hwops ppc460sx_pcie_hwops __initdata = { | 1187 | static struct ppc4xx_pciex_hwops ppc460sx_pcie_hwops __initdata = { |
1188 | .want_sdr = true, | ||
1184 | .core_init = ppc460sx_pciex_core_init, | 1189 | .core_init = ppc460sx_pciex_core_init, |
1185 | .port_init_hw = ppc460sx_pciex_init_port_hw, | 1190 | .port_init_hw = ppc460sx_pciex_init_port_hw, |
1186 | .setup_utl = ppc460sx_pciex_init_utl, | 1191 | .setup_utl = ppc460sx_pciex_init_utl, |
@@ -1276,6 +1281,7 @@ static int ppc405ex_pciex_init_utl(struct ppc4xx_pciex_port *port) | |||
1276 | 1281 | ||
1277 | static struct ppc4xx_pciex_hwops ppc405ex_pcie_hwops __initdata = | 1282 | static struct ppc4xx_pciex_hwops ppc405ex_pcie_hwops __initdata = |
1278 | { | 1283 | { |
1284 | .want_sdr = true, | ||
1279 | .core_init = ppc405ex_pciex_core_init, | 1285 | .core_init = ppc405ex_pciex_core_init, |
1280 | .port_init_hw = ppc405ex_pciex_init_port_hw, | 1286 | .port_init_hw = ppc405ex_pciex_init_port_hw, |
1281 | .setup_utl = ppc405ex_pciex_init_utl, | 1287 | .setup_utl = ppc405ex_pciex_init_utl, |
@@ -1972,13 +1978,15 @@ static void __init ppc4xx_probe_pciex_bridge(struct device_node *np) | |||
1972 | } | 1978 | } |
1973 | 1979 | ||
1974 | port->node = of_node_get(np); | 1980 | port->node = of_node_get(np); |
1975 | pval = of_get_property(np, "sdr-base", NULL); | 1981 | if (ppc4xx_pciex_hwops->want_sdr) { |
1976 | if (pval == NULL) { | 1982 | pval = of_get_property(np, "sdr-base", NULL); |
1977 | printk(KERN_ERR "PCIE: missing sdr-base for %s\n", | 1983 | if (pval == NULL) { |
1978 | np->full_name); | 1984 | printk(KERN_ERR "PCIE: missing sdr-base for %s\n", |
1979 | return; | 1985 | np->full_name); |
1986 | return; | ||
1987 | } | ||
1988 | port->sdr_base = *pval; | ||
1980 | } | 1989 | } |
1981 | port->sdr_base = *pval; | ||
1982 | 1990 | ||
1983 | /* Check if device_type property is set to "pci" or "pci-endpoint". | 1991 | /* Check if device_type property is set to "pci" or "pci-endpoint". |
1984 | * Resulting from this setup this PCIe port will be configured | 1992 | * Resulting from this setup this PCIe port will be configured |