All of lore.kernel.org
 help / color / mirror / Atom feed
From: Murali Nalajala <mnalajal@codeaurora.org>
To: Matthieu CASTET <matthieu.castet@parrot.com>
Cc: "dwmw2@infradead.org" <dwmw2@infradead.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"Dima Zavin" <dima@android.com>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Brian Swetland" <swetland@google.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH V2 2/2] mtd: msm_nand: Add initial msm nand driver support.
Date: Wed, 27 Apr 2011 21:34:00 +0530	[thread overview]
Message-ID: <4DB83E70.4050402@codeaurora.org> (raw)
In-Reply-To: <4DB80E2A.4000203@parrot.com>

On 4/27/2011 6:08 PM, Matthieu CASTET wrote:

Hi,

> Hi,
>
> Murali Nalajala a écrit :
>> On 4/18/2011 1:02 PM, Matthieu CASTET wrote:
>>> Hi,
>>>
>>> Murali Nalajala a écrit :
>>>> Add initial msm nand driver support for Qualcomm MSM platforms.
>>>> This driver is capable of handling both 2k and 4k page support
>>>> nand devices.
>>>>
>>>> This driver was originally developed by Arve Hjønnevåg at google.
>>>> Its source is available at
>>>> http://android.git.kernel.org/?p=kernel/msm.git under
>>>> android-msm-2.6.35 branch.
>>>>
>>>> CC: Dima Zavin<dima@android.com>
>>>> CC: Brian Swetland<swetland@google.com>
>>>> CC: Arve Hjønnevåg<arve@android.com>
>>>> Signed-off-by: Murali Nalajala<mnalajal@codeaurora.org>
>>>> ---
>>>> Changes in V2
>>>> * Turn most of the pr_info() calls into pr_debug().
>>>>
>>>>    drivers/mtd/devices/Kconfig    |   11 +
>>>>    drivers/mtd/devices/Makefile   |    1 +
>>>>    drivers/mtd/devices/msm_nand.c | 1597 ++++++++++++++++++++++++++++++++++++++++
>>>>    drivers/mtd/devices/msm_nand.h |   77 ++
>>>>    4 files changed, 1686 insertions(+), 0 deletions(-)
>>>>    create mode 100644 drivers/mtd/devices/msm_nand.c
>>>>    create mode 100644 drivers/mtd/devices/msm_nand.h
>>>>
>>> For the record, I am not sure it is a great idea to make nand drivers
>>> independent of the nand layer.
>>> By doing that you could change the expected behavior, and introduce bug
>>> difficult to debug.
>>>
>>> Why do you need that ? Nand drivers can override callbacks of nand framework.
>>>
>>> Maybe because the nand layer call the driver page per page, and  you want to
>>> work with more than one page. But in this case you can extend nand layer.
>>>
>>> Or does your controller don't allow sending raw command ?
>>> And in that case all the nand logic is in the nand controller ?
>>
>> Our controller doesn't allow sending RAW commands to the flash. All
>> these commands are abstracted by the controller logic. Please refer the
>> msm_nand.h file where you will find the commands which are different
>> from the actual NAND device commands.
> Ok, but does the controller does all other check : status check, ...

Yes, it does the automatic update of the status registers for every 
read/writes do report any ECC errors.

>
> In the nand framework there is already controller like yours : see the denali.c
> as example.

I had gone through it, here in driver i saw something like 
"nand_scan_ident" calls which still use the RAW commands.

So i need to do most of the custom nand scan implementation which i am 
doing it right now in my code!!!

>>
>> eg: To send read/write data command to the device we configure the
>> controller with page address&  controller specific command. Then the
>> controller itself takes care of generating the internal h/w signals
>> required by the flash and it polls for the R/B signal&  wait states are
>> internally controlled by the h/w.
>>
> So you provide your own
>      chip->ecc.read_page
>      chip->ecc.read_page_raw
>      chip->ecc.read_oob
>      chip->write_page
>      chip->ecc.write_oob

I don't see great advantage of re-writing these call backs in my driver 
( Which are very well written and tested ). Also the DMA handling is bit 
different than what i had seen in the denali.c code.
In my case most of the limitation comes from the controller.

We have used nand base kind of implementation wherever is possible.
eg: We have leveraged the code from nand base to detect the nand device 
properties.

>
> and your done.
>
>
> Matthieu


Thanks,
Murali N

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

WARNING: multiple messages have this Message-ID (diff)
From: Murali Nalajala <mnalajal@codeaurora.org>
To: Matthieu CASTET <matthieu.castet@parrot.com>
Cc: "linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"Dima Zavin" <dima@android.com>,
	"Arve Hjønnevåg" <arve@android.com>,
	"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	"Brian Swetland" <swetland@google.com>,
	"dwmw2@infradead.org" <dwmw2@infradead.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH V2 2/2] mtd: msm_nand: Add initial msm nand driver support.
Date: Wed, 27 Apr 2011 21:34:00 +0530	[thread overview]
Message-ID: <4DB83E70.4050402@codeaurora.org> (raw)
In-Reply-To: <4DB80E2A.4000203@parrot.com>

On 4/27/2011 6:08 PM, Matthieu CASTET wrote:

Hi,

> Hi,
>
> Murali Nalajala a écrit :
>> On 4/18/2011 1:02 PM, Matthieu CASTET wrote:
>>> Hi,
>>>
>>> Murali Nalajala a écrit :
>>>> Add initial msm nand driver support for Qualcomm MSM platforms.
>>>> This driver is capable of handling both 2k and 4k page support
>>>> nand devices.
>>>>
>>>> This driver was originally developed by Arve Hjønnevåg at google.
>>>> Its source is available at
>>>> http://android.git.kernel.org/?p=kernel/msm.git under
>>>> android-msm-2.6.35 branch.
>>>>
>>>> CC: Dima Zavin<dima@android.com>
>>>> CC: Brian Swetland<swetland@google.com>
>>>> CC: Arve Hjønnevåg<arve@android.com>
>>>> Signed-off-by: Murali Nalajala<mnalajal@codeaurora.org>
>>>> ---
>>>> Changes in V2
>>>> * Turn most of the pr_info() calls into pr_debug().
>>>>
>>>>    drivers/mtd/devices/Kconfig    |   11 +
>>>>    drivers/mtd/devices/Makefile   |    1 +
>>>>    drivers/mtd/devices/msm_nand.c | 1597 ++++++++++++++++++++++++++++++++++++++++
>>>>    drivers/mtd/devices/msm_nand.h |   77 ++
>>>>    4 files changed, 1686 insertions(+), 0 deletions(-)
>>>>    create mode 100644 drivers/mtd/devices/msm_nand.c
>>>>    create mode 100644 drivers/mtd/devices/msm_nand.h
>>>>
>>> For the record, I am not sure it is a great idea to make nand drivers
>>> independent of the nand layer.
>>> By doing that you could change the expected behavior, and introduce bug
>>> difficult to debug.
>>>
>>> Why do you need that ? Nand drivers can override callbacks of nand framework.
>>>
>>> Maybe because the nand layer call the driver page per page, and  you want to
>>> work with more than one page. But in this case you can extend nand layer.
>>>
>>> Or does your controller don't allow sending raw command ?
>>> And in that case all the nand logic is in the nand controller ?
>>
>> Our controller doesn't allow sending RAW commands to the flash. All
>> these commands are abstracted by the controller logic. Please refer the
>> msm_nand.h file where you will find the commands which are different
>> from the actual NAND device commands.
> Ok, but does the controller does all other check : status check, ...

Yes, it does the automatic update of the status registers for every 
read/writes do report any ECC errors.

>
> In the nand framework there is already controller like yours : see the denali.c
> as example.

I had gone through it, here in driver i saw something like 
"nand_scan_ident" calls which still use the RAW commands.

So i need to do most of the custom nand scan implementation which i am 
doing it right now in my code!!!

>>
>> eg: To send read/write data command to the device we configure the
>> controller with page address&  controller specific command. Then the
>> controller itself takes care of generating the internal h/w signals
>> required by the flash and it polls for the R/B signal&  wait states are
>> internally controlled by the h/w.
>>
> So you provide your own
>      chip->ecc.read_page
>      chip->ecc.read_page_raw
>      chip->ecc.read_oob
>      chip->write_page
>      chip->ecc.write_oob

I don't see great advantage of re-writing these call backs in my driver 
( Which are very well written and tested ). Also the DMA handling is bit 
different than what i had seen in the denali.c code.
In my case most of the limitation comes from the controller.

We have used nand base kind of implementation wherever is possible.
eg: We have leveraged the code from nand base to detect the nand device 
properties.

>
> and your done.
>
>
> Matthieu


Thanks,
Murali N

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

WARNING: multiple messages have this Message-ID (diff)
From: mnalajal@codeaurora.org (Murali Nalajala)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 2/2] mtd: msm_nand: Add initial msm nand driver support.
Date: Wed, 27 Apr 2011 21:34:00 +0530	[thread overview]
Message-ID: <4DB83E70.4050402@codeaurora.org> (raw)
In-Reply-To: <4DB80E2A.4000203@parrot.com>

On 4/27/2011 6:08 PM, Matthieu CASTET wrote:

Hi,

> Hi,
>
> Murali Nalajala a ?crit :
>> On 4/18/2011 1:02 PM, Matthieu CASTET wrote:
>>> Hi,
>>>
>>> Murali Nalajala a ?crit :
>>>> Add initial msm nand driver support for Qualcomm MSM platforms.
>>>> This driver is capable of handling both 2k and 4k page support
>>>> nand devices.
>>>>
>>>> This driver was originally developed by Arve Hj?nnev?g at google.
>>>> Its source is available at
>>>> http://android.git.kernel.org/?p=kernel/msm.git under
>>>> android-msm-2.6.35 branch.
>>>>
>>>> CC: Dima Zavin<dima@android.com>
>>>> CC: Brian Swetland<swetland@google.com>
>>>> CC: Arve Hj?nnev?g<arve@android.com>
>>>> Signed-off-by: Murali Nalajala<mnalajal@codeaurora.org>
>>>> ---
>>>> Changes in V2
>>>> * Turn most of the pr_info() calls into pr_debug().
>>>>
>>>>    drivers/mtd/devices/Kconfig    |   11 +
>>>>    drivers/mtd/devices/Makefile   |    1 +
>>>>    drivers/mtd/devices/msm_nand.c | 1597 ++++++++++++++++++++++++++++++++++++++++
>>>>    drivers/mtd/devices/msm_nand.h |   77 ++
>>>>    4 files changed, 1686 insertions(+), 0 deletions(-)
>>>>    create mode 100644 drivers/mtd/devices/msm_nand.c
>>>>    create mode 100644 drivers/mtd/devices/msm_nand.h
>>>>
>>> For the record, I am not sure it is a great idea to make nand drivers
>>> independent of the nand layer.
>>> By doing that you could change the expected behavior, and introduce bug
>>> difficult to debug.
>>>
>>> Why do you need that ? Nand drivers can override callbacks of nand framework.
>>>
>>> Maybe because the nand layer call the driver page per page, and  you want to
>>> work with more than one page. But in this case you can extend nand layer.
>>>
>>> Or does your controller don't allow sending raw command ?
>>> And in that case all the nand logic is in the nand controller ?
>>
>> Our controller doesn't allow sending RAW commands to the flash. All
>> these commands are abstracted by the controller logic. Please refer the
>> msm_nand.h file where you will find the commands which are different
>> from the actual NAND device commands.
> Ok, but does the controller does all other check : status check, ...

Yes, it does the automatic update of the status registers for every 
read/writes do report any ECC errors.

>
> In the nand framework there is already controller like yours : see the denali.c
> as example.

I had gone through it, here in driver i saw something like 
"nand_scan_ident" calls which still use the RAW commands.

So i need to do most of the custom nand scan implementation which i am 
doing it right now in my code!!!

>>
>> eg: To send read/write data command to the device we configure the
>> controller with page address&  controller specific command. Then the
>> controller itself takes care of generating the internal h/w signals
>> required by the flash and it polls for the R/B signal&  wait states are
>> internally controlled by the h/w.
>>
> So you provide your own
>      chip->ecc.read_page
>      chip->ecc.read_page_raw
>      chip->ecc.read_oob
>      chip->write_page
>      chip->ecc.write_oob

I don't see great advantage of re-writing these call backs in my driver 
( Which are very well written and tested ). Also the DMA handling is bit 
different than what i had seen in the denali.c code.
In my case most of the limitation comes from the controller.

We have used nand base kind of implementation wherever is possible.
eg: We have leveraged the code from nand base to detect the nand device 
properties.

>
> and your done.
>
>
> Matthieu


Thanks,
Murali N

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  reply	other threads:[~2011-04-27 16:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-16  7:17 [PATCH V2 2/2] mtd: msm_nand: Add initial msm nand driver support Murali Nalajala
2011-07-08 16:50 ` Murali Nalajala
2011-04-16  7:17 ` Murali Nalajala
2011-04-18  7:32 ` Matthieu CASTET
2011-04-18  7:32   ` Matthieu CASTET
2011-04-18  7:32   ` Matthieu CASTET
2011-04-18  7:56   ` Artem Bityutskiy
2011-04-18  7:56     ` Artem Bityutskiy
2011-04-18  7:56     ` Artem Bityutskiy
2011-04-26 12:57   ` Murali Nalajala
2011-04-26 12:57     ` Murali Nalajala
2011-04-26 12:57     ` Murali Nalajala
2011-04-27 12:38     ` Matthieu CASTET
2011-04-27 12:38       ` Matthieu CASTET
2011-04-27 12:38       ` Matthieu CASTET
2011-04-27 16:04       ` Murali Nalajala [this message]
2011-04-27 16:04         ` Murali Nalajala
2011-04-27 16:04         ` Murali Nalajala
2011-04-27 17:36         ` David Brown
2011-04-27 17:36           ` David Brown
2011-04-27 17:36           ` David Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DB83E70.4050402@codeaurora.org \
    --to=mnalajal@codeaurora.org \
    --cc=arve@android.com \
    --cc=dima@android.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=matthieu.castet@parrot.com \
    --cc=swetland@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.