board: amlogic: odroid: add runtime detection of the N2/N2+/C4/HC4 variants
authorMarek Szyprowski <m.szyprowski@samsung.com>
Wed, 3 Feb 2021 14:36:14 +0000 (15:36 +0100)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 15 Nov 2021 14:18:27 +0000 (15:18 +0100)
commit3d2a872398f3aac0d0e48479d9340eb8b54d94ef
treec797a824603e3483781b9a3d7aafa3a753c1311e
parentbe6e1dd862c4d8ac7dae76ce8c0e2d90173c9a41
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
board/amlogic/odroid-n2/odroid-n2.c
configs/odroid-c4_defconfig
include/samsung/tizen_amlogic.h