setup.c (d9bc125caf592b7d081021f32ce5b717efdf70c8) setup.c (fde5efd0e50e026f3f69629fc5790a4f0533dcaa)
1/*
2 * PS3 platform setup routines.
3 *
4 * Copyright (C) 2006 Sony Computer Entertainment Inc.
5 * Copyright 2006 Sony Corp.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 28 unchanged lines hidden (view full) ---

37#include "platform.h"
38
39#if defined(DEBUG)
40#define DBG(fmt...) udbg_printf(fmt)
41#else
42#define DBG(fmt...) do{if(0)printk(fmt);}while(0)
43#endif
44
1/*
2 * PS3 platform setup routines.
3 *
4 * Copyright (C) 2006 Sony Computer Entertainment Inc.
5 * Copyright 2006 Sony Corp.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

--- 28 unchanged lines hidden (view full) ---

37#include "platform.h"
38
39#if defined(DEBUG)
40#define DBG(fmt...) udbg_printf(fmt)
41#else
42#define DBG(fmt...) do{if(0)printk(fmt);}while(0)
43#endif
44
45#if !defined(CONFIG_SMP)
46static void smp_send_stop(void) {}
47#endif
48
45int ps3_get_firmware_version(union ps3_firmware_version *v)
46{
47 int result = lv1_get_version_info(&v->raw);
48
49 if (result) {
50 v->raw = 0;
51 return -1;
52 }

--- 8 unchanged lines hidden (view full) ---

61 * lv1_pause() puts the PPE thread into inactive state until an
62 * irq on an unmasked plug exists. MSR[EE] has no effect.
63 * flags: 0 = wake on DEC interrupt, 1 = ignore DEC interrupt.
64 */
65
66 lv1_pause(0);
67}
68
49int ps3_get_firmware_version(union ps3_firmware_version *v)
50{
51 int result = lv1_get_version_info(&v->raw);
52
53 if (result) {
54 v->raw = 0;
55 return -1;
56 }

--- 8 unchanged lines hidden (view full) ---

65 * lv1_pause() puts the PPE thread into inactive state until an
66 * irq on an unmasked plug exists. MSR[EE] has no effect.
67 * flags: 0 = wake on DEC interrupt, 1 = ignore DEC interrupt.
68 */
69
70 lv1_pause(0);
71}
72
73static void ps3_restart(char *cmd)
74{
75 DBG("%s:%d cmd '%s'\n", __func__, __LINE__, cmd);
76
77 smp_send_stop();
78 ps3_sys_manager_restart(); /* never returns */
79}
80
81static void ps3_power_off(void)
82{
83 DBG("%s:%d\n", __func__, __LINE__);
84
85 smp_send_stop();
86 ps3_sys_manager_power_off(); /* never returns */
87}
88
69static void ps3_panic(char *str)
70{
71 DBG("%s:%d %s\n", __func__, __LINE__, str);
72
89static void ps3_panic(char *str)
90{
91 DBG("%s:%d %s\n", __func__, __LINE__, str);
92
73#ifdef CONFIG_SMP
74 smp_send_stop();
93 smp_send_stop();
75#endif
76 printk("\n");
77 printk(" System does not reboot automatically.\n");
78 printk(" Please press POWER button.\n");
79 printk("\n");
80
94 printk("\n");
95 printk(" System does not reboot automatically.\n");
96 printk(" Please press POWER button.\n");
97 printk("\n");
98
81 for (;;) ;
99 while(1);
82}
83
100}
101
84
85static void prealloc(struct ps3_prealloc *p)
86{
87 if (!p->size)
88 return;
89
90 p->address = __alloc_bootmem(p->size, p->align, __pa(MAX_DMA_ADDRESS));
91 if (!p->address) {
92 printk(KERN_ERR "%s: Cannot allocate %s\n", __FUNCTION__,

--- 121 unchanged lines hidden (view full) ---

214 .setup_arch = ps3_setup_arch,
215 .init_IRQ = ps3_init_IRQ,
216 .panic = ps3_panic,
217 .get_boot_time = ps3_get_boot_time,
218 .set_rtc_time = ps3_set_rtc_time,
219 .get_rtc_time = ps3_get_rtc_time,
220 .calibrate_decr = ps3_calibrate_decr,
221 .progress = ps3_progress,
102static void prealloc(struct ps3_prealloc *p)
103{
104 if (!p->size)
105 return;
106
107 p->address = __alloc_bootmem(p->size, p->align, __pa(MAX_DMA_ADDRESS));
108 if (!p->address) {
109 printk(KERN_ERR "%s: Cannot allocate %s\n", __FUNCTION__,

--- 121 unchanged lines hidden (view full) ---

231 .setup_arch = ps3_setup_arch,
232 .init_IRQ = ps3_init_IRQ,
233 .panic = ps3_panic,
234 .get_boot_time = ps3_get_boot_time,
235 .set_rtc_time = ps3_set_rtc_time,
236 .get_rtc_time = ps3_get_rtc_time,
237 .calibrate_decr = ps3_calibrate_decr,
238 .progress = ps3_progress,
239 .restart = ps3_restart,
240 .power_off = ps3_power_off,
222#if defined(CONFIG_KEXEC)
223 .kexec_cpu_down = ps3_kexec_cpu_down,
224 .machine_kexec = ps3_machine_kexec,
225 .machine_kexec_prepare = default_machine_kexec_prepare,
226 .machine_crash_shutdown = default_machine_crash_shutdown,
227#endif
228};
241#if defined(CONFIG_KEXEC)
242 .kexec_cpu_down = ps3_kexec_cpu_down,
243 .machine_kexec = ps3_machine_kexec,
244 .machine_kexec_prepare = default_machine_kexec_prepare,
245 .machine_crash_shutdown = default_machine_crash_shutdown,
246#endif
247};