netns xfrm: fix "ip xfrm state|policy count" misreport
[safe/jmp/linux-2.6] / arch / arm / mach-rpc / riscpc.c
index 4371068..c7fc01e 100644 (file)
 #include <linux/sched.h>
 #include <linux/device.h>
 #include <linux/serial_8250.h>
+#include <linux/ata_platform.h>
+#include <linux/io.h>
+#include <linux/i2c.h>
 
 #include <asm/elf.h>
-#include <asm/io.h>
 #include <asm/mach-types.h>
-#include <asm/hardware.h>
+#include <mach/hardware.h>
 #include <asm/page.h>
 #include <asm/domain.h>
 #include <asm/setup.h>
@@ -61,9 +63,22 @@ static int __init parse_tag_acorn(const struct tag *tag)
 __tagtable(ATAG_ACORN, parse_tag_acorn);
 
 static struct map_desc rpc_io_desc[] __initdata = {
- { SCREEN_BASE,        SCREEN_START,   2*1048576, MT_DEVICE }, /* VRAM         */
- { (u32)IO_BASE, IO_START,     IO_SIZE  , MT_DEVICE }, /* IO space     */
- { EASI_BASE,  EASI_START,     EASI_SIZE, MT_DEVICE }  /* EASI space   */
+       {       /* VRAM         */
+               .virtual        =  SCREEN_BASE,
+               .pfn            = __phys_to_pfn(SCREEN_START),
+               .length         =       2*1048576,
+               .type           = MT_DEVICE
+       }, {    /* IO space     */
+               .virtual        =  (u32)IO_BASE,
+               .pfn            = __phys_to_pfn(IO_START),
+               .length         =       IO_SIZE  ,
+               .type           = MT_DEVICE
+       }, {    /* EASI space   */
+               .virtual        = EASI_BASE,
+               .pfn            = __phys_to_pfn(EASI_START),
+               .length         = EASI_SIZE,
+               .type           = MT_DEVICE
+       }
 };
 
 static void __init rpc_map_io(void)
@@ -73,7 +88,7 @@ static void __init rpc_map_io(void)
        /*
         * Turn off floppy.
         */
-       outb(0xc, 0x3f2);
+       writeb(0xc, PCIO_BASE + (0x3f2 << 2));
 
        /*
         * RiscPC can't handle half-word loads and stores
@@ -140,21 +155,60 @@ static struct plat_serial8250_port serial_platform_data[] = {
 
 static struct platform_device serial_device = {
        .name                   = "serial8250",
-       .id                     = 0,
+       .id                     = PLAT8250_DEV_PLATFORM,
        .dev                    = {
                .platform_data  = serial_platform_data,
        },
 };
 
+static struct pata_platform_info pata_platform_data = {
+       .ioport_shift           = 2,
+};
+
+static struct resource pata_resources[] = {
+       [0] = {
+               .start          = 0x030107c0,
+               .end            = 0x030107df,
+               .flags          = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start          = 0x03010fd8,
+               .end            = 0x03010fdb,
+               .flags          = IORESOURCE_MEM,
+       },
+       [2] = {
+               .start          = IRQ_HARDDISK,
+               .end            = IRQ_HARDDISK,
+               .flags          = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device pata_device = {
+       .name                   = "pata_platform",
+       .id                     = -1,
+       .num_resources          = ARRAY_SIZE(pata_resources),
+       .resource               = pata_resources,
+       .dev                    = {
+               .platform_data  = &pata_platform_data,
+               .coherent_dma_mask = ~0,        /* grumble */
+       },
+};
+
 static struct platform_device *devs[] __initdata = {
        &iomd_device,
        &kbd_device,
        &serial_device,
        &acornfb_device,
+       &pata_device,
+};
+
+static struct i2c_board_info i2c_rtc = {
+       I2C_BOARD_INFO("pcf8583", 0x50)
 };
 
 static int __init rpc_init(void)
 {
+       i2c_register_board_info(0, &i2c_rtc, 1);
        return platform_add_devices(devs, ARRAY_SIZE(devs));
 }
 
@@ -163,12 +217,13 @@ arch_initcall(rpc_init);
 extern struct sys_timer ioc_timer;
 
 MACHINE_START(RISCPC, "Acorn-RiscPC")
-       MAINTAINER("Russell King")
-       BOOT_MEM(0x10000000, 0x03000000, 0xe0000000)
-       BOOT_PARAMS(0x10000100)
-       DISABLE_PARPORT(0)
-       DISABLE_PARPORT(1)
-       MAPIO(rpc_map_io)
-       INITIRQ(rpc_init_irq)
+       /* Maintainer: Russell King */
+       .phys_io        = 0x03000000,
+       .io_pg_offst    = ((0xe0000000) >> 18) & 0xfffc,
+       .boot_params    = 0x10000100,
+       .reserve_lp0    = 1,
+       .reserve_lp1    = 1,
+       .map_io         = rpc_map_io,
+       .init_irq       = rpc_init_irq,
        .timer          = &ioc_timer,
 MACHINE_END