4 * (C) Copyright 2006-2007 TOSHIBA CORPORATION
6 * This code is based on arch/powerpc/platforms/cell/setup.c:
7 * Copyright (C) 1995 Linus Torvalds
8 * Adapted from 'alpha' version by Gary Thomas
9 * Modified by Cort Dougan (cort@cs.nmt.edu)
10 * Modified by PPC64 Team, IBM Corp
11 * Modified by Cell Team, IBM Deutschland Entwicklung GmbH
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
30 #include <linux/cpu.h>
31 #include <linux/sched.h>
32 #include <linux/kernel.h>
34 #include <linux/stddef.h>
35 #include <linux/unistd.h>
36 #include <linux/reboot.h>
37 #include <linux/init.h>
38 #include <linux/delay.h>
39 #include <linux/irq.h>
40 #include <linux/seq_file.h>
41 #include <linux/root_dev.h>
42 #include <linux/console.h>
45 #include <asm/processor.h>
47 #include <asm/kexec.h>
49 #include <asm/machdep.h>
50 #include <asm/cputable.h>
52 #include <asm/spu_priv1.h>
53 #include <asm/firmware.h>
54 #include <asm/of_platform.h>
56 #include "interrupt.h"
57 #include "beat_wrapper.h"
61 static char celleb_machine_type
[128] = "Celleb";
63 static void celleb_show_cpuinfo(struct seq_file
*m
)
65 struct device_node
*root
;
66 const char *model
= "";
68 root
= of_find_node_by_path("/");
70 model
= of_get_property(root
, "model", NULL
);
71 /* using "CHRP" is to trick anaconda into installing FCx into Celleb */
72 seq_printf(m
, "machine\t\t: %s %s\n", celleb_machine_type
, model
);
76 static int celleb_machine_type_hack(char *ptr
)
78 strncpy(celleb_machine_type
, ptr
, sizeof(celleb_machine_type
));
79 celleb_machine_type
[sizeof(celleb_machine_type
)-1] = 0;
83 __setup("celleb_machine_type_hack=", celleb_machine_type_hack
);
85 static void celleb_progress(char *s
, unsigned short hex
)
87 printk("*** %04x : %s\n", hex
, s
? s
: "");
90 static void __init
celleb_setup_arch(void)
92 #ifdef CONFIG_SPU_BASE
93 spu_priv1_ops
= &spu_priv1_beat_ops
;
94 spu_management_ops
= &spu_management_of_ops
;
101 /* init to some ~sane value until calibrate_delay() runs */
102 loops_per_jiffy
= 50000000;
105 printk("No ramdisk, default root is /dev/hda2\n");
106 ROOT_DEV
= Root_HDA2
;
109 #ifdef CONFIG_DUMMY_CONSOLE
110 conswitchp
= &dummy_con
;
114 static void beat_power_save(void)
119 static int __init
celleb_probe(void)
121 unsigned long root
= of_get_flat_dt_root();
123 if (!of_flat_dt_is_compatible(root
, "Beat"))
126 powerpc_firmware_features
|= FW_FEATURE_CELLEB_POSSIBLE
;
132 static void celleb_kexec_cpu_down(int crash
, int secondary
)
138 static struct of_device_id celleb_bus_ids
[] = {
140 { .type
= "ioif", }, /* old style */
144 static int __init
celleb_publish_devices(void)
146 if (!machine_is(celleb
))
149 /* Publish OF platform devices for southbridge IOs */
150 of_platform_bus_probe(NULL
, celleb_bus_ids
, NULL
);
154 device_initcall(celleb_publish_devices
);
156 define_machine(celleb
) {
157 .name
= "Cell Reference Set",
158 .probe
= celleb_probe
,
159 .setup_arch
= celleb_setup_arch
,
160 .show_cpuinfo
= celleb_show_cpuinfo
,
161 .restart
= beat_restart
,
162 .power_off
= beat_power_off
,
164 .get_rtc_time
= beat_get_rtc_time
,
165 .set_rtc_time
= beat_set_rtc_time
,
166 .calibrate_decr
= generic_calibrate_decr
,
167 .progress
= celleb_progress
,
168 .power_save
= beat_power_save
,
169 .nvram_size
= beat_nvram_get_size
,
170 .nvram_read
= beat_nvram_read
,
171 .nvram_write
= beat_nvram_write
,
172 .set_dabr
= beat_set_xdabr
,
173 .init_IRQ
= beatic_init_IRQ
,
174 .get_irq
= beatic_get_irq
,
175 .pci_probe_mode
= celleb_pci_probe_mode
,
176 .pci_setup_phb
= celleb_setup_phb
,
178 .kexec_cpu_down
= celleb_kexec_cpu_down
,
179 .machine_kexec
= default_machine_kexec
,
180 .machine_kexec_prepare
= default_machine_kexec_prepare
,
181 .machine_crash_shutdown
= default_machine_crash_shutdown
,