diff mbox

[U-Boot,U-boot,v3,3/3] k2hk: change default nand ecc layout

Message ID 1403617746-25024-4-git-send-email-ivan.khoronzhuk@ti.com
State Rejected
Delegated to: Scott Wood
Headers show

Commit Message

Ivan Khoronzhuk June 24, 2014, 1:49 p.m. UTC
For keystyone k2hk board the default nand layout is different
from davinci. So swich ecc layout at init in board file.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
---
 board/ti/k2hk_evm/board.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Scott Wood June 24, 2014, 11:26 p.m. UTC | #1
On Tue, 2014-06-24 at 16:49 +0300, Ivan Khoronzhuk wrote:
> For keystyone k2hk board the default nand layout is different
> from davinci. So swich ecc layout at init in board file.
> 
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
> ---
>  board/ti/k2hk_evm/board.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/board/ti/k2hk_evm/board.c b/board/ti/k2hk_evm/board.c
> index ef90f9d..baa6ab7 100644
> --- a/board/ti/k2hk_evm/board.c
> +++ b/board/ti/k2hk_evm/board.c
> @@ -11,6 +11,7 @@
>  #include <exports.h>
>  #include <fdt_support.h>
>  #include <libfdt.h>
> +#include <nand.h>
>  
>  #include <asm/arch/hardware.h>
>  #include <asm/arch/clock.h>
> @@ -19,6 +20,7 @@
>  #include <asm/arch/emac_defs.h>
>  #include <asm/arch/psc_defs.h>
>  #include <asm/ti-common/ti-aemif.h>
> +#include <asm/ti-common/davinci_nand.h>
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -147,6 +149,15 @@ int cpu_to_bus(u32 *ptr, u32 length)
>  	return 0;
>  }
>  
> +int board_nand_init(struct nand_chip *chip)
> +{
> +	davinci_nand_init(chip);
> +	chip->ecc.layout =
> +		board_nand_get_ecclayout(NAND_KEYSTONE_RBL_4BIT_LAYOUT);

Again, why not use board_nand_set_ecclayout()?

-Scott
Ivan Khoronzhuk June 25, 2014, 3:57 p.m. UTC | #2
On 06/25/2014 02:26 AM, Scott Wood wrote:
> On Tue, 2014-06-24 at 16:49 +0300, Ivan Khoronzhuk wrote:
>> For keystyone k2hk board the default nand layout is different
>> from davinci. So swich ecc layout at init in board file.
>>
>> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
>> ---
>>   board/ti/k2hk_evm/board.c | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/board/ti/k2hk_evm/board.c b/board/ti/k2hk_evm/board.c
>> index ef90f9d..baa6ab7 100644
>> --- a/board/ti/k2hk_evm/board.c
>> +++ b/board/ti/k2hk_evm/board.c
>> @@ -11,6 +11,7 @@
>>   #include <exports.h>
>>   #include <fdt_support.h>
>>   #include <libfdt.h>
>> +#include <nand.h>
>>   
>>   #include <asm/arch/hardware.h>
>>   #include <asm/arch/clock.h>
>> @@ -19,6 +20,7 @@
>>   #include <asm/arch/emac_defs.h>
>>   #include <asm/arch/psc_defs.h>
>>   #include <asm/ti-common/ti-aemif.h>
>> +#include <asm/ti-common/davinci_nand.h>
>>   
>>   DECLARE_GLOBAL_DATA_PTR;
>>   
>> @@ -147,6 +149,15 @@ int cpu_to_bus(u32 *ptr, u32 length)
>>   	return 0;
>>   }
>>   
>> +int board_nand_init(struct nand_chip *chip)
>> +{
>> +	davinci_nand_init(chip);
>> +	chip->ecc.layout =
>> +		board_nand_get_ecclayout(NAND_KEYSTONE_RBL_4BIT_LAYOUT);
> Again, why not use board_nand_set_ecclayout()?
>
> -Scott
>
>

Because oobavail is updated in nand_scan_tail(), which is called later.

Sorry for the mess, but it doesn't matter already, seems I can start 
with default
layout and switch later if needed. So I'm going to remove subj patch.

Thanks.
diff mbox

Patch

diff --git a/board/ti/k2hk_evm/board.c b/board/ti/k2hk_evm/board.c
index ef90f9d..baa6ab7 100644
--- a/board/ti/k2hk_evm/board.c
+++ b/board/ti/k2hk_evm/board.c
@@ -11,6 +11,7 @@ 
 #include <exports.h>
 #include <fdt_support.h>
 #include <libfdt.h>
+#include <nand.h>
 
 #include <asm/arch/hardware.h>
 #include <asm/arch/clock.h>
@@ -19,6 +20,7 @@ 
 #include <asm/arch/emac_defs.h>
 #include <asm/arch/psc_defs.h>
 #include <asm/ti-common/ti-aemif.h>
+#include <asm/ti-common/davinci_nand.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -147,6 +149,15 @@  int cpu_to_bus(u32 *ptr, u32 length)
 	return 0;
 }
 
+int board_nand_init(struct nand_chip *chip)
+{
+	davinci_nand_init(chip);
+	chip->ecc.layout =
+		board_nand_get_ecclayout(NAND_KEYSTONE_RBL_4BIT_LAYOUT);
+
+	return 0;
+}
+
 #if defined(CONFIG_BOARD_EARLY_INIT_F)
 int board_early_init_f(void)
 {