You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
powerpc/fsl-pci: Unify pci/pcie initialization code
We unified the Freescale pci/pcie initialization by changing the fsl_pci to a platform driver. In previous PCI code architecture the initialization routine is called at board_setup_arch stage. Now the initialization is done in probe function which is architectural better. Also It's convenient for adding PM support for PCI controller in later patch. Now we registered pci controllers as platform devices. So we combine two initialization code as one platform driver. Signed-off-by: Jia Hongtao <B38951@freescale.com> Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
@@ -27,6 +27,16 @@ static struct of_device_id __initdata mpc85xx_common_ids[] = {
|
||||
{ .compatible = "fsl,mpc8548-guts", },
|
||||
/* Probably unnecessary? */
|
||||
{ .compatible = "gpio-leds", },
|
||||
/* For all PCI controllers */
|
||||
{ .compatible = "fsl,mpc8540-pci", },
|
||||
{ .compatible = "fsl,mpc8548-pcie", },
|
||||
{ .compatible = "fsl,p1022-pcie", },
|
||||
{ .compatible = "fsl,p1010-pcie", },
|
||||
{ .compatible = "fsl,p1023-pcie", },
|
||||
{ .compatible = "fsl,p4080-pcie", },
|
||||
{ .compatible = "fsl,qoriq-pcie-v2.4", },
|
||||
{ .compatible = "fsl,qoriq-pcie-v2.3", },
|
||||
{ .compatible = "fsl,qoriq-pcie-v2.2", },
|
||||
{},
|
||||
};
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include <linux/kdev_t.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/memblock.h>
|
||||
|
||||
#include <asm/time.h>
|
||||
#include <asm/machdep.h>
|
||||
@@ -52,39 +51,16 @@ void __init corenet_ds_pic_init(void)
|
||||
*/
|
||||
void __init corenet_ds_setup_arch(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
struct device_node *np;
|
||||
struct pci_controller *hose;
|
||||
#endif
|
||||
dma_addr_t max = 0xffffffff;
|
||||
|
||||
mpc85xx_smp_init();
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
for_each_node_by_type(np, "pci") {
|
||||
if (of_device_is_compatible(np, "fsl,p4080-pcie") ||
|
||||
of_device_is_compatible(np, "fsl,qoriq-pcie-v2.2") ||
|
||||
of_device_is_compatible(np, "fsl,qoriq-pcie-v2.3") ||
|
||||
of_device_is_compatible(np, "fsl,qoriq-pcie-v2.4")) {
|
||||
fsl_add_bridge(np, 0);
|
||||
hose = pci_find_hose_for_OF_device(np);
|
||||
max = min(max, hose->dma_window_base_cur +
|
||||
hose->dma_window_size);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PPC64
|
||||
#if defined(CONFIG_PCI) && defined(CONFIG_PPC64)
|
||||
pci_devs_phb_init();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
if ((memblock_end_of_DRAM() - 1) > max) {
|
||||
ppc_swiotlb_enable = 1;
|
||||
set_pci_dma_ops(&swiotlb_dma_ops);
|
||||
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
|
||||
}
|
||||
#endif
|
||||
fsl_pci_assign_primary();
|
||||
|
||||
swiotlb_detect_4g();
|
||||
|
||||
pr_info("%s board from Freescale Semiconductor\n", ppc_md.name);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/memblock.h>
|
||||
|
||||
#include <asm/time.h>
|
||||
#include <asm/machdep.h>
|
||||
@@ -84,9 +83,23 @@ void __init ge_imp3a_pic_init(void)
|
||||
of_node_put(cascade_node);
|
||||
}
|
||||
|
||||
static void ge_imp3a_pci_assign_primary(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
static int primary_phb_addr;
|
||||
#endif /* CONFIG_PCI */
|
||||
struct device_node *np;
|
||||
struct resource rsrc;
|
||||
|
||||
for_each_node_by_type(np, "pci") {
|
||||
if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
|
||||
of_device_is_compatible(np, "fsl,mpc8548-pcie") ||
|
||||
of_device_is_compatible(np, "fsl,p2020-pcie")) {
|
||||
of_address_to_resource(np, 0, &rsrc);
|
||||
if ((rsrc.start & 0xfffff) == 0x9000)
|
||||
fsl_pci_primary = np;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Setup the architecture
|
||||
@@ -94,43 +107,15 @@ static int primary_phb_addr;
|
||||
static void __init ge_imp3a_setup_arch(void)
|
||||
{
|
||||
struct device_node *regs;
|
||||
#ifdef CONFIG_PCI
|
||||
struct device_node *np;
|
||||
struct pci_controller *hose;
|
||||
#endif
|
||||
dma_addr_t max = 0xffffffff;
|
||||
|
||||
if (ppc_md.progress)
|
||||
ppc_md.progress("ge_imp3a_setup_arch()", 0);
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
for_each_node_by_type(np, "pci") {
|
||||
if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
|
||||
of_device_is_compatible(np, "fsl,mpc8548-pcie") ||
|
||||
of_device_is_compatible(np, "fsl,p2020-pcie")) {
|
||||
struct resource rsrc;
|
||||
of_address_to_resource(np, 0, &rsrc);
|
||||
if ((rsrc.start & 0xfffff) == primary_phb_addr)
|
||||
fsl_add_bridge(np, 1);
|
||||
else
|
||||
fsl_add_bridge(np, 0);
|
||||
|
||||
hose = pci_find_hose_for_OF_device(np);
|
||||
max = min(max, hose->dma_window_base_cur +
|
||||
hose->dma_window_size);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
mpc85xx_smp_init();
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
if ((memblock_end_of_DRAM() - 1) > max) {
|
||||
ppc_swiotlb_enable = 1;
|
||||
set_pci_dma_ops(&swiotlb_dma_ops);
|
||||
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
|
||||
}
|
||||
#endif
|
||||
ge_imp3a_pci_assign_primary();
|
||||
|
||||
swiotlb_detect_4g();
|
||||
|
||||
/* Remap basic board registers */
|
||||
regs = of_find_compatible_node(NULL, NULL, "ge,imp3a-fpga-regs");
|
||||
@@ -215,17 +200,10 @@ static int __init ge_imp3a_probe(void)
|
||||
{
|
||||
unsigned long root = of_get_flat_dt_root();
|
||||
|
||||
if (of_flat_dt_is_compatible(root, "ge,IMP3A")) {
|
||||
#ifdef CONFIG_PCI
|
||||
primary_phb_addr = 0x9000;
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return of_flat_dt_is_compatible(root, "ge,IMP3A");
|
||||
}
|
||||
|
||||
machine_device_initcall(ge_imp3a, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(ge_imp3a, mpc85xx_common_publish_devices);
|
||||
|
||||
machine_arch_initcall(ge_imp3a, swiotlb_setup_bus_notifier);
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/memblock.h>
|
||||
|
||||
#include <asm/time.h>
|
||||
#include <asm/machdep.h>
|
||||
@@ -46,46 +45,17 @@ void __init mpc8536_ds_pic_init(void)
|
||||
*/
|
||||
static void __init mpc8536_ds_setup_arch(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
struct device_node *np;
|
||||
struct pci_controller *hose;
|
||||
#endif
|
||||
dma_addr_t max = 0xffffffff;
|
||||
|
||||
if (ppc_md.progress)
|
||||
ppc_md.progress("mpc8536_ds_setup_arch()", 0);
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
for_each_node_by_type(np, "pci") {
|
||||
if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
|
||||
of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
|
||||
struct resource rsrc;
|
||||
of_address_to_resource(np, 0, &rsrc);
|
||||
if ((rsrc.start & 0xfffff) == 0x8000)
|
||||
fsl_add_bridge(np, 1);
|
||||
else
|
||||
fsl_add_bridge(np, 0);
|
||||
fsl_pci_assign_primary();
|
||||
|
||||
hose = pci_find_hose_for_OF_device(np);
|
||||
max = min(max, hose->dma_window_base_cur +
|
||||
hose->dma_window_size);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
if ((memblock_end_of_DRAM() - 1) > max) {
|
||||
ppc_swiotlb_enable = 1;
|
||||
set_pci_dma_ops(&swiotlb_dma_ops);
|
||||
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
|
||||
}
|
||||
#endif
|
||||
swiotlb_detect_4g();
|
||||
|
||||
printk("MPC8536 DS board from Freescale Semiconductor\n");
|
||||
}
|
||||
|
||||
machine_device_initcall(mpc8536_ds, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(mpc8536_ds, mpc85xx_common_publish_devices);
|
||||
|
||||
machine_arch_initcall(mpc8536_ds, swiotlb_setup_bus_notifier);
|
||||
|
||||
|
||||
@@ -137,10 +137,6 @@ static void __init init_ioports(void)
|
||||
|
||||
static void __init mpc85xx_ads_setup_arch(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
struct device_node *np;
|
||||
#endif
|
||||
|
||||
if (ppc_md.progress)
|
||||
ppc_md.progress("mpc85xx_ads_setup_arch()", 0);
|
||||
|
||||
@@ -150,11 +146,10 @@ static void __init mpc85xx_ads_setup_arch(void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
for_each_compatible_node(np, "pci", "fsl,mpc8540-pci")
|
||||
fsl_add_bridge(np, 1);
|
||||
|
||||
ppc_md.pci_exclude_device = mpc85xx_exclude_device;
|
||||
#endif
|
||||
|
||||
fsl_pci_assign_primary();
|
||||
}
|
||||
|
||||
static void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
|
||||
@@ -173,7 +168,7 @@ static void mpc85xx_ads_show_cpuinfo(struct seq_file *m)
|
||||
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
|
||||
}
|
||||
|
||||
machine_device_initcall(mpc85xx_ads, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(mpc85xx_ads, mpc85xx_common_publish_devices);
|
||||
|
||||
/*
|
||||
* Called very early, device-tree isn't unflattened
|
||||
|
||||
@@ -276,6 +276,33 @@ machine_device_initcall(mpc85xx_cds, mpc85xx_cds_8259_attach);
|
||||
|
||||
#endif /* CONFIG_PPC_I8259 */
|
||||
|
||||
static void mpc85xx_cds_pci_assign_primary(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
struct device_node *np;
|
||||
|
||||
if (fsl_pci_primary)
|
||||
return;
|
||||
|
||||
/*
|
||||
* MPC85xx_CDS has ISA bridge but unfortunately there is no
|
||||
* isa node in device tree. We now looking for i8259 node as
|
||||
* a workaround for such a broken device tree. This routine
|
||||
* is for complying to all device trees.
|
||||
*/
|
||||
np = of_find_node_by_name(NULL, "i8259");
|
||||
while ((fsl_pci_primary = of_get_parent(np))) {
|
||||
of_node_put(np);
|
||||
np = fsl_pci_primary;
|
||||
|
||||
if ((of_device_is_compatible(np, "fsl,mpc8540-pci") ||
|
||||
of_device_is_compatible(np, "fsl,mpc8548-pcie")) &&
|
||||
of_device_is_available(np))
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Setup the architecture
|
||||
*/
|
||||
@@ -309,21 +336,12 @@ static void __init mpc85xx_cds_setup_arch(void)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
for_each_node_by_type(np, "pci") {
|
||||
if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
|
||||
of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
|
||||
struct resource rsrc;
|
||||
of_address_to_resource(np, 0, &rsrc);
|
||||
if ((rsrc.start & 0xfffff) == 0x8000)
|
||||
fsl_add_bridge(np, 1);
|
||||
else
|
||||
fsl_add_bridge(np, 0);
|
||||
}
|
||||
}
|
||||
|
||||
ppc_md.pci_irq_fixup = mpc85xx_cds_pci_irq_fixup;
|
||||
ppc_md.pci_exclude_device = mpc85xx_exclude_device;
|
||||
#endif
|
||||
|
||||
mpc85xx_cds_pci_assign_primary();
|
||||
fsl_pci_assign_primary();
|
||||
}
|
||||
|
||||
static void mpc85xx_cds_show_cpuinfo(struct seq_file *m)
|
||||
@@ -355,7 +373,7 @@ static int __init mpc85xx_cds_probe(void)
|
||||
return of_flat_dt_is_compatible(root, "MPC85xxCDS");
|
||||
}
|
||||
|
||||
machine_device_initcall(mpc85xx_cds, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(mpc85xx_cds, mpc85xx_common_publish_devices);
|
||||
|
||||
define_machine(mpc85xx_cds) {
|
||||
.name = "MPC85xx CDS",
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/memblock.h>
|
||||
|
||||
#include <asm/time.h>
|
||||
#include <asm/machdep.h>
|
||||
@@ -129,13 +128,11 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
|
||||
}
|
||||
#endif /* CONFIG_PCI */
|
||||
|
||||
static void __init mpc85xx_ds_pci_init(void)
|
||||
static void __init mpc85xx_ds_uli_init(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
struct device_node *node;
|
||||
|
||||
fsl_pci_init();
|
||||
|
||||
/* See if we have a ULI under the primary */
|
||||
|
||||
node = of_find_node_by_name(NULL, "uli1575");
|
||||
@@ -160,7 +157,8 @@ static void __init mpc85xx_ds_setup_arch(void)
|
||||
ppc_md.progress("mpc85xx_ds_setup_arch()", 0);
|
||||
|
||||
swiotlb_detect_4g();
|
||||
mpc85xx_ds_pci_init();
|
||||
fsl_pci_assign_primary();
|
||||
mpc85xx_ds_uli_init();
|
||||
mpc85xx_smp_init();
|
||||
|
||||
printk("MPC85xx DS board from Freescale Semiconductor\n");
|
||||
@@ -176,9 +174,9 @@ static int __init mpc8544_ds_probe(void)
|
||||
return !!of_flat_dt_is_compatible(root, "MPC8544DS");
|
||||
}
|
||||
|
||||
machine_device_initcall(mpc8544_ds, mpc85xx_common_publish_devices);
|
||||
machine_device_initcall(mpc8572_ds, mpc85xx_common_publish_devices);
|
||||
machine_device_initcall(p2020_ds, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(mpc8544_ds, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(mpc8572_ds, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p2020_ds, mpc85xx_common_publish_devices);
|
||||
|
||||
machine_arch_initcall(mpc8544_ds, swiotlb_setup_bus_notifier);
|
||||
machine_arch_initcall(mpc8572_ds, swiotlb_setup_bus_notifier);
|
||||
|
||||
@@ -327,44 +327,16 @@ static void __init mpc85xx_mds_qeic_init(void) { }
|
||||
|
||||
static void __init mpc85xx_mds_setup_arch(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
struct pci_controller *hose;
|
||||
struct device_node *np;
|
||||
#endif
|
||||
dma_addr_t max = 0xffffffff;
|
||||
|
||||
if (ppc_md.progress)
|
||||
ppc_md.progress("mpc85xx_mds_setup_arch()", 0);
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
for_each_node_by_type(np, "pci") {
|
||||
if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
|
||||
of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
|
||||
struct resource rsrc;
|
||||
of_address_to_resource(np, 0, &rsrc);
|
||||
if ((rsrc.start & 0xfffff) == 0x8000)
|
||||
fsl_add_bridge(np, 1);
|
||||
else
|
||||
fsl_add_bridge(np, 0);
|
||||
|
||||
hose = pci_find_hose_for_OF_device(np);
|
||||
max = min(max, hose->dma_window_base_cur +
|
||||
hose->dma_window_size);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
mpc85xx_smp_init();
|
||||
|
||||
mpc85xx_mds_qe_init();
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
if ((memblock_end_of_DRAM() - 1) > max) {
|
||||
ppc_swiotlb_enable = 1;
|
||||
set_pci_dma_ops(&swiotlb_dma_ops);
|
||||
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
|
||||
}
|
||||
#endif
|
||||
fsl_pci_assign_primary();
|
||||
|
||||
swiotlb_detect_4g();
|
||||
}
|
||||
|
||||
|
||||
@@ -409,9 +381,9 @@ static int __init mpc85xx_publish_devices(void)
|
||||
return mpc85xx_common_publish_devices();
|
||||
}
|
||||
|
||||
machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices);
|
||||
machine_device_initcall(mpc8569_mds, mpc85xx_publish_devices);
|
||||
machine_device_initcall(p1021_mds, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(mpc8568_mds, mpc85xx_publish_devices);
|
||||
machine_arch_initcall(mpc8569_mds, mpc85xx_publish_devices);
|
||||
machine_arch_initcall(p1021_mds, mpc85xx_common_publish_devices);
|
||||
|
||||
machine_arch_initcall(mpc8568_mds, swiotlb_setup_bus_notifier);
|
||||
machine_arch_initcall(mpc8569_mds, swiotlb_setup_bus_notifier);
|
||||
|
||||
@@ -86,23 +86,17 @@ void __init mpc85xx_rdb_pic_init(void)
|
||||
*/
|
||||
static void __init mpc85xx_rdb_setup_arch(void)
|
||||
{
|
||||
#if defined(CONFIG_PCI) || defined(CONFIG_QUICC_ENGINE)
|
||||
#ifdef CONFIG_QUICC_ENGINE
|
||||
struct device_node *np;
|
||||
#endif
|
||||
|
||||
if (ppc_md.progress)
|
||||
ppc_md.progress("mpc85xx_rdb_setup_arch()", 0);
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
for_each_node_by_type(np, "pci") {
|
||||
if (of_device_is_compatible(np, "fsl,mpc8548-pcie"))
|
||||
fsl_add_bridge(np, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
mpc85xx_smp_init();
|
||||
|
||||
fsl_pci_assign_primary();
|
||||
|
||||
#ifdef CONFIG_QUICC_ENGINE
|
||||
np = of_find_compatible_node(NULL, NULL, "fsl,qe");
|
||||
if (!np) {
|
||||
@@ -161,15 +155,15 @@ qe_fail:
|
||||
printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n");
|
||||
}
|
||||
|
||||
machine_device_initcall(p2020_rdb, mpc85xx_common_publish_devices);
|
||||
machine_device_initcall(p2020_rdb_pc, mpc85xx_common_publish_devices);
|
||||
machine_device_initcall(p1020_mbg_pc, mpc85xx_common_publish_devices);
|
||||
machine_device_initcall(p1020_rdb, mpc85xx_common_publish_devices);
|
||||
machine_device_initcall(p1020_rdb_pc, mpc85xx_common_publish_devices);
|
||||
machine_device_initcall(p1020_utm_pc, mpc85xx_common_publish_devices);
|
||||
machine_device_initcall(p1021_rdb_pc, mpc85xx_common_publish_devices);
|
||||
machine_device_initcall(p1025_rdb, mpc85xx_common_publish_devices);
|
||||
machine_device_initcall(p1024_rdb, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p2020_rdb, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p2020_rdb_pc, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p1020_mbg_pc, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p1020_rdb, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p1020_rdb_pc, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p1020_utm_pc, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p1021_rdb_pc, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p1025_rdb, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p1024_rdb, mpc85xx_common_publish_devices);
|
||||
|
||||
/*
|
||||
* Called very early, device-tree isn't unflattened
|
||||
|
||||
@@ -46,25 +46,15 @@ void __init p1010_rdb_pic_init(void)
|
||||
*/
|
||||
static void __init p1010_rdb_setup_arch(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
struct device_node *np;
|
||||
#endif
|
||||
|
||||
if (ppc_md.progress)
|
||||
ppc_md.progress("p1010_rdb_setup_arch()", 0);
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
for_each_node_by_type(np, "pci") {
|
||||
if (of_device_is_compatible(np, "fsl,p1010-pcie"))
|
||||
fsl_add_bridge(np, 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
fsl_pci_assign_primary();
|
||||
|
||||
printk(KERN_INFO "P1010 RDB board from Freescale Semiconductor\n");
|
||||
}
|
||||
|
||||
machine_device_initcall(p1010_rdb, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p1010_rdb, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p1010_rdb, swiotlb_setup_bus_notifier);
|
||||
|
||||
/*
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include <linux/pci.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <asm/div64.h>
|
||||
#include <asm/mpic.h>
|
||||
#include <asm/swiotlb.h>
|
||||
@@ -507,32 +506,9 @@ early_param("video", early_video_setup);
|
||||
*/
|
||||
static void __init p1022_ds_setup_arch(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
struct device_node *np;
|
||||
#endif
|
||||
dma_addr_t max = 0xffffffff;
|
||||
|
||||
if (ppc_md.progress)
|
||||
ppc_md.progress("p1022_ds_setup_arch()", 0);
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
for_each_compatible_node(np, "pci", "fsl,p1022-pcie") {
|
||||
struct resource rsrc;
|
||||
struct pci_controller *hose;
|
||||
|
||||
of_address_to_resource(np, 0, &rsrc);
|
||||
|
||||
if ((rsrc.start & 0xfffff) == 0x8000)
|
||||
fsl_add_bridge(np, 1);
|
||||
else
|
||||
fsl_add_bridge(np, 0);
|
||||
|
||||
hose = pci_find_hose_for_OF_device(np);
|
||||
max = min(max, hose->dma_window_base_cur +
|
||||
hose->dma_window_size);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
|
||||
diu_ops.get_pixel_format = p1022ds_get_pixel_format;
|
||||
diu_ops.set_gamma_table = p1022ds_set_gamma_table;
|
||||
@@ -601,18 +577,14 @@ static void __init p1022_ds_setup_arch(void)
|
||||
|
||||
mpc85xx_smp_init();
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
if ((memblock_end_of_DRAM() - 1) > max) {
|
||||
ppc_swiotlb_enable = 1;
|
||||
set_pci_dma_ops(&swiotlb_dma_ops);
|
||||
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
|
||||
}
|
||||
#endif
|
||||
fsl_pci_assign_primary();
|
||||
|
||||
swiotlb_detect_4g();
|
||||
|
||||
pr_info("Freescale P1022 DS reference board\n");
|
||||
}
|
||||
|
||||
machine_device_initcall(p1022_ds, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p1022_ds, mpc85xx_common_publish_devices);
|
||||
|
||||
machine_arch_initcall(p1022_ds, swiotlb_setup_bus_notifier);
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
#include <linux/pci.h>
|
||||
#include <linux/of_platform.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <asm/div64.h>
|
||||
#include <asm/mpic.h>
|
||||
#include <asm/swiotlb.h>
|
||||
@@ -121,32 +120,9 @@ void __init p1022_rdk_pic_init(void)
|
||||
*/
|
||||
static void __init p1022_rdk_setup_arch(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
struct device_node *np;
|
||||
#endif
|
||||
dma_addr_t max = 0xffffffff;
|
||||
|
||||
if (ppc_md.progress)
|
||||
ppc_md.progress("p1022_rdk_setup_arch()", 0);
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
for_each_compatible_node(np, "pci", "fsl,p1022-pcie") {
|
||||
struct resource rsrc;
|
||||
struct pci_controller *hose;
|
||||
|
||||
of_address_to_resource(np, 0, &rsrc);
|
||||
|
||||
if ((rsrc.start & 0xfffff) == 0x8000)
|
||||
fsl_add_bridge(np, 1);
|
||||
else
|
||||
fsl_add_bridge(np, 0);
|
||||
|
||||
hose = pci_find_hose_for_OF_device(np);
|
||||
max = min(max, hose->dma_window_base_cur +
|
||||
hose->dma_window_size);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE)
|
||||
diu_ops.set_monitor_port = p1022rdk_set_monitor_port;
|
||||
diu_ops.set_pixel_clock = p1022rdk_set_pixel_clock;
|
||||
@@ -155,18 +131,14 @@ static void __init p1022_rdk_setup_arch(void)
|
||||
|
||||
mpc85xx_smp_init();
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
if ((memblock_end_of_DRAM() - 1) > max) {
|
||||
ppc_swiotlb_enable = 1;
|
||||
set_pci_dma_ops(&swiotlb_dma_ops);
|
||||
ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
|
||||
}
|
||||
#endif
|
||||
fsl_pci_assign_primary();
|
||||
|
||||
swiotlb_detect_4g();
|
||||
|
||||
pr_info("Freescale / iVeia P1022 RDK reference board\n");
|
||||
}
|
||||
|
||||
machine_device_initcall(p1022_rdk, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p1022_rdk, mpc85xx_common_publish_devices);
|
||||
|
||||
machine_arch_initcall(p1022_rdk, swiotlb_setup_bus_notifier);
|
||||
|
||||
|
||||
@@ -80,15 +80,12 @@ static void __init mpc85xx_rds_setup_arch(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
for_each_compatible_node(np, "pci", "fsl,p1023-pcie")
|
||||
fsl_add_bridge(np, 0);
|
||||
#endif
|
||||
|
||||
mpc85xx_smp_init();
|
||||
|
||||
fsl_pci_assign_primary();
|
||||
}
|
||||
|
||||
machine_device_initcall(p1023_rds, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(p1023_rds, mpc85xx_common_publish_devices);
|
||||
|
||||
static void __init mpc85xx_rds_pic_init(void)
|
||||
{
|
||||
|
||||
@@ -80,7 +80,7 @@ define_machine(p2041_rdb) {
|
||||
.power_save = e500_idle,
|
||||
};
|
||||
|
||||
machine_device_initcall(p2041_rdb, corenet_ds_publish_devices);
|
||||
machine_arch_initcall(p2041_rdb, corenet_ds_publish_devices);
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
machine_arch_initcall(p2041_rdb, swiotlb_setup_bus_notifier);
|
||||
|
||||
@@ -82,7 +82,7 @@ define_machine(p3041_ds) {
|
||||
.power_save = e500_idle,
|
||||
};
|
||||
|
||||
machine_device_initcall(p3041_ds, corenet_ds_publish_devices);
|
||||
machine_arch_initcall(p3041_ds, corenet_ds_publish_devices);
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
machine_arch_initcall(p3041_ds, swiotlb_setup_bus_notifier);
|
||||
|
||||
@@ -81,7 +81,7 @@ define_machine(p4080_ds) {
|
||||
.power_save = e500_idle,
|
||||
};
|
||||
|
||||
machine_device_initcall(p4080_ds, corenet_ds_publish_devices);
|
||||
machine_arch_initcall(p4080_ds, corenet_ds_publish_devices);
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
machine_arch_initcall(p4080_ds, swiotlb_setup_bus_notifier);
|
||||
#endif
|
||||
|
||||
@@ -91,7 +91,7 @@ define_machine(p5020_ds) {
|
||||
#endif
|
||||
};
|
||||
|
||||
machine_device_initcall(p5020_ds, corenet_ds_publish_devices);
|
||||
machine_arch_initcall(p5020_ds, corenet_ds_publish_devices);
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
machine_arch_initcall(p5020_ds, swiotlb_setup_bus_notifier);
|
||||
|
||||
@@ -82,7 +82,7 @@ define_machine(p5040_ds) {
|
||||
#endif
|
||||
};
|
||||
|
||||
machine_device_initcall(p5040_ds, corenet_ds_publish_devices);
|
||||
machine_arch_initcall(p5040_ds, corenet_ds_publish_devices);
|
||||
|
||||
#ifdef CONFIG_SWIOTLB
|
||||
machine_arch_initcall(p5040_ds, swiotlb_setup_bus_notifier);
|
||||
|
||||
@@ -41,7 +41,7 @@ static void __init qemu_e500_setup_arch(void)
|
||||
{
|
||||
ppc_md.progress("qemu_e500_setup_arch()", 0);
|
||||
|
||||
fsl_pci_init();
|
||||
fsl_pci_assign_primary();
|
||||
swiotlb_detect_4g();
|
||||
mpc85xx_smp_init();
|
||||
}
|
||||
@@ -56,7 +56,7 @@ static int __init qemu_e500_probe(void)
|
||||
return !!of_flat_dt_is_compatible(root, "fsl,qemu-e500");
|
||||
}
|
||||
|
||||
machine_device_initcall(qemu_e500, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(qemu_e500, mpc85xx_common_publish_devices);
|
||||
|
||||
define_machine(qemu_e500) {
|
||||
.name = "QEMU e500",
|
||||
|
||||
@@ -88,26 +88,11 @@ static int __init sbc8548_hw_rev(void)
|
||||
*/
|
||||
static void __init sbc8548_setup_arch(void)
|
||||
{
|
||||
#ifdef CONFIG_PCI
|
||||
struct device_node *np;
|
||||
#endif
|
||||
|
||||
if (ppc_md.progress)
|
||||
ppc_md.progress("sbc8548_setup_arch()", 0);
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
for_each_node_by_type(np, "pci") {
|
||||
if (of_device_is_compatible(np, "fsl,mpc8540-pci") ||
|
||||
of_device_is_compatible(np, "fsl,mpc8548-pcie")) {
|
||||
struct resource rsrc;
|
||||
of_address_to_resource(np, 0, &rsrc);
|
||||
if ((rsrc.start & 0xfffff) == 0x8000)
|
||||
fsl_add_bridge(np, 1);
|
||||
else
|
||||
fsl_add_bridge(np, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
fsl_pci_assign_primary();
|
||||
|
||||
sbc_rev = sbc8548_hw_rev();
|
||||
}
|
||||
|
||||
@@ -128,7 +113,7 @@ static void sbc8548_show_cpuinfo(struct seq_file *m)
|
||||
seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
|
||||
}
|
||||
|
||||
machine_device_initcall(sbc8548, mpc85xx_common_publish_devices);
|
||||
machine_arch_initcall(sbc8548, mpc85xx_common_publish_devices);
|
||||
|
||||
/*
|
||||
* Called very early, device-tree isn't unflattened
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user