
Hi Frank,
Thanks for the patch. Just a few notes:
Please reformat your patch to a commit header and commit message. For example, this patch should be like this:
arm: socfpga: add resetmgr command
Add resetmgr command so reset can be deasserted in bootcmd (for example on peripheral dma interfaces after fpga has been programmed).
Now on to the patch itself. I don't think this patch is needed and is probably not the approach you want. It should be up to each driver to de-assert the resets that it needs. Do it manually is probably not the approach you want.
Dinh
On 12/14/2017 03:49 PM, Frank Mori Hess wrote:
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"
- ""
+);