diff mbox

[v2,05/12] NAND: DaVinci: allow forced disable of subpage writes

Message ID 1392918914-15564-6-git-send-email-m-karicheri2@ti.com
State New
Headers show

Commit Message

Murali Karicheri Feb. 20, 2014, 5:55 p.m. UTC
This patch introduces a configurable mechanism to disable
subpage writes in the DaVinci NAND driver.

Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
---
 - Added README
 README                          |    5 +++++
 drivers/mtd/nand/davinci_nand.c |    3 +++
 2 files changed, 8 insertions(+)

Comments

Murali Karicheri Feb. 27, 2014, 4:38 p.m. UTC | #1
On 2/25/2014 11:01 PM, Scott Wood wrote:
> On Thu, 2014-02-20 at 12:55 -0500, Murali Karicheri wrote:
>> This patch introduces a configurable mechanism to disable
>> subpage writes in the DaVinci NAND driver.
>>
>> Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
>> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
>> ---
>>   - Added README
>>   README                          |    5 +++++
>>   drivers/mtd/nand/davinci_nand.c |    3 +++
>>   2 files changed, 8 insertions(+)
>>
>> diff --git a/README b/README
>> index aea82be..caf60a2 100644
>> --- a/README
>> +++ b/README
>> @@ -4427,6 +4427,11 @@ Low Level (hardware related) configuration options:
>>   - CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC:
>>   		Enables the RTC32K OSC on AM33xx based plattforms
>>   
>> +- CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
>> +		Option to disable subpage write in NAND driver
>> +		Example driver that use this:
>> +		drivers/mtd/nand/davinci_nand.c
> I'd rather this be a full list of drivers that use it, not an example.

There are 3 nand drivers that disable sub page write using NAND_NO_SUBPAGE_WRITE
by default.

nand/docg4.c
nand/fsl_ifc_nand.c
nand/mxs_nand.c

nand/davinci_nand.c is used across many of ti's existing davinci platforms and some of them
do enable sub page write. In Keystone platform, we want to disable this option. So to answer
your question, davinci_nand.c is the only user driver using this configuration option,
but that doesn't prevent anyone from using the option. So I want to keep this configuration
option as a generic option.

Hope this clarifies.

Murali

> -Scott
>
>
Murali Karicheri Feb. 27, 2014, 9:20 p.m. UTC | #2
On 2/27/2014 2:21 PM, Scott Wood wrote:
> On Thu, 2014-02-27 at 16:14 +0000, Karicheri, Muralidharan wrote:
>>> -----Original Message-----
>>> From: Scott Wood [mailto:scottwood@freescale.com]
>>> Sent: Tuesday, February 25, 2014 11:01 PM
>>> To: Karicheri, Muralidharan
>>> Cc: u-boot@lists.denx.de; Rini, Tom
>>> Subject: Re: [U-Boot] [U-Boot PATCH v2 05/12] NAND: DaVinci: allow forced disable of
>>> subpage writes
>>>
>>> On Thu, 2014-02-20 at 12:55 -0500, Murali Karicheri wrote:
>>>> This patch introduces a configurable mechanism to disable subpage
>>>> writes in the DaVinci NAND driver.
>>>>
>>>> Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
>>>> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
>>>> ---
>>>>   - Added README
>>>>   README                          |    5 +++++
>>>>   drivers/mtd/nand/davinci_nand.c |    3 +++
>>>>   2 files changed, 8 insertions(+)
>>>>
>>>> diff --git a/README b/README
>>>> index aea82be..caf60a2 100644
>>>> --- a/README
>>>> +++ b/README
>>>> @@ -4427,6 +4427,11 @@ Low Level (hardware related) configuration options:
>>>>   - CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC:
>>>>   		Enables the RTC32K OSC on AM33xx based plattforms
>>>>
>>>> +- CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
>>>> +		Option to disable subpage write in NAND driver
>>>> +		Example driver that use this:
>>>> +		drivers/mtd/nand/davinci_nand.c
>>> I'd rather this be a full list of drivers that use it, not an example.
>> There are 3 drivers out there that disable sub page write using NAND_NO_SUBPAGE_WRITE
>> by default.
>>
>> nand/docg4.c
>> nand/fsl_ifc_nand.c
>> nand/mxs_nand.c
>>
>> nand/davinci_nand.c is used across many of ti's existing davinci platforms and some of them
>> do enable sub page write.
> And only one of them uses CONFIG_SYS_NAND_NO_SUBPAGE_WRITE, which is a
> potentially confusing thing given the generic naming, and thus warrants
> clear documentation.
>
>> In Keystone platform, we want to disable this option. So to answer
>> your question, davinci_nand.c is the only user driver using this configuration option,
>> but that doesn't prevent anyone from using the option. So I want to keep this configuration
>> option as a generic option.
> That's fine.  My point is just to s/Example driver/Drivers/ so that if
> someone adds this to a new driver, they (hopefully) add it to the list
> in README, rather than just thinking one example is enough.
>
> -Scott
>
>
That is fine. I will make the change in v3.

Murali
diff mbox

Patch

diff --git a/README b/README
index aea82be..caf60a2 100644
--- a/README
+++ b/README
@@ -4427,6 +4427,11 @@  Low Level (hardware related) configuration options:
 - CONFIG_SPL_AM33XX_ENABLE_RTC32K_OSC:
 		Enables the RTC32K OSC on AM33xx based plattforms
 
+- CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+		Option to disable subpage write in NAND driver
+		Example driver that use this:
+		drivers/mtd/nand/davinci_nand.c
+
 Freescale QE/FMAN Firmware Support:
 -----------------------------------
 
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 5b17d7b..75b03a7 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -609,6 +609,9 @@  void davinci_nand_init(struct nand_chip *nand)
 #ifdef CONFIG_SYS_NAND_USE_FLASH_BBT
 	nand->bbt_options	  |= NAND_BBT_USE_FLASH;
 #endif
+#ifdef CONFIG_SYS_NAND_NO_SUBPAGE_WRITE
+	nand->options	  |= NAND_NO_SUBPAGE_WRITE;
+#endif
 #ifdef CONFIG_SYS_NAND_HW_ECC
 	nand->ecc.mode = NAND_ECC_HW;
 	nand->ecc.size = 512;