diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2008-05-13 00:31:32 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-05-13 00:31:32 -0400 |
commit | 9cd9c616f5890c9345546e03c99ba392b7a82cdf (patch) | |
tree | ec566e8ce4aa7bc1ce2b9c72d147ad67df2d9b58 /arch | |
parent | 45b3947c2de5841d691f1d27d30419b9fae2d86c (diff) |
[Blackfin] arch: rename bf5xx-flash to bfin-async-flash
- 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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/blackfin/Kconfig | 10 | ||||
-rw-r--r-- | arch/blackfin/mach-bf533/boards/stamp.c | 24 |
2 files changed, 14 insertions, 20 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig index fd5708523f2e..785d8b4fa0cb 100644 --- a/arch/blackfin/Kconfig +++ b/arch/blackfin/Kconfig | |||
@@ -479,16 +479,6 @@ comment "Memory Setup" | |||
479 | 479 | ||
480 | comment "Misc" | 480 | comment "Misc" |
481 | 481 | ||
482 | config ENET_FLASH_PIN | ||
483 | int "PF port/pin used for flash and ethernet sharing" | ||
484 | depends on (BFIN533_STAMP) | ||
485 | default 0 | ||
486 | help | ||
487 | PF port/pin used for flash and ethernet sharing to allow other PF | ||
488 | pins to be used on other platforms without having to touch common | ||
489 | code. | ||
490 | For example: PF0 --> 0,PF1 --> 1,PF2 --> 2, etc. | ||
491 | |||
492 | choice | 482 | choice |
493 | prompt "Blackfin Exception Scratch Register" | 483 | prompt "Blackfin Exception Scratch Register" |
494 | default BFIN_SCRATCH_REG_RETN | 484 | default BFIN_SCRATCH_REG_RETN |
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c index 7fd35fb32fd5..ec05b236dc3f 100644 --- a/arch/blackfin/mach-bf533/boards/stamp.c +++ b/arch/blackfin/mach-bf533/boards/stamp.c | |||
@@ -111,7 +111,7 @@ static struct platform_device net2272_bfin_device = { | |||
111 | }; | 111 | }; |
112 | #endif | 112 | #endif |
113 | 113 | ||
114 | #if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE) | 114 | #if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE) |
115 | static struct mtd_partition stamp_partitions[] = { | 115 | static struct mtd_partition stamp_partitions[] = { |
116 | { | 116 | { |
117 | .name = "Bootloader", | 117 | .name = "Bootloader", |
@@ -141,13 +141,17 @@ static struct resource stamp_flash_resource[] = { | |||
141 | .end = 0x203fffff, | 141 | .end = 0x203fffff, |
142 | .flags = IORESOURCE_MEM, | 142 | .flags = IORESOURCE_MEM, |
143 | }, { | 143 | }, { |
144 | .start = CONFIG_ENET_FLASH_PIN, | 144 | .start = 0x7BB07BB0, /* AMBCTL0 setting when accessing flash */ |
145 | .end = 0x7BB07BB0, /* AMBCTL1 setting when accessing flash */ | ||
146 | .flags = IORESOURCE_MEM, | ||
147 | }, { | ||
148 | .start = GPIO_PF0, | ||
145 | .flags = IORESOURCE_IRQ, | 149 | .flags = IORESOURCE_IRQ, |
146 | } | 150 | } |
147 | }; | 151 | }; |
148 | 152 | ||
149 | static struct platform_device stamp_flash_device = { | 153 | static struct platform_device stamp_flash_device = { |
150 | .name = "BF5xx-Flash", | 154 | .name = "bfin-async-flash", |
151 | .id = 0, | 155 | .id = 0, |
152 | .dev = { | 156 | .dev = { |
153 | .platform_data = &stamp_flash_data, | 157 | .platform_data = &stamp_flash_data, |
@@ -595,7 +599,7 @@ static struct platform_device *stamp_devices[] __initdata = { | |||
595 | 599 | ||
596 | &bfin_gpios_device, | 600 | &bfin_gpios_device, |
597 | 601 | ||
598 | #if defined(CONFIG_MTD_BF5xx) || defined(CONFIG_MTD_BF5xx_MODULE) | 602 | #if defined(CONFIG_MTD_BFIN_ASYNC) || defined(CONFIG_MTD_BFIN_ASYNC_MODULE) |
599 | &stamp_flash_device, | 603 | &stamp_flash_device, |
600 | #endif | 604 | #endif |
601 | }; | 605 | }; |
@@ -617,8 +621,8 @@ static int __init stamp_init(void) | |||
617 | 621 | ||
618 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | 622 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
619 | /* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */ | 623 | /* setup BF533_STAMP CPLD to route AMS3 to Ethernet MAC */ |
620 | bfin_write_FIO_DIR(bfin_read_FIO_DIR() | (1 << CONFIG_ENET_FLASH_PIN)); | 624 | bfin_write_FIO_DIR(bfin_read_FIO_DIR() | PF0); |
621 | bfin_write_FIO_FLAG_S(1 << CONFIG_ENET_FLASH_PIN); | 625 | bfin_write_FIO_FLAG_S(PF0); |
622 | SSYNC(); | 626 | SSYNC(); |
623 | #endif | 627 | #endif |
624 | 628 | ||
@@ -636,8 +640,8 @@ arch_initcall(stamp_init); | |||
636 | 640 | ||
637 | void native_machine_restart(char *cmd) | 641 | void native_machine_restart(char *cmd) |
638 | { | 642 | { |
639 | #define BIT_TO_SET (1 << CONFIG_ENET_FLASH_PIN) | 643 | /* workaround pull up on cpld / flash pin not being strong enough */ |
640 | bfin_write_FIO_INEN(~BIT_TO_SET); | 644 | bfin_write_FIO_INEN(~PF0); |
641 | bfin_write_FIO_DIR(BIT_TO_SET); | 645 | bfin_write_FIO_DIR(PF0); |
642 | bfin_write_FIO_FLAG_C(BIT_TO_SET); | 646 | bfin_write_FIO_FLAG_C(PF0); |
643 | } | 647 | } |