Skip to content

gfplatdetect: Add SNVS_LPGPR based detection

Tim Jaacks requested to merge add-snvs-lpgpr-detection into dunfell

Add a platform detection based on the value pre-populated in the i.MX6 SNVS_LPGPR register

The current way of reading some pins as GPIOs does not work well for NALLINO during linux run-time. NALLINO has the special case that the platform detection pins are multiplexed with display signals.

This design assumes that either display or platform detection will be done. This makes it hard to read the platform from within a module-based run-time driver as the display should already be configured and show at least a boot-logo. So disabling the display is not a good option.

Just stealing the pinctrl is also a bad thing, the pinctrl is owned by the display.

One option would be an ordered load of the drivers, but this is not directly supported by the linux kernel.

In our case, with Flash-N-Go boot we already have platform detection in place in form of the bootloader and is is not interfering with the display.

Then there was the issue how to get the information from the bootloader to the linux space. For device-tree adjusting bootloaders this can be achieved by manipulating the device-tree. However by-design Flash-N-Go boot does not do this. Propagating the info via teh Linux kernel command line was regarded "not nice".

So we decided to leverage a general purpose register of the i.MX6 SoC. The choice was the SNVS_LPGR register. This is not touched by the ROM of the SoC and is not yet used in our driver.

With the snvs_lpgpr driver under drivers/nvmem/snvs_lpgpr.c tehre might be a consumer, however it is not yet part of our OS.

Merge request reports