Skip to content

Commit

Permalink
ODROID-N2: sort out the board revisions for ODROID-N2/N2Plus
Browse files Browse the repository at this point in the history
Signed-off-by: Dongjin Kim <[email protected]>
Change-Id: I25e25ae12a58bf9ac4ad0bd6d0a85357e199905c
  • Loading branch information
tobetter committed Feb 18, 2021
1 parent 2b46e83 commit 87a03db
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
26 changes: 21 additions & 5 deletions board/hardkernel/odroid-common/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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
1 change: 1 addition & 0 deletions board/hardkernel/odroid-common/odroid-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 87a03db

Please sign in to comment.