[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>
This commit is contained in:
parent
45b3947c2d
commit
9cd9c616f5
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue