summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongjin Kim <tobetter@gmail.com>2021-02-16 09:26:52 +0300
committerDongjin Kim <tobetter@gmail.com>2021-02-18 05:48:10 +0300
commit87a03db1e1f73984127785a1e7172d16916edb4f (patch)
tree3b7fa0798a1b77236a50815ee0e94751841ed63a
parent2b46e839826fc1cd706ced040c4b9ad7659f6ca7 (diff)
downloadu-boot-travis/odroidn2-181.tar.xz
ODROID-N2: sort out the board revisions for ODROID-N2/N2Plustravis/odroidn2-181
Signed-off-by: Dongjin Kim <tobetter@gmail.com> Change-Id: I25e25ae12a58bf9ac4ad0bd6d0a85357e199905c
-rw-r--r--board/hardkernel/odroid-common/board.c26
-rw-r--r--board/hardkernel/odroid-common/odroid-common.h1
2 files changed, 22 insertions, 5 deletions
diff --git a/board/hardkernel/odroid-common/board.c b/board/hardkernel/odroid-common/board.c
index 6941726309..72b4fd22c2 100644
--- a/board/hardkernel/odroid-common/board.c
+++ b/board/hardkernel/odroid-common/board.c
@@ -69,6 +69,8 @@ static unsigned int get_hw_revision(void)
else if (IS_RANGE(adc, 410, 430)) { /* avg : 419 */
/* ODROID-N2plus */
hwrev = BOARD_REVISION(2019, 11, 20);
+ } else if (IS_RANGE(adc, 500, 520)) {
+ hwrev = BOARD_REVISION(2021, 1, 21);
}
#elif defined(CONFIG_ODROID_C4)
if (IS_RANGE(adc, 80, 100)) /* avg : 90 */
@@ -104,20 +106,34 @@ void board_set_dtbfile(const char *format)
}
#if defined(CONFIG_ODROID_N2)
+int board_is_odroidn2(void)
+{
+ int hwrev = board_revision();
+
+ return (hwrev == BOARD_REVISION(2018, 7, 23))
+ || (hwrev == BOARD_REVISION(2018, 12, 6))
+ || (hwrev == BOARD_REVISION(2019, 1, 17))
+ || (hwrev == BOARD_REVISION(2019, 2, 7));
+}
+
int board_is_odroidn2plus(void)
{
- return (board_revision() >= 0x20191120);
+ return !board_is_odroidn2();
}
#elif defined(CONFIG_ODROID_C4)
int board_is_odroidc4(void)
{
- return (board_revision() == 0x20191129)
- || (board_revision() == 0x20200129);
+ int hwrev = board_revision();
+
+ return (hwrev == BOARD_REVISION(2019, 11, 29)
+ || (hwrev == BOARD_REVISION(2020, 1, 29));
}
int board_is_odroidhc4(void)
{
- return (board_revision() == 0x20191210)
- || (board_revision() == 0x20200807);
+ int hwrev = board_revision();
+
+ return (hwrev == BOARD_REVISION(2019, 12, 10)
+ || (hwrev == BOARD_REVISION(2020, 8, 7));
}
#endif
diff --git a/board/hardkernel/odroid-common/odroid-common.h b/board/hardkernel/odroid-common/odroid-common.h
index 5e0c692d2f..c91af944b9 100644
--- a/board/hardkernel/odroid-common/odroid-common.h
+++ b/board/hardkernel/odroid-common/odroid-common.h
@@ -31,6 +31,7 @@ int board_revision(void);
void board_set_dtbfile(const char *format);
#if defined(CONFIG_ODROID_N2)
+int board_is_odroidn2(void);
int board_is_odroidn2plus(void);
#elif defined(CONFIG_ODROID_C4)
int board_is_odroidc4(void);