2 * Toshiba rbtx4927 specific setup
4 * Author: MontaVista Software, Inc.
7 * Copyright 2001-2002 MontaVista Software Inc.
9 * Copyright (C) 1996, 97, 2001, 04 Ralf Baechle (ralf@linux-mips.org)
10 * Copyright (C) 2000 RidgeRun, Inc.
11 * Author: RidgeRun, Inc.
12 * glonnon@ridgerun.com, skranz@ridgerun.com, stevej@ridgerun.com
14 * Copyright 2001 MontaVista Software Inc.
15 * Author: jsun@mvista.com or jsun@junsun.net
17 * Copyright 2002 MontaVista Software Inc.
18 * Author: Michael Pruznick, michael_pruznick@mvista.com
20 * Copyright (C) 2000-2001 Toshiba Corporation
22 * Copyright (C) 2004 MontaVista Software Inc.
23 * Author: Manish Lachwani, mlachwani@mvista.com
25 * This program is free software; you can redistribute it and/or modify it
26 * under the terms of the GNU General Public License as published by the
27 * Free Software Foundation; either version 2 of the License, or (at your
28 * option) any later version.
30 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
31 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
32 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
33 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
34 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
35 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
36 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
37 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
38 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
39 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 * You should have received a copy of the GNU General Public License along
42 * with this program; if not, write to the Free Software Foundation, Inc.,
43 * 675 Mass Ave, Cambridge, MA 02139, USA.
45 #include <linux/init.h>
46 #include <linux/kernel.h>
47 #include <linux/types.h>
48 #include <linux/ioport.h>
49 #include <linux/interrupt.h>
50 #include <linux/pci.h>
52 #include <linux/platform_device.h>
53 #include <linux/clk.h>
55 #include <asm/bootinfo.h>
57 #include <asm/processor.h>
58 #include <asm/reboot.h>
60 #include <asm/txx9tmr.h>
61 #ifdef CONFIG_TOSHIBA_FPCIB0
62 #include <asm/txx9/smsc_fdc37m81x.h>
64 #include <asm/txx9/rbtx4927.h>
65 #ifdef CONFIG_SERIAL_TXX9
66 #include <linux/serial_core.h>
69 /* These functions are used for rebooting or halting the machine*/
70 extern void toshiba_rbtx4927_restart(char *command
);
71 extern void toshiba_rbtx4927_halt(void);
72 extern void toshiba_rbtx4927_power_off(void);
74 int tx4927_using_backplane
= 0;
76 extern void toshiba_rbtx4927_irq_setup(void);
78 char *prom_getcmdline(void);
81 #undef TX4927_SUPPORT_COMMAND_IO
82 #undef TX4927_SUPPORT_PCI_66
83 int tx4927_cpu_clock
= 100000000; /* 100MHz */
84 unsigned long mips_pci_io_base
;
85 unsigned long mips_pci_io_size
;
86 unsigned long mips_pci_mem_base
;
87 unsigned long mips_pci_mem_size
;
88 /* for legacy I/O, PCI I/O PCI Bus address must be 0 */
89 unsigned long mips_pci_io_pciaddr
= 0;
90 unsigned long mips_memory_upper
;
91 static int tx4927_ccfg_toeon
= 1;
92 static int tx4927_pcic_trdyto
= 0; /* default: disabled */
93 unsigned long tx4927_ce_base
[8];
94 int tx4927_pci66
= 0; /* 0:auto */
97 char *toshiba_name
= "";
100 extern struct pci_controller tx4927_controller
;
102 static struct pci_dev
*fake_pci_dev(struct pci_controller
*hose
,
103 int top_bus
, int busnr
, int devfn
)
105 static struct pci_dev dev
;
106 static struct pci_bus bus
;
108 dev
.sysdata
= (void *)hose
;
111 bus
.ops
= hose
->pci_ops
;
118 #define EARLY_PCI_OP(rw, size, type) \
119 static int early_##rw##_config_##size(struct pci_controller *hose, \
120 int top_bus, int bus, int devfn, int offset, type value) \
122 return pci_##rw##_config_##size( \
123 fake_pci_dev(hose, top_bus, bus, devfn), \
127 EARLY_PCI_OP(read
, byte
, u8
*)
128 EARLY_PCI_OP(read
, dword
, u32
*)
129 EARLY_PCI_OP(write
, byte
, u8
)
130 EARLY_PCI_OP(write
, dword
, u32
)
132 static int __init
tx4927_pcibios_init(void)
137 int devfn_stop
= 0xff;
138 int busno
= 0; /* One bus on the Toshiba */
139 struct pci_controller
*hose
= &tx4927_controller
;
141 for (pci_devfn
= devfn_start
; pci_devfn
< devfn_stop
; pci_devfn
++) {
142 early_read_config_dword(hose
, busno
, busno
, pci_devfn
,
145 if (id
== 0xffffffff) {
149 if (id
== 0x94601055) {
154 early_read_config_byte(hose
, busno
, busno
,
155 pci_devfn
, 0x64, &v08_64
);
156 early_read_config_dword(hose
, busno
, busno
,
157 pci_devfn
, 0xb0, &v32_b0
);
158 early_read_config_byte(hose
, busno
, busno
,
159 pci_devfn
, 0xe1, &v08_e1
);
161 /* serial irq control */
165 v32_b0
|= 0x00010000;
167 /* ide irq on isa14 */
171 early_write_config_byte(hose
, busno
, busno
,
172 pci_devfn
, 0x64, v08_64
);
173 early_write_config_dword(hose
, busno
, busno
,
174 pci_devfn
, 0xb0, v32_b0
);
175 early_write_config_byte(hose
, busno
, busno
,
176 pci_devfn
, 0xe1, v08_e1
);
179 if (id
== 0x91301055) {
186 early_read_config_byte(hose
, busno
, busno
,
187 pci_devfn
, 0x04, &v08_04
);
188 early_read_config_byte(hose
, busno
, busno
,
189 pci_devfn
, 0x09, &v08_09
);
190 early_read_config_byte(hose
, busno
, busno
,
191 pci_devfn
, 0x41, &v08_41
);
192 early_read_config_byte(hose
, busno
, busno
,
193 pci_devfn
, 0x43, &v08_43
);
194 early_read_config_byte(hose
, busno
, busno
,
195 pci_devfn
, 0x5c, &v08_5c
);
197 /* enable ide master/io */
198 v08_04
|= (PCI_COMMAND_MASTER
| PCI_COMMAND_IO
);
200 /* enable ide native mode */
203 /* enable primary ide */
206 /* enable secondary ide */
210 * !!! DO NOT REMOVE THIS COMMENT IT IS REQUIRED BY SMSC !!!
212 * This line of code is intended to provide the user with a work
213 * around solution to the anomalies cited in SMSC's anomaly sheet
214 * entitled, "SLC90E66 Functional Rev.J_0.1 Anomalies"".
216 * !!! DO NOT REMOVE THIS COMMENT IT IS REQUIRED BY SMSC !!!
220 early_write_config_byte(hose
, busno
, busno
,
221 pci_devfn
, 0x5c, v08_5c
);
222 early_write_config_byte(hose
, busno
, busno
,
223 pci_devfn
, 0x04, v08_04
);
224 early_write_config_byte(hose
, busno
, busno
,
225 pci_devfn
, 0x09, v08_09
);
226 early_write_config_byte(hose
, busno
, busno
,
227 pci_devfn
, 0x41, v08_41
);
228 early_write_config_byte(hose
, busno
, busno
,
229 pci_devfn
, 0x43, v08_43
);
234 register_pci_controller(&tx4927_controller
);
238 arch_initcall(tx4927_pcibios_init
);
240 extern struct resource pci_io_resource
;
241 extern struct resource pci_mem_resource
;
243 void __init
tx4927_pci_setup(void)
245 static int called
= 0;
246 extern unsigned int tx4927_get_mem_size(void);
248 mips_memory_upper
= tx4927_get_mem_size() << 20;
249 mips_memory_upper
+= KSEG0
;
250 mips_pci_io_base
= TX4927_PCIIO
;
251 mips_pci_io_size
= TX4927_PCIIO_SIZE
;
252 mips_pci_mem_base
= TX4927_PCIMEM
;
253 mips_pci_mem_size
= TX4927_PCIMEM_SIZE
;
257 ("%s PCIC -- DID:%04x VID:%04x RID:%02x Arbiter:%s\n",
259 (unsigned short) (tx4927_pcicptr
->pciid
>> 16),
260 (unsigned short) (tx4927_pcicptr
->pciid
& 0xffff),
261 (unsigned short) (tx4927_pcicptr
->pciccrev
& 0xff),
263 ccfg
& TX4927_CCFG_PCIXARB
)) ? "External" :
267 printk("%s PCIC --%s PCICLK:", toshiba_name
,
268 (tx4927_ccfgptr
->ccfg
& TX4927_CCFG_PCI66
) ? " PCI66" : "");
269 if (tx4927_ccfgptr
->pcfg
& TX4927_PCFG_PCICLKEN_ALL
) {
271 if (mips_machtype
== MACH_TOSHIBA_RBTX4937
)
272 switch ((unsigned long) tx4927_ccfgptr
->
273 ccfg
& TX4937_CCFG_PCIDIVMODE_MASK
) {
274 case TX4937_CCFG_PCIDIVMODE_4
:
275 pciclk
= tx4927_cpu_clock
/ 4;
277 case TX4937_CCFG_PCIDIVMODE_4_5
:
278 pciclk
= tx4927_cpu_clock
* 2 / 9;
280 case TX4937_CCFG_PCIDIVMODE_5
:
281 pciclk
= tx4927_cpu_clock
/ 5;
283 case TX4937_CCFG_PCIDIVMODE_5_5
:
284 pciclk
= tx4927_cpu_clock
* 2 / 11;
286 case TX4937_CCFG_PCIDIVMODE_8
:
287 pciclk
= tx4927_cpu_clock
/ 8;
289 case TX4937_CCFG_PCIDIVMODE_9
:
290 pciclk
= tx4927_cpu_clock
/ 9;
292 case TX4937_CCFG_PCIDIVMODE_10
:
293 pciclk
= tx4927_cpu_clock
/ 10;
295 case TX4937_CCFG_PCIDIVMODE_11
:
296 pciclk
= tx4927_cpu_clock
/ 11;
301 switch ((unsigned long) tx4927_ccfgptr
->
302 ccfg
& TX4927_CCFG_PCIDIVMODE_MASK
) {
303 case TX4927_CCFG_PCIDIVMODE_2_5
:
304 pciclk
= tx4927_cpu_clock
* 2 / 5;
306 case TX4927_CCFG_PCIDIVMODE_3
:
307 pciclk
= tx4927_cpu_clock
/ 3;
309 case TX4927_CCFG_PCIDIVMODE_5
:
310 pciclk
= tx4927_cpu_clock
/ 5;
312 case TX4927_CCFG_PCIDIVMODE_6
:
313 pciclk
= tx4927_cpu_clock
/ 6;
317 printk("Internal(%dMHz)", pciclk
/ 1000000);
322 /* GB->PCI mappings */
323 tx4927_pcicptr
->g2piomask
= (mips_pci_io_size
- 1) >> 4;
324 tx4927_pcicptr
->g2piogbase
= mips_pci_io_base
|
326 TX4927_PCIC_G2PIOGBASE_ECHG
328 TX4927_PCIC_G2PIOGBASE_BSDIS
332 tx4927_pcicptr
->g2piopbase
= 0;
334 tx4927_pcicptr
->g2pmmask
[0] = (mips_pci_mem_size
- 1) >> 4;
335 tx4927_pcicptr
->g2pmgbase
[0] = mips_pci_mem_base
|
337 TX4927_PCIC_G2PMnGBASE_ECHG
339 TX4927_PCIC_G2PMnGBASE_BSDIS
342 tx4927_pcicptr
->g2pmpbase
[0] = mips_pci_mem_base
;
344 tx4927_pcicptr
->g2pmmask
[1] = 0;
345 tx4927_pcicptr
->g2pmgbase
[1] = 0;
346 tx4927_pcicptr
->g2pmpbase
[1] = 0;
347 tx4927_pcicptr
->g2pmmask
[2] = 0;
348 tx4927_pcicptr
->g2pmgbase
[2] = 0;
349 tx4927_pcicptr
->g2pmpbase
[2] = 0;
352 /* PCI->GB mappings (I/O 256B) */
353 tx4927_pcicptr
->p2giopbase
= 0; /* 256B */
355 /* PCI->GB mappings (MEM 512MB) M0 gets all of memory */
356 tx4927_pcicptr
->p2gm0plbase
= 0;
357 tx4927_pcicptr
->p2gm0pubase
= 0;
358 tx4927_pcicptr
->p2gmgbase
[0] = 0 | TX4927_PCIC_P2GMnGBASE_TMEMEN
|
360 TX4927_PCIC_P2GMnGBASE_TECHG
362 TX4927_PCIC_P2GMnGBASE_TBSDIS
366 /* PCI->GB mappings (MEM 16MB) -not used */
367 tx4927_pcicptr
->p2gm1plbase
= 0xffffffff;
368 tx4927_pcicptr
->p2gm1pubase
= 0xffffffff;
369 tx4927_pcicptr
->p2gmgbase
[1] = 0;
371 /* PCI->GB mappings (MEM 1MB) -not used */
372 tx4927_pcicptr
->p2gm2pbase
= 0xffffffff;
373 tx4927_pcicptr
->p2gmgbase
[2] = 0;
376 /* Enable Initiator Memory 0 Space, I/O Space, Config */
377 tx4927_pcicptr
->pciccfg
&= TX4927_PCIC_PCICCFG_LBWC_MASK
;
378 tx4927_pcicptr
->pciccfg
|=
379 TX4927_PCIC_PCICCFG_IMSE0
| TX4927_PCIC_PCICCFG_IISE
|
380 TX4927_PCIC_PCICCFG_ICAE
| TX4927_PCIC_PCICCFG_ATR
;
383 /* Do not use MEMMUL, MEMINF: YMFPCI card causes M_ABORT. */
384 tx4927_pcicptr
->pcicfg1
= 0;
386 if (tx4927_pcic_trdyto
>= 0) {
387 tx4927_pcicptr
->g2ptocnt
&= ~0xff;
388 tx4927_pcicptr
->g2ptocnt
|= (tx4927_pcic_trdyto
& 0xff);
391 /* Clear All Local Bus Status */
392 tx4927_pcicptr
->pcicstatus
= TX4927_PCIC_PCICSTATUS_ALL
;
393 /* Enable All Local Bus Interrupts */
394 tx4927_pcicptr
->pcicmask
= TX4927_PCIC_PCICSTATUS_ALL
;
395 /* Clear All Initiator Status */
396 tx4927_pcicptr
->g2pstatus
= TX4927_PCIC_G2PSTATUS_ALL
;
397 /* Enable All Initiator Interrupts */
398 tx4927_pcicptr
->g2pmask
= TX4927_PCIC_G2PSTATUS_ALL
;
399 /* Clear All PCI Status Error */
400 tx4927_pcicptr
->pcistatus
=
401 (tx4927_pcicptr
->pcistatus
& 0x0000ffff) |
402 (TX4927_PCIC_PCISTATUS_ALL
<< 16);
403 /* Enable All PCI Status Error Interrupts */
404 tx4927_pcicptr
->pcimask
= TX4927_PCIC_PCISTATUS_ALL
;
406 /* PCIC Int => IRC IRQ16 */
407 tx4927_pcicptr
->pcicfg2
=
408 (tx4927_pcicptr
->pcicfg2
& 0xffffff00) | TX4927_IR_PCIC
;
410 if (!(tx4927_ccfgptr
->ccfg
& TX4927_CCFG_PCIXARB
)) {
413 /* Reset Bus Arbiter */
414 tx4927_pcicptr
->pbacfg
= TX4927_PCIC_PBACFG_RPBA
;
415 /* Enable Bus Arbiter */
416 tx4927_pcicptr
->pbacfg
= TX4927_PCIC_PBACFG_PBAEN
;
419 tx4927_pcicptr
->pcistatus
= PCI_COMMAND_MASTER
|
421 PCI_COMMAND_PARITY
| PCI_COMMAND_SERR
;
423 #endif /* CONFIG_PCI */
425 static void __noreturn
wait_forever(void)
432 void toshiba_rbtx4927_restart(char *command
)
434 printk(KERN_NOTICE
"System Rebooting...\n");
436 /* enable the s/w reset register */
437 writeb(RBTX4927_SW_RESET_ENABLE_SET
, RBTX4927_SW_RESET_ENABLE
);
439 /* wait for enable to be seen */
440 while ((readb(RBTX4927_SW_RESET_ENABLE
) &
441 RBTX4927_SW_RESET_ENABLE_SET
) == 0x00);
444 writeb(RBTX4927_SW_RESET_DO_SET
, RBTX4927_SW_RESET_DO
);
446 /* do something passive while waiting for reset */
452 void toshiba_rbtx4927_halt(void)
454 printk(KERN_NOTICE
"System Halted\n");
460 void toshiba_rbtx4927_power_off(void)
462 toshiba_rbtx4927_halt();
466 void __init
plat_mem_setup(void)
472 printk("CPU is %s\n", toshiba_name
);
474 /* f/w leaves this on at startup */
475 clear_c0_status(ST0_ERL
);
477 /* enable caches -- HCP5 does this, pmon does not */
478 cp0_config
= read_c0_config();
479 cp0_config
= cp0_config
& ~(TX49_CONF_IC
| TX49_CONF_DC
);
480 write_c0_config(cp0_config
);
482 set_io_port_base(KSEG1
+ TBTX4927_ISA_IO_OFFSET
);
484 ioport_resource
.end
= 0xffffffff;
485 iomem_resource
.end
= 0xffffffff;
487 _machine_restart
= toshiba_rbtx4927_restart
;
488 _machine_halt
= toshiba_rbtx4927_halt
;
489 pm_power_off
= toshiba_rbtx4927_power_off
;
491 for (i
= 0; i
< TX4927_NR_TMR
; i
++)
492 txx9_tmr_init(TX4927_TMR_REG(0) & 0xfffffffffULL
);
498 * ASSUMPTION: PCIDIVMODE is configured for PCI 33MHz or 66MHz.
501 * PCIDIVMODE[12:11]'s initial value is given by S9[4:3] (ON:0, OFF:1).
502 * CPU 166MHz: PCI 66MHz : PCIDIVMODE: 00 (1/2.5)
503 * CPU 200MHz: PCI 66MHz : PCIDIVMODE: 01 (1/3)
504 * CPU 166MHz: PCI 33MHz : PCIDIVMODE: 10 (1/5)
505 * CPU 200MHz: PCI 33MHz : PCIDIVMODE: 11 (1/6)
506 * i.e. S9[3]: ON (83MHz), OFF (100MHz)
509 * PCIDIVMODE[12:11]'s initial value is given by S1[5:4] (ON:0, OFF:1)
510 * PCIDIVMODE[10] is 0.
511 * CPU 266MHz: PCI 33MHz : PCIDIVMODE: 000 (1/8)
512 * CPU 266MHz: PCI 66MHz : PCIDIVMODE: 001 (1/4)
513 * CPU 300MHz: PCI 33MHz : PCIDIVMODE: 010 (1/9)
514 * CPU 300MHz: PCI 66MHz : PCIDIVMODE: 011 (1/4.5)
515 * CPU 333MHz: PCI 33MHz : PCIDIVMODE: 100 (1/10)
516 * CPU 333MHz: PCI 66MHz : PCIDIVMODE: 101 (1/5)
519 if (mips_machtype
== MACH_TOSHIBA_RBTX4937
)
520 switch ((unsigned long)tx4927_ccfgptr
->
521 ccfg
& TX4937_CCFG_PCIDIVMODE_MASK
) {
522 case TX4937_CCFG_PCIDIVMODE_8
:
523 case TX4937_CCFG_PCIDIVMODE_4
:
524 tx4927_cpu_clock
= 266666666; /* 266MHz */
526 case TX4937_CCFG_PCIDIVMODE_9
:
527 case TX4937_CCFG_PCIDIVMODE_4_5
:
528 tx4927_cpu_clock
= 300000000; /* 300MHz */
531 tx4927_cpu_clock
= 333333333; /* 333MHz */
534 switch ((unsigned long)tx4927_ccfgptr
->
535 ccfg
& TX4927_CCFG_PCIDIVMODE_MASK
) {
536 case TX4927_CCFG_PCIDIVMODE_2_5
:
537 case TX4927_CCFG_PCIDIVMODE_5
:
538 tx4927_cpu_clock
= 166666666; /* 166MHz */
541 tx4927_cpu_clock
= 200000000; /* 200MHz */
545 /* do reset on watchdog */
546 tx4927_ccfgptr
->ccfg
|= TX4927_CCFG_WR
;
547 /* enable Timeout BusError */
548 if (tx4927_ccfg_toeon
)
549 tx4927_ccfgptr
->ccfg
|= TX4927_CCFG_TOE
;
552 if (tx4927_using_backplane
== 1)
553 printk("backplane board IS installed\n");
555 printk("No Backplane \n");
557 /* this is on ISA bus behind PCI bus, so need PCI up first */
558 #ifdef CONFIG_TOSHIBA_FPCIB0
559 if (tx4927_using_backplane
) {
560 smsc_fdc37m81x_init(0x3f0);
561 smsc_fdc37m81x_config_beg();
562 smsc_fdc37m81x_config_set(SMSC_FDC37M81X_DNUM
,
564 smsc_fdc37m81x_config_set(SMSC_FDC37M81X_INT
, 1);
565 smsc_fdc37m81x_config_set(SMSC_FDC37M81X_INT2
, 12);
566 smsc_fdc37m81x_config_set(SMSC_FDC37M81X_ACTIVE
,
568 smsc_fdc37m81x_config_end();
571 #endif /* CONFIG_PCI */
573 #ifdef CONFIG_SERIAL_TXX9
575 extern int early_serial_txx9_setup(struct uart_port
*port
);
576 struct uart_port req
;
577 for(i
= 0; i
< 2; i
++) {
578 memset(&req
, 0, sizeof(req
));
580 req
.iotype
= UPIO_MEM
;
581 req
.membase
= (char *)(0xff1ff300 + i
* 0x100);
582 req
.mapbase
= 0xff1ff300 + i
* 0x100;
583 req
.irq
= TX4927_IRQ_PIC_BEG
+ 8 + i
;
584 req
.flags
|= UPF_BUGGY_UART
/*HAVE_CTS_LINE*/;
585 req
.uartclk
= 50000000;
586 early_serial_txx9_setup(&req
);
589 #ifdef CONFIG_SERIAL_TXX9_CONSOLE
590 argptr
= prom_getcmdline();
591 if (strstr(argptr
, "console=") == NULL
) {
592 strcat(argptr
, " console=ttyS0,38400");
597 #ifdef CONFIG_ROOT_NFS
598 argptr
= prom_getcmdline();
599 if (strstr(argptr
, "root=") == NULL
) {
600 strcat(argptr
, " root=/dev/nfs rw");
605 argptr
= prom_getcmdline();
606 if (strstr(argptr
, "ip=") == NULL
) {
607 strcat(argptr
, " ip=any");
612 void __init
plat_time_init(void)
614 mips_hpt_frequency
= tx4927_cpu_clock
/ 2;
615 if (tx4927_ccfgptr
->ccfg
& TX4927_CCFG_TINTDIS
)
616 txx9_clockevent_init(TX4927_TMR_REG(0) & 0xfffffffffULL
,
621 static int __init
toshiba_rbtx4927_rtc_init(void)
623 static struct resource __initdata res
= {
625 .end
= 0x1c010000 + 0x800 - 1,
626 .flags
= IORESOURCE_MEM
,
628 struct platform_device
*dev
=
629 platform_device_register_simple("rtc-ds1742", -1, &res
, 1);
630 return IS_ERR(dev
) ? PTR_ERR(dev
) : 0;
632 device_initcall(toshiba_rbtx4927_rtc_init
);
634 static int __init
rbtx4927_ne_init(void)
636 static struct resource __initdata res
[] = {
638 .start
= RBTX4927_RTL_8019_BASE
,
639 .end
= RBTX4927_RTL_8019_BASE
+ 0x20 - 1,
640 .flags
= IORESOURCE_IO
,
642 .start
= RBTX4927_RTL_8019_IRQ
,
643 .flags
= IORESOURCE_IRQ
,
646 struct platform_device
*dev
=
647 platform_device_register_simple("ne", -1,
648 res
, ARRAY_SIZE(res
));
649 return IS_ERR(dev
) ? PTR_ERR(dev
) : 0;
651 device_initcall(rbtx4927_ne_init
);
653 /* Watchdog support */
655 static int __init
txx9_wdt_init(unsigned long base
)
657 struct resource res
= {
659 .end
= base
+ 0x100 - 1,
660 .flags
= IORESOURCE_MEM
,
662 struct platform_device
*dev
=
663 platform_device_register_simple("txx9wdt", -1, &res
, 1);
664 return IS_ERR(dev
) ? PTR_ERR(dev
) : 0;
667 static int __init
rbtx4927_wdt_init(void)
669 return txx9_wdt_init(TX4927_TMR_REG(2) & 0xfffffffffULL
);
671 device_initcall(rbtx4927_wdt_init
);
673 /* Minimum CLK support */
675 struct clk
*clk_get(struct device
*dev
, const char *id
)
677 if (!strcmp(id
, "imbus_clk"))
678 return (struct clk
*)50000000;
679 return ERR_PTR(-ENOENT
);
681 EXPORT_SYMBOL(clk_get
);
683 int clk_enable(struct clk
*clk
)
687 EXPORT_SYMBOL(clk_enable
);
689 void clk_disable(struct clk
*clk
)
692 EXPORT_SYMBOL(clk_disable
);
694 unsigned long clk_get_rate(struct clk
*clk
)
696 return (unsigned long)clk
;
698 EXPORT_SYMBOL(clk_get_rate
);
700 void clk_put(struct clk
*clk
)
703 EXPORT_SYMBOL(clk_put
);