Skip to contentSkip to conversation

powerpc: Add early debugging / xmon support for Cell

PATCH In review Michael Ellerman 1 participant 2 messages May 2, 2006 – Jun 8, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 powerpc: Add early debugging / xmon support for Cell

This patch adds udbg routines for cell, and hooks them up for use as an early debugging console or for xmon.

With this patch xmon seems to work. On one occasion after sitting in xmon for a while I lost hard disk interrupts and had to power off, not sure what the story was there.

---

 arch/powerpc/Kconfig.debug           |    6 ++
 arch/powerpc/kernel/udbg.c           |    3 +
 arch/powerpc/platforms/cell/Makefile |    2 
 arch/powerpc/platforms/cell/setup.c  |    3 +
 arch/powerpc/platforms/cell/udbg.c   |   86 +++++++++++++++++++++++++++++++++++
 include/asm-powerpc/udbg.h           |    1 
 6 files changed, 100 insertions(+), 1 deletion(-)
arch/powerpc/Kconfig.debug +6 -0
Index: cell/arch/powerpc/Kconfig.debug
===================================================================
@@ -131,6 +131,12 @@ config PPC_EARLY_DEBUG_G5
 	help
 	  Select this to enable early debugging for Apple G5 machines.
 
+config PPC_EARLY_DEBUG_CELL
+	bool "Cell RTAS console"
+	depends on PPC_CELL
+	help
+	  Select this to enable early debugging for Cell systems.
+
 config PPC_EARLY_DEBUG_RTAS
 	bool "RTAS Panel"
 	depends on PPC_RTAS
arch/powerpc/kernel/udbg.c +3 -0
Index: cell/arch/powerpc/kernel/udbg.c
===================================================================
@@ -42,6 +42,9 @@ void __init udbg_early_init(void)
 #elif defined(CONFIG_PPC_EARLY_DEBUG_ISERIES)
 	/* For iSeries - hit Ctrl-x Ctrl-x to see the output */
 	udbg_init_iseries();
+#elif defined(CONFIG_PPC_EARLY_DEBUG_CELL)
+	/* Cell RTAS console */
+	udbg_init_cell();
 #endif
 }
 
arch/powerpc/platforms/cell/Makefile +1 -1
Index: cell/arch/powerpc/platforms/cell/Makefile
===================================================================
@@ -1,5 +1,5 @@
 obj-y			+= interrupt.o iommu.o setup.o spider-pic.o
-obj-y			+= pervasive.o pci.o
+obj-y			+= pervasive.o pci.o udbg.o
 
 obj-$(CONFIG_SMP)	+= smp.o
 obj-$(CONFIG_SPU_FS)	+= spufs/
arch/powerpc/platforms/cell/setup.c +3 -0
Index: cell/arch/powerpc/platforms/cell/setup.c
===================================================================
@@ -49,6 +49,7 @@
 #include <asm/ppc-pci.h>
 #include <asm/irq.h>
 #include <asm/spu.h>
+#include <asm/udbg.h>
 
 #include "interrupt.h"
 #include "iommu.h"
@@ -145,6 +146,8 @@ static void __init cell_init_early(void)
 {
 	DBG(" -> cell_init_early()\n");
 
+	udbg_init_cell();
+
 	hpte_init_native();
 
 	cell_init_iommu();
arch/powerpc/platforms/cell/udbg.c new file +86 -0

86 lines not on this page · raw message

include/asm-powerpc/udbg.h +1 -0
Index: cell/include/asm-powerpc/udbg.h
===================================================================
@@ -42,6 +42,7 @@ extern void __init udbg_init_pmac_realmo
 extern void __init udbg_init_maple_realmode(void);
 extern void __init udbg_init_iseries(void);
 extern void __init udbg_init_rtas(void);
+extern void __init udbg_init_cell(void);
 
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_UDBG_H */
#1 lore raw
Quoted 8 lines · Michael Ellerman

This patch adds udbg routines for cell, and hooks them up for use as an early debugging console or for xmon.

With this patch xmon seems to work. On one occasion after sitting in xmon for a while I lost hard disk interrupts and had to power off, not sure what the story was there.

This patch is no good, it allows you to inadvertently call rtas before it's ready which causes the kernel to die. I think we can structure things so that a) rtas is callable earlier, and b) rtas_call fails gracefully when rtas isn't setup yet.

The BML guys now use these rtas calls too, so I'll do a version under kernel/ so they can use it too.

New patch RSN.

cheers

Signature · 8 lines
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person