Commit 8c8e5bf8 authored by Matt Porter's avatar Matt Porter Committed by Linus Torvalds

[PATCH] ppc32: 40x and Book E debug: 4xx platform support

This patch adds support to the 40x and 44x platform code for initializing
debug events and using the in-kernel kgdb stub.
Signed-off-by: default avatarMatt Porter <mporter@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7f82e010
...@@ -201,7 +201,7 @@ config PPC4xx_EDMA ...@@ -201,7 +201,7 @@ config PPC4xx_EDMA
config PPC_GEN550 config PPC_GEN550
bool bool
depends on 44x depends on 4xx
default y default y
config PM config PM
......
...@@ -313,14 +313,6 @@ ebony_setup_arch(void) ...@@ -313,14 +313,6 @@ ebony_setup_arch(void)
struct ocp_def *def; struct ocp_def *def;
struct ocp_func_emac_data *emacdata; struct ocp_func_emac_data *emacdata;
#if !defined(CONFIG_BDI_SWITCH)
/*
* The Abatron BDI JTAG debugger does not tolerate others
* mucking with the debug registers.
*/
mtspr(SPRN_DBCR0, (DBCR0_TDE | DBCR0_IDM));
#endif
/* Set mac_addr for each EMAC */ /* Set mac_addr for each EMAC */
vpd_base = ioremap64(EBONY_VPD_BASE, EBONY_VPD_SIZE); vpd_base = ioremap64(EBONY_VPD_BASE, EBONY_VPD_SIZE);
def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 0); def = ocp_get_one_device(OCP_VENDOR_IBM, OCP_FUNC_EMAC, 0);
......
...@@ -291,14 +291,6 @@ ocotea_setup_arch(void) ...@@ -291,14 +291,6 @@ ocotea_setup_arch(void)
ibm440gx_tah_enable(); ibm440gx_tah_enable();
#if !defined(CONFIG_BDI_SWITCH)
/*
* The Abatron BDI JTAG debugger does not tolerate others
* mucking with the debug registers.
*/
mtspr(SPRN_DBCR0, (DBCR0_TDE | DBCR0_IDM));
#endif
/* Setup TODC access */ /* Setup TODC access */
TODC_INIT(TODC_TYPE_DS1743, TODC_INIT(TODC_TYPE_DS1743,
0, 0,
......
...@@ -25,7 +25,6 @@ obj-$(CONFIG_GEN_RTC) += todc_time.o ...@@ -25,7 +25,6 @@ obj-$(CONFIG_GEN_RTC) += todc_time.o
obj-$(CONFIG_PPC4xx_DMA) += ppc4xx_dma.o obj-$(CONFIG_PPC4xx_DMA) += ppc4xx_dma.o
obj-$(CONFIG_PPC4xx_EDMA) += ppc4xx_sgdma.o obj-$(CONFIG_PPC4xx_EDMA) += ppc4xx_sgdma.o
ifeq ($(CONFIG_40x),y) ifeq ($(CONFIG_40x),y)
obj-$(CONFIG_KGDB) += ppc4xx_kgdb.o
obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o ppc405_pci.o obj-$(CONFIG_PCI) += indirect_pci.o pci_auto.o ppc405_pci.o
endif endif
endif endif
......
...@@ -166,5 +166,17 @@ void __init ibm44x_platform_init(void) ...@@ -166,5 +166,17 @@ void __init ibm44x_platform_init(void)
#ifdef CONFIG_KGDB #ifdef CONFIG_KGDB
ppc_md.kgdb_map_scc = gen550_kgdb_map_scc; ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
#endif #endif
/*
* The Abatron BDI JTAG debugger does not tolerate others
* mucking with the debug registers.
*/
#if !defined(CONFIG_BDI_SWITCH)
/* Enable internal debug mode */
mtspr(SPRN_DBCR0, (DBCR0_IDM));
/* Clear any residual debug events */
mtspr(SPRN_DBSR, 0xffffffff);
#endif
} }
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <syslib/gen550.h>
/* Function Prototypes */ /* Function Prototypes */
extern void abort(void); extern void abort(void);
extern void ppc4xx_find_bridges(void); extern void ppc4xx_find_bridges(void);
...@@ -56,8 +58,16 @@ bd_t __res; ...@@ -56,8 +58,16 @@ bd_t __res;
void __init void __init
ppc4xx_setup_arch(void) ppc4xx_setup_arch(void)
{ {
/* Setup PCI host bridges */ #if !defined(CONFIG_BDI_SWITCH)
/*
* The Abatron BDI JTAG debugger does not tolerate others
* mucking with the debug registers.
*/
mtspr(SPRN_DBCR0, (DBCR0_IDM));
mtspr(SPRN_DBSR, 0xffffffff);
#endif
/* Setup PCI host bridges */
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
ppc4xx_find_bridges(); ppc4xx_find_bridges();
#endif #endif
...@@ -189,38 +199,6 @@ ppc4xx_calibrate_decr(void) ...@@ -189,38 +199,6 @@ ppc4xx_calibrate_decr(void)
/* Set the PIT reload value and just let it run. */ /* Set the PIT reload value and just let it run. */
mtspr(SPRN_PIT, tb_ticks_per_jiffy); mtspr(SPRN_PIT, tb_ticks_per_jiffy);
} }
#ifdef CONFIG_SERIAL_TEXT_DEBUG
#ifdef SERIAL_DEBUG_IO_BASE
/* We assume that the UART has already been initialized by the
firmware or the boot loader */
static void
serial_putc(u8 * com_port, unsigned char c)
{
while ((readb(com_port + (UART_LSR)) & UART_LSR_THRE) == 0) ;
writeb(c, com_port);
}
static void
ppc4xx_progress(char *s, unsigned short hex)
{
char c;
u8 *com_port = (u8 *) SERIAL_DEBUG_IO_BASE;
while ((c = *s++) != '\0') {
serial_putc(com_port, c);
}
serial_putc(com_port, '\r');
serial_putc(com_port, '\n');
}
#else
static void
ppc4xx_progress(char *s, unsigned short hex)
{
printk("%s\r\n", s);
}
#endif
#endif /* CONFIG_SERIAL_TEXT_DEBUG */
/* /*
* IDE stuff. * IDE stuff.
...@@ -323,13 +301,9 @@ ppc4xx_init(unsigned long r3, unsigned long r4, unsigned long r5, ...@@ -323,13 +301,9 @@ ppc4xx_init(unsigned long r3, unsigned long r4, unsigned long r5,
ppc_md.setup_io_mappings = ppc4xx_map_io; ppc_md.setup_io_mappings = ppc4xx_map_io;
#ifdef CONFIG_SERIAL_TEXT_DEBUG #ifdef CONFIG_SERIAL_TEXT_DEBUG
ppc_md.progress = ppc4xx_progress; ppc_md.progress = gen550_progress;
#endif #endif
/*
** m8xx_setup.c, prep_setup.c use
** defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)
*/
#if defined(CONFIG_PCI) && defined(CONFIG_IDE) #if defined(CONFIG_PCI) && defined(CONFIG_IDE)
ppc_ide_md.ide_init_hwif = ppc4xx_ide_init_hwif_ports; ppc_ide_md.ide_init_hwif = ppc4xx_ide_init_hwif_ports;
#endif /* defined(CONFIG_PCI) && defined(CONFIG_IDE) */ #endif /* defined(CONFIG_PCI) && defined(CONFIG_IDE) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment