aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2008-11-18 04:48:22 -0500
committerBryan Wu <cooloney@kernel.org>2008-11-18 04:48:22 -0500
commit2de73e71c298842db814556379cbe25f5c14691e (patch)
tree5f9b28db7e1d7f9166399535e6ef513421e1d753
parenta4f0b32c331a3da1dd1336f1691504268c63fc14 (diff)
Blackfin arch: use physmap in board resources rather than legacy config method
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
-rw-r--r--arch/blackfin/configs/CM-BF548_defconfig2
-rw-r--r--arch/blackfin/mach-bf548/boards/cm_bf548.c45
2 files changed, 46 insertions, 1 deletions
diff --git a/arch/blackfin/configs/CM-BF548_defconfig b/arch/blackfin/configs/CM-BF548_defconfig
index a0d32a1afc1..2e91e492aca 100644
--- a/arch/blackfin/configs/CM-BF548_defconfig
+++ b/arch/blackfin/configs/CM-BF548_defconfig
@@ -543,7 +543,7 @@ CONFIG_MTD_RAM=y
543CONFIG_MTD_COMPLEX_MAPPINGS=y 543CONFIG_MTD_COMPLEX_MAPPINGS=y
544CONFIG_MTD_PHYSMAP=y 544CONFIG_MTD_PHYSMAP=y
545CONFIG_MTD_PHYSMAP_START=0x20000000 545CONFIG_MTD_PHYSMAP_START=0x20000000
546CONFIG_MTD_PHYSMAP_LEN=0x800000 546CONFIG_MTD_PHYSMAP_LEN=0
547CONFIG_MTD_PHYSMAP_BANKWIDTH=2 547CONFIG_MTD_PHYSMAP_BANKWIDTH=2
548# CONFIG_MTD_UCLINUX is not set 548# CONFIG_MTD_UCLINUX is not set
549# CONFIG_MTD_PLATRAM is not set 549# CONFIG_MTD_PLATRAM is not set
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c
index 3c1d9dbeb27..5857f3d7e51 100644
--- a/arch/blackfin/mach-bf548/boards/cm_bf548.c
+++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c
@@ -32,6 +32,7 @@
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/mtd/mtd.h> 33#include <linux/mtd/mtd.h>
34#include <linux/mtd/partitions.h> 34#include <linux/mtd/partitions.h>
35#include <linux/mtd/physmap.h>
35#include <linux/spi/spi.h> 36#include <linux/spi/spi.h>
36#include <linux/spi/flash.h> 37#include <linux/spi/flash.h>
37#include <linux/irq.h> 38#include <linux/irq.h>
@@ -378,6 +379,46 @@ static struct platform_device bf54x_sdh_device = {
378}; 379};
379#endif 380#endif
380 381
382#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
383static struct mtd_partition para_partitions[] = {
384 {
385 .name = "bootloader(nor)",
386 .size = 0x40000,
387 .offset = 0,
388 }, {
389 .name = "linux kernel(nor)",
390 .size = 0x400000,
391 .offset = MTDPART_OFS_APPEND,
392 }, {
393 .name = "file system(nor)",
394 .size = MTDPART_SIZ_FULL,
395 .offset = MTDPART_OFS_APPEND,
396 }
397};
398
399static struct physmap_flash_data para_flash_data = {
400 .width = 2,
401 .parts = para_partitions,
402 .nr_parts = ARRAY_SIZE(para_partitions),
403};
404
405static struct resource para_flash_resource = {
406 .start = 0x20000000,
407 .end = 0x207fffff,
408 .flags = IORESOURCE_MEM,
409};
410
411static struct platform_device para_flash_device = {
412 .name = "physmap-flash",
413 .id = 0,
414 .dev = {
415 .platform_data = &para_flash_data,
416 },
417 .num_resources = 1,
418 .resource = &para_flash_resource,
419};
420#endif
421
381#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 422#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
382/* all SPI peripherals info goes here */ 423/* all SPI peripherals info goes here */
383#if defined(CONFIG_MTD_M25P80) \ 424#if defined(CONFIG_MTD_M25P80) \
@@ -688,6 +729,10 @@ static struct platform_device *cm_bf548_devices[] __initdata = {
688#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 729#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
689 &bfin_device_gpiokeys, 730 &bfin_device_gpiokeys,
690#endif 731#endif
732
733#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
734 &para_flash_device,
735#endif
691}; 736};
692 737
693static int __init cm_bf548_init(void) 738static int __init cm_bf548_init(void)