Hi,

On 13/07/2023 21:44, Nishanth Menon wrote:
> 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).

So I've been working on this on the side and got linker list way working
with custom script booting but as soon as I move to standard boot flow
it no longer works. This is because there is no code in place to
apply the overlay and pass it to next stage e.g. EFI.

I see the following note at
https://elixir.bootlin.com/u-boot/latest/source/boot/bootmeth_efi.c#L304

"
                /*
                 * TODO: Apply extension overlay
                 *
                 * Here we need to load and apply the extension overlay. This is
                 * not implemented. See do_extension_apply(). The extension
                 * stuff needs an implementation in boot/extension.c so it is
                 * separate from the command code. Really the extension stuff
                 * should use the device tree and a uclass / driver interface
                 * rather than implementing its own list
                 */
"

Another note at
https://elixir.bootlin.com/u-boot/latest/source/cmd/extension_board.c#L198

"/* extensions should have a uclass - for now we use UCLASS_SIMPLE_BUS uclass 
*/"

So are we better off implementing a class driver for extension stuff?

Once that is in place how should extension apply work?
Current implementation relies on a extension_overlay_cmd environment
to be specified.
e.g. for EFI boot case, the overlay files should be obtained in the same
way we get the base device tree i.e. bootmeth_common_read_file()?

-- 
cheers,
-roger

Reply via email to