From f355b046d1a6cbfa2f5354e373c7bdf10c7fcf0b Mon Sep 17 00:00:00 2001 From: Matt Porter Date: Mon, 18 Oct 2004 08:57:14 -0700 Subject: [PATCH] [PATCH] ppc32: use gen550 for PPC44x progress/ppc-stub Use gen550 for early PPC progress messages and for the in-kernel ppc-stub.c on PPC44x. Signed-off-by: Matt Porter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/ppc/platforms/4xx/Kconfig | 5 ++++ arch/ppc/platforms/4xx/ebony.c | 24 ++++++++++++---- arch/ppc/platforms/4xx/ocotea.c | 18 +++++++++--- arch/ppc/syslib/gen550_kgdb.c | 6 ++-- arch/ppc/syslib/ibm44x_common.c | 51 ++++++--------------------------- include/asm-ppc/machdep.h | 1 + 6 files changed, 51 insertions(+), 54 deletions(-) diff --git a/arch/ppc/platforms/4xx/Kconfig b/arch/ppc/platforms/4xx/Kconfig index d0317a1278f17..fd01f006b3884 100644 --- a/arch/ppc/platforms/4xx/Kconfig +++ b/arch/ppc/platforms/4xx/Kconfig @@ -199,6 +199,11 @@ config PPC4xx_EDMA depends on !STB03xxx && PPC4xx_DMA default y +config PPC_GEN550 + bool + depends on 44x + default y + config PM bool "Power Management support (EXPERIMENTAL)" depends on 4xx && EXPERIMENTAL diff --git a/arch/ppc/platforms/4xx/ebony.c b/arch/ppc/platforms/4xx/ebony.c index 118d8520e38b4..787d485240d45 100644 --- a/arch/ppc/platforms/4xx/ebony.c +++ b/arch/ppc/platforms/4xx/ebony.c @@ -1,10 +1,10 @@ /* - * arch/ppc/platforms/ebony.c + * arch/ppc/platforms/4xx/ebony.c * * Ebony board specific routines * - * Matt Porter - * Copyright 2002 MontaVista Software Inc. + * Matt Porter + * Copyright 2002-2004 MontaVista Software Inc. * * Eugene Surovegin or * Copyright (c) 2003, 2004 Zultys Technologies @@ -50,6 +50,10 @@ #include #include +#include + +static struct ibm44x_clocks clocks __initdata; + /* * Ebony IRQ triggering/polarity settings */ @@ -120,8 +124,6 @@ static u_char ebony_IRQ_initsenses[] __initdata = { (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 63: EMAC 1 WOL */ }; -static struct ibm44x_clocks clocks __initdata; - static void __init ebony_calibrate_decr(void) { @@ -284,13 +286,24 @@ ebony_early_serial_map(void) printk("Early serial init of port 0 failed\n"); } +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) + /* Configure debug serial access */ + gen550_init(0, &port); +#endif + port.membase = ioremap64(PPC440GP_UART1_ADDR, 8); port.irq = 1; + port.uartclk = clocks.uart1; port.line = 1; if (early_serial_setup(&port) != 0) { printk("Early serial init of port 1 failed\n"); } + +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) + /* Configure debug serial access */ + gen550_init(1, &port); +#endif } static void __init @@ -378,7 +391,6 @@ void __init platform_init(unsigned long r3, unsigned long r4, ppc_md.nvram_read_val = todc_direct_read_val; ppc_md.nvram_write_val = todc_direct_write_val; - #ifdef CONFIG_KGDB ppc_md.early_serial_map = ebony_early_serial_map; #endif diff --git a/arch/ppc/platforms/4xx/ocotea.c b/arch/ppc/platforms/4xx/ocotea.c index c981f70aad5f5..6d4a3b9ef6697 100644 --- a/arch/ppc/platforms/4xx/ocotea.c +++ b/arch/ppc/platforms/4xx/ocotea.c @@ -1,11 +1,11 @@ /* - * arch/ppc/platforms/ocotea.c + * arch/ppc/platforms/4xx/ocotea.c * * Ocotea board specific routines * - * Matt Porter + * Matt Porter * - * Copyright 2003 MontaVista Software Inc. + * Copyright 2003-2004 MontaVista Software Inc. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -49,6 +49,7 @@ #include #include +#include #include /* @@ -263,6 +264,11 @@ ocotea_early_serial_map(void) printk("Early serial init of port 0 failed\n"); } +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) + /* Configure debug serial access */ + gen550_init(0, &port); +#endif + port.membase = ioremap64(PPC440GX_UART1_ADDR, 8); port.irq = UART1_INT; port.uartclk = clocks.uart1; @@ -271,6 +277,11 @@ ocotea_early_serial_map(void) if (early_serial_setup(&port) != 0) { printk("Early serial init of port 1 failed\n"); } + +#if defined(CONFIG_SERIAL_TEXT_DEBUG) || defined(CONFIG_KGDB) + /* Configure debug serial access */ + gen550_init(1, &port); +#endif } static void __init @@ -355,7 +366,6 @@ void __init platform_init(unsigned long r3, unsigned long r4, ppc_md.nvram_read_val = todc_direct_read_val; ppc_md.nvram_write_val = todc_direct_write_val; - #ifdef CONFIG_KGDB ppc_md.early_serial_map = ocotea_early_serial_map; #endif diff --git a/arch/ppc/syslib/gen550_kgdb.c b/arch/ppc/syslib/gen550_kgdb.c index 232044cdbe038..7239d5d7ddcdc 100644 --- a/arch/ppc/syslib/gen550_kgdb.c +++ b/arch/ppc/syslib/gen550_kgdb.c @@ -9,9 +9,9 @@ * * Adapted from ppc4xx_kgdb.c. * - * Author: Matt Porter + * Author: Matt Porter * - * 2002-2003 (c) MontaVista Software, Inc. This file is licensed under + * 2002-2004 (c) MontaVista Software, Inc. This file is licensed under * the terms of the GNU General Public License version 2. This program * is licensed "as is" without any warranty of any kind, whether express * or implied. @@ -80,5 +80,7 @@ void gen550_kgdb_map_scc(void) { printk(KERN_DEBUG "kgdb init\n"); + if (ppc_md.early_serial_map) + ppc_md.early_serial_map(); kgdb_debugport = serial_init(KGDB_PORT, NULL); } diff --git a/arch/ppc/syslib/ibm44x_common.c b/arch/ppc/syslib/ibm44x_common.c index 76d18d3372e47..b67e3a5f0181b 100644 --- a/arch/ppc/syslib/ibm44x_common.c +++ b/arch/ppc/syslib/ibm44x_common.c @@ -3,8 +3,8 @@ * * PPC44x system library * - * Matt Porter - * Copyright 2002-2003 MontaVista Software Inc. + * Matt Porter + * Copyright 2002-2004 MontaVista Software Inc. * * Eugene Surovegin or * Copyright (c) 2003, 2004 Zultys Technologies @@ -16,16 +16,18 @@ * */ #include +#include #include #include -#include #include #include #include #include #include +#include + phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size) { phys_addr_t page_4gb = 0; @@ -149,44 +151,6 @@ static void __init ibm44x_init_irq(void) irq_desc[i].handler = ppc4xx_pic; } -#ifdef CONFIG_SERIAL_TEXT_DEBUG -#include -#include -#include - -static struct serial_state rs_table[RS_TABLE_SIZE] = { - SERIAL_PORT_DFNS /* Defined in */ -}; - -static void ibm44x_progress(char *s, unsigned short hex) -{ - volatile char c; - volatile unsigned long com_port; - u16 shift; - - com_port = (unsigned long)rs_table[0].iomem_base; - shift = rs_table[0].iomem_reg_shift; - - while ((c = *s++) != 0) { - while ((*((volatile unsigned char *)com_port + - (UART_LSR << shift)) & UART_LSR_THRE) == 0) - ; - *(volatile unsigned char *)com_port = c; - - } - - /* Send LF/CR to pretty up output */ - while ((*((volatile unsigned char *)com_port + - (UART_LSR << shift)) & UART_LSR_THRE) == 0) - ; - *(volatile unsigned char *)com_port = '\r'; - while ((*((volatile unsigned char *)com_port + - (UART_LSR << shift)) & UART_LSR_THRE) == 0) - ; - *(volatile unsigned char *)com_port = '\n'; -} -#endif /* CONFIG_SERIAL_TEXT_DEBUG */ - void __init ibm44x_platform_init(void) { ppc_md.init_IRQ = ibm44x_init_irq; @@ -196,7 +160,10 @@ void __init ibm44x_platform_init(void) ppc_md.halt = ibm44x_halt; #ifdef CONFIG_SERIAL_TEXT_DEBUG - ppc_md.progress = ibm44x_progress; + ppc_md.progress = gen550_progress; #endif /* CONFIG_SERIAL_TEXT_DEBUG */ +#ifdef CONFIG_KGDB + ppc_md.kgdb_map_scc = gen550_kgdb_map_scc; +#endif } diff --git a/include/asm-ppc/machdep.h b/include/asm-ppc/machdep.h index b1c0bb7878c11..87a5501638fc4 100644 --- a/include/asm-ppc/machdep.h +++ b/include/asm-ppc/machdep.h @@ -56,6 +56,7 @@ struct machdep_calls { unsigned long (*find_end_of_memory)(void); void (*setup_io_mappings)(void); + void (*early_serial_map)(void); void (*progress)(char *, unsigned short); void (*kgdb_map_scc)(void); -- 2.53.0