On 15:29-20230711, Roger Quadros wrote: > Hi Simon, > > On 10/07/2023 22:45, Simon Glass wrote: > > Hi Roger, > > > > On Mon, 10 Jul 2023 at 08:51, Roger Quadros <rog...@kernel.org> wrote: > >> > >> Support the Expansion cards via Extension framework. > >> This should make 'expansion' command work to scan > >> for expansion cards and apply DT overlays. > >> > >> Card detection code is moved to a library so > >> other boards can benefit from it. > >> > >> Signed-off-by: Roger Quadros <rog...@kernel.org> > >> --- > >> board/ti/am65x/evm.c | 264 ++++++++--------------------- > >> board/ti/common/Kconfig | 8 + > >> board/ti/common/Makefile | 1 + > >> board/ti/common/ti_card_detect.c | 155 +++++++++++++++++ > >> board/ti/common/ti_card_detect.h | 43 +++++ > >> configs/am65x_evm_a53_defconfig | 2 + > >> configs/am65x_hs_evm_a53_defconfig | 2 + > >> 7 files changed, 280 insertions(+), 195 deletions(-) > >> create mode 100644 board/ti/common/ti_card_detect.c > >> create mode 100644 board/ti/common/ti_card_detect.h > > > > Before this goes too far I think this should move to using a linker > > list to declare the driver (or a driver-model driver if you prefer, > > but that might be overkill). > > ti_card_detect.c This is not a device driver but just a helper library > which is ultimately going to be used directly by the board files. > > e.g. > see board/ti/am65x/evm.c > > > > > What do people think?
I think the linker list idea is better that library approach. One of the whack-a-mole we have been dealing with is with i2c eeprom detection board/ti/common/board_detect.c The linker list idea could potentially allows us to have a common detect schemes with appropriate fall backs as pertinent to the platform (e.g. mid production update from 2byte to 1 byte eeprom etc) maybe the order indicated by defconfig? And adds capability to have fall through down to board type detection (thinking cape_detect / ti_card_detect etc..).. Also boards that dont care for this can disable the configuration and use the rest of the codebase (simplify evm.c) Just my 2 cents.. -- Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D