summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoy Cho <joy.cho@hardkernel.com>2020-03-25 05:44:09 +0300
committerJoy Cho <joy.cho@hardkernel.com>2020-03-25 08:13:14 +0300
commit29ea56d0a928731b3ac158d80f7fe15667d24e3e (patch)
tree6f37ad92e3f5dba2353e43b2eaa110184c07e9aa
parent67ef0dba8e28d6934f6f83dc58db8b50bb961ce3 (diff)
downloadu-boot-29ea56d0a928731b3ac158d80f7fe15667d24e3e.tar.xz
odroid-goA: Update hw revision detection logic
- change adc reference value based on new resistor values - move detection logic - add hwrev command for spi config Change-Id: Ib631a55e3c03ec9ae4065cbadca8cba0b22a3e58
-rw-r--r--arch/arm/mach-rockchip/board.c8
-rw-r--r--board/rockchip/odroidgo2/odroidgo2.c8
-rw-r--r--cmd/hwrev.c4
-rw-r--r--configs/odroidgo2-spi_defconfig1
4 files changed, 11 insertions, 10 deletions
diff --git a/arch/arm/mach-rockchip/board.c b/arch/arm/mach-rockchip/board.c
index 2583854627..94ad05b524 100644
--- a/arch/arm/mach-rockchip/board.c
+++ b/arch/arm/mach-rockchip/board.c
@@ -305,11 +305,19 @@ int check_fdt_header(ulong fdt_addr)
return i < 4 ? CMD_RET_FAILURE : CMD_RET_SUCCESS;
}
+void board_check_hwrev(void)
+{
+ run_command("hwrev", 0);
+}
+
int init_kernel_dtb(void)
{
ulong fdt_addr;
int ret;
+ /* check hw revision */
+ board_check_hwrev();
+
fdt_addr = env_get_ulong("fdt_addr_r", 16, 0);
if (!fdt_addr) {
printf("No Found FDT Load Address.\n");
diff --git a/board/rockchip/odroidgo2/odroidgo2.c b/board/rockchip/odroidgo2/odroidgo2.c
index 102a08b238..86dcffdc12 100644
--- a/board/rockchip/odroidgo2/odroidgo2.c
+++ b/board/rockchip/odroidgo2/odroidgo2.c
@@ -135,19 +135,11 @@ err:
odroid_wait_pwrkey();
}
-void board_check_hwrev(void)
-{
- run_command("hwrev", 0);
-}
-
int rk_board_late_init(void)
{
/* turn on blue led */
board_alive_led();
- /* check hw revision */
- board_check_hwrev();
-
/* set uart2-m1 port as a default debug console */
board_debug_uart2m1();
diff --git a/cmd/hwrev.c b/cmd/hwrev.c
index e58c591be6..c0d1ce4607 100644
--- a/cmd/hwrev.c
+++ b/cmd/hwrev.c
@@ -20,7 +20,7 @@ int do_hwrev(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
}
/* rev 1.1 */
- if (check_range(898, 978, hwrev_adc)) {
+ if (check_range(655, 695, hwrev_adc)) {
env_set("hwrev", "v11");
env_set("dtb_name", "rk3326-odroidgo2-linux-v11.dtb");
}
@@ -35,7 +35,7 @@ int do_hwrev(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
env_set("dtb_name", "rk3326-odroidgo2-linux.dtb");
}
- debug("adc0 (hw rev) %d\n", hwrev_adc);
+ printf("adc0 (hw rev) %d\n", hwrev_adc);
return CMD_RET_SUCCESS;
}
diff --git a/configs/odroidgo2-spi_defconfig b/configs/odroidgo2-spi_defconfig
index 1d2c1d97b3..b0db66be9d 100644
--- a/configs/odroidgo2-spi_defconfig
+++ b/configs/odroidgo2-spi_defconfig
@@ -641,6 +641,7 @@ CONFIG_CMD_ODROID_ADC=y
CONFIG_CMD_ODROID_CFGLOAD=y
CONFIG_CMD_ODROID_BATTERY=y
CONFIG_CMD_ODROID_TEST=y
+CONFIG_CMD_ODROID_HWREV=y
#
# Partition Types