From 5e7e40617c072f20dbaf33e6a32b8721eb8157e3 Mon Sep 17 00:00:00 2001 From: Andy Yan Date: Mon, 13 Nov 2017 15:26:40 +0800 Subject: [PATCH] test: rockchip: add bootrom download mode test Enter bootrom download mode by command: rktest brom_dnl Change-Id: I6120a885e5514a57c81fd469ce27a2472009c4fd Signed-off-by: Andy Yan --- test/rockchip/Makefile | 1 + test/rockchip/test-brom-dnl.c | 9 +++++++++ test/rockchip/test-rockchip.c | 1 + test/rockchip/test-rockchip.h | 2 ++ 4 files changed, 13 insertions(+) create mode 100644 test/rockchip/test-brom-dnl.c diff --git a/test/rockchip/Makefile b/test/rockchip/Makefile index 0113a3724e..90c710ce44 100644 --- a/test/rockchip/Makefile +++ b/test/rockchip/Makefile @@ -12,3 +12,4 @@ obj-y += test-regulator.o obj-y += test-rknand.o obj-$(CONFIG_GMAC_ROCKCHIP) += test-eth.o obj-$(CONFIG_RK_IR) += test-ir.o +obj-y += test-brom-dnl.o diff --git a/test/rockchip/test-brom-dnl.c b/test/rockchip/test-brom-dnl.c new file mode 100644 index 0000000000..85f60c5afc --- /dev/null +++ b/test/rockchip/test-brom-dnl.c @@ -0,0 +1,9 @@ +#include +#include +#include + +int board_brom_dnl_test(int argc, char * const argv[]) +{ + writel(BOOT_BROM_DOWNLOAD, CONFIG_ROCKCHIP_BOOT_MODE_REG); + return do_reset(NULL, 0, 0, NULL); +} diff --git a/test/rockchip/test-rockchip.c b/test/rockchip/test-rockchip.c index 22e369022a..d6e808bfb9 100644 --- a/test/rockchip/test-rockchip.c +++ b/test/rockchip/test-rockchip.c @@ -25,6 +25,7 @@ static board_module_t g_board_modules[] = { #if defined(CONFIG_RK_IR) { .name = "ir", .test = board_ir_test }, #endif + { .name = "brom_dnl", .test = board_brom_dnl_test} }; static int do_rockchip_test(cmd_tbl_t *cmdtp, int flag, diff --git a/test/rockchip/test-rockchip.h b/test/rockchip/test-rockchip.h index 29930a4748..e628829a28 100644 --- a/test/rockchip/test-rockchip.h +++ b/test/rockchip/test-rockchip.h @@ -19,4 +19,6 @@ int board_eth_test(int argc, char * const argv[]); int board_ir_test(int argc, char * const argv[]); #endif +int board_brom_dnl_test(int argc, char * const argv[]); + #endif /* _TEST_ROCKCHIP_H */