Hi,
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
ls1021a.dtsi:
-------------
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";
nand@0{
#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
Sanju
The memory/fsl/ifc.c driver is required. You can't replace it with a struct full of zeroes. You need to determine why it is not getting probed. What board/SoC is this? If a custom board, what do your dts and board C files look like?
Usually Linux kernel does not change IFC initialization for the NAND.
Test NAND Flash operations under u-boot.
What messages do you see for the NAND using under Linux?
Have a great day,
Pavel
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------