summaryrefslogtreecommitdiff
path: root/arch/blackfin/mach-bf533
diff options
context:
space:
mode:
authorMike Frysinger <michael.frysinger@analog.com>2008-01-24 17:14:04 +0800
committerBryan Wu <bryan.wu@analog.com>2008-01-24 17:14:04 +0800
commitde8c43f2fca9bb06f3ee87b38a61d5d9966ce221 (patch)
treec39c995e31e29703056cd547f5aa4e3a967ba9ab /arch/blackfin/mach-bf533
parent96a5c6f9bef027e1187b2f168bb3e08ef21d0b6f (diff)
[Blackfin] arch: use common flash driver to setup partitions rather than the bf5xx-flash driver
Signed-off-by: Mike Frysinger <michael.frysinger@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/mach-bf533')
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c52
1 files changed, 47 insertions, 5 deletions
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index cd87df730ef5..ac52b040b336 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -32,6 +32,7 @@
#include <linux/platform_device.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
#include <linux/spi/spi.h>
#include <linux/spi/flash.h>
#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
@@ -108,6 +109,50 @@ static struct platform_device net2272_bfin_device = {
};
#endif
+static struct mtd_partition stamp_partitions[] = {
+ {
+ .name = "Bootloader",
+ .size = 0x20000,
+ .offset = 0,
+ }, {
+ .name = "Kernel",
+ .size = 0xE0000,
+ .offset = MTDPART_OFS_APPEND,
+ }, {
+ .name = "RootFS",
+ .size = MTDPART_SIZ_FULL,
+ .offset = MTDPART_OFS_APPEND,
+ }
+};
+
+static struct physmap_flash_data stamp_flash_data = {
+ .width = 2,
+ .parts = stamp_partitions,
+ .nr_parts = ARRAY_SIZE(stamp_partitions),
+};
+
+static struct resource stamp_flash_resource[] = {
+ {
+ .name = "cfi_probe",
+ .start = 0x20000000,
+ .end = 0x203fffff,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = CONFIG_ENET_FLASH_PIN,
+ .flags = IORESOURCE_IRQ,
+ }
+};
+
+static struct platform_device stamp_flash_device = {
+ .name = "BF5xx-Flash",
+ .id = 0,
+ .dev = {
+ .platform_data = &stamp_flash_data,
+ },
+ .num_resources = ARRAY_SIZE(stamp_flash_resource),
+ .resource = stamp_flash_resource,
+};
+
#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
/* all SPI peripherals info goes here */
@@ -457,6 +502,7 @@ static struct platform_device *stamp_devices[] __initdata = {
#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
&i2c_gpio_device,
#endif
+ &stamp_flash_device,
};
static int __init stamp_init(void)
@@ -469,12 +515,10 @@ static int __init stamp_init(void)
return ret;
#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
-# if defined(CONFIG_BFIN_SHARED_FLASH_ENET)
/* 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);
SSYNC();
-# endif
#endif
#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
@@ -491,10 +535,8 @@ arch_initcall(stamp_init);
void native_machine_restart(char *cmd)
{
-#if defined(CONFIG_BFIN_SHARED_FLASH_ENET)
-# define BIT_TO_SET (1 << CONFIG_ENET_FLASH_PIN)
+#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);
-#endif
}