]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[Blackfin] arch: rename bf5xx-flash to bfin-async-flash
authorMike Frysinger <vapier.adi@gmail.com>
Tue, 13 May 2008 04:31:32 +0000 (12:31 +0800)
committerBryan Wu <cooloney@kernel.org>
Tue, 13 May 2008 04:31:32 +0000 (12:31 +0800)
 - move all kconfig board settings into board resources
 - fixup casting style according to lkml feedback
 - rewrite driver so that it can handle arbitrary
   of instances according to the declared platform resources

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Cc: Joern Engel <joern@logfs.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
arch/blackfin/Kconfig
arch/blackfin/mach-bf533/boards/stamp.c

index fd5708523f2e6c1469ae91d5e5acf0985a45f5ba..785d8b4fa0cb9dd453a78db16bb409850afe54d9 100644 (file)
@@ -479,16 +479,6 @@ comment "Memory Setup"
 
 comment "Misc"
 
-config ENET_FLASH_PIN
-       int "PF port/pin used for flash and ethernet sharing"
-       depends on (BFIN533_STAMP)
-       default  0
-       help
-         PF port/pin used for flash and ethernet sharing to allow other PF
-         pins to be used on other platforms without having to touch common
-         code.
-         For example: PF0 --> 0,PF1 --> 1,PF2 --> 2, etc.
-
 choice
        prompt "Blackfin Exception Scratch Register"
        default BFIN_SCRATCH_REG_RETN
index 7fd35fb32fd52a0206e157893608eab0fd53766b..ec05b236dc3f766ab738cf7a8d0dcd997ce85454 100644 (file)
@@ -111,7 +111,7 @@ static struct platform_device net2272_bfin_device = {
 };
 #endif
 
-#if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE)
+#if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE)
 static struct mtd_partition stamp_partitions[] = {
        {
                .name   = "Bootloader",
@@ -141,13 +141,17 @@ static struct resource stamp_flash_resource[] = {
                .end   = 0x203fffff,
                .flags = IORESOURCE_MEM,
        }, {
-               .start = CONFIG_ENET_FLASH_PIN,
+               .start = 0x7BB07BB0,    /* AMBCTL0 setting when accessing flash */
+               .end   = 0x7BB07BB0,    /* AMBCTL1 setting when accessing flash */
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = GPIO_PF0,
                .flags = IORESOURCE_IRQ,
        }
 };
 
 static struct platform_device stamp_flash_device = {
-       .name          = "BF5xx-Flash",
+       .name          = "bfin-async-flash",
        .id            = 0,
        .dev = {
                .platform_data = &stamp_flash_data,
@@ -595,7 +599,7 @@ static struct platform_device *stamp_devices[] __initdata = {
 
        &bfin_gpios_device,
 
-#if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE)
+#if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE)
        &stamp_flash_device,
 #endif
 };
@@ -617,8 +621,8 @@ static int __init stamp_init(void)
 
 #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
        /* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */
-       bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (1 << CONFIG_ENET_FLASH_PIN));
-       bfin_write_FIO_FLAG_S(1 << CONFIG_ENET_FLASH_PIN);
+       bfin_write_FIO_DIR(bfin_read_FIO_DIR() | PF0);
+       bfin_write_FIO_FLAG_S(PF0);
        SSYNC();
 #endif
 
@@ -636,8 +640,8 @@ arch_initcall(stamp_init);
 
 void native_machine_restart(char *cmd)
 {
-#define BIT_TO_SET (1 << CONFIG_ENET_FLASH_PIN)
-       bfin_write_FIO_INEN(~BIT_TO_SET);
-       bfin_write_FIO_DIR(BIT_TO_SET);
-       bfin_write_FIO_FLAG_C(BIT_TO_SET);
+       /* workaround pull up on cpld / flash pin not being strong enough */
+       bfin_write_FIO_INEN(~PF0);
+       bfin_write_FIO_DIR(PF0);
+       bfin_write_FIO_FLAG_C(PF0);
 }