fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / arch / arm / mach-s3c2410 / mach-anubis.c
index 3e327b8..0fad0c2 100644 (file)
@@ -4,15 +4,9 @@
  *     http://armlinux.simtec.co.uk/
  *     Ben Dooks <ben@simtec.co.uk>
  *
- *
- *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
- *
- * Modifications:
- *     02-May-2005 BJD  Copied from mach-bast.c
- *     20-Sep-2005 BJD  Added static to non-exported items
 */
 
 #include <linux/kernel.h>
@@ -21,6 +15,7 @@
 #include <linux/list.h>
 #include <linux/timer.h>
 #include <linux/init.h>
+#include <linux/serial_core.h>
 #include <linux/platform_device.h>
 
 #include <asm/mach/arch.h>
@@ -60,11 +55,12 @@ static struct map_desc anubis_iodesc[] __initdata = {
        .virtual        = (u32)S3C24XX_VA_ISA_BYTE,
        .pfn            = __phys_to_pfn(0x0),
        .length         = SZ_4M,
-       .type           = MT_DEVICE
+       .type           = MT_DEVICE,
   }, {
        .virtual        = (u32)S3C24XX_VA_ISA_WORD,
        .pfn            = __phys_to_pfn(0x0),
-       .length         = SZ_4M, MT_DEVICE
+       .length         = SZ_4M,
+       .type           = MT_DEVICE,
   },
 
   /* we could possibly compress the next set down into a set of smaller tables
@@ -78,36 +74,12 @@ static struct map_desc anubis_iodesc[] __initdata = {
        .virtual        = (u32)ANUBIS_VA_CTRL1,
        .pfn            = __phys_to_pfn(ANUBIS_PA_CTRL1),
        .length         = SZ_4K,
-       .type           = MT_DEVICE
+       .type           = MT_DEVICE,
   }, {
        .virtual        = (u32)ANUBIS_VA_CTRL2,
        .pfn            = __phys_to_pfn(ANUBIS_PA_CTRL2),
        .length         = SZ_4K,
-       .type           =MT_DEVICE
-  },
-
-  /* IDE drives */
-
-  {
-       .virtual        = (u32)ANUBIS_IDEPRI,
-       .pfn            = __phys_to_pfn(S3C2410_CS3),
-       .length         = SZ_1M,
-       .type           = MT_DEVICE
-  }, {
-       .virtual        = (u32)ANUBIS_IDEPRIAUX,
-       .pfn            = __phys_to_pfn(S3C2410_CS3+(1<<26)),
-       .length         = SZ_1M,
-       .type           = MT_DEVICE
-  }, {
-       .virtual        = (u32)ANUBIS_IDESEC,
-       .pfn            = __phys_to_pfn(S3C2410_CS4),
-       .length         = SZ_1M,
-       .type           = MT_DEVICE
-  }, {
-       .virtual        = (u32)ANUBIS_IDESECAUX,
-       .pfn            = __phys_to_pfn(S3C2410_CS4+(1<<26)),
-       .length         = SZ_1M,
-       .type           = MT_DEVICE
+       .type           = MT_DEVICE,
   },
 };
 
@@ -126,12 +98,12 @@ static struct s3c24xx_uart_clksrc anubis_serial_clocks[] = {
                .name           = "pclk",
                .divisor        = 1,
                .min_baud       = 0,
-               .max_baud       = 0.
+               .max_baud       = 0,
        }
 };
 
 
-static struct s3c2410_uartcfg anubis_uartcfgs[] = {
+static struct s3c2410_uartcfg anubis_uartcfgs[] __initdata = {
        [0] = {
                .hwport      = 0,
                .flags       = 0,
@@ -139,7 +111,7 @@ static struct s3c2410_uartcfg anubis_uartcfgs[] = {
                .ulcon       = ULCON,
                .ufcon       = UFCON,
                .clocks      = anubis_serial_clocks,
-               .clocks_size = ARRAY_SIZE(anubis_serial_clocks)
+               .clocks_size = ARRAY_SIZE(anubis_serial_clocks),
        },
        [1] = {
                .hwport      = 2,
@@ -148,7 +120,7 @@ static struct s3c2410_uartcfg anubis_uartcfgs[] = {
                .ulcon       = ULCON,
                .ufcon       = UFCON,
                .clocks      = anubis_serial_clocks,
-               .clocks_size = ARRAY_SIZE(anubis_serial_clocks)
+               .clocks_size = ARRAY_SIZE(anubis_serial_clocks),
        },
 };
 
@@ -162,7 +134,7 @@ static struct mtd_partition anubis_default_nand_part[] = {
        [0] = {
                .name   = "Boot Agent",
                .size   = SZ_16K,
-               .offset = 0
+               .offset = 0,
        },
        [1] = {
                .name   = "/boot",
@@ -194,21 +166,21 @@ static struct s3c2410_nand_set anubis_nand_sets[] = {
                .nr_chips       = 1,
                .nr_map         = external_map,
                .nr_partitions  = ARRAY_SIZE(anubis_default_nand_part),
-               .partitions     = anubis_default_nand_part
+               .partitions     = anubis_default_nand_part,
        },
        [0] = {
                .name           = "chip0",
                .nr_chips       = 1,
                .nr_map         = chip0_map,
                .nr_partitions  = ARRAY_SIZE(anubis_default_nand_part),
-               .partitions     = anubis_default_nand_part
+               .partitions     = anubis_default_nand_part,
        },
        [2] = {
                .name           = "chip1",
                .nr_chips       = 1,
                .nr_map         = chip1_map,
                .nr_partitions  = ARRAY_SIZE(anubis_default_nand_part),
-               .partitions     = anubis_default_nand_part
+               .partitions     = anubis_default_nand_part,
        },
 };
 
@@ -232,13 +204,61 @@ static void anubis_nand_select(struct s3c2410_nand_set *set, int slot)
 
 static struct s3c2410_platform_nand anubis_nand_info = {
        .tacls          = 25,
-       .twrph0         = 80,
-       .twrph1         = 80,
+       .twrph0         = 55,
+       .twrph1         = 40,
        .nr_sets        = ARRAY_SIZE(anubis_nand_sets),
        .sets           = anubis_nand_sets,
        .select_chip    = anubis_nand_select,
 };
 
+/* IDE channels */
+
+static struct resource anubis_ide0_resource[] = {
+       {
+               .start  = S3C2410_CS3,
+               .end    = S3C2410_CS3 + (8*32) - 1,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = S3C2410_CS3 + (1<<26),
+               .end    = S3C2410_CS3 + (1<<26) + (8*32) - 1,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = IRQ_IDE0,
+               .end    = IRQ_IDE0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device anubis_device_ide0 = {
+       .name           = "simtec-ide",
+       .id             = 0,
+       .num_resources  = ARRAY_SIZE(anubis_ide0_resource),
+       .resource       = anubis_ide0_resource,
+};
+
+static struct resource anubis_ide1_resource[] = {
+       {
+               .start  = S3C2410_CS4,
+               .end    = S3C2410_CS4 + (8*32) - 1,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = S3C2410_CS4 + (1<<26),
+               .end    = S3C2410_CS4 + (1<<26) + (8*32) - 1,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = IRQ_IDE0,
+               .end    = IRQ_IDE0,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+
+static struct platform_device anubis_device_ide1 = {
+       .name           = "simtec-ide",
+       .id             = 1,
+       .num_resources  = ARRAY_SIZE(anubis_ide1_resource),
+       .resource       = anubis_ide1_resource,
+};
 
 /* Standard Anubis devices */
 
@@ -249,6 +269,8 @@ static struct platform_device *anubis_devices[] __initdata = {
        &s3c_device_i2c,
        &s3c_device_rtc,
        &s3c_device_nand,
+       &anubis_device_ide0,
+       &anubis_device_ide1,
 };
 
 static struct clk *anubis_clocks[] = {
@@ -263,7 +285,7 @@ static struct s3c24xx_board anubis_board __initdata = {
        .devices       = anubis_devices,
        .devices_count = ARRAY_SIZE(anubis_devices),
        .clocks        = anubis_clocks,
-       .clocks_count  = ARRAY_SIZE(anubis_clocks)
+       .clocks_count  = ARRAY_SIZE(anubis_clocks),
 };
 
 static void __init anubis_map_io(void)