summaryrefslogtreecommitdiff
path: root/arch/arm/mach-socfpga/misc.c
diff options
context:
space:
mode:
authorLey Foon Tan <ley.foon.tan@intel.com>2018-05-24 00:17:23 +0800
committerMarek Vasut <marex@denx.de>2018-07-12 09:22:11 +0200
commit10f9e4b1c86bcc28b1a70ade88b487f639447eec (patch)
treeb15a08c17d55e5b8f8661aadc646b573d83d4cb5 /arch/arm/mach-socfpga/misc.c
parent8b71e46ceab8b66208107de688cbb4dd25fe38cd (diff)
arm: socfpga: misc: Move bridge command to misc common
Move bridge command to misc common driver, in preparation to used by other platforms. Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Diffstat (limited to 'arch/arm/mach-socfpga/misc.c')
-rw-r--r--arch/arm/mach-socfpga/misc.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/mach-socfpga/misc.c b/arch/arm/mach-socfpga/misc.c
index fca86507f18..68eeb292ce7 100644
--- a/arch/arm/mach-socfpga/misc.c
+++ b/arch/arm/mach-socfpga/misc.c
@@ -204,3 +204,35 @@ int socfpga_eth_reset_common(void (*resetfn)(const u8 of_reset_id,
return 0;
}
#endif
+
+#ifndef CONFIG_SPL_BUILD
+static int do_bridge(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+ if (argc != 2)
+ return CMD_RET_USAGE;
+
+ argv++;
+
+ switch (*argv[0]) {
+ case 'e': /* Enable */
+ do_bridge_reset(1);
+ break;
+ case 'd': /* Disable */
+ do_bridge_reset(0);
+ break;
+ default:
+ return CMD_RET_USAGE;
+ }
+
+ return 0;
+}
+
+U_BOOT_CMD(
+ bridge, 2, 1, do_bridge,
+ "SoCFPGA HPS FPGA bridge control",
+ "enable - Enable HPS-to-FPGA, FPGA-to-HPS, LWHPS-to-FPGA bridges\n"
+ "bridge disable - Enable HPS-to-FPGA, FPGA-to-HPS, LWHPS-to-FPGA bridges\n"
+ ""
+);
+
+#endif