[U-Boot] [PATCH v3] fsl-ifc-nand : Corrected the programming of chip select

Scott Wood scott.wood at nxp.com
Wed Sep 28 22:52:52 CEST 2016


On 09/26/2016 09:48 PM, Matt Weber wrote:
> Corrected the chip selection in IFC_NAND_CSEL register. Due to this
> issue in multi-chip nand use-case, IFC was always pointing to the last
> probed chip even though the user select another device through "nand
> device <dev>" command.
> 
> Also, remove the usage of ifc_ctrl->cs_nand from driver as chipselect
> is a property of the chip not the controller.
> 
> Signed-off-by: Matthew Weber <matthew.weber at rockwellcollins.com>
> Signed-off-by: Ronak Desai <ronak.desai at rockwellcollins.com>
> 
> --
> v1 -> v2
> [ Scott W
>  - Update fsl_ifc_sram_init() with correct csel and
>    cs_nand removed.
> 
> v2 -> v3
> [ Prabhakar
>  - Remove braces around if in fsl_ifc_chip_init()
> ---
>  drivers/mtd/nand/fsl_ifc_nand.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
> index bc6bdc9..990b698 100644
> --- a/drivers/mtd/nand/fsl_ifc_nand.c
> +++ b/drivers/mtd/nand/fsl_ifc_nand.c
> @@ -48,7 +48,7 @@ struct fsl_ifc_ctrl {
>  	/* device info */
>  	struct fsl_ifc regs;
>  	void __iomem *addr;      /* Address of assigned IFC buffer        */
> -	unsigned int cs_nand;    /* On which chipsel NAND is connected	  */
> +	unsigned int cs_nand;    /* On which chipsel NAND is connected    */
>  	unsigned int page;       /* Last page written to / read from      */
>  	unsigned int read_bytes; /* Number of bytes read during command   */
>  	unsigned int column;     /* Saved column from SEQIN               */

Changelog says you removed cs_nand, but this hunk just changes whitespace.

> @@ -798,7 +798,7 @@ static void fsl_ifc_select_chip(struct mtd_info *mtd, int chip)
>  {
>  }
>  
> -static int fsl_ifc_sram_init(uint32_t ver)
> +static int fsl_ifc_sram_init(uint32_t ver, struct fsl_ifc_mtd *priv)

Could you put priv first, as is usually done with context structs?

I notice Linux doesn't pass "ver" at all to this function, and only
implements the ver == 1.1.0 method.  Prabhakar, any plans to update
Linux for that?

-Scott



More information about the U-Boot mailing list