• Thomas Petazzoni's avatar
    mtd: nand: fsmc: add support for SDR timings · d9fb0795
    Thomas Petazzoni authored
    Until now, the fsmc_nand driver was either using controller timings
    specified in the Device Tree (through FSMC specific DT properties) or
    alternatively default/fallback timings.
    
    This commit implements support to use the timings advertised by the NAND
    chip itself, by implementing the ->setup_data_interface() hook. To
    preserve backward compatibility, if timings are specified in the Device
    Tree, we use the timings from the Device Tree (and don't implement
    ->setup_data_interface).
    
    Many thanks to Boris Brezillon for coming up with the logic to convert
    the NAND chip timings into the timings expected by the FSMC controller.
    
    Also, since the timings are now not only coming from the DT, the message
    warning that default timings will be used is removed.
    Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
    Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
    d9fb0795
fsmc_nand.c 30.4 KB