summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongjin Kim <tobetter@gmail.com>2020-01-29 12:16:20 +0300
committerDongjin Kim <tobetter@gmail.com>2020-02-13 11:13:40 +0300
commit08d68de83eebf4ac075998bc61720d1df185b4f2 (patch)
tree9516c7581ccaaa55c5aaabdbf016009ec856bce3
parent7b3133c9e98020fdfb8598520aaa53c5d002ec0b (diff)
downloadu-boot-08d68de83eebf4ac075998bc61720d1df185b4f2.tar.xz
ODROID-C4/HC4: add to read board revision functions
Signed-off-by: Dongjin Kim <tobetter@gmail.com> Change-Id: I3ad9d97c78d5c195fc00cf0a930ab5b0fb37db0a
-rw-r--r--board/hardkernel/odroid-common/board.c15
-rw-r--r--board/hardkernel/odroid-common/odroid-common.h3
-rw-r--r--board/hardkernel/odroidc4/odroidc4.c3
3 files changed, 21 insertions, 0 deletions
diff --git a/board/hardkernel/odroid-common/board.c b/board/hardkernel/odroid-common/board.c
index c2abb9f42a..512709e420 100644
--- a/board/hardkernel/odroid-common/board.c
+++ b/board/hardkernel/odroid-common/board.c
@@ -70,6 +70,11 @@ static unsigned int get_hw_revision(void)
/* ODROID-N2plus */
hwrev = BOARD_REVISION(2019, 11, 20);
}
+#elif defined(CONFIG_ODROID_C4)
+ if (IS_RANGE(adc, 335, 345)) /* avg : 341 */
+ hwrev = BOARD_REVISION(2019, 11, 29);
+ else if (IS_RANGE(adc, 300, 320)) /* avg : 308 */
+ hwrev = BOARD_REVISION(2019, 12, 10);
#endif
debug("ADC=%d, hwrev=0x%x\n", adc, hwrev);
@@ -99,4 +104,14 @@ int board_is_odroidn2plus(void)
{
return (board_revision() >= 0x20191120);
}
+#elif defined(CONFIG_ODROID_C4)
+int board_is_odroidc4(void)
+{
+ return (board_revision() == 0x20191129);
+}
+
+int board_is_odroidhc4(void)
+{
+ return (board_revision() == 0x20191210);
+}
#endif
diff --git a/board/hardkernel/odroid-common/odroid-common.h b/board/hardkernel/odroid-common/odroid-common.h
index 8d2038a754..5e0c692d2f 100644
--- a/board/hardkernel/odroid-common/odroid-common.h
+++ b/board/hardkernel/odroid-common/odroid-common.h
@@ -32,6 +32,9 @@ void board_set_dtbfile(const char *format);
#if defined(CONFIG_ODROID_N2)
int board_is_odroidn2plus(void);
+#elif defined(CONFIG_ODROID_C4)
+int board_is_odroidc4(void);
+int board_is_odroidhc4(void);
#endif
/*
diff --git a/board/hardkernel/odroidc4/odroidc4.c b/board/hardkernel/odroidc4/odroidc4.c
index dbfac9aad4..7cbc9b509f 100644
--- a/board/hardkernel/odroidc4/odroidc4.c
+++ b/board/hardkernel/odroidc4/odroidc4.c
@@ -386,6 +386,9 @@ int board_late_init(void)
board_cvbs_probe();
#endif
+ setenv("variant", board_is_odroidc4() ? "c4" : "hc4");
+ board_set_dtbfile("meson64_odroid%s.dtb");
+
if (get_boot_device() == BOOT_DEVICE_SPI) {
setenv("bootdelay", "0");
setenv("bootcmd", "run boot_spi");