Regarding NAND driver based on PrimeCell Static Memory Controller (PL350 series)

Divyanshu Verma dverma at broadcom.com
Tue Aug 26 04:29:15 EDT 2008


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 at 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






More information about the linux-mtd mailing list