diff options
author | Dongjin Kim <tobetter@gmail.com> | 2019-12-16 14:13:11 +0900 |
---|---|---|
committer | Dongjin Kim <tobetter@gmail.com> | 2020-02-13 17:13:40 +0900 |
commit | 7b3133c9e98020fdfb8598520aaa53c5d002ec0b (patch) | |
tree | 226de974b800f3006c110db9c902e231813edb5f | |
parent | 03172f05c55497514fdf38df3d68df568959a4ee (diff) | |
download | u-boot-odroid-c1-7b3133c9e98020fdfb8598520aaa53c5d002ec0b.tar.gz |
ODROID-N2PLUS: add board revision and set model name
Change-Id: I4b0d16b18e4edabebbe9322c788bfa39b6556eff
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
-rw-r--r-- | board/hardkernel/odroid-common/board.c | 22 | ||||
-rw-r--r-- | board/hardkernel/odroid-common/odroid-common.h | 5 | ||||
-rw-r--r-- | board/hardkernel/odroidn2/odroidn2.c | 3 |
3 files changed, 30 insertions, 0 deletions
diff --git a/board/hardkernel/odroid-common/board.c b/board/hardkernel/odroid-common/board.c index 9c06d1473c..c2abb9f42a 100644 --- a/board/hardkernel/odroid-common/board.c +++ b/board/hardkernel/odroid-common/board.c @@ -57,6 +57,7 @@ static unsigned int get_hw_revision(void) int hwrev = -1; int adc = get_adc_value(1); +#if defined(CONFIG_ODROID_N2) if (IS_RANGE(adc, 80, 90)) /* ave : 84 */ hwrev = BOARD_REVISION(2018, 7, 23); else if (IS_RANGE(adc, 160, 170)) /* avg : 164 */ @@ -65,6 +66,11 @@ static unsigned int get_hw_revision(void) hwrev = BOARD_REVISION(2019, 1, 17); else if (IS_RANGE(adc, 330, 350)) /* avg : 334 */ hwrev = BOARD_REVISION(2019, 2, 7); + else if (IS_RANGE(adc, 410, 430)) { /* avg : 419 */ + /* ODROID-N2plus */ + hwrev = BOARD_REVISION(2019, 11, 20); + } +#endif debug("ADC=%d, hwrev=0x%x\n", adc, hwrev); @@ -78,3 +84,19 @@ int board_revision(void) return board_rev; } + +void board_set_dtbfile(const char *format) +{ + char s[128]; + char *ep = getenv("variant"); + + snprintf(s, sizeof(s), format, ep ? ep : ""); + setenv("fdtfile", s); +} + +#if defined(CONFIG_ODROID_N2) +int board_is_odroidn2plus(void) +{ + return (board_revision() >= 0x20191120); +} +#endif diff --git a/board/hardkernel/odroid-common/odroid-common.h b/board/hardkernel/odroid-common/odroid-common.h index e230ef9a7f..8d2038a754 100644 --- a/board/hardkernel/odroid-common/odroid-common.h +++ b/board/hardkernel/odroid-common/odroid-common.h @@ -28,6 +28,11 @@ extern int get_adc_value(int channel); | ((0x##m & 0xff) << 8) | ((0x##d & 0xff) << 0)) int board_revision(void); +void board_set_dtbfile(const char *format); + +#if defined(CONFIG_ODROID_N2) +int board_is_odroidn2plus(void); +#endif /* * CVBS diff --git a/board/hardkernel/odroidn2/odroidn2.c b/board/hardkernel/odroidn2/odroidn2.c index 6e24402c7b..f47c6cd9fa 100644 --- a/board/hardkernel/odroidn2/odroidn2.c +++ b/board/hardkernel/odroidn2/odroidn2.c @@ -389,6 +389,9 @@ int board_late_init(void) board_cvbs_probe(); #endif + setenv("variant", board_is_odroidn2plus() ? "_plus" : ""); + board_set_dtbfile("meson64_odroidn2%s.dtb"); + /* boot logo display - 1080p60hz */ run_command("showlogo", 0); |