diff mbox

[U-Boot,11/13] mxc nand: Let driver detect IP revision

Message ID 716411359.2375004.1344891042122.JavaMail.root@advansee.com
State Accepted
Commit 1884d6577e6b298ab2966d7d8fd7be888c3b7332
Delegated to: Scott Wood
Headers show

Commit Message

Benoît Thébaudeau Aug. 13, 2012, 8:50 p.m. UTC
There is no reason to have board configs to select the NFC IP revision. Just let
the driver detect it. BTW, remove broken NFC IP revision configs from board
config files.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Stefano Babic <sbabic@denx.de>
---
 .../include/configs/flea3.h                        |    1 -
 .../include/configs/mx35pdk.h                      |    1 -
 .../include/configs/tx25.h                         |    1 -
 .../include/fsl_nfc.h                              |    8 +++-----
 4 files changed, 3 insertions(+), 8 deletions(-)

Comments

Stefano Babic Aug. 14, 2012, 9:28 a.m. UTC | #1
On 13/08/2012 22:50, Benoît Thébaudeau wrote:
> There is no reason to have board configs to select the NFC IP revision. Just let
> the driver detect it. BTW, remove broken NFC IP revision configs from board
> config files.
> 
> Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
> Cc: Scott Wood <scottwood@freescale.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---

Hi Benoît,

>  .../include/configs/flea3.h                        |    1 -
>  .../include/configs/mx35pdk.h                      |    1 -
>  .../include/configs/tx25.h                         |    1 -
>  .../include/fsl_nfc.h                              |    8 +++-----
>  4 files changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git u-boot-4d3c95f.orig/include/configs/flea3.h u-boot-4d3c95f/include/configs/flea3.h
> index 46939d4..43cadbc 100644
> --- u-boot-4d3c95f.orig/include/configs/flea3.h
> +++ u-boot-4d3c95f/include/configs/flea3.h
> @@ -221,7 +221,6 @@
>   * NAND FLASH driver setup
>   */
>  #define CONFIG_NAND_MXC
> -#define CONFIG_NAND_MXC_V1_1
>  #define CONFIG_MXC_NAND_REGS_BASE	(NFC_BASE_ADDR)
>  #define CONFIG_SYS_MAX_NAND_DEVICE	1
>  #define CONFIG_SYS_NAND_BASE		(NFC_BASE_ADDR)
> diff --git u-boot-4d3c95f.orig/include/configs/mx35pdk.h u-boot-4d3c95f/include/configs/mx35pdk.h
> index 6eb5da5..93a9dd7 100644
> --- u-boot-4d3c95f.orig/include/configs/mx35pdk.h
> +++ u-boot-4d3c95f/include/configs/mx35pdk.h
> @@ -239,7 +239,6 @@
>   * NAND FLASH driver setup
>   */
>  #define CONFIG_NAND_MXC
> -#define CONFIG_NAND_MXC_V1_1
>  #define CONFIG_MXC_NAND_REGS_BASE	(NFC_BASE_ADDR)
>  #define CONFIG_SYS_MAX_NAND_DEVICE	1
>  #define CONFIG_SYS_NAND_BASE		(NFC_BASE_ADDR)
> diff --git u-boot-4d3c95f.orig/include/configs/tx25.h u-boot-4d3c95f/include/configs/tx25.h
> index 6821528..870e863 100644
> --- u-boot-4d3c95f.orig/include/configs/tx25.h
> +++ u-boot-4d3c95f/include/configs/tx25.h
> @@ -108,7 +108,6 @@
>  
>  /* NAND */
>  #define CONFIG_NAND_MXC
> -#define CONFIG_NAND_MXC_V1_1
>  #define CONFIG_MXC_NAND_REGS_BASE	(0xBB000000)
>  #define CONFIG_SYS_MAX_NAND_DEVICE	1
>  #define CONFIG_SYS_NAND_BASE		(0xBB000000)
> diff --git u-boot-4d3c95f.orig/include/fsl_nfc.h u-boot-4d3c95f/include/fsl_nfc.h
> index c248cef..6618089 100644
> --- u-boot-4d3c95f.orig/include/fsl_nfc.h
> +++ u-boot-4d3c95f/include/fsl_nfc.h
> @@ -42,10 +42,12 @@
>   */
>  #if defined(CONFIG_MX27) || defined(CONFIG_MX31)
>  #define MXC_NFC_V1
> +#define is_mxc_nfc_11()		0
>  #elif defined(CONFIG_MX25) || defined(CONFIG_MX35)
>  #define MXC_NFC_V1_1
> +#define is_mxc_nfc_11()		1
>  #else
> -#warning "MXC NFC version not defined"
> +#error "MXC NFC implementation not supported"
>  #endif
>  
>  #if defined(MXC_NFC_V1)
> @@ -53,14 +55,10 @@
>  #define NAND_MXC_SPARE_BUF_SIZE		16
>  #define NAND_MXC_REG_OFFSET		0xe00
>  #define NAND_MXC_2K_MULTI_CYCLE
> -#define is_mxc_nfc_11()			0
>  #elif defined(MXC_NFC_V1_1)
>  #define NAND_MXC_NR_BUFS		8
>  #define NAND_MXC_SPARE_BUF_SIZE		64
>  #define NAND_MXC_REG_OFFSET		0x1e00
> -#define is_mxc_nfc_11()			1
> -#else
> -#error "define CONFIG_NAND_MXC_VXXX to use the mxc nand driver"
>  #endif
>  
>  struct fsl_nfc_regs {
> 

Agree on this change. The NAND controller version belongs to the SOC,
and not to the board. It should be not here.

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox

Patch

diff --git u-boot-4d3c95f.orig/include/configs/flea3.h u-boot-4d3c95f/include/configs/flea3.h
index 46939d4..43cadbc 100644
--- u-boot-4d3c95f.orig/include/configs/flea3.h
+++ u-boot-4d3c95f/include/configs/flea3.h
@@ -221,7 +221,6 @@ 
  * NAND FLASH driver setup
  */
 #define CONFIG_NAND_MXC
-#define CONFIG_NAND_MXC_V1_1
 #define CONFIG_MXC_NAND_REGS_BASE	(NFC_BASE_ADDR)
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 #define CONFIG_SYS_NAND_BASE		(NFC_BASE_ADDR)
diff --git u-boot-4d3c95f.orig/include/configs/mx35pdk.h u-boot-4d3c95f/include/configs/mx35pdk.h
index 6eb5da5..93a9dd7 100644
--- u-boot-4d3c95f.orig/include/configs/mx35pdk.h
+++ u-boot-4d3c95f/include/configs/mx35pdk.h
@@ -239,7 +239,6 @@ 
  * NAND FLASH driver setup
  */
 #define CONFIG_NAND_MXC
-#define CONFIG_NAND_MXC_V1_1
 #define CONFIG_MXC_NAND_REGS_BASE	(NFC_BASE_ADDR)
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 #define CONFIG_SYS_NAND_BASE		(NFC_BASE_ADDR)
diff --git u-boot-4d3c95f.orig/include/configs/tx25.h u-boot-4d3c95f/include/configs/tx25.h
index 6821528..870e863 100644
--- u-boot-4d3c95f.orig/include/configs/tx25.h
+++ u-boot-4d3c95f/include/configs/tx25.h
@@ -108,7 +108,6 @@ 
 
 /* NAND */
 #define CONFIG_NAND_MXC
-#define CONFIG_NAND_MXC_V1_1
 #define CONFIG_MXC_NAND_REGS_BASE	(0xBB000000)
 #define CONFIG_SYS_MAX_NAND_DEVICE	1
 #define CONFIG_SYS_NAND_BASE		(0xBB000000)
diff --git u-boot-4d3c95f.orig/include/fsl_nfc.h u-boot-4d3c95f/include/fsl_nfc.h
index c248cef..6618089 100644
--- u-boot-4d3c95f.orig/include/fsl_nfc.h
+++ u-boot-4d3c95f/include/fsl_nfc.h
@@ -42,10 +42,12 @@ 
  */
 #if defined(CONFIG_MX27) || defined(CONFIG_MX31)
 #define MXC_NFC_V1
+#define is_mxc_nfc_11()		0
 #elif defined(CONFIG_MX25) || defined(CONFIG_MX35)
 #define MXC_NFC_V1_1
+#define is_mxc_nfc_11()		1
 #else
-#warning "MXC NFC version not defined"
+#error "MXC NFC implementation not supported"
 #endif
 
 #if defined(MXC_NFC_V1)
@@ -53,14 +55,10 @@ 
 #define NAND_MXC_SPARE_BUF_SIZE		16
 #define NAND_MXC_REG_OFFSET		0xe00
 #define NAND_MXC_2K_MULTI_CYCLE
-#define is_mxc_nfc_11()			0
 #elif defined(MXC_NFC_V1_1)
 #define NAND_MXC_NR_BUFS		8
 #define NAND_MXC_SPARE_BUF_SIZE		64
 #define NAND_MXC_REG_OFFSET		0x1e00
-#define is_mxc_nfc_11()			1
-#else
-#error "define CONFIG_NAND_MXC_VXXX to use the mxc nand driver"
 #endif
 
 struct fsl_nfc_regs {