Common Driver Initialization
There are several implementations of up_initialize(), at least one per architecture. Each of these initializtion files is very similar; each initializes the same set of common drivers under the drivers/ directory.
This common logic should be captured in common logic perhaps at /drivers/init. The common driver initialization should be removed from architecture-specific up_initialize() and replaces with calls to drvr_early_initialize() and drvr_last_initialize() in new files under /drivers/init.
Hello @patacongo, is this still a valid issue? If so, I would like to try helping with.
@dalprahcd some suggestion was done recently, you can reference the code here: https://github.com/apache/nuttx/blob/master/drivers/drivers_initialize.c
@xiaoxiang781216 since there is a common file to initialize all the drivers, is this issue closed then? Because checking the following architectures looks like there is no much duplication at up_intialize.
https://github.com/apache/nuttx/blob/42dad89211f2d34f62c103a7647bd64e466a0215/arch/avr/src/common/avr_initialize.c#L125 https://github.com/apache/nuttx/blob/42dad89211f2d34f62c103a7647bd64e466a0215/arch/arm/src/common/arm_initialize.c#L98 https://github.com/apache/nuttx/blob/42dad89211f2d34f62c103a7647bd64e466a0215/arch/risc-v/src/common/riscv_initialize.c#L88 https://github.com/apache/nuttx/blob/42dad89211f2d34f62c103a7647bd64e466a0215/arch/xtensa/src/common/xtensa_initialize.c#L101