a20r.c (bc95f3669f5e6f63cf0b84fe4922c3c6dd4aa775) a20r.c (06cf5583fd9ac782cf34996cdabb48afdf478e37)
1/*
2 * A20R 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 * A20R 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
20#define PORT(_base,_irq) \
21 { \
22 .iobase = _base, \
23 .irq = _irq, \
24 .uartclk = 1843200, \
25 .iotype = UPIO_PORT, \
26 .flags = UPF_BOOT_AUTOCONF, \

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

35static struct platform_device a20r_serial8250_device = {
36 .name = "serial8250",
37 .id = PLAT8250_DEV_PLATFORM,
38 .dev = {
39 .platform_data = a20r_data,
40 },
41};
42
18
19#define PORT(_base,_irq) \
20 { \
21 .iobase = _base, \
22 .irq = _irq, \
23 .uartclk = 1843200, \
24 .iotype = UPIO_PORT, \
25 .flags = UPF_BOOT_AUTOCONF, \

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

34static struct platform_device a20r_serial8250_device = {
35 .name = "serial8250",
36 .id = PLAT8250_DEV_PLATFORM,
37 .dev = {
38 .platform_data = a20r_data,
39 },
40};
41
42static struct resource a20r_ds1216_rsrc[] = {
43 {
44 .start = 0x1c081ffc,
45 .end = 0x1c081fff,
46 .flags = IORESOURCE_MEM
47 }
48};
49
50static struct platform_device a20r_ds1216_device = {
51 .name = "rtc-ds1216",
52 .num_resources = ARRAY_SIZE(a20r_ds1216_rsrc),
53 .resource = a20r_ds1216_rsrc
54};
55
43static struct resource snirm_82596_rsrc[] = {
44 {
56static struct resource snirm_82596_rsrc[] = {
57 {
45 .start = 0xb8000000,
46 .end = 0xb8000004,
58 .start = 0x18000000,
59 .end = 0x18000004,
47 .flags = IORESOURCE_MEM
48 },
49 {
60 .flags = IORESOURCE_MEM
61 },
62 {
50 .start = 0xb8010000,
51 .end = 0xb8010004,
63 .start = 0x18010000,
64 .end = 0x18010004,
52 .flags = IORESOURCE_MEM
53 },
54 {
65 .flags = IORESOURCE_MEM
66 },
67 {
55 .start = 0xbff00000,
56 .end = 0xbff00020,
68 .start = 0x1ff00000,
69 .end = 0x1ff00020,
57 .flags = IORESOURCE_MEM
58 },
59 {
60 .start = 22,
61 .end = 22,
62 .flags = IORESOURCE_IRQ
63 },
64 {

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

200 set_irq_chip(i, &a20r_irq_type);
201 sni_hwint = a20r_hwint;
202 change_c0_status(ST0_IM, IE_IRQ0);
203 setup_irq (SNI_A20R_IRQ_BASE + 3, &sni_isa_irq);
204}
205
206void sni_a20r_init(void)
207{
70 .flags = IORESOURCE_MEM
71 },
72 {
73 .start = 22,
74 .end = 22,
75 .flags = IORESOURCE_IRQ
76 },
77 {

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

213 set_irq_chip(i, &a20r_irq_type);
214 sni_hwint = a20r_hwint;
215 change_c0_status(ST0_IM, IE_IRQ0);
216 setup_irq (SNI_A20R_IRQ_BASE + 3, &sni_isa_irq);
217}
218
219void sni_a20r_init(void)
220{
208 ds1216_base = (volatile unsigned char *) SNI_DS1216_A20R_BASE;
209 rtc_mips_get_time = ds1216_get_cmos_time;
221 /* FIXME, remove if not needed */
210}
211
212static int __init snirm_a20r_setup_devinit(void)
213{
214 switch (sni_brd_type) {
215 case SNI_BRD_TOWER_OASIC:
216 case SNI_BRD_MINITOWER:
217 platform_device_register(&snirm_82596_pdev);
218 platform_device_register(&snirm_53c710_pdev);
219 platform_device_register(&sc26xx_pdev);
220 platform_device_register(&a20r_serial8250_device);
222}
223
224static int __init snirm_a20r_setup_devinit(void)
225{
226 switch (sni_brd_type) {
227 case SNI_BRD_TOWER_OASIC:
228 case SNI_BRD_MINITOWER:
229 platform_device_register(&snirm_82596_pdev);
230 platform_device_register(&snirm_53c710_pdev);
231 platform_device_register(&sc26xx_pdev);
232 platform_device_register(&a20r_serial8250_device);
233 platform_device_register(&a20r_ds1216_device);
221 break;
222 }
223
224 return 0;
225}
226
227device_initcall(snirm_a20r_setup_devinit);
234 break;
235 }
236
237 return 0;
238}
239
240device_initcall(snirm_a20r_setup_devinit);