Commit f355b046 authored by Matt Porter's avatar Matt Porter Committed by Linus Torvalds

[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: 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 971d7fa0
...@@ -199,6 +199,11 @@ config PPC4xx_EDMA ...@@ -199,6 +199,11 @@ config PPC4xx_EDMA
depends on !STB03xxx && PPC4xx_DMA depends on !STB03xxx && PPC4xx_DMA
default y default y
config PPC_GEN550
bool
depends on 44x
default y
config PM config PM
bool "Power Management support (EXPERIMENTAL)" bool "Power Management support (EXPERIMENTAL)"
depends on 4xx && EXPERIMENTAL depends on 4xx && EXPERIMENTAL
......
/* /*
* arch/ppc/platforms/ebony.c * arch/ppc/platforms/4xx/ebony.c
* *
* Ebony board specific routines * Ebony board specific routines
* *
* Matt Porter <mporter@mvista.com> * Matt Porter <mporter@kernel.crashing.org>
* Copyright 2002 MontaVista Software Inc. * Copyright 2002-2004 MontaVista Software Inc.
* *
* Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
* Copyright (c) 2003, 2004 Zultys Technologies * Copyright (c) 2003, 2004 Zultys Technologies
...@@ -50,6 +50,10 @@ ...@@ -50,6 +50,10 @@
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <asm/ppc4xx_pic.h> #include <asm/ppc4xx_pic.h>
#include <syslib/gen550.h>
static struct ibm44x_clocks clocks __initdata;
/* /*
* Ebony IRQ triggering/polarity settings * Ebony IRQ triggering/polarity settings
*/ */
...@@ -120,8 +124,6 @@ static u_char ebony_IRQ_initsenses[] __initdata = { ...@@ -120,8 +124,6 @@ static u_char ebony_IRQ_initsenses[] __initdata = {
(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 63: EMAC 1 WOL */ (IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE), /* 63: EMAC 1 WOL */
}; };
static struct ibm44x_clocks clocks __initdata;
static void __init static void __init
ebony_calibrate_decr(void) ebony_calibrate_decr(void)
{ {
...@@ -284,13 +286,24 @@ ebony_early_serial_map(void) ...@@ -284,13 +286,24 @@ ebony_early_serial_map(void)
printk("Early serial init of port 0 failed\n"); 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.membase = ioremap64(PPC440GP_UART1_ADDR, 8);
port.irq = 1; port.irq = 1;
port.uartclk = clocks.uart1;
port.line = 1; port.line = 1;
if (early_serial_setup(&port) != 0) { if (early_serial_setup(&port) != 0) {
printk("Early serial init of port 1 failed\n"); 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 static void __init
...@@ -378,7 +391,6 @@ void __init platform_init(unsigned long r3, unsigned long r4, ...@@ -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_read_val = todc_direct_read_val;
ppc_md.nvram_write_val = todc_direct_write_val; ppc_md.nvram_write_val = todc_direct_write_val;
#ifdef CONFIG_KGDB #ifdef CONFIG_KGDB
ppc_md.early_serial_map = ebony_early_serial_map; ppc_md.early_serial_map = ebony_early_serial_map;
#endif #endif
......
/* /*
* arch/ppc/platforms/ocotea.c * arch/ppc/platforms/4xx/ocotea.c
* *
* Ocotea board specific routines * Ocotea board specific routines
* *
* Matt Porter <mporter@mvista.com> * Matt Porter <mporter@kernel.crashing.org>
* *
* Copyright 2003 MontaVista Software Inc. * Copyright 2003-2004 MontaVista Software Inc.
* *
* This program is free software; you can redistribute it and/or modify it * 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 * under the terms of the GNU General Public License as published by the
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <asm/ppc4xx_pic.h> #include <asm/ppc4xx_pic.h>
#include <asm/ppcboot.h> #include <asm/ppcboot.h>
#include <syslib/gen550.h>
#include <syslib/ibm440gx_common.h> #include <syslib/ibm440gx_common.h>
/* /*
...@@ -263,6 +264,11 @@ ocotea_early_serial_map(void) ...@@ -263,6 +264,11 @@ ocotea_early_serial_map(void)
printk("Early serial init of port 0 failed\n"); 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.membase = ioremap64(PPC440GX_UART1_ADDR, 8);
port.irq = UART1_INT; port.irq = UART1_INT;
port.uartclk = clocks.uart1; port.uartclk = clocks.uart1;
...@@ -271,6 +277,11 @@ ocotea_early_serial_map(void) ...@@ -271,6 +277,11 @@ ocotea_early_serial_map(void)
if (early_serial_setup(&port) != 0) { if (early_serial_setup(&port) != 0) {
printk("Early serial init of port 1 failed\n"); 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 static void __init
...@@ -355,7 +366,6 @@ void __init platform_init(unsigned long r3, unsigned long r4, ...@@ -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_read_val = todc_direct_read_val;
ppc_md.nvram_write_val = todc_direct_write_val; ppc_md.nvram_write_val = todc_direct_write_val;
#ifdef CONFIG_KGDB #ifdef CONFIG_KGDB
ppc_md.early_serial_map = ocotea_early_serial_map; ppc_md.early_serial_map = ocotea_early_serial_map;
#endif #endif
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
* *
* Adapted from ppc4xx_kgdb.c. * Adapted from ppc4xx_kgdb.c.
* *
* Author: Matt Porter <mporter@mvista.com> * Author: Matt Porter <mporter@kernel.crashing.org>
* *
* 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 * the terms of the GNU General Public License version 2. This program
* is licensed "as is" without any warranty of any kind, whether express * is licensed "as is" without any warranty of any kind, whether express
* or implied. * or implied.
...@@ -80,5 +80,7 @@ void ...@@ -80,5 +80,7 @@ void
gen550_kgdb_map_scc(void) gen550_kgdb_map_scc(void)
{ {
printk(KERN_DEBUG "kgdb init\n"); printk(KERN_DEBUG "kgdb init\n");
if (ppc_md.early_serial_map)
ppc_md.early_serial_map();
kgdb_debugport = serial_init(KGDB_PORT, NULL); kgdb_debugport = serial_init(KGDB_PORT, NULL);
} }
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
* *
* PPC44x system library * PPC44x system library
* *
* Matt Porter <mporter@mvista.com> * Matt Porter <mporter@kernel.crashing.org>
* Copyright 2002-2003 MontaVista Software Inc. * Copyright 2002-2004 MontaVista Software Inc.
* *
* Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net> * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
* Copyright (c) 2003, 2004 Zultys Technologies * Copyright (c) 2003, 2004 Zultys Technologies
...@@ -16,16 +16,18 @@ ...@@ -16,16 +16,18 @@
* *
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/time.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <asm/param.h>
#include <asm/ibm44x.h> #include <asm/ibm44x.h>
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/time.h> #include <asm/time.h>
#include <asm/ppc4xx_pic.h> #include <asm/ppc4xx_pic.h>
#include <syslib/gen550.h>
phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size) phys_addr_t fixup_bigphys_addr(phys_addr_t addr, phys_addr_t size)
{ {
phys_addr_t page_4gb = 0; phys_addr_t page_4gb = 0;
...@@ -149,44 +151,6 @@ static void __init ibm44x_init_irq(void) ...@@ -149,44 +151,6 @@ static void __init ibm44x_init_irq(void)
irq_desc[i].handler = ppc4xx_pic; irq_desc[i].handler = ppc4xx_pic;
} }
#ifdef CONFIG_SERIAL_TEXT_DEBUG
#include <linux/serialP.h>
#include <linux/serial_reg.h>
#include <asm/serial.h>
static struct serial_state rs_table[RS_TABLE_SIZE] = {
SERIAL_PORT_DFNS /* Defined in <asm/serial.h> */
};
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) void __init ibm44x_platform_init(void)
{ {
ppc_md.init_IRQ = ibm44x_init_irq; ppc_md.init_IRQ = ibm44x_init_irq;
...@@ -196,7 +160,10 @@ void __init ibm44x_platform_init(void) ...@@ -196,7 +160,10 @@ void __init ibm44x_platform_init(void)
ppc_md.halt = ibm44x_halt; ppc_md.halt = ibm44x_halt;
#ifdef CONFIG_SERIAL_TEXT_DEBUG #ifdef CONFIG_SERIAL_TEXT_DEBUG
ppc_md.progress = ibm44x_progress; ppc_md.progress = gen550_progress;
#endif /* CONFIG_SERIAL_TEXT_DEBUG */ #endif /* CONFIG_SERIAL_TEXT_DEBUG */
#ifdef CONFIG_KGDB
ppc_md.kgdb_map_scc = gen550_kgdb_map_scc;
#endif
} }
...@@ -56,6 +56,7 @@ struct machdep_calls { ...@@ -56,6 +56,7 @@ struct machdep_calls {
unsigned long (*find_end_of_memory)(void); unsigned long (*find_end_of_memory)(void);
void (*setup_io_mappings)(void); void (*setup_io_mappings)(void);
void (*early_serial_map)(void);
void (*progress)(char *, unsigned short); void (*progress)(char *, unsigned short);
void (*kgdb_map_scc)(void); void (*kgdb_map_scc)(void);
......
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