Release 4.14 arch/powerpc/platforms/85xx/xes_mpc85xx.c
/*
* Copyright (C) 2009 Extreme Engineering Solutions, Inc.
*
* X-ES board-specific functionality
*
* Based on mpc85xx_ds code from Freescale Semiconductor, Inc.
*
* Author: Nate Case <ncase@xes-inc.com>
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#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/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>
#include "smp.h"
#include "mpc85xx.h"
/* A few bit definitions needed for fixups on some boards */
#define MPC85xx_L2CTL_L2E 0x80000000
/* L2 enable */
#define MPC85xx_L2CTL_L2I 0x40000000
/* L2 flash invalidate */
#define MPC85xx_L2CTL_L2SIZ_MASK 0x30000000
/* L2 SRAM size (R/O) */
void __init xes_mpc85xx_pic_init(void)
{
struct mpic *mpic = mpic_alloc(NULL, 0, MPIC_BIG_ENDIAN,
0, 256, " OpenPIC ");
BUG_ON(mpic == NULL);
mpic_init(mpic);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Nate Case | 36 | 90.00% | 1 | 33.33% |
Kyle Moffett | 4 | 10.00% | 2 | 66.67% |
Total | 40 | 100.00% | 3 | 100.00% |
static void xes_mpc85xx_configure_l2(void __iomem *l2_base)
{
volatile uint32_t ctl, tmp;
asm volatile("msync; isync");
tmp = in_be32(l2_base);
/*
* xMon may have enabled part of L2 as SRAM, so we need to set it
* up for all cache mode just to be safe.
*/
printk(KERN_INFO "xes_mpc85xx: Enabling L2 as cache\n");
ctl = MPC85xx_L2CTL_L2E | MPC85xx_L2CTL_L2I;
if (of_machine_is_compatible("MPC8540") ||
of_machine_is_compatible("MPC8560"))
/*
* Assume L2 SRAM is used fully for cache, so set
* L2BLKSZ (bits 4:5) to match L2SIZ (bits 2:3).
*/
ctl |= (tmp & MPC85xx_L2CTL_L2SIZ_MASK) >> 2;
asm volatile("msync; isync");
out_be32(l2_base, ctl);
asm volatile("msync; isync");
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Nate Case | 74 | 97.37% | 1 | 50.00% |
Grant C. Likely | 2 | 2.63% | 1 | 50.00% |
Total | 76 | 100.00% | 2 | 100.00% |
static void xes_mpc85xx_fixups(void)
{
struct device_node *np;
int err;
/*
* Legacy xMon firmware on some X-ES boards does not enable L2
* as cache. We must ensure that they get enabled here.
*/
for_each_node_by_name(np, "l2-cache-controller") {
struct resource r[2];
void __iomem *l2_base;
/* Only MPC8548, MPC8540, and MPC8560 boards are affected */
if (!of_device_is_compatible(np,
"fsl,mpc8548-l2-cache-controller") &&
!of_device_is_compatible(np,
"fsl,mpc8540-l2-cache-controller") &&
!of_device_is_compatible(np,
"fsl,mpc8560-l2-cache-controller"))
continue;
err = of_address_to_resource(np, 0, &r[0]);
if (err) {
printk(KERN_WARNING "xes_mpc85xx: Could not get "
"resource for device tree node '%pOF'",
np);
continue;
}
l2_base = ioremap(r[0].start, resource_size(&r[0]));
xes_mpc85xx_configure_l2(l2_base);
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Nate Case | 117 | 95.90% | 1 | 33.33% |
Joe Perches | 4 | 3.28% | 1 | 33.33% |
Rob Herring | 1 | 0.82% | 1 | 33.33% |
Total | 122 | 100.00% | 3 | 100.00% |
/*
* Setup the architecture
*/
static void __init xes_mpc85xx_setup_arch(void)
{
struct device_node *root;
const char *model = "Unknown";
root = of_find_node_by_path("/");
if (root == NULL)
return;
model = of_get_property(root, "model", NULL);
printk(KERN_INFO "X-ES MPC85xx-based single-board computer: %s\n",
model + strlen("xes,"));
xes_mpc85xx_fixups();
mpc85xx_smp_init();
fsl_pci_assign_primary();
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Nate Case | 65 | 95.59% | 1 | 50.00% |
Jia Hongtao | 3 | 4.41% | 1 | 50.00% |
Total | 68 | 100.00% | 2 | 100.00% |
machine_arch_initcall(xes_mpc8572, mpc85xx_common_publish_devices);
machine_arch_initcall(xes_mpc8548, mpc85xx_common_publish_devices);
machine_arch_initcall(xes_mpc8540, mpc85xx_common_publish_devices);
/*
* Called very early, device-tree isn't unflattened
*/
static int __init xes_mpc8572_probe(void)
{
return of_machine_is_compatible("xes,MPC8572");
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Nate Case | 13 | 86.67% | 1 | 33.33% |
Jia Hongtao | 1 | 6.67% | 1 | 33.33% |
Benjamin Herrenschmidt | 1 | 6.67% | 1 | 33.33% |
Total | 15 | 100.00% | 3 | 100.00% |
static int __init xes_mpc8548_probe(void)
{
return of_machine_is_compatible("xes,MPC8548");
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Nate Case | 13 | 86.67% | 1 | 33.33% |
Jia Hongtao | 1 | 6.67% | 1 | 33.33% |
Benjamin Herrenschmidt | 1 | 6.67% | 1 | 33.33% |
Total | 15 | 100.00% | 3 | 100.00% |
static int __init xes_mpc8540_probe(void)
{
return of_machine_is_compatible("xes,MPC8540");
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Nate Case | 13 | 86.67% | 1 | 33.33% |
Jia Hongtao | 1 | 6.67% | 1 | 33.33% |
Benjamin Herrenschmidt | 1 | 6.67% | 1 | 33.33% |
Total | 15 | 100.00% | 3 | 100.00% |
define_machine(xes_mpc8572)
{
.name = "X-ES MPC8572",
.probe = xes_mpc8572_probe,
.setup_arch = xes_mpc85xx_setup_arch,
.init_IRQ = xes_mpc85xx_pic_init,
#ifdef CONFIG_PCI
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
.pcibios_fixup_phb = fsl_pcibios_fixup_phb,
#endif
.get_irq = mpic_get_irq,
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
};
define_machine(xes_mpc8548)
{
.name = "X-ES MPC8548",
.probe = xes_mpc8548_probe,
.setup_arch = xes_mpc85xx_setup_arch,
.init_IRQ = xes_mpc85xx_pic_init,
#ifdef CONFIG_PCI
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
.pcibios_fixup_phb = fsl_pcibios_fixup_phb,
#endif
.get_irq = mpic_get_irq,
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
};
define_machine(xes_mpc8540)
{
.name = "X-ES MPC8540",
.probe = xes_mpc8540_probe,
.setup_arch = xes_mpc85xx_setup_arch,
.init_IRQ = xes_mpc85xx_pic_init,
#ifdef CONFIG_PCI
.pcibios_fixup_bus = fsl_pcibios_fixup_bus,
.pcibios_fixup_phb = fsl_pcibios_fixup_phb,
#endif
.get_irq = mpic_get_irq,
.calibrate_decr = generic_calibrate_decr,
.progress = udbg_progress,
};
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Nate Case | 572 | 92.41% | 1 | 8.33% |
Dongsheng Wang | 15 | 2.42% | 1 | 8.33% |
Jia Hongtao | 9 | 1.45% | 1 | 8.33% |
Kyle Moffett | 7 | 1.13% | 3 | 25.00% |
Dmitry Baryshkov | 6 | 0.97% | 2 | 16.67% |
Joe Perches | 4 | 0.65% | 1 | 8.33% |
Benjamin Herrenschmidt | 3 | 0.48% | 1 | 8.33% |
Grant C. Likely | 2 | 0.32% | 1 | 8.33% |
Rob Herring | 1 | 0.16% | 1 | 8.33% |
Total | 619 | 100.00% | 12 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.