After supporting nor flash device for Agilex NAND booting mode, there will be 2 kinds of flash initialized during kernel boots up. The mtd0 device node is assigned to NAND flash that is initialized before nor flash. But for the RSU feature, the userspac app only thinks the mtd0 is the first partition of nor flash. So, in order to compatible with it, adjust the NAND flash driver is loaded in a little later with late_initcall(), so that mtd0 is assigned to nor flash device.
Signed-off-by: Meng Li <[email protected]> --- drivers/mtd/nand/raw/denali_dt.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/denali_dt.c b/drivers/mtd/nand/raw/denali_dt.c index f08740ae282b..7227938e9162 100644 --- a/drivers/mtd/nand/raw/denali_dt.c +++ b/drivers/mtd/nand/raw/denali_dt.c @@ -258,7 +258,28 @@ static struct platform_driver denali_dt_driver = { .of_match_table = denali_nand_dt_ids, }, }; -module_platform_driver(denali_dt_driver); + +/** + * denali_dt_init - denali nand driver module init + * + * Called when initializing the driver. + */ +static int __init denali_dt_init(void) +{ + return platform_driver_register(&denali_dt_driver); +} +late_initcall(denali_dt_init); + +/** + * denali_dt_exit - denali nand driver module exit + * + * Called when exiting the driver completely. + */ +static void __exit denali_dt_exit(void) +{ + platform_driver_unregister(&denali_dt_driver); +} +module_exit(denali_dt_exit); MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("Jamie Iles"); -- 2.17.1
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#10870): https://lists.yoctoproject.org/g/linux-yocto/message/10870 Mute This Topic: https://lists.yoctoproject.org/mt/88668702/21656 Group Owner: [email protected] Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
