aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2014-04-12 09:49:30 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2014-05-28 04:11:53 -0400
commitc46f46d02c90959b82b99badfadc575081666aae (patch)
treeeef1f9bde612c02693fbd8042e4a57b89783ade8 /arch/m68k
parent7913ad1ad83409e7f9ed5758bb4324bf64c95a73 (diff)
m68k/mvme16x: Adopt common boot console
In a multi-platform kernel binary we only need one early console instance. The difficulty here is that the common early console is started by early_param(), whereas the MVME16x instance is started later by config_mvme16x(). That means some interrupt setup must be done earlier. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Tested-by: Stephen N Chivers <schivers@csc.com.au> [Geert] Tag debug_cons_write() with __ref to kill section mismatch warning Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/kernel/early_printk.c21
-rw-r--r--arch/m68k/kernel/head.S11
-rw-r--r--arch/m68k/mvme16x/config.c26
3 files changed, 25 insertions, 33 deletions
diff --git a/arch/m68k/kernel/early_printk.c b/arch/m68k/kernel/early_printk.c
index 919b83794545..ff9708d71921 100644
--- a/arch/m68k/kernel/early_printk.c
+++ b/arch/m68k/kernel/early_printk.c
@@ -12,12 +12,21 @@
12#include <linux/string.h> 12#include <linux/string.h>
13#include <asm/setup.h> 13#include <asm/setup.h>
14 14
15extern void mvme16x_cons_write(struct console *co,
16 const char *str, unsigned count);
17
15asmlinkage void __init debug_cons_nputs(const char *s, unsigned n); 18asmlinkage void __init debug_cons_nputs(const char *s, unsigned n);
16 19
17static void debug_cons_write(struct console *c, 20static void __ref debug_cons_write(struct console *c,
18 const char *s, unsigned n) 21 const char *s, unsigned n)
19{ 22{
20 debug_cons_nputs(s, n); 23#if !(defined(CONFIG_SUN3) || defined(CONFIG_M68360) || \
24 defined(CONFIG_M68000) || defined(CONFIG_COLDFIRE))
25 if (MACH_IS_MVME16x)
26 mvme16x_cons_write(c, s, n);
27 else
28 debug_cons_nputs(s, n);
29#endif
21} 30}
22 31
23static struct console early_console_instance = { 32static struct console early_console_instance = {
@@ -29,10 +38,6 @@ static struct console early_console_instance = {
29 38
30static int __init setup_early_printk(char *buf) 39static int __init setup_early_printk(char *buf)
31{ 40{
32 /* MVME16x registers an early console after interrupt setup. */
33 if (MACH_IS_MVME16x)
34 return 0;
35
36 if (early_console || buf) 41 if (early_console || buf)
37 return 0; 42 return 0;
38 43
@@ -52,7 +57,7 @@ early_param("earlyprintk", setup_early_printk);
52 57
53static int __init unregister_early_console(void) 58static int __init unregister_early_console(void)
54{ 59{
55 if (!early_console) 60 if (!early_console || MACH_IS_MVME16x)
56 return 0; 61 return 0;
57 62
58 return unregister_console(early_console); 63 return unregister_console(early_console);
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S
index a3cfada88368..b671f07aeb81 100644
--- a/arch/m68k/kernel/head.S
+++ b/arch/m68k/kernel/head.S
@@ -2936,6 +2936,15 @@ L(serial_init_not_mac):
29362: 29362:
2937#endif 2937#endif
2938 2938
2939#ifdef CONFIG_MVME16x
2940 is_not_mvme16x(L(serial_init_not_mvme16x))
2941 moveb #0x10,M167_PCSCCMICR
2942 moveb #0x10,M167_PCSCCTICR
2943 moveb #0x10,M167_PCSCCRICR
2944 jra L(serial_init_done)
2945L(serial_init_not_mvme16x):
2946#endif
2947
2939#ifdef CONFIG_APOLLO 2948#ifdef CONFIG_APOLLO
2940/* We count on the PROM initializing SIO1 */ 2949/* We count on the PROM initializing SIO1 */
2941#endif 2950#endif
@@ -3768,7 +3777,9 @@ M167_CYIER = 0xfff45011
3768M167_CYLICR = 0xfff45026 3777M167_CYLICR = 0xfff45026
3769M167_CYTEOIR = 0xfff45085 3778M167_CYTEOIR = 0xfff45085
3770M167_CYTDR = 0xfff450f8 3779M167_CYTDR = 0xfff450f8
3780M167_PCSCCMICR = 0xfff4201d
3771M167_PCSCCTICR = 0xfff4201e 3781M167_PCSCCTICR = 0xfff4201e
3782M167_PCSCCRICR = 0xfff4201f
3772M167_PCTPIACKR = 0xfff42025 3783M167_PCTPIACKR = 0xfff42025
3773#endif 3784#endif
3774 3785
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
index eab7d342757e..a53803cc66cd 100644
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -213,7 +213,7 @@ static void __init mvme16x_init_IRQ (void)
213#define CySCRH (0x22) 213#define CySCRH (0x22)
214#define CyTFTC (0x80) 214#define CyTFTC (0x80)
215 215
216static void cons_write(struct console *co, const char *str, unsigned count) 216void mvme16x_cons_write(struct console *co, const char *str, unsigned count)
217{ 217{
218 volatile unsigned char *base_addr = (u_char *)CD2401_ADDR; 218 volatile unsigned char *base_addr = (u_char *)CD2401_ADDR;
219 volatile u_char sink; 219 volatile u_char sink;
@@ -268,20 +268,6 @@ static void cons_write(struct console *co, const char *str, unsigned count)
268 base_addr[CyIER] = ier; 268 base_addr[CyIER] = ier;
269} 269}
270 270
271static struct console cons_info =
272{
273 .name = "sercon",
274 .write = cons_write,
275 .flags = CON_PRINTBUFFER | CON_BOOT,
276 .index = -1,
277};
278
279static void __init mvme16x_early_console(void)
280{
281 register_console(&cons_info);
282
283 printk(KERN_INFO "MVME16x: early console registered\n");
284}
285#endif 271#endif
286 272
287void __init config_mvme16x(void) 273void __init config_mvme16x(void)
@@ -336,16 +322,6 @@ void __init config_mvme16x(void)
336 else 322 else
337 { 323 {
338 mvme16x_config = MVME16x_CONFIG_GOT_LP | MVME16x_CONFIG_GOT_CD2401; 324 mvme16x_config = MVME16x_CONFIG_GOT_LP | MVME16x_CONFIG_GOT_CD2401;
339
340 /* Dont allow any interrupts from the CD2401 until the interrupt */
341 /* handlers are installed */
342
343 pcc2chip[PccSCCMICR] = 0x10;
344 pcc2chip[PccSCCTICR] = 0x10;
345 pcc2chip[PccSCCRICR] = 0x10;
346#ifdef CONFIG_EARLY_PRINTK
347 mvme16x_early_console();
348#endif
349 } 325 }
350} 326}
351 327