Title: [4121] trunk: [#2628] punt bf561-ezkit specific mtd mapping and use the common cfi physmap
Revision
4121
Author
vapier
Date
2008-01-20 20:43:31 -0600 (Sun, 20 Jan 2008)

Log Message

[#2628] punt bf561-ezkit specific mtd mapping and use the common cfi physmap

Diffstat

 arch/blackfin/configs/BF561-EZKIT_defconfig |   22 ++--
 arch/blackfin/mach-bf561/boards/ezkit.c     |   42 +++++++++
 drivers/mtd/maps/Kconfig                    |    6 -
 drivers/mtd/maps/Makefile                   |    2 
 drivers/mtd/maps/ezkit561.c                 |  128 ----------------------------
 5 files changed, 53 insertions(+), 147 deletions(-)

Modified Paths

Removed Paths

Property Changed

Diff

Property changes: trunk


Name: svn:ignore
   - .*.d
*.cmd
.config
.config.old
.gdbinit
.version
.tmp_versions
.tmp_System.map
.tmp_kallsyms?.S
.tmp_vmlinux?
.vmlinux.cmd
linux
modules
Module.symvers
System.map
vmlinux*
   + .*.d
*.cmd
*.log
.config
.config.old
.gdbinit
.version
.tmp_versions
.tmp_System.map
.tmp_kallsyms?.S
.tmp_vmlinux?
.vmlinux.cmd
linux
modules
Module.symvers
System.map
vmlinux*

Modified: trunk/arch/blackfin/configs/BF561-EZKIT_defconfig (4120 => 4121)


--- trunk/arch/blackfin/configs/BF561-EZKIT_defconfig	2008-01-18 20:23:06 UTC (rev 4120)
+++ trunk/arch/blackfin/configs/BF561-EZKIT_defconfig	2008-01-21 02:43:31 UTC (rev 4121)
@@ -512,7 +512,7 @@
 # CONFIG_MTD_CONCAT is not set
 CONFIG_MTD_PARTITIONS=y
 # CONFIG_MTD_REDBOOT_PARTS is not set
-# CONFIG_MTD_CMDLINE_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
 
 #
 # User Modules And Translation Layers
@@ -529,8 +529,8 @@
 #
 # RAM/ROM/Flash chip drivers
 #
-# CONFIG_MTD_CFI is not set
-CONFIG_MTD_JEDECPROBE=m
+CONFIG_MTD_CFI=m
+# CONFIG_MTD_JEDECPROBE is not set
 CONFIG_MTD_GEN_PROBE=m
 # CONFIG_MTD_CFI_ADV_OPTIONS is not set
 CONFIG_MTD_MAP_BANK_WIDTH_1=y
@@ -544,9 +544,10 @@
 # CONFIG_MTD_CFI_I4 is not set
 # CONFIG_MTD_CFI_I8 is not set
 # CONFIG_MTD_CFI_INTELEXT is not set
-# CONFIG_MTD_CFI_AMDSTD is not set
+CONFIG_MTD_CFI_AMDSTD=m
 # CONFIG_MTD_CFI_STAA is not set
-CONFIG_MTD_MW320D=m
+# CONFIG_MTD_MW320D is not set
+CONFIG_MTD_CFI_UTIL=m
 CONFIG_MTD_RAM=y
 CONFIG_MTD_ROM=m
 # CONFIG_MTD_ABSENT is not set
@@ -554,12 +555,11 @@
 #
 # Mapping drivers for chip access
 #
-CONFIG_MTD_COMPLEX_MAPPINGS=y
-# CONFIG_MTD_PHYSMAP is not set
-# CONFIG_MTD_EZKIT561 is not set
-CONFIG_MTD_BF5xx=m
-CONFIG_BFIN_FLASH_SIZE=0x0400000
-CONFIG_EBIU_FLASH_BASE=0x20000000
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP=m
+CONFIG_MTD_PHYSMAP_START=0x20000000
+CONFIG_MTD_PHYSMAP_LEN=0x0
+CONFIG_MTD_PHYSMAP_BANKWIDTH=2
 # CONFIG_MTD_UCLINUX is not set
 # CONFIG_MTD_PLATRAM is not set
 

Modified: trunk/arch/blackfin/mach-bf561/boards/ezkit.c (4120 => 4121)


--- trunk/arch/blackfin/mach-bf561/boards/ezkit.c	2008-01-18 20:23:06 UTC (rev 4120)
+++ trunk/arch/blackfin/mach-bf561/boards/ezkit.c	2008-01-21 02:43:31 UTC (rev 4121)
@@ -29,6 +29,9 @@
 
 #include <linux/device.h>
 #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/irq.h>
 #include <linux/interrupt.h>
@@ -155,6 +158,44 @@
 };
 #endif
 
+static struct mtd_partition ezkit_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 ezkit_flash_data = {
+	.width      = 2,
+	.parts      = ezkit_partitions,
+	.nr_parts   = ARRAY_SIZE(ezkit_partitions),
+};
+
+static struct resource ezkit_flash_resource = {
+	.start = 0x20000000,
+	.end   = 0x207fffff,
+	.flags = IORESOURCE_MEM,
+};
+
+static struct platform_device ezkit_flash_device = {
+	.name          = "physmap-flash",
+	.id            = 0,
+	.dev = {
+		.platform_data = &ezkit_flash_data,
+	},
+	.num_resources = 1,
+	.resource      = &ezkit_flash_resource,
+};
+
 #ifdef CONFIG_SPI_BFIN
 #if defined(CONFIG_SND_BLACKFIN_AD1836) \
 	|| defined(CONFIG_SND_BLACKFIN_AD1836_MODULE)
@@ -318,6 +359,7 @@
 #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
 	&i2c_gpio_device,
 #endif
+	&ezkit_flash_device,
 };
 
 static int __init ezkit_init(void)

Modified: trunk/drivers/mtd/maps/Kconfig (4120 => 4121)


--- trunk/drivers/mtd/maps/Kconfig	2008-01-18 20:23:06 UTC (rev 4120)
+++ trunk/drivers/mtd/maps/Kconfig	2008-01-21 02:43:31 UTC (rev 4121)
@@ -558,12 +558,6 @@
 
 	  If unsure, say N.
 
-config MTD_EZKIT561
-	tristate "Blackfin BF561 EZKIT Flash Chip Support"
-	depends on (BFIN561_EZKIT) && MTD_PARTITIONS
-	help
-	  Map for the CFI compliant 8 MiB flash chip on BF561 EZKIT dev boards
-
 config MTD_BF5xx
 	tristate "Blackfin BF533-STAMP Flash Chip Support"
 	depends on BFIN533_STAMP

Modified: trunk/drivers/mtd/maps/Makefile (4120 => 4121)


--- trunk/drivers/mtd/maps/Makefile	2008-01-18 20:23:06 UTC (rev 4120)
+++ trunk/drivers/mtd/maps/Makefile	2008-01-21 02:43:31 UTC (rev 4121)
@@ -73,5 +73,3 @@
 obj-$(CONFIG_MTD_MTX1)		+= mtx-1_flash.o
 obj-$(CONFIG_MTD_TQM834x)	+= tqm834x.o
 obj-$(CONFIG_MTD_BF5xx)		+= bf5xx-flash.o
-obj-$(CONFIG_MTD_EZKIT561)	+= ezkit561.o
-

Deleted: trunk/drivers/mtd/maps/ezkit561.c (4120 => 4121)


--- trunk/drivers/mtd/maps/ezkit561.c	2008-01-18 20:23:06 UTC (rev 4120)
+++ trunk/drivers/mtd/maps/ezkit561.c	2008-01-21 02:43:31 UTC (rev 4121)
@@ -1,128 +0,0 @@
-/*
- * drivers/mtd/maps/ezkit561.c
- *
- * FLASH map for the ADI BF561 EZ-KIT
- *
- * Author: Griffin Technology, Inc.
- *
- * 2006 (c) Griffin Technology, Inc. This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/init.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/map.h>
-#include <linux/mtd/partitions.h>
-
-#include <asm/io.h>
-
-/* 8 MiB flash wired to ASYNC mem bank 0 */
-#define EZKIT561_FLASH_BASE 0x20000000
-#define EZKIT561_FLASH_SIZE 0x00800000
-
-/*
-	Flash partition scheme: (default partition map used on blackfin.uclinux.org, modify as needed)
-	0x20000000 - 0x2003FFFF (256 KiB) : U-Boot partition
-	0x20040000 - 0x200FFFFF (768 KiB) : Linux kernel
-	0x20100000 - 0x207FFFFF (7 MiB) : root fs (8 MiB flash)
-
-	Alternate configuration (1MiB for kernel)
-	0x20000000 - 0x2003FFFF (256 KiB) : U-Boot partition
-	0x20040000 - 0x201FFFFF (1.75 MiB) : Linux kernel
-	0x20200000 - 0x207FFFFF (6 MiB) : root fs (8 MiB flash)
-*/
-
-#define EZKIT561_PART_COUNT 3
-
-/* First is similar to the bf5xx map, 256KiB u-boot, 768KiB kernel, then 7MiB filesystem */
-#if 0
-#define EZKIT561_PART0_OFFSET 0x00000000
-#define EZKIT561_PART0_SIZE 0x40000
-#define EZKIT561_PART1_OFFSET (EZKIT561_PART0_OFFSET + EZKIT561_PART0_SIZE)
-#define EZKIT561_PART1_SIZE 0xC0000
-#define EZKIT561_PART2_OFFSET (EZKIT561_PART1_OFFSET + EZKIT561_PART1_SIZE)
-#define EZKIT561_PART2_SIZE 0x700000
-#else				/* 256KiB u-boot, 1.75MiB kernel, 6MiB filesystem */
-#define EZKIT561_PART0_OFFSET 0x00000000
-#define EZKIT561_PART0_SIZE 0x40000
-#define EZKIT561_PART1_OFFSET (EZKIT561_PART0_OFFSET + EZKIT561_PART0_SIZE)
-#define EZKIT561_PART1_SIZE 0x1C0000
-#define EZKIT561_PART2_OFFSET (EZKIT561_PART1_OFFSET + EZKIT561_PART1_SIZE)
-#define EZKIT561_PART2_SIZE 0x600000
-#endif
-
-static struct mtd_partition ezkit561_parts[] = {
-	{
-	 .name = "Das U-Boot",
-	 .offset = EZKIT561_PART0_OFFSET,
-	 .size = EZKIT561_PART0_SIZE,
-	 .mask_flags = MTD_WRITEABLE	/* disable write access */
-	 },
-	{
-	 .name = "Linux kernel",
-	 .offset = EZKIT561_PART1_OFFSET,
-	 .size = EZKIT561_PART1_SIZE,
-	 .mask_flags = MTD_WRITEABLE	/* disable at your own peril... */
-	 },
-	{
-	 .name = "Linux root fs",
-	 .offset = EZKIT561_PART2_OFFSET,
-	 .size = EZKIT561_PART2_SIZE,
-/*	 .mask_flags = MTD_WRITEABLE */	/* uncomment to force filesystem read-only */
-	 }
-};
-
-struct map_info ezkit561_map = {
-	.name = "BF561 EZKIT Map",
-	.phys = EZKIT561_FLASH_BASE,
-	.size = EZKIT561_FLASH_SIZE,
-	.bankwidth = 2,		/* 16 bit */
-};
-
-static struct mtd_info *ezkit561_mtd;
-
-int __init init_ezkit561_flash(void)
-{
-	printk(KERN_NOTICE "ezkit561 map: mapping %ld MiB flash at 0x%x\n",
-	       EZKIT561_FLASH_SIZE / 0x100000, EZKIT561_FLASH_BASE);
-
-	ezkit561_map.virt = ioremap(EZKIT561_FLASH_BASE, EZKIT561_FLASH_SIZE);
-
-	if (!ezkit561_map.virt) {
-		printk("init_ezkit561_flash: failed to ioremap\n");
-		return -EIO;
-	}
-	simple_map_init(&ezkit561_map);
-
-	ezkit561_mtd = do_map_probe("cfi_probe", &ezkit561_map);
-	if (ezkit561_mtd) {
-		ezkit561_mtd->owner = THIS_MODULE;
-		return add_mtd_partitions(ezkit561_mtd, ezkit561_parts,
-					  EZKIT561_PART_COUNT);
-	}
-
-	return -ENXIO;
-}
-
-static void __exit cleanup_ezkit561_flash(void)
-{
-	if (ezkit561_mtd) {
-		del_mtd_partitions(ezkit561_mtd);
-		/* moved iounmap after map_destroy - armin */
-		map_destroy(ezkit561_mtd);
-		iounmap((void *)ezkit561_map.virt);
-	}
-}
-
-module_init(init_ezkit561_flash);
-module_exit(cleanup_ezkit561_flash);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Griffin Technology, Inc");
-MODULE_DESCRIPTION("Flash map driver for ADI BF561 EZKIT development boards");
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to