Merge branch 'fix/misc' into for-linus
[safe/jmp/linux-2.6] / arch / mips / sni / a20r.c
index 31ab80f..e698089 100644 (file)
@@ -15,7 +15,6 @@
 
 #include <asm/sni.h>
 #include <asm/time.h>
-#include <asm/ds1216.h>
 
 #define PORT(_base,_irq)                               \
        {                                               \
@@ -40,20 +39,34 @@ static struct platform_device a20r_serial8250_device = {
        },
 };
 
+static struct resource a20r_ds1216_rsrc[] = {
+        {
+                .start = 0x1c081ffc,
+                .end   = 0x1c081fff,
+                .flags = IORESOURCE_MEM
+        }
+};
+
+static struct platform_device a20r_ds1216_device = {
+        .name           = "rtc-ds1216",
+        .num_resources  = ARRAY_SIZE(a20r_ds1216_rsrc),
+        .resource       = a20r_ds1216_rsrc
+};
+
 static struct resource snirm_82596_rsrc[] = {
        {
-               .start = 0xb8000000,
-               .end   = 0xb8000004,
+               .start = 0x18000000,
+               .end   = 0x18000004,
                .flags = IORESOURCE_MEM
        },
        {
-               .start = 0xb8010000,
-               .end   = 0xb8010004,
+               .start = 0x18010000,
+               .end   = 0x18010004,
                .flags = IORESOURCE_MEM
        },
        {
-               .start = 0xbff00000,
-               .end   = 0xbff00020,
+               .start = 0x1ff00000,
+               .end   = 0x1ff00020,
                .flags = IORESOURCE_MEM
        },
        {
@@ -74,8 +87,8 @@ static struct platform_device snirm_82596_pdev = {
 
 static struct resource snirm_53c710_rsrc[] = {
        {
-               .start = 0xb9000000,
-               .end   = 0xb90fffff,
+               .start = 0x19000000,
+               .end   = 0x190fffff,
                .flags = IORESOURCE_MEM
        },
        {
@@ -93,8 +106,8 @@ static struct platform_device snirm_53c710_pdev = {
 
 static struct resource sc26xx_rsrc[] = {
        {
-               .start = 0xbc070000,
-               .end   = 0xbc0700ff,
+               .start = 0x1c070000,
+               .end   = 0x1c0700ff,
                .flags = IORESOURCE_MEM
        },
        {
@@ -104,17 +117,26 @@ static struct resource sc26xx_rsrc[] = {
        }
 };
 
+static unsigned int sc26xx_data[2] = {
+       /* DTR   |   RTS    |   DSR    |   CTS     |   DCD     |   RI    */
+       (8 << 0) | (4 << 4) | (6 << 8) | (0 << 12) | (6 << 16) | (0 << 20),
+       (3 << 0) | (2 << 4) | (1 << 8) | (2 << 12) | (3 << 16) | (4 << 20)
+};
+
 static struct platform_device sc26xx_pdev = {
        .name           = "SC26xx",
        .num_resources  = ARRAY_SIZE(sc26xx_rsrc),
-       .resource       = sc26xx_rsrc
+       .resource       = sc26xx_rsrc,
+       .dev                    = {
+               .platform_data  = sc26xx_data,
+       }
 };
 
 static u32 a20r_ack_hwint(void)
 {
        u32 status = read_c0_status();
 
-       write_c0_status (status | 0x00010000);
+       write_c0_status(status | 0x00010000);
        asm volatile(
        "       .set    push                    \n"
        "       .set    noat                    \n"
@@ -166,7 +188,7 @@ static void end_a20r_irq(unsigned int irq)
 }
 
 static struct irq_chip a20r_irq_type = {
-       .typename       = "A20R",
+       .name           = "A20R",
        .ack            = mask_a20r_irq,
        .mask           = mask_a20r_irq,
        .mask_ack       = mask_a20r_irq,
@@ -182,7 +204,7 @@ static void a20r_hwint(void)
        u32 cause, status;
        int irq;
 
-       clear_c0_status (IE_IRQ0);
+       clear_c0_status(IE_IRQ0);
        status = a20r_ack_hwint();
        cause = read_c0_cause();
 
@@ -197,16 +219,15 @@ void __init sni_a20r_irq_init(void)
        int i;
 
        for (i = SNI_A20R_IRQ_BASE + 2 ; i < SNI_A20R_IRQ_BASE + 8; i++)
-               set_irq_chip(i, &a20r_irq_type);
+               set_irq_chip_and_handler(i, &a20r_irq_type, handle_level_irq);
        sni_hwint = a20r_hwint;
        change_c0_status(ST0_IM, IE_IRQ0);
-       setup_irq (SNI_A20R_IRQ_BASE + 3, &sni_isa_irq);
+       setup_irq(SNI_A20R_IRQ_BASE + 3, &sni_isa_irq);
 }
 
 void sni_a20r_init(void)
 {
-       ds1216_base = (volatile unsigned char *) SNI_DS1216_A20R_BASE;
-       rtc_mips_get_time = ds1216_get_cmos_time;
+       /* FIXME, remove if not needed */
 }
 
 static int __init snirm_a20r_setup_devinit(void)
@@ -218,9 +239,10 @@ static int __init snirm_a20r_setup_devinit(void)
                platform_device_register(&snirm_53c710_pdev);
                platform_device_register(&sc26xx_pdev);
                platform_device_register(&a20r_serial8250_device);
+               platform_device_register(&a20r_ds1216_device);
+               sni_eisa_root_init();
                break;
        }
-
        return 0;
 }