Path: blob/master/arch/powerpc/platforms/cell/qpace_setup.c
10818 views
/*1* linux/arch/powerpc/platforms/cell/qpace_setup.c2*3* Copyright (C) 1995 Linus Torvalds4* Adapted from 'alpha' version by Gary Thomas5* Modified by Cort Dougan ([email protected])6* Modified by PPC64 Team, IBM Corp7* Modified by Cell Team, IBM Deutschland Entwicklung GmbH8* Modified by Benjamin Krill <[email protected]>, IBM Corp.9*10* This program is free software; you can redistribute it and/or11* modify it under the terms of the GNU General Public License12* as published by the Free Software Foundation; either version13* 2 of the License, or (at your option) any later version.14*/1516#include <linux/sched.h>17#include <linux/kernel.h>18#include <linux/init.h>19#include <linux/delay.h>20#include <linux/irq.h>21#include <linux/console.h>22#include <linux/of_platform.h>2324#include <asm/mmu.h>25#include <asm/processor.h>26#include <asm/io.h>27#include <asm/kexec.h>28#include <asm/pgtable.h>29#include <asm/prom.h>30#include <asm/rtas.h>31#include <asm/dma.h>32#include <asm/machdep.h>33#include <asm/time.h>34#include <asm/cputable.h>35#include <asm/irq.h>36#include <asm/spu.h>37#include <asm/spu_priv1.h>38#include <asm/udbg.h>39#include <asm/cell-regs.h>4041#include "interrupt.h"42#include "pervasive.h"43#include "ras.h"4445static void qpace_show_cpuinfo(struct seq_file *m)46{47struct device_node *root;48const char *model = "";4950root = of_find_node_by_path("/");51if (root)52model = of_get_property(root, "model", NULL);53seq_printf(m, "machine\t\t: CHRP %s\n", model);54of_node_put(root);55}5657static void qpace_progress(char *s, unsigned short hex)58{59printk("*** %04x : %s\n", hex, s ? s : "");60}6162static const struct of_device_id qpace_bus_ids[] __initdata = {63{ .type = "soc", },64{ .compatible = "soc", },65{ .type = "spider", },66{ .type = "axon", },67{ .type = "plb5", },68{ .type = "plb4", },69{ .type = "opb", },70{ .type = "ebc", },71{},72};7374static int __init qpace_publish_devices(void)75{76int node;7778/* Publish OF platform devices for southbridge IOs */79of_platform_bus_probe(NULL, qpace_bus_ids, NULL);8081/* There is no device for the MIC memory controller, thus we create82* a platform device for it to attach the EDAC driver to.83*/84for_each_online_node(node) {85if (cbe_get_cpu_mic_tm_regs(cbe_node_to_cpu(node)) == NULL)86continue;87platform_device_register_simple("cbe-mic", node, NULL, 0);88}8990return 0;91}92machine_subsys_initcall(qpace, qpace_publish_devices);9394static void __init qpace_setup_arch(void)95{96#ifdef CONFIG_SPU_BASE97spu_priv1_ops = &spu_priv1_mmio_ops;98spu_management_ops = &spu_management_of_ops;99#endif100101cbe_regs_init();102103#ifdef CONFIG_CBE_RAS104cbe_ras_init();105#endif106107#ifdef CONFIG_SMP108smp_init_cell();109#endif110111/* init to some ~sane value until calibrate_delay() runs */112loops_per_jiffy = 50000000;113114cbe_pervasive_init();115#ifdef CONFIG_DUMMY_CONSOLE116conswitchp = &dummy_con;117#endif118}119120static int __init qpace_probe(void)121{122unsigned long root = of_get_flat_dt_root();123124if (!of_flat_dt_is_compatible(root, "IBM,QPACE"))125return 0;126127hpte_init_native();128129return 1;130}131132define_machine(qpace) {133.name = "QPACE",134.probe = qpace_probe,135.setup_arch = qpace_setup_arch,136.show_cpuinfo = qpace_show_cpuinfo,137.restart = rtas_restart,138.power_off = rtas_power_off,139.halt = rtas_halt,140.get_boot_time = rtas_get_boot_time,141.get_rtc_time = rtas_get_rtc_time,142.set_rtc_time = rtas_set_rtc_time,143.calibrate_decr = generic_calibrate_decr,144.progress = qpace_progress,145.init_IRQ = iic_init_IRQ,146};147148149