1 --- a/arch/powerpc/platforms/ps3/Kconfig 2013-02-21 13:59:28.585037559 +0100
2 +++ b/arch/powerpc/platforms/ps3/Kconfig 2013-02-21 14:01:19.724894506 +0100
5 If in doubt, say N here.
7 +config PS3_LV1_CONS_UDBG
8 + bool "PS3 udbg output via LV1 console"
11 + Enables udbg early debugging output to LV1 console.
13 + If in doubt, say N here.
16 --- a/arch/powerpc/platforms/ps3/Makefile 2013-02-21 14:02:49.992787219 +0100
17 +++ b/arch/powerpc/platforms/ps3/Makefile 2013-02-21 14:03:33.870050887 +0100
21 obj-$(CONFIG_PS3GELIC_UDBG) += gelic_udbg.o
22 +obj-$(CONFIG_PS3_LV1_CONS_UDBG) += lv1_cons_udbg.o
23 obj-$(CONFIG_SMP) += smp.o
24 obj-$(CONFIG_SPU_BASE) += spu.o
25 obj-y += device-init.o
26 --- /dev/null 2012-11-28 15:48:49.557690341 +0100
27 +++ b/arch/powerpc/platforms/ps3/lv1_cons_udbg.c 2013-02-21 14:23:49.250083391 +0100
30 + * PS3 LV1 Debug Console
32 + * Copyright (C) 2013 glevand <geoffrey.levand@mail.ru>
33 + * All rights reserved.
35 + * This program is free software; you can redistribute it and/or modify it
36 + * under the terms of the GNU General Public License as published
37 + * by the Free Software Foundation; version 2 of the License.
39 + * This program is distributed in the hope that it will be useful, but
40 + * WITHOUT ANY WARRANTY; without even the implied warranty of
41 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
42 + * General Public License for more details.
44 + * You should have received a copy of the GNU General Public License along
45 + * with this program; if not, write to the Free Software Foundation, Inc.,
46 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
50 +#include <asm/udbg.h>
51 +#include <asm/lv1call.h>
53 +#define LV1_CONS_ID 1
54 +#define LV1_CONS_LENGTH 0xff0
56 +static int initialized = 0;
58 +static void lv1_cons_udbg_putc(char ch)
64 + ret = lv1_undocumented_function_105(LV1_CONS_ID, 0, 0,
65 + LV1_CONS_LENGTH, LV1_CONS_LENGTH, 0, 0);
66 + if ((ret != 0) && (ret != -7))
75 + lv1_undocumented_function_107(LV1_CONS_ID, 1, data, 0, 0, 0, &written);
77 + /* flush to console buffer in LV1 */
79 + lv1_undocumented_function_109(LV1_CONS_ID);
82 +void __init udbg_init_ps3_lv1_cons(void)
84 + udbg_putc = lv1_cons_udbg_putc;
86 --- a/arch/powerpc/Kconfig.debug 2013-02-21 14:31:39.023621546 +0100
87 +++ b/arch/powerpc/Kconfig.debug 2013-02-21 14:32:47.370765998 +0100
89 Select this to enable early debugging for the PlayStation3 via
90 UDP broadcasts sent out through the Ethernet port.
92 +config PPC_EARLY_DEBUG_PS3_LV1_CONS
93 + bool "Early debugging through the PS3 LV1 console"
95 + select PS3_LV1_CONS_UDBG
97 + Select this to enable early debugging for the PlayStation3 via
100 config PPC_EARLY_DEBUG_OPAL_RAW
101 bool "OPAL raw console"
103 --- a/arch/powerpc/include/asm/udbg.h 2013-02-21 14:15:53.855871374 +0100
104 +++ b/arch/powerpc/include/asm/udbg.h 2013-02-21 14:16:16.107616876 +0100
106 extern void __init udbg_init_wsp(void);
107 extern void __init udbg_init_ehv_bc(void);
108 extern void __init udbg_init_ps3gelic(void);
109 +extern void __init udbg_init_ps3_lv1_cons(void);
110 extern void __init udbg_init_debug_opal_raw(void);
111 extern void __init udbg_init_debug_opal_hvsi(void);
113 --- a/arch/powerpc/kernel/udbg.c 2013-02-21 14:14:28.283621378 +0100
114 +++ b/arch/powerpc/kernel/udbg.c 2013-02-21 14:15:16.431624882 +0100
117 #elif defined(CONFIG_PPC_EARLY_DEBUG_PS3GELIC)
118 udbg_init_ps3gelic();
119 +#elif defined(CONFIG_PPC_EARLY_DEBUG_PS3_LV1_CONS)
120 + udbg_init_ps3_lv1_cons();
121 #elif defined(CONFIG_PPC_EARLY_DEBUG_OPAL_RAW)
122 udbg_init_debug_opal_raw();
123 #elif defined(CONFIG_PPC_EARLY_DEBUG_OPAL_HVSI)