Patchwork [U-Boot,08/17] ARM: SPL: Remove NAND_MODE_HW_ECC from spl_nand.c

login
register
mail settings
Submitter Tom Rini
Date Aug. 15, 2012, 9:30 p.m.
Message ID <1345066254-6911-9-git-send-email-trini@ti.com>
Download mbox | patch
Permalink /patch/177829/
State Superseded
Delegated to: Tom Rini
Headers show

Comments

Tom Rini - Aug. 15, 2012, 9:30 p.m.
This detection code doesn't (and can't) do anything currently, so
remove.

Signed-off-by: Tom Rini <trini@ti.com>
---
 arch/arm/cpu/armv7/omap3/board.c   |    3 ---
 arch/arm/include/asm/omap_common.h |    1 -
 arch/arm/lib/spl_nand.c            |   13 +++----------
 3 files changed, 3 insertions(+), 14 deletions(-)
Stefano Babic - Aug. 16, 2012, 7:59 a.m.
On 15/08/2012 23:30, Tom Rini wrote:
> This detection code doesn't (and can't) do anything currently, so
> remove.
> 
> Signed-off-by: Tom Rini <trini@ti.com>
> ---
>  arch/arm/cpu/armv7/omap3/board.c   |    3 ---
>  arch/arm/include/asm/omap_common.h |    1 -
>  arch/arm/lib/spl_nand.c            |   13 +++----------
>  3 files changed, 3 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
> index 1640696..a487374 100644
> --- a/arch/arm/cpu/armv7/omap3/board.c
> +++ b/arch/arm/cpu/armv7/omap3/board.c
> @@ -77,9 +77,6 @@ u32 spl_boot_mode(void)
>  	case BOOT_DEVICE_MMC1:
>  		return MMCSD_MODE_FAT;
>  		break;
> -	case BOOT_DEVICE_NAND:
> -		return NAND_MODE_HW_ECC;
> -		break;
>  	default:
>  		puts("spl: ERROR:  unknown device - can't select boot mode\n");
>  		hang();
> diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
> index 9ac0cc2..1e8f59b 100644
> --- a/arch/arm/include/asm/omap_common.h
> +++ b/arch/arm/include/asm/omap_common.h
> @@ -76,7 +76,6 @@ void preloader_console_init(void);
>  #define	MMCSD_MODE_UNDEFINED	0
>  #define MMCSD_MODE_RAW		1
>  #define MMCSD_MODE_FAT		2
> -#define NAND_MODE_HW_ECC	3
>  
>  struct spl_image_info {
>  	const char *name;
> diff --git a/arch/arm/lib/spl_nand.c b/arch/arm/lib/spl_nand.c
> index ea7cc8a..39221d5 100644
> --- a/arch/arm/lib/spl_nand.c
> +++ b/arch/arm/lib/spl_nand.c
> @@ -35,16 +35,9 @@ void spl_nand_load_image(void)
>  	int *src __attribute__((unused));
>  	int *dst __attribute__((unused));
>  
> -	switch (spl_boot_mode()) {
> -	case NAND_MODE_HW_ECC:
> -		debug("spl: nand - using hw ecc\n");
> -		gpmc_init();
> -		nand_init();
> -		break;
> -	default:
> -		puts("spl: ERROR: This bootmode is not implemented - hanging");
> -		hang();
> -	}
> +	debug("spl: nand - using hw ecc\n");
> +	gpmc_init();
> +	nand_init();
>  

This also does not work with other SOCs, where there is not a gpmc init.
My idea was to add here a soc specific function, where gpmc_init and
nand_init can be called.

Regards,
Stefano

Patch

diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 1640696..a487374 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -77,9 +77,6 @@  u32 spl_boot_mode(void)
 	case BOOT_DEVICE_MMC1:
 		return MMCSD_MODE_FAT;
 		break;
-	case BOOT_DEVICE_NAND:
-		return NAND_MODE_HW_ECC;
-		break;
 	default:
 		puts("spl: ERROR:  unknown device - can't select boot mode\n");
 		hang();
diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
index 9ac0cc2..1e8f59b 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -76,7 +76,6 @@  void preloader_console_init(void);
 #define	MMCSD_MODE_UNDEFINED	0
 #define MMCSD_MODE_RAW		1
 #define MMCSD_MODE_FAT		2
-#define NAND_MODE_HW_ECC	3
 
 struct spl_image_info {
 	const char *name;
diff --git a/arch/arm/lib/spl_nand.c b/arch/arm/lib/spl_nand.c
index ea7cc8a..39221d5 100644
--- a/arch/arm/lib/spl_nand.c
+++ b/arch/arm/lib/spl_nand.c
@@ -35,16 +35,9 @@  void spl_nand_load_image(void)
 	int *src __attribute__((unused));
 	int *dst __attribute__((unused));
 
-	switch (spl_boot_mode()) {
-	case NAND_MODE_HW_ECC:
-		debug("spl: nand - using hw ecc\n");
-		gpmc_init();
-		nand_init();
-		break;
-	default:
-		puts("spl: ERROR: This bootmode is not implemented - hanging");
-		hang();
-	}
+	debug("spl: nand - using hw ecc\n");
+	gpmc_init();
+	nand_init();
 
 	/*use CONFIG_SYS_TEXT_BASE as temporary storage area */
 	header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);