[U-Boot] [PATCH V2 2/3] mtd: nand: mxs check maximum ecc that platfrom supports

Scott Wood
2015-08-25T21:05:56Z

On Tue, 2015-07-21 at 16:15 +0800, Peng Fan wrote:
> Check maximum ecc strength for each platfrom to avoid the calculated ecc
> exceed the limitation.
>
> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
> Signed-off-by: Han Xu <b45815@freescale.com>
> Reviewed-by: Marek Vasut <marex@denx.de>
> ---
>
> Changes v2:
> Add Marek's reviewed by.
>
> drivers/mtd/nand/mxs_nand.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c
> index 33ce817..97011b2 100644
> --- a/drivers/mtd/nand/mxs_nand.c
> +++ b/drivers/mtd/nand/mxs_nand.c
> @@ -149,6 +149,13 @@ static inline uint32_t
> mxs_nand_get_ecc_strength(uint32_t page_data_size,
> uint32_t page_oob_size)
> {
> int ecc_strength;
> + int max_ecc_strength_supported;
> +
> + /* Refer to Chapter 17 for i.MX6DQ, Chapter 18 for i.MX6SX */
> + if (is_cpu_type(MXC_CPU_MX6SX))
> + max_ecc_strength_supported = 62;
> + else
> + max_ecc_strength_supported = 40;

arm: + mx28evk_nand
+drivers/mtd/nand/mxs_nand.c:155:18: error: 'MXC_CPU_MX6SX' undeclared (first use in this function)
+drivers/mtd/nand/mxs_nand.c:155:18: note: each undeclared identifier is reported only once for each function it appears in
+make[2]: *** [drivers/mtd/nand/mxs_nand.o] Error 1
+make[1]: *** [drivers/mtd/nand] Error 2
+make: *** [sub-make] Error 2

(among other failed targets)

I tried to fix it by including asm/arch-imx/cpu.h, but then got undefined
reference to is_cpu_type().

-Scott