From 9cd9c616f5890c9345546e03c99ba392b7a82cdf Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 13 May 2008 12:31:32 +0800 Subject: [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 Cc: Joern Engel Signed-off-by: Bryan Wu --- arch/blackfin/mach-bf533/boards/stamp.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'arch/blackfin/mach-bf533/boards/stamp.c') 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 = { }; #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); } -- cgit v1.2.3 From 5bda27235b24146cf870de663141ee4fbfa8a70b Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 7 Jun 2008 15:03:01 +0800 Subject: Blackfin arch: protect only the SPI bus controller with CONFIG_SPI_BFIN Signed-off-by: Mike Frysinger Signed-off-by: Bryan Wu --- arch/blackfin/mach-bf533/boards/stamp.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'arch/blackfin/mach-bf533/boards/stamp.c') diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c index ec05b236dc3f..13ae49515f73 100644 --- a/arch/blackfin/mach-bf533/boards/stamp.c +++ b/arch/blackfin/mach-bf533/boards/stamp.c @@ -161,9 +161,6 @@ static struct platform_device stamp_flash_device = { }; #endif -#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) -/* all SPI peripherals info goes here */ - #if defined(CONFIG_MTD_M25P80) || defined(CONFIG_MTD_M25P80_MODULE) static struct mtd_partition bfin_spi_flash_partitions[] = { { @@ -320,6 +317,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { #endif }; +#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) /* SPI (0) */ static struct resource bfin_spi0_resource[] = { [0] = { @@ -626,10 +624,8 @@ static int __init stamp_init(void) SSYNC(); #endif -#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) - spi_register_board_info(bfin_spi_board_info, - ARRAY_SIZE(bfin_spi_board_info)); -#endif + spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); + #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) irq_desc[PATA_INT].status |= IRQ_NOAUTOEN; #endif -- cgit v1.2.3