rm200.c (bc95f3669f5e6f63cf0b84fe4922c3c6dd4aa775) rm200.c (06cf5583fd9ac782cf34996cdabb48afdf478e37)
1/*
2 * RM200 specific code
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 (C) 2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
9 */
10
11#include <linux/init.h>
12#include <linux/interrupt.h>
13#include <linux/platform_device.h>
14#include <linux/serial_8250.h>
15
16#include <asm/sni.h>
17#include <asm/time.h>
1/*
2 * RM200 specific code
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 (C) 2006 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
9 */
10
11#include <linux/init.h>
12#include <linux/interrupt.h>
13#include <linux/platform_device.h>
14#include <linux/serial_8250.h>
15
16#include <asm/sni.h>
17#include <asm/time.h>
18#include <asm/ds1216.h>
19#include <asm/irq_cpu.h>
20
21#define PORT(_base,_irq) \
22 { \
23 .iobase = _base, \
24 .irq = _irq, \
25 .uartclk = 1843200, \
26 .iotype = UPIO_PORT, \

--- 9 unchanged lines hidden (view full) ---

36static struct platform_device rm200_serial8250_device = {
37 .name = "serial8250",
38 .id = PLAT8250_DEV_PLATFORM,
39 .dev = {
40 .platform_data = rm200_data,
41 },
42};
43
18#include <asm/irq_cpu.h>
19
20#define PORT(_base,_irq) \
21 { \
22 .iobase = _base, \
23 .irq = _irq, \
24 .uartclk = 1843200, \
25 .iotype = UPIO_PORT, \

--- 9 unchanged lines hidden (view full) ---

35static struct platform_device rm200_serial8250_device = {
36 .name = "serial8250",
37 .id = PLAT8250_DEV_PLATFORM,
38 .dev = {
39 .platform_data = rm200_data,
40 },
41};
42
43static struct resource rm200_ds1216_rsrc[] = {
44 {
45 .start = 0x1cd41ffc,
46 .end = 0x1cd41fff,
47 .flags = IORESOURCE_MEM
48 }
49};
50
51static struct platform_device rm200_ds1216_device = {
52 .name = "rtc-ds1216",
53 .num_resources = ARRAY_SIZE(rm200_ds1216_rsrc),
54 .resource = rm200_ds1216_rsrc
55};
56
44static struct resource snirm_82596_rm200_rsrc[] = {
45 {
57static struct resource snirm_82596_rm200_rsrc[] = {
58 {
46 .start = 0xb8000000,
47 .end = 0xb80fffff,
59 .start = 0x18000000,
60 .end = 0x180fffff,
48 .flags = IORESOURCE_MEM
49 },
50 {
61 .flags = IORESOURCE_MEM
62 },
63 {
51 .start = 0xbb000000,
52 .end = 0xbb000004,
64 .start = 0x1b000000,
65 .end = 0x1b000004,
53 .flags = IORESOURCE_MEM
54 },
55 {
66 .flags = IORESOURCE_MEM
67 },
68 {
56 .start = 0xbff00000,
57 .end = 0xbff00020,
69 .start = 0x1ff00000,
70 .end = 0x1ff00020,
58 .flags = IORESOURCE_MEM
59 },
60 {
61 .start = 27,
62 .end = 27,
63 .flags = IORESOURCE_IRQ
64 },
65 {

--- 25 unchanged lines hidden (view full) ---

91 .num_resources = ARRAY_SIZE(snirm_53c710_rm200_rsrc),
92 .resource = snirm_53c710_rm200_rsrc
93};
94
95static int __init snirm_setup_devinit(void)
96{
97 if (sni_brd_type == SNI_BRD_RM200) {
98 platform_device_register(&rm200_serial8250_device);
71 .flags = IORESOURCE_MEM
72 },
73 {
74 .start = 27,
75 .end = 27,
76 .flags = IORESOURCE_IRQ
77 },
78 {

--- 25 unchanged lines hidden (view full) ---

104 .num_resources = ARRAY_SIZE(snirm_53c710_rm200_rsrc),
105 .resource = snirm_53c710_rm200_rsrc
106};
107
108static int __init snirm_setup_devinit(void)
109{
110 if (sni_brd_type == SNI_BRD_RM200) {
111 platform_device_register(&rm200_serial8250_device);
112 platform_device_register(&rm200_ds1216_device);
99 platform_device_register(&snirm_82596_rm200_pdev);
100 platform_device_register(&snirm_53c710_rm200_pdev);
101 }
102 return 0;
103}
104
105device_initcall(snirm_setup_devinit);
106

--- 64 unchanged lines hidden (view full) ---

171 /* Actually we've got more interrupts to handle ... */
172 for (i = SNI_RM200_INT_START; i <= SNI_RM200_INT_END; i++)
173 set_irq_chip(i, &rm200_irq_type);
174 sni_hwint = sni_rm200_hwint;
175 change_c0_status(ST0_IM, IE_IRQ0);
176 setup_irq (SNI_RM200_INT_START + 0, &sni_isa_irq);
177}
178
113 platform_device_register(&snirm_82596_rm200_pdev);
114 platform_device_register(&snirm_53c710_rm200_pdev);
115 }
116 return 0;
117}
118
119device_initcall(snirm_setup_devinit);
120

--- 64 unchanged lines hidden (view full) ---

185 /* Actually we've got more interrupts to handle ... */
186 for (i = SNI_RM200_INT_START; i <= SNI_RM200_INT_END; i++)
187 set_irq_chip(i, &rm200_irq_type);
188 sni_hwint = sni_rm200_hwint;
189 change_c0_status(ST0_IM, IE_IRQ0);
190 setup_irq (SNI_RM200_INT_START + 0, &sni_isa_irq);
191}
192
179void sni_rm200_init(void)
193void __init sni_rm200_init(void)
180{
181 set_io_port_base(SNI_PORT_BASE + 0x02000000);
182 ioport_resource.end += 0x02000000;
194{
195 set_io_port_base(SNI_PORT_BASE + 0x02000000);
196 ioport_resource.end += 0x02000000;
183 ds1216_base = (volatile unsigned char *) SNI_DS1216_RM200_BASE;
184 rtc_mips_get_time = ds1216_get_cmos_time;
185 board_time_init = sni_cpu_time_init;
186}
197 board_time_init = sni_cpu_time_init;
198}