aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2010-02-08 06:02:54 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-02-08 20:34:12 -0500
commit4ae04acb81256719a71125c0f0280e2a3ad68e25 (patch)
tree88f308d4dc70e3a196cedf3ba04781e0f7a4b138 /arch/arm/mach-shmobile
parent62f60d6a37910501814c6281e6c21b485434a7f1 (diff)
ARM: mach-shmobile: early console support using earlyprintk
Add support for early console to the SH-Mobile boards. Simply perform an early platform probe for "earlyprintk" to trigger the early serial console code in sh-sci.c. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/Makefile2
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c3
-rw-r--r--arch/arm/mach-shmobile/board-g3evm.c3
-rw-r--r--arch/arm/mach-shmobile/board-g4evm.c3
-rw-r--r--arch/arm/mach-shmobile/console.c31
-rw-r--r--arch/arm/mach-shmobile/include/mach/common.h1
6 files changed, 39 insertions, 4 deletions
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 88893dbf710..800e7dd9e9d 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# Common objects 5# Common objects
6obj-y := timer.o 6obj-y := timer.o console.o
7 7
8# CPU objects 8# CPU objects
9obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o 9obj-$(CONFIG_ARCH_SH7367) += setup-sh7367.o clock-sh7367.o
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index a8d815c9623..94b545b3fe8 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -105,9 +105,10 @@ static void __init ap4evb_map_io(void)
105{ 105{
106 iotable_init(ap4evb_io_desc, ARRAY_SIZE(ap4evb_io_desc)); 106 iotable_init(ap4evb_io_desc, ARRAY_SIZE(ap4evb_io_desc));
107 107
108 /* setup early devices and clocks here as well */ 108 /* setup early devices, clocks and console here as well */
109 sh7372_add_early_devices(); 109 sh7372_add_early_devices();
110 sh7367_clock_init(); /* use g3 clocks for now */ 110 sh7367_clock_init(); /* use g3 clocks for now */
111 shmobile_setup_console();
111} 112}
112 113
113static void __init ap4evb_init(void) 114static void __init ap4evb_init(void)
diff --git a/arch/arm/mach-shmobile/board-g3evm.c b/arch/arm/mach-shmobile/board-g3evm.c
index b4b202718e4..eba2311beba 100644
--- a/arch/arm/mach-shmobile/board-g3evm.c
+++ b/arch/arm/mach-shmobile/board-g3evm.c
@@ -105,9 +105,10 @@ static void __init g3evm_map_io(void)
105{ 105{
106 iotable_init(g3evm_io_desc, ARRAY_SIZE(g3evm_io_desc)); 106 iotable_init(g3evm_io_desc, ARRAY_SIZE(g3evm_io_desc));
107 107
108 /* setup early devices and clocks here as well */ 108 /* setup early devices, clocks and console here as well */
109 sh7367_add_early_devices(); 109 sh7367_add_early_devices();
110 sh7367_clock_init(); 110 sh7367_clock_init();
111 shmobile_setup_console();
111} 112}
112 113
113static void __init g3evm_init(void) 114static void __init g3evm_init(void)
diff --git a/arch/arm/mach-shmobile/board-g4evm.c b/arch/arm/mach-shmobile/board-g4evm.c
index 0d2948f1776..0ddde038588 100644
--- a/arch/arm/mach-shmobile/board-g4evm.c
+++ b/arch/arm/mach-shmobile/board-g4evm.c
@@ -105,9 +105,10 @@ static void __init g4evm_map_io(void)
105{ 105{
106 iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc)); 106 iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc));
107 107
108 /* setup early devices and clocks here as well */ 108 /* setup early devices, clocks and console here as well */
109 sh7377_add_early_devices(); 109 sh7377_add_early_devices();
110 sh7367_clock_init(); /* use g3 clocks for now */ 110 sh7367_clock_init(); /* use g3 clocks for now */
111 shmobile_setup_console();
111} 112}
112 113
113static void __init g4evm_init(void) 114static void __init g4evm_init(void)
diff --git a/arch/arm/mach-shmobile/console.c b/arch/arm/mach-shmobile/console.c
new file mode 100644
index 00000000000..9411a5bf4fd
--- /dev/null
+++ b/arch/arm/mach-shmobile/console.c
@@ -0,0 +1,31 @@
1/*
2 * SH-Mobile Console
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/platform_device.h>
22#include <mach/common.h>
23#include <asm/mach/map.h>
24
25void __init shmobile_setup_console(void)
26{
27 parse_early_param();
28
29 /* Let earlyprintk output early console messages */
30 early_platform_driver_probe("earlyprintk", 1, 1);
31}
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h
index a12eb4d75f6..f5986ea561f 100644
--- a/arch/arm/mach-shmobile/include/mach/common.h
+++ b/arch/arm/mach-shmobile/include/mach/common.h
@@ -2,6 +2,7 @@
2#define __ARCH_MACH_COMMON_H 2#define __ARCH_MACH_COMMON_H
3 3
4extern struct sys_timer shmobile_timer; 4extern struct sys_timer shmobile_timer;
5extern void shmobile_setup_console(void);
5 6
6extern void sh7367_init_irq(void); 7extern void sh7367_init_irq(void);
7extern void sh7367_add_early_devices(void); 8extern void sh7367_add_early_devices(void);