2009-08-07 22:35:16 +07:00
|
|
|
/*
|
|
|
|
* MPC85xx RDB Board Setup
|
|
|
|
*
|
|
|
|
* Copyright 2009 Freescale Semiconductor Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
|
|
* option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/stddef.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/pci.h>
|
|
|
|
#include <linux/kdev_t.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/seq_file.h>
|
|
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <linux/of_platform.h>
|
|
|
|
|
|
|
|
#include <asm/system.h>
|
|
|
|
#include <asm/time.h>
|
|
|
|
#include <asm/machdep.h>
|
|
|
|
#include <asm/pci-bridge.h>
|
|
|
|
#include <mm/mmu_decl.h>
|
|
|
|
#include <asm/prom.h>
|
|
|
|
#include <asm/udbg.h>
|
|
|
|
#include <asm/mpic.h>
|
|
|
|
|
|
|
|
#include <sysdev/fsl_soc.h>
|
|
|
|
#include <sysdev/fsl_pci.h>
|
2011-12-02 13:27:58 +07:00
|
|
|
#include "smp.h"
|
2009-08-07 22:35:16 +07:00
|
|
|
|
2011-11-18 00:56:16 +07:00
|
|
|
#include "mpc85xx.h"
|
|
|
|
|
2009-08-07 22:35:16 +07:00
|
|
|
#undef DEBUG
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
#define DBG(fmt, args...) printk(KERN_ERR "%s: " fmt, __func__, ## args)
|
|
|
|
#else
|
|
|
|
#define DBG(fmt, args...)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
void __init mpc85xx_rdb_pic_init(void)
|
|
|
|
{
|
|
|
|
struct mpic *mpic;
|
powerpc/85xx: Create dts for each core in CAMP mode for P2020RDB
This patch creates the dts files for each core and splits the devices
between the two cores for P2020RDB.
core0 has memory, L2, i2c, spi, dma1, usb, eth0, eth1, crypto,
global-util, pci0,
core1 has L2, dma2, eth0, pci1, msi.
MPIC is shared between two cores but each core will protect its
interrupts from other core by using "protected-sources" of mpic.
Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-09-20 00:13:56 +07:00
|
|
|
unsigned long root = of_get_flat_dt_root();
|
2009-08-07 22:35:16 +07:00
|
|
|
|
2011-07-12 14:49:43 +07:00
|
|
|
if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) {
|
2011-12-22 17:19:14 +07:00
|
|
|
mpic = mpic_alloc(NULL, 0, MPIC_NO_RESET |
|
2011-12-22 17:19:12 +07:00
|
|
|
MPIC_BIG_ENDIAN |
|
2011-07-12 14:49:43 +07:00
|
|
|
MPIC_SINGLE_DEST_CPU,
|
powerpc/85xx: Create dts for each core in CAMP mode for P2020RDB
This patch creates the dts files for each core and splits the devices
between the two cores for P2020RDB.
core0 has memory, L2, i2c, spi, dma1, usb, eth0, eth1, crypto,
global-util, pci0,
core1 has L2, dma2, eth0, pci1, msi.
MPIC is shared between two cores but each core will protect its
interrupts from other core by using "protected-sources" of mpic.
Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-09-20 00:13:56 +07:00
|
|
|
0, 256, " OpenPIC ");
|
|
|
|
} else {
|
2011-12-02 13:28:02 +07:00
|
|
|
mpic = mpic_alloc(NULL, 0,
|
2011-12-22 17:19:12 +07:00
|
|
|
MPIC_BIG_ENDIAN |
|
2009-08-07 22:35:16 +07:00
|
|
|
MPIC_SINGLE_DEST_CPU,
|
|
|
|
0, 256, " OpenPIC ");
|
powerpc/85xx: Create dts for each core in CAMP mode for P2020RDB
This patch creates the dts files for each core and splits the devices
between the two cores for P2020RDB.
core0 has memory, L2, i2c, spi, dma1, usb, eth0, eth1, crypto,
global-util, pci0,
core1 has L2, dma2, eth0, pci1, msi.
MPIC is shared between two cores but each core will protect its
interrupts from other core by using "protected-sources" of mpic.
Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2009-09-20 00:13:56 +07:00
|
|
|
}
|
2009-08-07 22:35:16 +07:00
|
|
|
|
|
|
|
BUG_ON(mpic == NULL);
|
|
|
|
mpic_init(mpic);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Setup the architecture
|
|
|
|
*/
|
|
|
|
static void __init mpc85xx_rdb_setup_arch(void)
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_PCI
|
|
|
|
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();
|
|
|
|
printk(KERN_INFO "MPC85xx RDB board from Freescale Semiconductor\n");
|
|
|
|
}
|
|
|
|
|
2011-11-18 00:56:17 +07:00
|
|
|
machine_device_initcall(p2020_rdb, mpc85xx_common_publish_devices);
|
2011-12-28 10:41:47 +07:00
|
|
|
machine_device_initcall(p2020_rdb_pc, mpc85xx_common_publish_devices);
|
2011-11-18 00:56:17 +07:00
|
|
|
machine_device_initcall(p1020_rdb, mpc85xx_common_publish_devices);
|
2012-01-17 15:01:30 +07:00
|
|
|
machine_device_initcall(p1021_rdb_pc, mpc85xx_common_publish_devices);
|
2012-02-14 05:06:22 +07:00
|
|
|
machine_device_initcall(p1025_rdb, mpc85xx_common_publish_devices);
|
2009-08-07 22:35:16 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Called very early, device-tree isn't unflattened
|
|
|
|
*/
|
|
|
|
static int __init p2020_rdb_probe(void)
|
|
|
|
{
|
|
|
|
unsigned long root = of_get_flat_dt_root();
|
|
|
|
|
|
|
|
if (of_flat_dt_is_compatible(root, "fsl,P2020RDB"))
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-09-25 11:20:28 +07:00
|
|
|
static int __init p1020_rdb_probe(void)
|
|
|
|
{
|
|
|
|
unsigned long root = of_get_flat_dt_root();
|
|
|
|
|
|
|
|
if (of_flat_dt_is_compatible(root, "fsl,P1020RDB"))
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-01-17 15:01:30 +07:00
|
|
|
static int __init p1021_rdb_pc_probe(void)
|
|
|
|
{
|
|
|
|
unsigned long root = of_get_flat_dt_root();
|
|
|
|
|
|
|
|
if (of_flat_dt_is_compatible(root, "fsl,P1021RDB-PC"))
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-12-28 10:41:47 +07:00
|
|
|
static int __init p2020_rdb_pc_probe(void)
|
|
|
|
{
|
|
|
|
unsigned long root = of_get_flat_dt_root();
|
|
|
|
|
|
|
|
if (of_flat_dt_is_compatible(root, "fsl,P2020RDB-PC"))
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-02-14 05:06:22 +07:00
|
|
|
static int __init p1025_rdb_probe(void)
|
|
|
|
{
|
|
|
|
unsigned long root = of_get_flat_dt_root();
|
|
|
|
|
|
|
|
return of_flat_dt_is_compatible(root, "fsl,P1025RDB");
|
|
|
|
}
|
|
|
|
|
2009-08-07 22:35:16 +07:00
|
|
|
define_machine(p2020_rdb) {
|
|
|
|
.name = "P2020 RDB",
|
|
|
|
.probe = p2020_rdb_probe,
|
|
|
|
.setup_arch = mpc85xx_rdb_setup_arch,
|
|
|
|
.init_IRQ = mpc85xx_rdb_pic_init,
|
|
|
|
#ifdef CONFIG_PCI
|
|
|
|
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
|
|
|
|
#endif
|
|
|
|
.get_irq = mpic_get_irq,
|
|
|
|
.restart = fsl_rstcr_restart,
|
|
|
|
.calibrate_decr = generic_calibrate_decr,
|
|
|
|
.progress = udbg_progress,
|
|
|
|
};
|
2009-09-25 11:20:28 +07:00
|
|
|
|
|
|
|
define_machine(p1020_rdb) {
|
|
|
|
.name = "P1020 RDB",
|
|
|
|
.probe = p1020_rdb_probe,
|
|
|
|
.setup_arch = mpc85xx_rdb_setup_arch,
|
|
|
|
.init_IRQ = mpc85xx_rdb_pic_init,
|
|
|
|
#ifdef CONFIG_PCI
|
|
|
|
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
|
|
|
|
#endif
|
|
|
|
.get_irq = mpic_get_irq,
|
|
|
|
.restart = fsl_rstcr_restart,
|
|
|
|
.calibrate_decr = generic_calibrate_decr,
|
|
|
|
.progress = udbg_progress,
|
|
|
|
};
|
2012-01-17 15:01:30 +07:00
|
|
|
|
|
|
|
define_machine(p1021_rdb_pc) {
|
|
|
|
.name = "P1021 RDB-PC",
|
|
|
|
.probe = p1021_rdb_pc_probe,
|
|
|
|
.setup_arch = mpc85xx_rdb_setup_arch,
|
|
|
|
.init_IRQ = mpc85xx_rdb_pic_init,
|
|
|
|
#ifdef CONFIG_PCI
|
|
|
|
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
|
|
|
|
#endif
|
|
|
|
.get_irq = mpic_get_irq,
|
|
|
|
.restart = fsl_rstcr_restart,
|
|
|
|
.calibrate_decr = generic_calibrate_decr,
|
|
|
|
.progress = udbg_progress,
|
|
|
|
};
|
2011-12-28 10:41:47 +07:00
|
|
|
|
|
|
|
define_machine(p2020_rdb_pc) {
|
|
|
|
.name = "P2020RDB-PC",
|
|
|
|
.probe = p2020_rdb_pc_probe,
|
|
|
|
.setup_arch = mpc85xx_rdb_setup_arch,
|
|
|
|
.init_IRQ = mpc85xx_rdb_pic_init,
|
|
|
|
#ifdef CONFIG_PCI
|
|
|
|
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
|
|
|
|
#endif
|
|
|
|
.get_irq = mpic_get_irq,
|
|
|
|
.restart = fsl_rstcr_restart,
|
|
|
|
.calibrate_decr = generic_calibrate_decr,
|
|
|
|
.progress = udbg_progress,
|
|
|
|
};
|
2012-02-14 05:06:22 +07:00
|
|
|
|
|
|
|
define_machine(p1025_rdb) {
|
|
|
|
.name = "P1025 RDB",
|
|
|
|
.probe = p1025_rdb_probe,
|
|
|
|
.setup_arch = mpc85xx_rdb_setup_arch,
|
|
|
|
.init_IRQ = mpc85xx_rdb_pic_init,
|
|
|
|
#ifdef CONFIG_PCI
|
|
|
|
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
|
|
|
|
#endif
|
|
|
|
.get_irq = mpic_get_irq,
|
|
|
|
.restart = fsl_rstcr_restart,
|
|
|
|
.calibrate_decr = generic_calibrate_decr,
|
|
|
|
.progress = udbg_progress,
|
|
|
|
};
|