2 * linux/arch/powerpc/platforms/cell/cell_setup.c
4 * Copyright (C) 1995 Linus Torvalds
5 * Adapted from 'alpha' version by Gary Thomas
6 * Modified by Cort Dougan (cort@cs.nmt.edu)
7 * Modified by PPC64 Team, IBM Corp
8 * Modified by Cell Team, IBM Deutschland Entwicklung GmbH
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
17 #include <linux/config.h>
18 #include <linux/sched.h>
19 #include <linux/kernel.h>
21 #include <linux/stddef.h>
22 #include <linux/unistd.h>
23 #include <linux/slab.h>
24 #include <linux/user.h>
25 #include <linux/reboot.h>
26 #include <linux/init.h>
27 #include <linux/delay.h>
28 #include <linux/irq.h>
29 #include <linux/seq_file.h>
30 #include <linux/root_dev.h>
31 #include <linux/console.h>
32 #include <linux/mutex.h>
33 #include <linux/memory_hotplug.h>
36 #include <asm/processor.h>
38 #include <asm/kexec.h>
39 #include <asm/pgtable.h>
42 #include <asm/pci-bridge.h>
43 #include <asm/iommu.h>
45 #include <asm/machdep.h>
47 #include <asm/nvram.h>
48 #include <asm/cputable.h>
49 #include <asm/ppc-pci.h>
53 #include "interrupt.h"
55 #include "pervasive.h"
58 #define DBG(fmt...) udbg_printf(fmt)
63 static void cell_show_cpuinfo(struct seq_file *m)
65 struct device_node *root;
66 const char *model = "";
68 root = of_find_node_by_path("/");
70 model = get_property(root, "model", NULL);
71 seq_printf(m, "machine\t\t: CHRP %s\n", model);
75 static void cell_progress(char *s, unsigned short hex)
77 printk("*** %04x : %s\n", hex, s ? s : "");
80 static void __init cell_setup_arch(void)
82 ppc_md.init_IRQ = iic_init_IRQ;
83 ppc_md.get_irq = iic_get_irq;
89 /* init to some ~sane value until calibrate_delay() runs */
90 loops_per_jiffy = 50000000;
93 printk("No ramdisk, default root is /dev/hda2\n");
97 /* Find and initialize PCI host bridges */
98 init_pci_config_tokens();
101 cell_pervasive_init();
102 #ifdef CONFIG_DUMMY_CONSOLE
103 conswitchp = &dummy_con;
110 * Early initialization. Relocation is on but do not reference unbolted pages
112 static void __init cell_init_early(void)
114 DBG(" -> cell_init_early()\n");
120 ppc64_interrupt_controller = IC_CELL_PIC;
122 DBG(" <- cell_init_early()\n");
126 static int __init cell_probe(void)
128 /* XXX This is temporary, the Cell maintainer will come up with
129 * more appropriate detection logic
131 unsigned long root = of_get_flat_dt_root();
132 if (!of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
139 * Cell has no legacy IO; anything calling this function has to
140 * fail or bad things will happen
142 static int cell_check_legacy_ioport(unsigned int baseport)
147 define_machine(cell) {
150 .setup_arch = cell_setup_arch,
151 .init_early = cell_init_early,
152 .show_cpuinfo = cell_show_cpuinfo,
153 .restart = rtas_restart,
154 .power_off = rtas_power_off,
156 .get_boot_time = rtas_get_boot_time,
157 .get_rtc_time = rtas_get_rtc_time,
158 .set_rtc_time = rtas_set_rtc_time,
159 .calibrate_decr = generic_calibrate_decr,
160 .check_legacy_ioport = cell_check_legacy_ioport,
161 .progress = cell_progress,
163 .machine_kexec = default_machine_kexec,
164 .machine_kexec_prepare = default_machine_kexec_prepare,
165 .machine_crash_shutdown = default_machine_crash_shutdown,