* [PATCH][MIPS] MTX-1 flash partition setup move to platform devices registration
@ 2008-07-11 13:34 Yoichi Yuasa
2008-07-11 13:50 ` Florian Fainelli
2008-07-11 14:10 ` Ralf Baechle
0 siblings, 2 replies; 9+ messages in thread
From: Yoichi Yuasa @ 2008-07-11 13:34 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, linux-mtd, yoichi_yuasa
MTX-1 flash partition setup move to platform devices registration.
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/arch/mips/au1000/mtx-1/platform.c linux/arch/mips/au1000/mtx-1/platform.c
--- linux-orig/arch/mips/au1000/mtx-1/platform.c 2008-05-12 08:28:21.391041296 +0900
+++ linux/arch/mips/au1000/mtx-1/platform.c 2008-05-12 08:28:36.375895238 +0900
@@ -24,6 +24,9 @@
#include <linux/gpio.h>
#include <linux/gpio_keys.h>
#include <linux/input.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/physmap.h>
+#include <mtd/mtd-abi.h>
static struct gpio_keys_button mtx1_gpio_button[] = {
{
@@ -85,10 +88,56 @@ static struct platform_device mtx1_gpio_
}
};
+static struct mtd_partition mtx1_mtd_partitions[] = {
+ {
+ .name = "filesystem",
+ .size = 0x01C00000,
+ .offset = 0,
+ },
+ {
+ .name = "yamon",
+ .size = 0x00100000,
+ .offset = MTDPART_OFS_APPEND,
+ .mask_flags = MTD_WRITEABLE,
+ },
+ {
+ .name = "kernel",
+ .size = 0x002c0000,
+ .offset = MTDPART_OFS_APPEND,
+ },
+ {
+ .name = "yamon env",
+ .size = 0x00040000,
+ .offset = MTDPART_OFS_APPEND,
+ },
+};
+
+static struct physmap_flash_data mtx1_flash_data = {
+ .width = 4,
+ .nr_parts = 4,
+ .parts = mtx1_mtd_partitions,
+};
+
+static struct resource mtx1_mtd_resource = {
+ .start = 0x1e000000,
+ .end = 0x1fffffff,
+ .flags = IORESOURCE_MEM,
+};
+
+static struct platform_device mtx1_mtd = {
+ .name = "physmap-flash",
+ .dev = {
+ .platform_data = &mtx1_flash_data,
+ },
+ .num_resources = 1,
+ .resource = &mtx1_mtd_resource,
+};
+
static struct __initdata platform_device * mtx1_devs[] = {
&mtx1_gpio_leds,
&mtx1_wdt,
- &mtx1_button
+ &mtx1_button,
+ &mtx1_mtd,
};
static int __init mtx1_register_devices(void)
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/drivers/mtd/maps/Kconfig linux/drivers/mtd/maps/Kconfig
--- linux-orig/drivers/mtd/maps/Kconfig 2008-05-12 08:28:24.811236201 +0900
+++ linux/drivers/mtd/maps/Kconfig 2008-05-12 08:28:36.375895238 +0900
@@ -258,13 +258,6 @@ config MTD_ALCHEMY
help
Flash memory access on AMD Alchemy Pb/Db/RDK Reference Boards
-config MTD_MTX1
- tristate "4G Systems MTX-1 Flash device"
- depends on MIPS_MTX1 && MTD_CFI
- help
- Flash memory access on 4G Systems MTX-1 Board. If you have one of
- these boards and would like to use the flash chips on it, say 'Y'.
-
config MTD_DILNETPC
tristate "CFI Flash device mapped on DIL/Net PC"
depends on X86 && MTD_CONCAT && MTD_PARTITIONS && MTD_CFI_INTELEXT
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/drivers/mtd/maps/Makefile linux/drivers/mtd/maps/Makefile
--- linux-orig/drivers/mtd/maps/Makefile 2008-05-12 08:28:24.811236201 +0900
+++ linux/drivers/mtd/maps/Makefile 2008-05-12 08:28:36.375895238 +0900
@@ -65,5 +65,4 @@ obj-$(CONFIG_MTD_DMV182) += dmv182.o
obj-$(CONFIG_MTD_SHARP_SL) += sharpsl-flash.o
obj-$(CONFIG_MTD_PLATRAM) += plat-ram.o
obj-$(CONFIG_MTD_OMAP_NOR) += omap_nor.o
-obj-$(CONFIG_MTD_MTX1) += mtx-1_flash.o
obj-$(CONFIG_MTD_INTEL_VR_NOR) += intel_vr_nor.o
diff -pruN -X /home/yuasa/Memo/dontdiff linux-orig/drivers/mtd/maps/mtx-1_flash.c linux/drivers/mtd/maps/mtx-1_flash.c
--- linux-orig/drivers/mtd/maps/mtx-1_flash.c 2008-05-12 08:28:24.839237803 +0900
+++ linux/drivers/mtd/maps/mtx-1_flash.c 1970-01-01 09:00:00.000000000 +0900
@@ -1,95 +0,0 @@
-/*
- * Flash memory access on 4G Systems MTX-1 boards
- *
- * $Id: mtx-1_flash.c,v 1.2 2005/11/07 11:14:27 gleixner Exp $
- *
- * (C) 2005 Bruno Randolf <bruno.randolf@4g-systems.biz>
- * (C) 2005 Joern Engel <joern@wohnheim.fh-wedel.de>
- *
- */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/init.h>
-#include <linux/kernel.h>
-
-#include <linux/mtd/mtd.h>
-#include <linux/mtd/map.h>
-#include <linux/mtd/partitions.h>
-
-#include <asm/io.h>
-
-static struct map_info mtx1_map = {
- .name = "MTX-1 flash",
- .bankwidth = 4,
- .size = 0x2000000,
- .phys = 0x1E000000,
-};
-
-static struct mtd_partition mtx1_partitions[] = {
- {
- .name = "filesystem",
- .size = 0x01C00000,
- .offset = 0,
- },{
- .name = "yamon",
- .size = 0x00100000,
- .offset = MTDPART_OFS_APPEND,
- .mask_flags = MTD_WRITEABLE,
- },{
- .name = "kernel",
- .size = 0x002c0000,
- .offset = MTDPART_OFS_APPEND,
- },{
- .name = "yamon env",
- .size = 0x00040000,
- .offset = MTDPART_OFS_APPEND,
- }
-};
-
-static struct mtd_info *mtx1_mtd;
-
-int __init mtx1_mtd_init(void)
-{
- int ret = -ENXIO;
-
- simple_map_init(&mtx1_map);
-
- mtx1_map.virt = ioremap(mtx1_map.phys, mtx1_map.size);
- if (!mtx1_map.virt)
- return -EIO;
-
- mtx1_mtd = do_map_probe("cfi_probe", &mtx1_map);
- if (!mtx1_mtd)
- goto err;
-
- mtx1_mtd->owner = THIS_MODULE;
-
- ret = add_mtd_partitions(mtx1_mtd, mtx1_partitions,
- ARRAY_SIZE(mtx1_partitions));
- if (ret)
- goto err;
-
- return 0;
-
-err:
- iounmap(mtx1_map.virt);
- return ret;
-}
-
-static void __exit mtx1_mtd_cleanup(void)
-{
- if (mtx1_mtd) {
- del_mtd_partitions(mtx1_mtd);
- map_destroy(mtx1_mtd);
- }
- if (mtx1_map.virt)
- iounmap(mtx1_map.virt);
-}
-
-module_init(mtx1_mtd_init);
-module_exit(mtx1_mtd_cleanup);
-
-MODULE_AUTHOR("Bruno Randolf <bruno.randolf@4g-systems.biz>");
-MODULE_DESCRIPTION("MTX-1 flash map");
-MODULE_LICENSE("GPL");
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH][MIPS] MTX-1 flash partition setup move to platform devices registration
2008-07-11 13:34 [PATCH][MIPS] MTX-1 flash partition setup move to platform devices registration Yoichi Yuasa
@ 2008-07-11 13:50 ` Florian Fainelli
2008-07-11 14:10 ` Ralf Baechle
1 sibling, 0 replies; 9+ messages in thread
From: Florian Fainelli @ 2008-07-11 13:50 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: linux-mips, linux-mtd, Ralf Baechle
Hello Yoichi,
Le Friday 11 July 2008 15:34:48 Yoichi Yuasa, vous avez écrit :
> MTX-1 flash partition setup move to platform devices registration.
Thanks for doing this.
>
> Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Acked-by: Florian Fainelli <florian.fainelli@telecomint.eu>
--
Cordialement, Florian Fainelli
------------------------------
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][MIPS] MTX-1 flash partition setup move to platform devices registration
2008-07-11 13:34 [PATCH][MIPS] MTX-1 flash partition setup move to platform devices registration Yoichi Yuasa
2008-07-11 13:50 ` Florian Fainelli
@ 2008-07-11 14:10 ` Ralf Baechle
2008-07-11 17:39 ` David Woodhouse
1 sibling, 1 reply; 9+ messages in thread
From: Ralf Baechle @ 2008-07-11 14:10 UTC (permalink / raw)
To: Yoichi Yuasa; +Cc: linux-mips, linux-mtd
On Fri, Jul 11, 2008 at 10:34:48PM +0900, Yoichi Yuasa wrote:
> MTX-1 flash partition setup move to platform devices registration.
MTD guys, if you're ok with this patch I'd like to queue it for 2.6.27.
Ralf
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][MIPS] MTX-1 flash partition setup move to platform devices registration
2008-07-11 14:10 ` Ralf Baechle
@ 2008-07-11 17:39 ` David Woodhouse
2008-07-14 10:33 ` Regarding NAND driver based on PrimeCell Static Memory Controller (PL350 series) Divyanshu Verma
2008-07-14 11:47 ` [PATCH][MIPS] MTX-1 flash partition setup move to platform devices registration Ralf Baechle
0 siblings, 2 replies; 9+ messages in thread
From: David Woodhouse @ 2008-07-11 17:39 UTC (permalink / raw)
To: Ralf Baechle; +Cc: linux-mips, linux-mtd, Yoichi Yuasa
On Fri, 2008-07-11 at 15:10 +0100, Ralf Baechle wrote:
> On Fri, Jul 11, 2008 at 10:34:48PM +0900, Yoichi Yuasa wrote:
>
> > MTX-1 flash partition setup move to platform devices registration.
>
> MTD guys, if you're ok with this patch I'd like to queue it for
> 2.6.27.
Acked-By: David Woodhouse <David.Woodhouse@intel.com>
--
dwmw2
^ permalink raw reply [flat|nested] 9+ messages in thread
* Regarding NAND driver based on PrimeCell Static Memory Controller (PL350 series)
2008-07-11 17:39 ` David Woodhouse
@ 2008-07-14 10:33 ` Divyanshu Verma
2008-07-14 14:26 ` David Woodhouse
2008-07-14 20:33 ` Vitaly Wool
2008-07-14 11:47 ` [PATCH][MIPS] MTX-1 flash partition setup move to platform devices registration Ralf Baechle
1 sibling, 2 replies; 9+ messages in thread
From: Divyanshu Verma @ 2008-07-14 10:33 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd
Hi,
I am trying to implement a NAND driver for our SOC. The problem I am
facing is that, our NAND controller does not allow me to have access to
hardware specific control line. In other words, I cannot follow the
mechanism given on http://www.linux-mtd.infradead.org/ for NAND driver
as I cannot write "my_nand_hwcontrol" function. The H/w guys say that
all this is taken care in the controller itself.
I then decided to identify the NAND Chip as a MTD_BLOCK device, so that
I will not require any Hwcontrol function. Now for doing so, is it
possible to write a kernel module for NAND which can use functions
exported by mtd/mtd_blkdevs.c ?
My very cordial thanks for any heads up on this as I am struggling for
a long time.
Just for info I am using ARM PrimeCell Static Memory Controller (PL350
series) as NAND controller.They way h/w guys have designed it is that it
doesn't provide me access to HWCONTROL functions.
Thanks and regards,
Divyanshu
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Regarding NAND driver based on PrimeCell Static Memory Controller (PL350 series)
2008-07-14 10:33 ` Regarding NAND driver based on PrimeCell Static Memory Controller (PL350 series) Divyanshu Verma
@ 2008-07-14 14:26 ` David Woodhouse
2008-08-26 8:29 ` Divyanshu Verma
2008-07-14 20:33 ` Vitaly Wool
1 sibling, 1 reply; 9+ messages in thread
From: David Woodhouse @ 2008-07-14 14:26 UTC (permalink / raw)
To: Divyanshu Verma; +Cc: linux-mtd
On Mon, 2008-07-14 at 03:33 -0700, Divyanshu Verma wrote:
> I am trying to implement a NAND driver for our SOC. The problem I am
> facing is that, our NAND controller does not allow me to have access to
> hardware specific control line. In other words, I cannot follow the
> mechanism given on http://www.linux-mtd.infradead.org/ for NAND driver
> as I cannot write "my_nand_hwcontrol" function. The H/w guys say that
> all this is taken care in the controller itself.
>
> I then decided to identify the NAND Chip as a MTD_BLOCK device, so that
> I will not require any Hwcontrol function. Now for doing so, is it
> possible to write a kernel module for NAND which can use functions
> exported by mtd/mtd_blkdevs.c ?
It sounds like it isn't 'NAND' at all, as far as you're concerned. It's
a disk drive of some form. Usually these things present themselves as
IDE, so you'd use the IDE driver. If it has its own 'special' interface
then you probably want a dedicated block driver for it; nothing to do
with the MTD subsystem at all.
--
dwmw2
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: Regarding NAND driver based on PrimeCell Static Memory Controller (PL350 series)
2008-07-14 14:26 ` David Woodhouse
@ 2008-08-26 8:29 ` Divyanshu Verma
0 siblings, 0 replies; 9+ messages in thread
From: Divyanshu Verma @ 2008-08-26 8:29 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd
Hi,
I finally got the NAND as MTD device, by providing blank hw_control function and providing my SOC specific read/write functions.
It passes nand_scan successfully and shows up as an mtd device under /proc/mtd.
But when I try to cat NAND device, ( without any filesystem mounte)d it crashes.
I traced down the sequence and found that, on doing "cat" it issues a read 512 bytes ( for 8 consecutive sectors not sure why??).
The low level read command then gets 2048 bytes from the NAND chip and puts it in NAND controller memory( page size of NAND is 2K).After that it tries to read 512 bytes into mtd buffer ( sent from mtdblock.c) but falls in between giving following oops message.
Unable to handle kernel NULL pointer dereference at virtual address 00000078
pgd = 0000d67c
Unable to handle kernel paging request at virtual address 0000d67c
pgd = 0000d67c
Unable to handle kernel paging request at virtual address 0000d67c
pgd = 0000d67c
Unable to handle kernel paging request at virtual address 0000d67c
pgd = 0000d67c
Unable to handle kernel paging request at virtual address 0000d67c
pgd = 0000d67c
Unable to handle kernel paging request at virtual address 0000d67c
pgd = 0000d67c
Unable to handle kernel paging request at virtual address 0000d67c
pgd = 0000d67c
Unable to handle kernel paging request at virtual address 0000d67c
pgd = 0000d67c
Unable to handle kernel paging request at virtual address 0000d67c
pgd = 0000d67c
Unable to handle kernel paging request at virtual address 0000d67c
Any pointer to solve this will be highly appreciated.
Regards,
Divyanshu
-----Original Message-----
From: David Woodhouse [mailto:dwmw2@infradead.org]
Sent: Monday, July 14, 2008 7:57 PM
To: Divyanshu Verma
Cc: linux-mtd
Subject: Re: Regarding NAND driver based on PrimeCell Static Memory Controller (PL350 series)
On Mon, 2008-07-14 at 03:33 -0700, Divyanshu Verma wrote:
> I am trying to implement a NAND driver for our SOC. The problem I am
> facing is that, our NAND controller does not allow me to have access to
> hardware specific control line. In other words, I cannot follow the
> mechanism given on http://www.linux-mtd.infradead.org/ for NAND driver
> as I cannot write "my_nand_hwcontrol" function. The H/w guys say that
> all this is taken care in the controller itself.
>
> I then decided to identify the NAND Chip as a MTD_BLOCK device, so that
> I will not require any Hwcontrol function. Now for doing so, is it
> possible to write a kernel module for NAND which can use functions
> exported by mtd/mtd_blkdevs.c ?
It sounds like it isn't 'NAND' at all, as far as you're concerned. It's
a disk drive of some form. Usually these things present themselves as
IDE, so you'd use the IDE driver. If it has its own 'special' interface
then you probably want a dedicated block driver for it; nothing to do
with the MTD subsystem at all.
--
dwmw2
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Regarding NAND driver based on PrimeCell Static Memory Controller (PL350 series)
2008-07-14 10:33 ` Regarding NAND driver based on PrimeCell Static Memory Controller (PL350 series) Divyanshu Verma
2008-07-14 14:26 ` David Woodhouse
@ 2008-07-14 20:33 ` Vitaly Wool
1 sibling, 0 replies; 9+ messages in thread
From: Vitaly Wool @ 2008-07-14 20:33 UTC (permalink / raw)
To: Divyanshu Verma; +Cc: linux-mtd, David Woodhouse
On 7/14/08, Divyanshu Verma <dverma@broadcom.com> wrote:
>
> Hi,
> I am trying to implement a NAND driver for our SOC. The problem I am
> facing is that, our NAND controller does not allow me to have access to
> hardware specific control line. In other words, I cannot follow the
> mechanism given on http://www.linux-mtd.infradead.org/ for NAND driver
> as I cannot write "my_nand_hwcontrol" function. The H/w guys say that
> all this is taken care in the controller itself.
As far as I recall, PrimeCell thingies fit well into the _new_
MTD/NAND subsystem.
Please provide more detail on your one and I hope I'll be able to give
you some guidance.
Vitaly
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][MIPS] MTX-1 flash partition setup move to platform devices registration
2008-07-11 17:39 ` David Woodhouse
2008-07-14 10:33 ` Regarding NAND driver based on PrimeCell Static Memory Controller (PL350 series) Divyanshu Verma
@ 2008-07-14 11:47 ` Ralf Baechle
1 sibling, 0 replies; 9+ messages in thread
From: Ralf Baechle @ 2008-07-14 11:47 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mips, linux-mtd, Yoichi Yuasa
On Fri, Jul 11, 2008 at 06:39:19PM +0100, David Woodhouse wrote:
> Acked-By: David Woodhouse <David.Woodhouse@intel.com>
Thanks, so this one also queued for 2.6.27.
Ralf
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-08-26 8:30 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-11 13:34 [PATCH][MIPS] MTX-1 flash partition setup move to platform devices registration Yoichi Yuasa
2008-07-11 13:50 ` Florian Fainelli
2008-07-11 14:10 ` Ralf Baechle
2008-07-11 17:39 ` David Woodhouse
2008-07-14 10:33 ` Regarding NAND driver based on PrimeCell Static Memory Controller (PL350 series) Divyanshu Verma
2008-07-14 14:26 ` David Woodhouse
2008-08-26 8:29 ` Divyanshu Verma
2008-07-14 20:33 ` Vitaly Wool
2008-07-14 11:47 ` [PATCH][MIPS] MTX-1 flash partition setup move to platform devices registration Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox