21 #include <linux/kernel.h>
26 #include <linux/export.h>
29 #include <asm/machdep.h>
32 #include <asm/iommu.h>
41 #define DBG udbg_printf
72 static void ps3_power_save(
void)
83 static void ps3_restart(
char *
cmd)
85 DBG(
"%s:%d cmd '%s'\n", __func__, __LINE__, cmd);
91 static void ps3_power_off(
void)
93 DBG(
"%s:%d\n", __func__, __LINE__);
99 static void ps3_halt(
void)
101 DBG(
"%s:%d\n", __func__, __LINE__);
107 static void ps3_panic(
char *
str)
109 DBG(
"%s:%d %s\n", __func__, __LINE__, str);
113 printk(
" System does not reboot automatically.\n");
114 printk(
" Please press POWER button.\n");
121 #if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE) || \
122 defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE)
140 #if defined(CONFIG_FB_PS3) || defined(CONFIG_FB_PS3_MODULE)
142 .name =
"ps3fb videomemory",
143 .size = CONFIG_FB_PS3_DEFAULT_SIZE_M*1024*1024,
147 #define prealloc_ps3fb_videomemory() prealloc(&ps3fb_videomemory)
149 static int __init early_parse_ps3fb(
char *p)
155 ps3fb_videomemory.
align);
160 #define prealloc_ps3fb_videomemory() do { } while (0)
163 #if defined(CONFIG_PS3_FLASH) || defined(CONFIG_PS3_FLASH_MODULE)
165 .name =
"ps3flash bounce buffer",
170 #define prealloc_ps3flash_bounce_buffer() prealloc(&ps3flash_bounce_buffer)
172 static int __init early_parse_ps3flash(
char *p)
178 ps3flash_bounce_buffer.
size = 0;
184 #define prealloc_ps3flash_bounce_buffer() do { } while (0)
187 static int ps3_set_dabr(
unsigned long dabr,
unsigned long dabrx)
190 if (dabrx == 0 && dabr == 0)
193 dabrx &= DABRX_BTI | DABRX_KERNEL | DABRX_USER;
195 return lv1_set_dabr(dabr, dabrx) ? -1 : 0;
198 static void __init ps3_setup_arch(
void)
202 DBG(
" -> %s:%d\n", __func__, __LINE__);
216 #ifdef CONFIG_DUMMY_CONSOLE
223 ppc_md.power_save = ps3_power_save;
226 DBG(
" <- %s:%d\n", __func__, __LINE__);
229 static void __init ps3_progress(
char *
s,
unsigned short hex)
231 printk(
"*** %04x : %s\n", hex, s ? s :
"");
234 static int __init ps3_probe(
void)
236 unsigned long htab_size;
237 unsigned long dt_root;
239 DBG(
" -> %s:%d\n", __func__, __LINE__);
241 dt_root = of_get_flat_dt_root();
242 if (!of_flat_dt_is_compatible(dt_root,
"sony,ps3"))
245 powerpc_firmware_features |= FW_FEATURE_PS3_POSSIBLE;
252 DBG(
" <- %s:%d\n", __func__, __LINE__);
256 #if defined(CONFIG_KEXEC)
257 static void ps3_kexec_cpu_down(
int crash_shutdown,
int secondary)
261 DBG(
" -> %s:%d: (%d)\n", __func__, __LINE__, cpu);
266 DBG(
" <- %s:%d\n", __func__, __LINE__);
273 .setup_arch = ps3_setup_arch,
277 .set_dabr = ps3_set_dabr,
279 .progress = ps3_progress,
280 .restart = ps3_restart,
281 .power_off = ps3_power_off,
283 #if defined(CONFIG_KEXEC)
284 .kexec_cpu_down = ps3_kexec_cpu_down,