siemens / meta-iot2050

SIMATIC IOT2050 Isar/Debian Board Support Package
MIT License
129 stars 76 forks source link

Rework M.2 support #365

Closed jan-kiszka closed 1 year ago

jan-kiszka commented 1 year ago

This changes the interface between firmware and kernel for configuring and communicating the M.2 mode.

Previously, a different device tree was selected by the firmware when a different mode was set, including repeating updates of the U-Boot environment in flash on every boot. This approach here uses the device tree fix-up of U-Boot to adjust a given DT to the selected mode.

Further changes:

AsuraZeng commented 1 year ago

why no dtbo in kernel?

AsuraZeng commented 1 year ago

in secure mode, ebg will load the overlay or not?

jan-kiszka commented 1 year ago

why no dtbo in kernel?

The kernel has not use case for that overlay.

jan-kiszka commented 1 year ago

in secure mode, ebg will load the overlay or not?

No, firmware will load it (it's embedded) and apply it when the UEFI bootloader (EBG, systemd-boot) requests EFI_DT_FIXUP_PROTOCOL.

AsuraZeng commented 1 year ago

why no dtbo in kernel?

The kernel has not use case for that overlay.

yes, but we intend to overlay kernel's dtb.However the dtb is produced under uboot, I think it's better to place copies in the kernel also.

jan-kiszka commented 1 year ago

why no dtbo in kernel?

The kernel has not use case for that overlay.

yes, but we intend to overlay kernel's dtb.However the dtb is produced under uboot, I think it's better to place copies in the kernel also.

Again: what for?

AsuraZeng commented 1 year ago

why no dtbo in kernel?

The kernel has not use case for that overlay.

yes, but we intend to overlay kernel's dtb.However the dtb is produced under uboot, I think it's better to place copies in the kernel also.

Again: what for?

Can this dtbo be used in the kernel? Put dtbo in the file system. The advantage of this is that there is no need to forcibly bind the dtbo of the kernel to uboot. The disadvantage may also require additional consideration of the secure aspect

Consider a scenario. If a customer customizes their own file system, they only need to use the IOT2050 hardware. Since some of the dtbo are not in the kernel, the dts is incomplete.

jan-kiszka commented 1 year ago

I'll also prepare an MR for master then, or should I wait for further testing? Ordering is unusual already anyway.

chombourger commented 1 year ago

There is unfortunately no PV or PR bump in this changeset meaning that the linux-image-iot2050 package will have the same version and will not be upgraded in the apt dist-upgrade scenario

jan-kiszka commented 1 year ago

Right, we do not address package updates so far, specifically of the kernel as it would not work under all circumstances (secure boot). That said, we can discuss where such a versioning policy would help, how is should look like and how we make sure to enforce it.