[ARM] 3615/1: ixp23xx: use platform devices for physmap flash
authorLennert Buytenhek <buytenh@wantstofly.org>
Thu, 22 Jun 2006 09:30:52 +0000 (10:30 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 22 Jun 2006 09:30:52 +0000 (10:30 +0100)
Patch from Lennert Buytenhek

Now that the physmap platform device rewrite is in, make the ixp23xx
boards use platform devices for physmap flash.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-ixp23xx/espresso.c
arch/arm/mach-ixp23xx/ixdp2351.c
arch/arm/mach-ixp23xx/roadrunner.c

index bf688c1286301b90db9b05e27d4809e34e0226e4..dc5e489c70bc1144f60b13be9c90f214f2ea2b1f 100644 (file)
@@ -53,9 +53,29 @@ static int __init espresso_pci_init(void)
 };
 subsys_initcall(espresso_pci_init);
 
+static struct physmap_flash_data espresso_flash_data = {
+       .width          = 2,
+};
+
+static struct resource espresso_flash_resource = {
+       .start          = 0x90000000,
+       .end            = 0x92000000,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device espresso_flash = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &espresso_flash_data,
+       },
+       .num_resources  = 1,
+       .resource       = &espresso_flash_resource,
+};
+
 static void __init espresso_init(void)
 {
-       physmap_configure(0x90000000, 0x02000000, 2, NULL);
+       platform_device_register(&espresso_flash);
 
        /*
         * Mark flash as writeable.
index 00146c35daacca140f492f7e578d427c86a728d5..535b334ee045296b0df665f269a8a88ace6f7ef8 100644 (file)
@@ -298,9 +298,29 @@ static void __init ixdp2351_map_io(void)
        iotable_init(ixdp2351_io_desc, ARRAY_SIZE(ixdp2351_io_desc));
 }
 
+static struct physmap_flash_data ixdp2351_flash_data = {
+       .width          = 1,
+};
+
+static struct resource ixdp2351_flash_resource = {
+       .start          = 0x90000000,
+       .end            = 0x94000000,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device ixdp2351_flash = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &ixdp2351_flash_data,
+       },
+       .num_resources  = 1,
+       .resource       = &ixdp2351_flash_resource,
+};
+
 static void __init ixdp2351_init(void)
 {
-       physmap_configure(0x90000000, 0x04000000, 1, NULL);
+       platform_device_register(&ixdp2351_flash);
 
        /*
         * Mark flash as writeable
index 43c14e740794b47078fa53e5a50517c9edadebdb..b9f5d13fcfe126422528cf1502ed0a9f697bad01 100644 (file)
@@ -137,9 +137,29 @@ static int __init roadrunner_pci_init(void)
 
 subsys_initcall(roadrunner_pci_init);
 
+static struct physmap_flash_data roadrunner_flash_data = {
+       .width          = 2,
+};
+
+static struct resource roadrunner_flash_resource = {
+       .start          = 0x90000000,
+       .end            = 0x94000000,
+       .flags          = IORESOURCE_MEM,
+};
+
+static struct platform_device roadrunner_flash = {
+       .name           = "physmap-flash",
+       .id             = 0,
+       .dev            = {
+               .platform_data  = &roadrunner_flash_data,
+       },
+       .num_resources  = 1,
+       .resource       = &roadrunner_flash_resource,
+};
+
 static void __init roadrunner_init(void)
 {
-       physmap_configure(0x90000000, 0x04000000, 2, NULL);
+       platform_device_register(&roadrunner_flash);
 
        /*
         * Mark flash as writeable