[PATCH 2/3] nand: add NXP IFC nand driver

Sascha Hauer sha at pengutronix.de
Mon Aug 9 12:16:25 PDT 2021


Hi Renaud,

On Mon, Aug 02, 2021 at 11:40:03AM +0100, Renaud Barbier wrote:
> Add the NXP IFC nand driver support. This driver
> can be used with the NXP QorIQ cores.

Could you leave a few words here which base you used for the driver? Is
it based on Linux or U-Boot, which version?

> +static void fsl_ifc_ctrl_init(void)
> +{
> +	struct fsl_ifc_ctrl *ctrl;
> +	struct device_node *np;
> +
> +	np = of_find_compatible_node(NULL, NULL, "fsl,ifc");
> +	if (!np)
> +		return;

Looks like this function can fail, it should return an error.

> +		while (!is_timeout(time_start, IFC_TIMEOUT_MS * MSECOND)) {
> +			ifc_ctrl->nand_stat =
> +				ifc_in32(ctrl->rregs + FSL_IFC_NAND_EVTER_STAT);
> +
> +			if (!(ifc_ctrl->nand_stat & IFC_NAND_SRAM_INIT_EN))
> +				return 0;
> +		}
> +		pr_err("fsl-ifc: Failed to Initialise SRAM\n");
> +		return 1;

It would be better to return an error code here and propagate that.

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list