[U-Boot] [PATCH] ARM SOCFPGA: add resetmgr command so reset can be deasserted in bootcmd (for example on peripheral dma interfaces after fpga has been programmed).

Frank Mori Hess fmh6jj at gmail.com
Thu Dec 14 21:03:59 UTC 2017


---
 arch/arm/mach-socfpga/reset_manager_gen5.c | 31 ++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/arch/arm/mach-socfpga/reset_manager_gen5.c b/arch/arm/mach-socfpga/reset_manager_gen5.c
index aa88adb414..6ad5d2a362 100644
--- a/arch/arm/mach-socfpga/reset_manager_gen5.c
+++ b/arch/arm/mach-socfpga/reset_manager_gen5.c
@@ -114,3 +114,34 @@ void socfpga_bridges_reset(int enable)
 	return;
 }
 #endif
+
+int resetmgr_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+	unsigned long bank;
+	unsigned long offset;
+	unsigned long assert;
+
+	if (argc != 4)
+		return CMD_RET_USAGE;
+
+	bank = simple_strtoul(argv[1], NULL, 0);
+	offset = simple_strtoul(argv[2], NULL, 0);
+	assert = simple_strtoul(argv[3], NULL, 0);
+	socfpga_per_reset(RSTMGR_DEFINE(bank, offset), assert);
+	return 0;
+}
+
+U_BOOT_CMD(
+	resetmgr, 4, 1, resetmgr_cmd,
+	"SoCFPGA HPS reset manager control",
+	"resetmgr bank offset assert\n"
+	"    bank - Bank of reset to assert/deassert.\n"
+	"        0 ... mpumodrst\n"
+	"        1 ... permodrst\n"
+	"        2 ... per2modrst\n"
+	"        3 ... brgmodrst\n"
+	"        4 ... miscmodrst\n"
+	"    offset - Offset of reset to assert/deassert.\n"
+	"    assert - 1 to assert reset, 0 to deassert.\n"
+	""
+);
-- 
2.11.0




More information about the U-Boot mailing list