board: amlogic: odroid: add runtime detection of the N2/N2+/C4/HC4 variants 74/253074/4 accepted/tizen/unified/20210210.052157 submit/tizen/20210209.230141
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 3 Feb 2021 14:36:14 +0000 (15:36 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Fri, 5 Feb 2021 14:13:05 +0000 (15:13 +0100)
commit6dc94c896b76bc05c92c9b02fd23be6293c0fca7
treec61840c4840cd1f4ef3d539b3063bfe30e6b39c3
parent30b685b42551b6a55d76a57637817a9147e4b353
board: amlogic: odroid: add runtime detection of the N2/N2+/C4/HC4 variants

Use the ADC channel 1 to check the hardware revision of the board and
detect the N2 vs. N2+ and the C4 vs. HC4 variants. Each of them use
different dtb file, so adjust fdtfile environment variable to the
detected variant.

The ADC min/max values for each variant are taken from the vendor code,
adjusted to the 12-bit ADC driver operation mode (vendor code use 10-bit
mode).

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I702a531c24b0fa9bdc1618defa1e0cc2b55c81c5
arch/arm/dts/meson-g12b-odroid-n2-u-boot.dtsi
arch/arm/dts/meson-sm1-odroid-c4-u-boot.dtsi
board/amlogic/odroid-n2/odroid-n2.c
configs/odroid-c4_defconfig
configs/odroid-n2_defconfig
include/samsung/tizen_amlogic.h