From ca2e9b2f693958346de7c6d2db42e49ed9d37500 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 3 Feb 2004 18:30:50 -0800 Subject: [PATCH] [PATCH] Fixes / Enhancements for PPC_GEN550 From: Tom Rini Various fixes for the PPC_GEN550 backend. - Move PPC_GEN550 bool into a more appropriate spot. - Add PPC_GEN550 support to the MCPN765 platform. - Allow for SERIAL_TEXT_DEBUG on PPC_GEN550. - Add missing headers to arch/ppc/syslib/gen550_dbg.c - Clean-up the KGDB interface such that we allow for a kgdb_map_scc call, but do not require one. - Add gen550 prototypes to - PPC_GEN550 backend code doesn't depend on 8250_SERIAL. --- arch/ppc/Kconfig | 12 ++++++------ arch/ppc/kernel/setup.c | 8 ++------ arch/ppc/platforms/mcpn765_setup.c | 7 ++++--- arch/ppc/platforms/sandpoint.c | 7 ++++--- arch/ppc/syslib/Makefile | 2 +- arch/ppc/syslib/gen550_dbg.c | 2 ++ arch/ppc/syslib/gen550_kgdb.c | 2 +- include/asm-ppc/kgdb.h | 11 ++++++++++- include/asm-ppc/machdep.h | 1 + 9 files changed, 31 insertions(+), 21 deletions(-) diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index ec25b00bfaaf7..c066db4a3ba86 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig @@ -583,11 +583,6 @@ config PPC_CHRP depends on PPC_MULTIPLATFORM default y -config PPC_GEN550 - bool - depends on SANDPOINT - default y - config PPC_PMAC bool depends on PPC_MULTIPLATFORM @@ -603,6 +598,11 @@ config PPC_OF depends on PPC_PMAC || PPC_CHRP default y +config PPC_GEN550 + bool + depends on SANDPOINT || MCPN765 + default y + config FORCE bool depends on 6xx && (PCORE || POWERPMC250) @@ -1404,7 +1404,7 @@ config BOOTX_TEXT config SERIAL_TEXT_DEBUG bool "Support for early boot texts over serial port" - depends on 4xx || GT64260 || LOPEC || MCPN765 || PPLUS || PRPMC800 || SANDPOINT + depends on 4xx || GT64260 || LOPEC || PPLUS || PRPMC800 || PPC_GEN550 config OCP bool diff --git a/arch/ppc/kernel/setup.c b/arch/ppc/kernel/setup.c index 32fece5881366..94c00edb40bf6 100644 --- a/arch/ppc/kernel/setup.c +++ b/arch/ppc/kernel/setup.c @@ -48,11 +48,6 @@ extern void identify_cpu(unsigned long offset, unsigned long cpu); extern void do_cpu_ftr_fixups(unsigned long offset); extern void reloc_got2(unsigned long offset); - -#ifdef CONFIG_KGDB -extern void kgdb_map_scc(void); -#endif - extern void ppc6xx_idle(void); extern void power4_idle(void); @@ -632,7 +627,8 @@ void __init setup_arch(char **cmdline_p) if ( ppc_md.progress ) ppc_md.progress("setup_arch: enter", 0x3eab); #if defined(CONFIG_KGDB) - kgdb_map_scc(); + if (ppc_md.kgdb_map_scc) + ppc_md.kgdb_map_scc(); set_debug_traps(); if (strstr(cmd_line, "gdb")) { if (ppc_md.progress) diff --git a/arch/ppc/platforms/mcpn765_setup.c b/arch/ppc/platforms/mcpn765_setup.c index e64cfb9f60b3a..3ffcc85120014 100644 --- a/arch/ppc/platforms/mcpn765_setup.c +++ b/arch/ppc/platforms/mcpn765_setup.c @@ -50,6 +50,7 @@ #include #include #include +#include #include "mcpn765.h" #include "mcpn765_serial.h" @@ -78,9 +79,6 @@ static u_char mcpn765_openpic_initsenses[] __initdata = { extern u_int openpic_irq(void); extern char cmd_line[]; -extern void gen550_progress(char *, unsigned short); -extern void gen550_init(int, struct uart_port *); - int use_of_interrupt_tree = 0; static void mcpn765_halt(void); @@ -472,6 +470,9 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, #if defined(CONFIG_SERIAL_8250) && \ (defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG)) mcpn765_early_serial_map(); +#ifdef CONFIG_KGDB + ppc_md.kgdb_map_scc = gen550_kgdb_map_scc; +#endif #ifdef CONFIG_SERIAL_TEXT_DEBUG ppc_md.progress = gen550_progress; #endif diff --git a/arch/ppc/platforms/sandpoint.c b/arch/ppc/platforms/sandpoint.c index e41b109fc4afb..fa837875255f8 100644 --- a/arch/ppc/platforms/sandpoint.c +++ b/arch/ppc/platforms/sandpoint.c @@ -103,12 +103,10 @@ #include #include #include +#include #include "sandpoint.h" -extern void gen550_progress(char *, unsigned short); -extern void gen550_init(int, struct uart_port *); - unsigned char __res[sizeof(bd_t)]; static void sandpoint_halt(void); @@ -706,6 +704,9 @@ platform_init(unsigned long r3, unsigned long r4, unsigned long r5, #if defined(CONFIG_SERIAL_8250) && \ (defined(CONFIG_KGDB) || defined(CONFIG_SERIAL_TEXT_DEBUG)) sandpoint_early_serial_map(); +#ifdef CONFIG_KGDB + ppc_md.kgdb_map_scc = gen550_kgdb_map_scc; +#endif #ifdef CONFIG_SERIAL_TEXT_DEBUG ppc_md.progress = gen550_progress; #endif diff --git a/arch/ppc/syslib/Makefile b/arch/ppc/syslib/Makefile index 59dd330444bcf..9c5faac973505 100644 --- a/arch/ppc/syslib/Makefile +++ b/arch/ppc/syslib/Makefile @@ -66,7 +66,7 @@ obj-$(CONFIG_SANDPOINT) += i8259.o open_pic.o mpc10x_common.o \ obj-$(CONFIG_SPRUCE) += cpc700_pic.o indirect_pci.o pci_auto.o \ todc_time.o obj-$(CONFIG_8260) += m8260_setup.o ppc8260_pic.o -ifeq ($(CONFIG_SERIAL_8250)$(CONFIG_PPC_GEN550),yy) +ifeq ($(CONFIG_PPC_GEN550),y) obj-$(CONFIG_KGDB) += gen550_kgdb.o gen550_dbg.o obj-$(CONFIG_SERIAL_TEXT_DEBUG) += gen550_dbg.o endif diff --git a/arch/ppc/syslib/gen550_dbg.c b/arch/ppc/syslib/gen550_dbg.c index 7fb0b41a241c4..cfac3ab654f86 100644 --- a/arch/ppc/syslib/gen550_dbg.c +++ b/arch/ppc/syslib/gen550_dbg.c @@ -17,6 +17,8 @@ */ #include +#include +#include #include /* For linux/serial_core.h */ #include #include diff --git a/arch/ppc/syslib/gen550_kgdb.c b/arch/ppc/syslib/gen550_kgdb.c index 4171b50bde515..232044cdbe038 100644 --- a/arch/ppc/syslib/gen550_kgdb.c +++ b/arch/ppc/syslib/gen550_kgdb.c @@ -77,7 +77,7 @@ void putDebugString(char* str) * to use. */ void -kgdb_map_scc(void) +gen550_kgdb_map_scc(void) { printk(KERN_DEBUG "kgdb init\n"); kgdb_debugport = serial_init(KGDB_PORT, NULL); diff --git a/include/asm-ppc/kgdb.h b/include/asm-ppc/kgdb.h index 13e09287cae67..1d3c927ce6262 100644 --- a/include/asm-ppc/kgdb.h +++ b/include/asm-ppc/kgdb.h @@ -11,8 +11,17 @@ #define _PPC_KGDB_H #ifndef __ASSEMBLY__ -/* To initialize the serial, first thing called */ + +/* Things specific to the gen550 backend. */ +struct uart_port; + +extern void gen550_progress(char *, unsigned short); +extern void gen550_kgdb_map_scc(void); +extern void gen550_init(int, struct uart_port *); + +/* Things specific to the pmac backend. */ extern void zs_kgdb_hook(int tty_num); + /* To init the kgdb engine. (called by serial hook)*/ extern void set_debug_traps(void); diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h index 01ffbcd3cdbf8..54cb5a93d5085 100644 --- a/include/asm-ppc/machdep.h +++ b/include/asm-ppc/machdep.h @@ -53,6 +53,7 @@ struct machdep_calls { void (*setup_io_mappings)(void); void (*progress)(char *, unsigned short); + void (*kgdb_map_scc)(void); unsigned char (*nvram_read_val)(int addr); void (*nvram_write_val)(int addr, unsigned char val); -- 2.53.0