aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>2008-07-29 09:10:08 -0400
committerRalf Baechle <ralf@linux-mips.org>2008-07-30 16:54:41 -0400
commite352953ce00bb870124e9054dbbbda2262f9269c (patch)
tree76297cc5749b91bec76d75f4520d88add8ca3efc
parent7779a5e07d33fe316fe468e7afe7975fb686a831 (diff)
[MIPS] TXx9: Support early_printk
Kill jmr3927-specific prom_putchar and add txx9-generic prom_putchar to support early_printk. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/txx9/Kconfig3
-rw-r--r--arch/mips/txx9/generic/setup.c31
-rw-r--r--arch/mips/txx9/jmr3927/prom.c17
-rw-r--r--arch/mips/txx9/rbtx4927/prom.c1
-rw-r--r--arch/mips/txx9/rbtx4938/prom.c1
-rw-r--r--include/asm-mips/txx9/generic.h9
6 files changed, 46 insertions, 16 deletions
diff --git a/arch/mips/txx9/Kconfig b/arch/mips/txx9/Kconfig
index 6de4c5aa92be..9b14db2ce204 100644
--- a/arch/mips/txx9/Kconfig
+++ b/arch/mips/txx9/Kconfig
@@ -30,6 +30,7 @@ config SOC_TX3927
30 select IRQ_TXX9 30 select IRQ_TXX9
31 select SWAP_IO_SPACE 31 select SWAP_IO_SPACE
32 select SYS_HAS_CPU_TX39XX 32 select SYS_HAS_CPU_TX39XX
33 select SYS_HAS_EARLY_PRINTK
33 select SYS_SUPPORTS_32BIT_KERNEL 34 select SYS_SUPPORTS_32BIT_KERNEL
34 select SYS_SUPPORTS_LITTLE_ENDIAN 35 select SYS_SUPPORTS_LITTLE_ENDIAN
35 select SYS_SUPPORTS_BIG_ENDIAN 36 select SYS_SUPPORTS_BIG_ENDIAN
@@ -49,6 +50,7 @@ config SOC_TX4927
49 select PCI_TX4927 50 select PCI_TX4927
50 select SWAP_IO_SPACE 51 select SWAP_IO_SPACE
51 select SYS_HAS_CPU_TX49XX 52 select SYS_HAS_CPU_TX49XX
53 select SYS_HAS_EARLY_PRINTK
52 select SYS_SUPPORTS_32BIT_KERNEL 54 select SYS_SUPPORTS_32BIT_KERNEL
53 select SYS_SUPPORTS_64BIT_KERNEL 55 select SYS_SUPPORTS_64BIT_KERNEL
54 select SYS_SUPPORTS_LITTLE_ENDIAN 56 select SYS_SUPPORTS_LITTLE_ENDIAN
@@ -70,6 +72,7 @@ config SOC_TX4938
70 select PCI_TX4927 72 select PCI_TX4927
71 select SWAP_IO_SPACE 73 select SWAP_IO_SPACE
72 select SYS_HAS_CPU_TX49XX 74 select SYS_HAS_CPU_TX49XX
75 select SYS_HAS_EARLY_PRINTK
73 select SYS_SUPPORTS_32BIT_KERNEL 76 select SYS_SUPPORTS_32BIT_KERNEL
74 select SYS_SUPPORTS_64BIT_KERNEL 77 select SYS_SUPPORTS_64BIT_KERNEL
75 select SYS_SUPPORTS_LITTLE_ENDIAN 78 select SYS_SUPPORTS_LITTLE_ENDIAN
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 94ce1a5c38a4..1bc57d0f4c5c 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -271,6 +271,37 @@ void __init txx9_sio_init(unsigned long baseaddr, int irq,
271#endif /* CONFIG_SERIAL_TXX9 */ 271#endif /* CONFIG_SERIAL_TXX9 */
272} 272}
273 273
274#ifdef CONFIG_EARLY_PRINTK
275static void __init null_prom_putchar(char c)
276{
277}
278void (*txx9_prom_putchar)(char c) __initdata = null_prom_putchar;
279
280void __init prom_putchar(char c)
281{
282 txx9_prom_putchar(c);
283}
284
285static void __iomem *early_txx9_sio_port;
286
287static void __init early_txx9_sio_putchar(char c)
288{
289#define TXX9_SICISR 0x0c
290#define TXX9_SITFIFO 0x1c
291#define TXX9_SICISR_TXALS 0x00000002
292 while (!(__raw_readl(early_txx9_sio_port + TXX9_SICISR) &
293 TXX9_SICISR_TXALS))
294 ;
295 __raw_writel(c, early_txx9_sio_port + TXX9_SITFIFO);
296}
297
298void __init txx9_sio_putchar_init(unsigned long baseaddr)
299{
300 early_txx9_sio_port = ioremap(baseaddr, 0x24);
301 txx9_prom_putchar = early_txx9_sio_putchar;
302}
303#endif /* CONFIG_EARLY_PRINTK */
304
274/* wrappers */ 305/* wrappers */
275void __init plat_mem_setup(void) 306void __init plat_mem_setup(void)
276{ 307{
diff --git a/arch/mips/txx9/jmr3927/prom.c b/arch/mips/txx9/jmr3927/prom.c
index 23df38c1490e..70c4c8ec3e84 100644
--- a/arch/mips/txx9/jmr3927/prom.c
+++ b/arch/mips/txx9/jmr3927/prom.c
@@ -41,22 +41,6 @@
41#include <asm/txx9/generic.h> 41#include <asm/txx9/generic.h>
42#include <asm/txx9/jmr3927.h> 42#include <asm/txx9/jmr3927.h>
43 43
44#define TIMEOUT 0xffffff
45
46void
47prom_putchar(char c)
48{
49 int i = 0;
50
51 do {
52 i++;
53 if (i>TIMEOUT)
54 break;
55 } while (!(tx3927_sioptr(1)->cisr & TXx927_SICISR_TXALS));
56 tx3927_sioptr(1)->tfifo = c;
57 return;
58}
59
60void __init jmr3927_prom_init(void) 44void __init jmr3927_prom_init(void)
61{ 45{
62 /* CCFG */ 46 /* CCFG */
@@ -65,4 +49,5 @@ void __init jmr3927_prom_init(void)
65 49
66 prom_init_cmdline(); 50 prom_init_cmdline();
67 add_memory_region(0, JMR3927_SDRAM_SIZE, BOOT_MEM_RAM); 51 add_memory_region(0, JMR3927_SDRAM_SIZE, BOOT_MEM_RAM);
52 txx9_sio_putchar_init(TX3927_SIO_REG(1));
68} 53}
diff --git a/arch/mips/txx9/rbtx4927/prom.c b/arch/mips/txx9/rbtx4927/prom.c
index 5c0de54ebdd2..1dc0a5b1956b 100644
--- a/arch/mips/txx9/rbtx4927/prom.c
+++ b/arch/mips/txx9/rbtx4927/prom.c
@@ -38,4 +38,5 @@ void __init rbtx4927_prom_init(void)
38{ 38{
39 prom_init_cmdline(); 39 prom_init_cmdline();
40 add_memory_region(0, tx4927_get_mem_size(), BOOT_MEM_RAM); 40 add_memory_region(0, tx4927_get_mem_size(), BOOT_MEM_RAM);
41 txx9_sio_putchar_init(TX4927_SIO_REG(0) & 0xfffffffffULL);
41} 42}
diff --git a/arch/mips/txx9/rbtx4938/prom.c b/arch/mips/txx9/rbtx4938/prom.c
index ee189519ce5a..d73123cd2ab9 100644
--- a/arch/mips/txx9/rbtx4938/prom.c
+++ b/arch/mips/txx9/rbtx4938/prom.c
@@ -22,4 +22,5 @@ void __init rbtx4938_prom_init(void)
22 prom_init_cmdline(); 22 prom_init_cmdline();
23#endif 23#endif
24 add_memory_region(0, tx4938_get_mem_size(), BOOT_MEM_RAM); 24 add_memory_region(0, tx4938_get_mem_size(), BOOT_MEM_RAM);
25 txx9_sio_putchar_init(TX4938_SIO_REG(0) & 0xfffffffffULL);
25} 26}
diff --git a/include/asm-mips/txx9/generic.h b/include/asm-mips/txx9/generic.h
index a295aaa846fa..5b1ccf901c62 100644
--- a/include/asm-mips/txx9/generic.h
+++ b/include/asm-mips/txx9/generic.h
@@ -49,5 +49,14 @@ void txx9_spi_init(int busid, unsigned long base, int irq);
49void txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr); 49void txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr);
50void txx9_sio_init(unsigned long baseaddr, int irq, 50void txx9_sio_init(unsigned long baseaddr, int irq,
51 unsigned int line, unsigned int sclk, int nocts); 51 unsigned int line, unsigned int sclk, int nocts);
52void prom_putchar(char c);
53#ifdef CONFIG_EARLY_PRINTK
54extern void (*txx9_prom_putchar)(char c);
55void txx9_sio_putchar_init(unsigned long baseaddr);
56#else
57static inline void txx9_sio_putchar_init(unsigned long baseaddr)
58{
59}
60#endif
52 61
53#endif /* __ASM_TXX9_GENERIC_H */ 62#endif /* __ASM_TXX9_GENERIC_H */