2009-08-07 15:35:16 +00: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 06:27:58 +00:00
|
|
|
#include "smp.h"
|
2009-08-07 15:35:16 +00:00
|
|
|
|
2011-11-17 17:56:16 +00:00
|
|
|
#include "mpc85xx.h"
|
|
|
|
|
2009-08-07 15:35:16 +00: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-19 17:13:56 +00:00
|
|
|
unsigned long root = of_get_flat_dt_root();
|
2009-08-07 15:35:16 +00:00
|
|
|
|
2011-07-12 07:49:43 +00:00
|
|
|
if (of_flat_dt_is_compatible(root, "fsl,MPC85XXRDB-CAMP")) {
|
2011-12-02 06:28:02 +00:00
|
|
|
mpic = mpic_alloc(NULL, 0,
|
2011-07-12 07:49:43 +00:00
|
|
|
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
|
|
|
|
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-19 17:13:56 +00:00
|
|
|
0, 256, " OpenPIC ");
|
|
|
|
} else {
|
2011-12-02 06:28:02 +00:00
|
|
|
mpic = mpic_alloc(NULL, 0,
|
2011-12-02 06:28:03 +00:00
|
|
|
MPIC_WANTS_RESET |
|
2009-08-07 15:35:16 +00:00
|
|
|
MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS |
|
|
|
|
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-19 17:13:56 +00:00
|
|
|
}
|
2009-08-07 15:35:16 +00: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-17 17:56:17 +00:00
|
|
|
machine_device_initcall(p2020_rdb, mpc85xx_common_publish_devices);
|
|
|
|
machine_device_initcall(p1020_rdb, mpc85xx_common_publish_devices);
|
2009-08-07 15:35:16 +00: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 04:20:28 +00: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;
|
|
|
|
}
|
|
|
|
|
2009-08-07 15:35:16 +00: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 04:20:28 +00: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,
|
|
|
|
};
|