aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/txx9/generic
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-08-07 04:55:03 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-08-07 04:55:03 -0400
commit4fb8af10d0fd09372d52966b76922b9e82bbc950 (patch)
treed240e4d40357583e3f3eb228dccf20122a5b31ed /arch/mips/txx9/generic
parentf44f82e8a20b98558486eb14497b2f71c78fa325 (diff)
parent64a99d2a8c3ed5c4e39f3ae1cc682aa8fd3977fc (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes
Diffstat (limited to 'arch/mips/txx9/generic')
-rw-r--r--arch/mips/txx9/generic/Makefile2
-rw-r--r--arch/mips/txx9/generic/dbgio.c48
-rw-r--r--arch/mips/txx9/generic/irq_tx3927.c25
-rw-r--r--arch/mips/txx9/generic/pci.c36
-rw-r--r--arch/mips/txx9/generic/setup.c124
-rw-r--r--arch/mips/txx9/generic/setup_tx3927.c130
-rw-r--r--arch/mips/txx9/generic/setup_tx4927.c30
-rw-r--r--arch/mips/txx9/generic/setup_tx4938.c41
-rw-r--r--arch/mips/txx9/generic/smsc_fdc37m81x.c20
9 files changed, 364 insertions, 92 deletions
diff --git a/arch/mips/txx9/generic/Makefile b/arch/mips/txx9/generic/Makefile
index 9c120771e65f..9bb34af26b73 100644
--- a/arch/mips/txx9/generic/Makefile
+++ b/arch/mips/txx9/generic/Makefile
@@ -4,9 +4,9 @@
4 4
5obj-y += setup.o 5obj-y += setup.o
6obj-$(CONFIG_PCI) += pci.o 6obj-$(CONFIG_PCI) += pci.o
7obj-$(CONFIG_SOC_TX3927) += setup_tx3927.o irq_tx3927.o
7obj-$(CONFIG_SOC_TX4927) += mem_tx4927.o setup_tx4927.o irq_tx4927.o 8obj-$(CONFIG_SOC_TX4927) += mem_tx4927.o setup_tx4927.o irq_tx4927.o
8obj-$(CONFIG_SOC_TX4938) += mem_tx4927.o setup_tx4938.o irq_tx4938.o 9obj-$(CONFIG_SOC_TX4938) += mem_tx4927.o setup_tx4938.o irq_tx4938.o
9obj-$(CONFIG_TOSHIBA_FPCIB0) += smsc_fdc37m81x.o 10obj-$(CONFIG_TOSHIBA_FPCIB0) += smsc_fdc37m81x.o
10obj-$(CONFIG_KGDB) += dbgio.o
11 11
12EXTRA_CFLAGS += -Werror 12EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/txx9/generic/dbgio.c b/arch/mips/txx9/generic/dbgio.c
deleted file mode 100644
index 33b9c672a322..000000000000
--- a/arch/mips/txx9/generic/dbgio.c
+++ /dev/null
@@ -1,48 +0,0 @@
1/*
2 * linux/arch/mips/tx4938/common/dbgio.c
3 *
4 * kgdb interface for gdb
5 *
6 * Author: MontaVista Software, Inc.
7 * source@mvista.com
8 *
9 * Copyright 2005 MontaVista Software Inc.
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 *
16 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
24 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * You should have received a copy of the GNU General Public License along
28 * with this program; if not, write to the Free Software Foundation, Inc.,
29 * 675 Mass Ave, Cambridge, MA 02139, USA.
30 *
31 * Support for TX4938 in 2.6 - Hiroshi DOYU <Hiroshi_DOYU@montavista.co.jp>
32 */
33
34#include <linux/types>
35
36extern u8 txx9_sio_kdbg_rd(void);
37extern int txx9_sio_kdbg_wr( u8 ch );
38
39u8 getDebugChar(void)
40{
41 return (txx9_sio_kdbg_rd());
42}
43
44int putDebugChar(u8 byte)
45{
46 return (txx9_sio_kdbg_wr(byte));
47}
48
diff --git a/arch/mips/txx9/generic/irq_tx3927.c b/arch/mips/txx9/generic/irq_tx3927.c
new file mode 100644
index 000000000000..c683f593eda2
--- /dev/null
+++ b/arch/mips/txx9/generic/irq_tx3927.c
@@ -0,0 +1,25 @@
1/*
2 * Common tx3927 irq handler
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright 2001 MontaVista Software Inc.
9 * Copyright (C) 2000-2001 Toshiba Corporation
10 */
11#include <linux/init.h>
12#include <asm/txx9irq.h>
13#include <asm/txx9/tx3927.h>
14
15void __init tx3927_irq_init(void)
16{
17 int i;
18
19 txx9_irq_init(TX3927_IRC_REG);
20 /* raise priority for timers, sio */
21 for (i = 0; i < TX3927_NR_TMR; i++)
22 txx9_irq_set_pri(TX3927_IR_TMR(i), 6);
23 for (i = 0; i < TX3927_NR_SIO; i++)
24 txx9_irq_set_pri(TX3927_IR_SIO(i), 7);
25}
diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c
index 0b92d8c13208..7b637a7c0e66 100644
--- a/arch/mips/txx9/generic/pci.c
+++ b/arch/mips/txx9/generic/pci.c
@@ -386,3 +386,39 @@ int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
386{ 386{
387 return txx9_board_vec->pci_map_irq(dev, slot, pin); 387 return txx9_board_vec->pci_map_irq(dev, slot, pin);
388} 388}
389
390char * (*txx9_board_pcibios_setup)(char *str) __devinitdata;
391
392char *__devinit txx9_pcibios_setup(char *str)
393{
394 if (txx9_board_pcibios_setup && !txx9_board_pcibios_setup(str))
395 return NULL;
396 if (!strcmp(str, "picmg")) {
397 /* PICMG compliant backplane (TOSHIBA JMB-PICMG-ATX
398 (5V or 3.3V), JMB-PICMG-L2 (5V only), etc.) */
399 txx9_pci_option |= TXX9_PCI_OPT_PICMG;
400 return NULL;
401 } else if (!strcmp(str, "nopicmg")) {
402 /* non-PICMG compliant backplane (TOSHIBA
403 RBHBK4100,RBHBK4200, Interface PCM-PCM05, etc.) */
404 txx9_pci_option &= ~TXX9_PCI_OPT_PICMG;
405 return NULL;
406 } else if (!strncmp(str, "clk=", 4)) {
407 char *val = str + 4;
408 txx9_pci_option &= ~TXX9_PCI_OPT_CLK_MASK;
409 if (strcmp(val, "33") == 0)
410 txx9_pci_option |= TXX9_PCI_OPT_CLK_33;
411 else if (strcmp(val, "66") == 0)
412 txx9_pci_option |= TXX9_PCI_OPT_CLK_66;
413 else /* "auto" */
414 txx9_pci_option |= TXX9_PCI_OPT_CLK_AUTO;
415 return NULL;
416 } else if (!strncmp(str, "err=", 4)) {
417 if (!strcmp(str + 4, "panic"))
418 txx9_pci_err_action = TXX9_PCI_ERR_PANIC;
419 else if (!strcmp(str + 4, "ignore"))
420 txx9_pci_err_action = TXX9_PCI_ERR_IGNORE;
421 return NULL;
422 }
423 return str;
424}
diff --git a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
index 8c60c78b9a9e..1bc57d0f4c5c 100644
--- a/arch/mips/txx9/generic/setup.c
+++ b/arch/mips/txx9/generic/setup.c
@@ -20,9 +20,13 @@
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23#include <linux/platform_device.h>
24#include <linux/serial_core.h>
23#include <asm/bootinfo.h> 25#include <asm/bootinfo.h>
24#include <asm/time.h> 26#include <asm/time.h>
27#include <asm/reboot.h>
25#include <asm/txx9/generic.h> 28#include <asm/txx9/generic.h>
29#include <asm/txx9/pci.h>
26#ifdef CONFIG_CPU_TX49XX 30#ifdef CONFIG_CPU_TX49XX
27#include <asm/txx9/tx4938.h> 31#include <asm/txx9/tx4938.h>
28#endif 32#endif
@@ -187,6 +191,117 @@ char * __init prom_getcmdline(void)
187 return &(arcs_cmdline[0]); 191 return &(arcs_cmdline[0]);
188} 192}
189 193
194static void __noreturn txx9_machine_halt(void)
195{
196 local_irq_disable();
197 clear_c0_status(ST0_IM);
198 while (1) {
199 if (cpu_wait) {
200 (*cpu_wait)();
201 if (cpu_has_counter) {
202 /*
203 * Clear counter interrupt while it
204 * breaks WAIT instruction even if
205 * masked.
206 */
207 write_c0_compare(0);
208 }
209 }
210 }
211}
212
213/* Watchdog support */
214void __init txx9_wdt_init(unsigned long base)
215{
216 struct resource res = {
217 .start = base,
218 .end = base + 0x100 - 1,
219 .flags = IORESOURCE_MEM,
220 };
221 platform_device_register_simple("txx9wdt", -1, &res, 1);
222}
223
224/* SPI support */
225void __init txx9_spi_init(int busid, unsigned long base, int irq)
226{
227 struct resource res[] = {
228 {
229 .start = base,
230 .end = base + 0x20 - 1,
231 .flags = IORESOURCE_MEM,
232 }, {
233 .start = irq,
234 .flags = IORESOURCE_IRQ,
235 },
236 };
237 platform_device_register_simple("spi_txx9", busid,
238 res, ARRAY_SIZE(res));
239}
240
241void __init txx9_ethaddr_init(unsigned int id, unsigned char *ethaddr)
242{
243 struct platform_device *pdev =
244 platform_device_alloc("tc35815-mac", id);
245 if (!pdev ||
246 platform_device_add_data(pdev, ethaddr, 6) ||
247 platform_device_add(pdev))
248 platform_device_put(pdev);
249}
250
251void __init txx9_sio_init(unsigned long baseaddr, int irq,
252 unsigned int line, unsigned int sclk, int nocts)
253{
254#ifdef CONFIG_SERIAL_TXX9
255 struct uart_port req;
256
257 memset(&req, 0, sizeof(req));
258 req.line = line;
259 req.iotype = UPIO_MEM;
260 req.membase = ioremap(baseaddr, 0x24);
261 req.mapbase = baseaddr;
262 req.irq = irq;
263 if (!nocts)
264 req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/;
265 if (sclk) {
266 req.flags |= UPF_MAGIC_MULTIPLIER /*USE_SCLK*/;
267 req.uartclk = sclk;
268 } else
269 req.uartclk = TXX9_IMCLK;
270 early_serial_txx9_setup(&req);
271#endif /* CONFIG_SERIAL_TXX9 */
272}
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
190/* wrappers */ 305/* wrappers */
191void __init plat_mem_setup(void) 306void __init plat_mem_setup(void)
192{ 307{
@@ -194,6 +309,15 @@ void __init plat_mem_setup(void)
194 ioport_resource.end = ~0UL; /* no limit */ 309 ioport_resource.end = ~0UL; /* no limit */
195 iomem_resource.start = 0; 310 iomem_resource.start = 0;
196 iomem_resource.end = ~0UL; /* no limit */ 311 iomem_resource.end = ~0UL; /* no limit */
312
313 /* fallback restart/halt routines */
314 _machine_restart = (void (*)(char *))txx9_machine_halt;
315 _machine_halt = txx9_machine_halt;
316 pm_power_off = txx9_machine_halt;
317
318#ifdef CONFIG_PCI
319 pcibios_plat_setup = txx9_pcibios_setup;
320#endif
197 txx9_board_vec->mem_setup(); 321 txx9_board_vec->mem_setup();
198} 322}
199 323
diff --git a/arch/mips/txx9/generic/setup_tx3927.c b/arch/mips/txx9/generic/setup_tx3927.c
new file mode 100644
index 000000000000..7bd963d37fc3
--- /dev/null
+++ b/arch/mips/txx9/generic/setup_tx3927.c
@@ -0,0 +1,130 @@
1/*
2 * TX3927 setup routines
3 * Based on linux/arch/mips/txx9/jmr3927/setup.c
4 *
5 * Copyright 2001 MontaVista Software Inc.
6 * Copyright (C) 2000-2001 Toshiba Corporation
7 * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
8 *
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive
11 * for more details.
12 */
13#include <linux/init.h>
14#include <linux/ioport.h>
15#include <linux/delay.h>
16#include <linux/param.h>
17#include <linux/io.h>
18#include <asm/mipsregs.h>
19#include <asm/txx9irq.h>
20#include <asm/txx9tmr.h>
21#include <asm/txx9pio.h>
22#include <asm/txx9/generic.h>
23#include <asm/txx9/tx3927.h>
24
25void __init tx3927_wdt_init(void)
26{
27 txx9_wdt_init(TX3927_TMR_REG(2));
28}
29
30void __init tx3927_setup(void)
31{
32 int i;
33 unsigned int conf;
34
35 /* don't enable - see errata */
36 txx9_ccfg_toeon = 0;
37 if (strstr(prom_getcmdline(), "toeon") != NULL)
38 txx9_ccfg_toeon = 1;
39
40 txx9_reg_res_init(TX3927_REV_PCODE(), TX3927_REG_BASE,
41 TX3927_REG_SIZE);
42
43 /* SDRAMC,ROMC are configured by PROM */
44 for (i = 0; i < 8; i++) {
45 if (!(tx3927_romcptr->cr[i] & 0x8))
46 continue; /* disabled */
47 txx9_ce_res[i].start = (unsigned long)TX3927_ROMC_BA(i);
48 txx9_ce_res[i].end =
49 txx9_ce_res[i].start + TX3927_ROMC_SIZE(i) - 1;
50 request_resource(&iomem_resource, &txx9_ce_res[i]);
51 }
52
53 /* clocks */
54 txx9_gbus_clock = txx9_cpu_clock / 2;
55 /* change default value to udelay/mdelay take reasonable time */
56 loops_per_jiffy = txx9_cpu_clock / HZ / 2;
57
58 /* CCFG */
59 /* enable Timeout BusError */
60 if (txx9_ccfg_toeon)
61 tx3927_ccfgptr->ccfg |= TX3927_CCFG_TOE;
62
63 /* clear BusErrorOnWrite flag */
64 tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_BEOW;
65 if (read_c0_conf() & TX39_CONF_WBON)
66 /* Disable PCI snoop */
67 tx3927_ccfgptr->ccfg &= ~TX3927_CCFG_PSNP;
68 else
69 /* Enable PCI SNOOP - with write through only */
70 tx3927_ccfgptr->ccfg |= TX3927_CCFG_PSNP;
71 /* do reset on watchdog */
72 tx3927_ccfgptr->ccfg |= TX3927_CCFG_WR;
73
74 printk(KERN_INFO "TX3927 -- CRIR:%08lx CCFG:%08lx PCFG:%08lx\n",
75 tx3927_ccfgptr->crir,
76 tx3927_ccfgptr->ccfg, tx3927_ccfgptr->pcfg);
77
78 /* TMR */
79 for (i = 0; i < TX3927_NR_TMR; i++)
80 txx9_tmr_init(TX3927_TMR_REG(i));
81
82 /* DMA */
83 tx3927_dmaptr->mcr = 0;
84 for (i = 0; i < ARRAY_SIZE(tx3927_dmaptr->ch); i++) {
85 /* reset channel */
86 tx3927_dmaptr->ch[i].ccr = TX3927_DMA_CCR_CHRST;
87 tx3927_dmaptr->ch[i].ccr = 0;
88 }
89 /* enable DMA */
90#ifdef __BIG_ENDIAN
91 tx3927_dmaptr->mcr = TX3927_DMA_MCR_MSTEN;
92#else
93 tx3927_dmaptr->mcr = TX3927_DMA_MCR_MSTEN | TX3927_DMA_MCR_LE;
94#endif
95
96 /* PIO */
97 __raw_writel(0, &tx3927_pioptr->maskcpu);
98 __raw_writel(0, &tx3927_pioptr->maskext);
99 txx9_gpio_init(TX3927_PIO_REG, 0, 16);
100
101 conf = read_c0_conf();
102 if (!(conf & TX39_CONF_ICE))
103 printk(KERN_INFO "TX3927 I-Cache disabled.\n");
104 if (!(conf & TX39_CONF_DCE))
105 printk(KERN_INFO "TX3927 D-Cache disabled.\n");
106 else if (!(conf & TX39_CONF_WBON))
107 printk(KERN_INFO "TX3927 D-Cache WriteThrough.\n");
108 else if (!(conf & TX39_CONF_CWFON))
109 printk(KERN_INFO "TX3927 D-Cache WriteBack.\n");
110 else
111 printk(KERN_INFO "TX3927 D-Cache WriteBack (CWF) .\n");
112}
113
114void __init tx3927_time_init(unsigned int evt_tmrnr, unsigned int src_tmrnr)
115{
116 txx9_clockevent_init(TX3927_TMR_REG(evt_tmrnr),
117 TXX9_IRQ_BASE + TX3927_IR_TMR(evt_tmrnr),
118 TXX9_IMCLK);
119 txx9_clocksource_init(TX3927_TMR_REG(src_tmrnr), TXX9_IMCLK);
120}
121
122void __init tx3927_sio_init(unsigned int sclk, unsigned int cts_mask)
123{
124 int i;
125
126 for (i = 0; i < 2; i++)
127 txx9_sio_init(TX3927_SIO_REG(i),
128 TXX9_IRQ_BASE + TX3927_IR_SIO(i),
129 i, sclk, (1 << i) & cts_mask);
130}
diff --git a/arch/mips/txx9/generic/setup_tx4927.c b/arch/mips/txx9/generic/setup_tx4927.c
index 89d6e28add93..f80d4b7a694d 100644
--- a/arch/mips/txx9/generic/setup_tx4927.c
+++ b/arch/mips/txx9/generic/setup_tx4927.c
@@ -13,7 +13,6 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/ioport.h> 14#include <linux/ioport.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/serial_core.h>
17#include <linux/param.h> 16#include <linux/param.h>
18#include <asm/txx9irq.h> 17#include <asm/txx9irq.h>
19#include <asm/txx9tmr.h> 18#include <asm/txx9tmr.h>
@@ -21,7 +20,7 @@
21#include <asm/txx9/generic.h> 20#include <asm/txx9/generic.h>
22#include <asm/txx9/tx4927.h> 21#include <asm/txx9/tx4927.h>
23 22
24void __init tx4927_wdr_init(void) 23static void __init tx4927_wdr_init(void)
25{ 24{
26 /* clear WatchDogReset (W1C) */ 25 /* clear WatchDogReset (W1C) */
27 tx4927_ccfg_set(TX4927_CCFG_WDRST); 26 tx4927_ccfg_set(TX4927_CCFG_WDRST);
@@ -29,6 +28,11 @@ void __init tx4927_wdr_init(void)
29 tx4927_ccfg_set(TX4927_CCFG_WR); 28 tx4927_ccfg_set(TX4927_CCFG_WR);
30} 29}
31 30
31void __init tx4927_wdt_init(void)
32{
33 txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL);
34}
35
32static struct resource tx4927_sdram_resource[4]; 36static struct resource tx4927_sdram_resource[4];
33 37
34void __init tx4927_setup(void) 38void __init tx4927_setup(void)
@@ -173,22 +177,12 @@ void __init tx4927_time_init(unsigned int tmrnr)
173 TXX9_IMCLK); 177 TXX9_IMCLK);
174} 178}
175 179
176void __init tx4927_setup_serial(void) 180void __init tx4927_sio_init(unsigned int sclk, unsigned int cts_mask)
177{ 181{
178#ifdef CONFIG_SERIAL_TXX9
179 int i; 182 int i;
180 struct uart_port req; 183
181 184 for (i = 0; i < 2; i++)
182 for (i = 0; i < 2; i++) { 185 txx9_sio_init(TX4927_SIO_REG(i) & 0xfffffffffULL,
183 memset(&req, 0, sizeof(req)); 186 TXX9_IRQ_BASE + TX4927_IR_SIO(i),
184 req.line = i; 187 i, sclk, (1 << i) & cts_mask);
185 req.iotype = UPIO_MEM;
186 req.membase = (unsigned char __iomem *)TX4927_SIO_REG(i);
187 req.mapbase = TX4927_SIO_REG(i) & 0xfffffffffULL;
188 req.irq = TXX9_IRQ_BASE + TX4927_IR_SIO(i);
189 req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/;
190 req.uartclk = TXX9_IMCLK;
191 early_serial_txx9_setup(&req);
192 }
193#endif /* CONFIG_SERIAL_TXX9 */
194} 188}
diff --git a/arch/mips/txx9/generic/setup_tx4938.c b/arch/mips/txx9/generic/setup_tx4938.c
index 317378d8579d..f3040b9ba059 100644
--- a/arch/mips/txx9/generic/setup_tx4938.c
+++ b/arch/mips/txx9/generic/setup_tx4938.c
@@ -13,7 +13,6 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/ioport.h> 14#include <linux/ioport.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/serial_core.h>
17#include <linux/param.h> 16#include <linux/param.h>
18#include <asm/txx9irq.h> 17#include <asm/txx9irq.h>
19#include <asm/txx9tmr.h> 18#include <asm/txx9tmr.h>
@@ -21,7 +20,7 @@
21#include <asm/txx9/generic.h> 20#include <asm/txx9/generic.h>
22#include <asm/txx9/tx4938.h> 21#include <asm/txx9/tx4938.h>
23 22
24void __init tx4938_wdr_init(void) 23static void __init tx4938_wdr_init(void)
25{ 24{
26 /* clear WatchDogReset (W1C) */ 25 /* clear WatchDogReset (W1C) */
27 tx4938_ccfg_set(TX4938_CCFG_WDRST); 26 tx4938_ccfg_set(TX4938_CCFG_WDRST);
@@ -29,6 +28,11 @@ void __init tx4938_wdr_init(void)
29 tx4938_ccfg_set(TX4938_CCFG_WR); 28 tx4938_ccfg_set(TX4938_CCFG_WR);
30} 29}
31 30
31void __init tx4938_wdt_init(void)
32{
33 txx9_wdt_init(TX4938_TMR_REG(2) & 0xfffffffffULL);
34}
35
32static struct resource tx4938_sdram_resource[4]; 36static struct resource tx4938_sdram_resource[4];
33static struct resource tx4938_sram_resource; 37static struct resource tx4938_sram_resource;
34 38
@@ -233,11 +237,9 @@ void __init tx4938_time_init(unsigned int tmrnr)
233 TXX9_IMCLK); 237 TXX9_IMCLK);
234} 238}
235 239
236void __init tx4938_setup_serial(void) 240void __init tx4938_sio_init(unsigned int sclk, unsigned int cts_mask)
237{ 241{
238#ifdef CONFIG_SERIAL_TXX9
239 int i; 242 int i;
240 struct uart_port req;
241 unsigned int ch_mask = 0; 243 unsigned int ch_mask = 0;
242 244
243 if (__raw_readq(&tx4938_ccfgptr->pcfg) & TX4938_PCFG_ETH0_SEL) 245 if (__raw_readq(&tx4938_ccfgptr->pcfg) & TX4938_PCFG_ETH0_SEL)
@@ -245,15 +247,24 @@ void __init tx4938_setup_serial(void)
245 for (i = 0; i < 2; i++) { 247 for (i = 0; i < 2; i++) {
246 if ((1 << i) & ch_mask) 248 if ((1 << i) & ch_mask)
247 continue; 249 continue;
248 memset(&req, 0, sizeof(req)); 250 txx9_sio_init(TX4938_SIO_REG(i) & 0xfffffffffULL,
249 req.line = i; 251 TXX9_IRQ_BASE + TX4938_IR_SIO(i),
250 req.iotype = UPIO_MEM; 252 i, sclk, (1 << i) & cts_mask);
251 req.membase = (unsigned char __iomem *)TX4938_SIO_REG(i);
252 req.mapbase = TX4938_SIO_REG(i) & 0xfffffffffULL;
253 req.irq = TXX9_IRQ_BASE + TX4938_IR_SIO(i);
254 req.flags |= UPF_BUGGY_UART /*HAVE_CTS_LINE*/;
255 req.uartclk = TXX9_IMCLK;
256 early_serial_txx9_setup(&req);
257 } 253 }
258#endif /* CONFIG_SERIAL_TXX9 */ 254}
255
256void __init tx4938_spi_init(int busid)
257{
258 txx9_spi_init(busid, TX4938_SPI_REG & 0xfffffffffULL,
259 TXX9_IRQ_BASE + TX4938_IR_SPI);
260}
261
262void __init tx4938_ethaddr_init(unsigned char *addr0, unsigned char *addr1)
263{
264 u64 pcfg = __raw_readq(&tx4938_ccfgptr->pcfg);
265
266 if (addr0 && (pcfg & TX4938_PCFG_ETH0_SEL))
267 txx9_ethaddr_init(TXX9_IRQ_BASE + TX4938_IR_ETH0, addr0);
268 if (addr1 && (pcfg & TX4938_PCFG_ETH1_SEL))
269 txx9_ethaddr_init(TXX9_IRQ_BASE + TX4938_IR_ETH1, addr1);
259} 270}
diff --git a/arch/mips/txx9/generic/smsc_fdc37m81x.c b/arch/mips/txx9/generic/smsc_fdc37m81x.c
index 69e487467fa5..a2b2d62d88e3 100644
--- a/arch/mips/txx9/generic/smsc_fdc37m81x.c
+++ b/arch/mips/txx9/generic/smsc_fdc37m81x.c
@@ -15,8 +15,6 @@
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/txx9/smsc_fdc37m81x.h> 16#include <asm/txx9/smsc_fdc37m81x.h>
17 17
18#define DEBUG
19
20/* Common Registers */ 18/* Common Registers */
21#define SMSC_FDC37M81X_CONFIG_INDEX 0x00 19#define SMSC_FDC37M81X_CONFIG_INDEX 0x00
22#define SMSC_FDC37M81X_CONFIG_DATA 0x01 20#define SMSC_FDC37M81X_CONFIG_DATA 0x01
@@ -55,7 +53,7 @@
55#define SMSC_FDC37M81X_CONFIG_EXIT 0xaa 53#define SMSC_FDC37M81X_CONFIG_EXIT 0xaa
56#define SMSC_FDC37M81X_CHIP_ID 0x4d 54#define SMSC_FDC37M81X_CHIP_ID 0x4d
57 55
58static unsigned long g_smsc_fdc37m81x_base = 0; 56static unsigned long g_smsc_fdc37m81x_base;
59 57
60static inline unsigned char smsc_fdc37m81x_rd(unsigned char index) 58static inline unsigned char smsc_fdc37m81x_rd(unsigned char index)
61{ 59{
@@ -107,7 +105,8 @@ unsigned long __init smsc_fdc37m81x_init(unsigned long port)
107 u8 chip_id; 105 u8 chip_id;
108 106
109 if (g_smsc_fdc37m81x_base) 107 if (g_smsc_fdc37m81x_base)
110 printk("smsc_fdc37m81x_init() stepping on old base=0x%0*lx\n", 108 printk(KERN_WARNING "%s: stepping on old base=0x%0*lx\n",
109 __func__,
111 field, g_smsc_fdc37m81x_base); 110 field, g_smsc_fdc37m81x_base);
112 111
113 g_smsc_fdc37m81x_base = port; 112 g_smsc_fdc37m81x_base = port;
@@ -118,7 +117,7 @@ unsigned long __init smsc_fdc37m81x_init(unsigned long port)
118 if (chip_id == SMSC_FDC37M81X_CHIP_ID) 117 if (chip_id == SMSC_FDC37M81X_CHIP_ID)
119 smsc_fdc37m81x_config_end(); 118 smsc_fdc37m81x_config_end();
120 else { 119 else {
121 printk("smsc_fdc37m81x_init() unknow chip id 0x%02x\n", 120 printk(KERN_WARNING "%s: unknow chip id 0x%02x\n", __func__,
122 chip_id); 121 chip_id);
123 g_smsc_fdc37m81x_base = 0; 122 g_smsc_fdc37m81x_base = 0;
124 } 123 }
@@ -127,22 +126,23 @@ unsigned long __init smsc_fdc37m81x_init(unsigned long port)
127} 126}
128 127
129#ifdef DEBUG 128#ifdef DEBUG
130void smsc_fdc37m81x_config_dump_one(char *key, u8 dev, u8 reg) 129static void smsc_fdc37m81x_config_dump_one(const char *key, u8 dev, u8 reg)
131{ 130{
132 printk("%s: dev=0x%02x reg=0x%02x val=0x%02x\n", key, dev, reg, 131 printk(KERN_INFO "%s: dev=0x%02x reg=0x%02x val=0x%02x\n",
132 key, dev, reg,
133 smsc_fdc37m81x_rd(reg)); 133 smsc_fdc37m81x_rd(reg));
134} 134}
135 135
136void smsc_fdc37m81x_config_dump(void) 136void smsc_fdc37m81x_config_dump(void)
137{ 137{
138 u8 orig; 138 u8 orig;
139 char *fname = "smsc_fdc37m81x_config_dump()"; 139 const char *fname = __func__;
140 140
141 smsc_fdc37m81x_config_beg(); 141 smsc_fdc37m81x_config_beg();
142 142
143 orig = smsc_fdc37m81x_rd(SMSC_FDC37M81X_DNUM); 143 orig = smsc_fdc37m81x_rd(SMSC_FDC37M81X_DNUM);
144 144
145 printk("%s: common\n", fname); 145 printk(KERN_INFO "%s: common\n", fname);
146 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE, 146 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
147 SMSC_FDC37M81X_DNUM); 147 SMSC_FDC37M81X_DNUM);
148 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE, 148 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
@@ -154,7 +154,7 @@ void smsc_fdc37m81x_config_dump(void)
154 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE, 154 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_NONE,
155 SMSC_FDC37M81X_PMGT); 155 SMSC_FDC37M81X_PMGT);
156 156
157 printk("%s: keyboard\n", fname); 157 printk(KERN_INFO "%s: keyboard\n", fname);
158 smsc_dc37m81x_wr(SMSC_FDC37M81X_DNUM, SMSC_FDC37M81X_KBD); 158 smsc_dc37m81x_wr(SMSC_FDC37M81X_DNUM, SMSC_FDC37M81X_KBD);
159 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_KBD, 159 smsc_fdc37m81x_config_dump_one(fname, SMSC_FDC37M81X_KBD,
160 SMSC_FDC37M81X_ACTIVE); 160 SMSC_FDC37M81X_ACTIVE);