AnsweredAssumed Answered

LS1021a- Custom Board - NAND Chip not detected under Linux

Question asked by SANJU VARGHESE on Jan 29, 2016
Latest reply on Feb 5, 2016 by Scott Wood


I am facing a NAND issue under Linux. The NAND chip is working under u-boot as I can Erase/Read/Write the chip. But Linux is unable to load the NAND driver successfully. The mtd/nand/fsl_ifc_nand.c always failing in this condition



if (!fsl_ifc_ctrl_dev || !fsl_ifc_ctrl_dev->regs)

       return -ENODEV;



I checked the the driver for fsl_ifc_ctrl_dev and it is getting updated in memory/fsl/ifc.c probe function(fsl_ifc_ctrl_probe). But the Linux is not calling the probe function. If I am manually allocating the memory of fsl_ifc_ctrl_dev in fsl_ifc_nand.c by adding the following lines


fsl_ifc_ctrl_dev = kzalloc(sizeof(*fsl_ifc_ctrl_dev), GFP_KERNEL);

  if (!fsl_ifc_ctrl_dev)

  return -ENOMEM;


Now the error moved to this location


ret = of_address_to_resource(node, 0, &res);

  if (ret) {

  dev_err(&dev->dev, "%s: failed to get resource\n", __func__);

  return ret;




Here is my device tree settings





ifc: ifc@1530000 {

                        compatible = "fsl,ifc","simple-bus";

                        reg = <0x0 0x1530000 0x0 0x10000>;

                        interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;


ls1021aiot.dts :


&ifc {

        #address-cells = <2>;

        #size-cells = <1>;

        ranges = <0x0 0x0 0x7e800000 0x10000>;

        status = "okay";


                #address-cells = <1>;

                #size-cells = <1>;

                compatible = "fsl,ifc-nand";

                reg = <0x0 0 0x10000>;

                bank-width = <1>;

                device-width = <1>;






Can you please help us to solve the NAND issue in linux?


Thanks In advance