aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/early_printk.c
diff options
context:
space:
mode:
authorMarkus Brunner <super.firetwister@gmail.com>2007-08-19 19:59:33 -0400
committerPaul Mundt <lethal@linux-sh.org>2007-09-20 22:57:49 -0400
commit3ea6bc3de4f15fcae84fb31eeea4d420685a3da2 (patch)
tree2b9e37135052aab926b7be0822d024c4ba71c32e /arch/sh/kernel/early_printk.c
parentdfc5ed2a939baf08f9385a8c6249b719cac63665 (diff)
sh: Add SH7720 CPU support.
This adds support for the SH7720 (SH3-DSP) CPU. Signed-off by: Markus Brunner <super.firetwister@gmail.com> Signed-off by: Mark Jonas <toertel@gmail.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/early_printk.c')
-rw-r--r--arch/sh/kernel/early_printk.c38
1 files changed, 34 insertions, 4 deletions
diff --git a/arch/sh/kernel/early_printk.c b/arch/sh/kernel/early_printk.c
index 80b637c3020..85ed5b7ef27 100644
--- a/arch/sh/kernel/early_printk.c
+++ b/arch/sh/kernel/early_printk.c
@@ -13,6 +13,7 @@
13#include <linux/tty.h> 13#include <linux/tty.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/delay.h>
16 17
17#ifdef CONFIG_SH_STANDARD_BIOS 18#ifdef CONFIG_SH_STANDARD_BIOS
18#include <asm/sh_bios.h> 19#include <asm/sh_bios.h>
@@ -62,6 +63,18 @@ static struct console bios_console = {
62#include <linux/serial_core.h> 63#include <linux/serial_core.h>
63#include "../../../drivers/serial/sh-sci.h" 64#include "../../../drivers/serial/sh-sci.h"
64 65
66#if defined(CONFIG_CPU_SUBTYPE_SH7720)
67#define EPK_SCSMR_VALUE 0x000
68#define EPK_SCBRR_VALUE 0x00C
69#define EPK_FIFO_SIZE 64
70#define EPK_FIFO_BITS (0x7f00 >> 8)
71#else
72#define EPK_FIFO_SIZE 16
73#define EPK_FIFO_BITS (0x1f00 >> 8)
74#endif
75
76
77
65static struct uart_port scif_port = { 78static struct uart_port scif_port = {
66 .mapbase = CONFIG_EARLY_SCIF_CONSOLE_PORT, 79 .mapbase = CONFIG_EARLY_SCIF_CONSOLE_PORT,
67 .membase = (char __iomem *)CONFIG_EARLY_SCIF_CONSOLE_PORT, 80 .membase = (char __iomem *)CONFIG_EARLY_SCIF_CONSOLE_PORT,
@@ -69,7 +82,7 @@ static struct uart_port scif_port = {
69 82
70static void scif_sercon_putc(int c) 83static void scif_sercon_putc(int c)
71{ 84{
72 while (((sci_in(&scif_port, SCFDR) & 0x1f00 >> 8) == 16)) 85 while (((sci_in(&scif_port, SCFDR) & EPK_FIFO_BITS) >= EPK_FIFO_SIZE))
73 ; 86 ;
74 87
75 sci_out(&scif_port, SCxTDR, c); 88 sci_out(&scif_port, SCxTDR, c);
@@ -105,7 +118,22 @@ static struct console scif_console = {
105 .index = -1, 118 .index = -1,
106}; 119};
107 120
108#if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_STANDARD_BIOS) 121#if !defined(CONFIG_SH_STANDARD_BIOS)
122#if defined(CONFIG_CPU_SUBTYPE_SH7720)
123static void scif_sercon_init(char *s)
124{
125 sci_out(&scif_port, SCSCR, 0x0000); /* clear TE and RE */
126 sci_out(&scif_port, SCFCR, 0x4006); /* reset */
127 sci_out(&scif_port, SCSCR, 0x0000); /* select internal clock */
128 sci_out(&scif_port, SCSMR, EPK_SCSMR_VALUE);
129 sci_out(&scif_port, SCBRR, EPK_SCBRR_VALUE);
130
131 mdelay(1); /* wait 1-bit time */
132
133 sci_out(&scif_port, SCFCR, 0x0030); /* TTRG=b'11 */
134 sci_out(&scif_port, SCSCR, 0x0030); /* TE, RE */
135}
136#elif defined(CONFIG_CPU_SH4)
109#define DEFAULT_BAUD 115200 137#define DEFAULT_BAUD 115200
110/* 138/*
111 * Simple SCIF init, primarily aimed at SH7750 and other similar SH-4 139 * Simple SCIF init, primarily aimed at SH7750 and other similar SH-4
@@ -146,7 +174,8 @@ static void scif_sercon_init(char *s)
146 ctrl_outw(0, scif_port.mapbase + 36); 174 ctrl_outw(0, scif_port.mapbase + 36);
147 ctrl_outw(0x30, scif_port.mapbase + 8); 175 ctrl_outw(0x30, scif_port.mapbase + 8);
148} 176}
149#endif /* CONFIG_CPU_SH4 && !CONFIG_SH_STANDARD_BIOS */ 177#endif /* defined(CONFIG_CPU_SUBTYPE_SH7720) */
178#endif /* !defined(CONFIG_SH_STANDARD_BIOS) */
150#endif /* CONFIG_EARLY_SCIF_CONSOLE */ 179#endif /* CONFIG_EARLY_SCIF_CONSOLE */
151 180
152/* 181/*
@@ -186,7 +215,8 @@ int __init setup_early_printk(char *buf)
186 if (!strncmp(buf, "serial", 6)) { 215 if (!strncmp(buf, "serial", 6)) {
187 early_console = &scif_console; 216 early_console = &scif_console;
188 217
189#if defined(CONFIG_CPU_SH4) && !defined(CONFIG_SH_STANDARD_BIOS) 218#if (defined(CONFIG_CPU_SH4) || defined(CONFIG_CPU_SUBTYPE_SH7720)) && \
219 !defined(CONFIG_SH_STANDARD_BIOS)
190 scif_sercon_init(buf + 6); 220 scif_sercon_init(buf + 6);
191#endif 221#endif
192 } 222 }