From 64e809afeaf1572c3246a5bca198a77d0498fd89 Mon Sep 17 00:00:00 2001 From: Siva Durga Prasad Paladugu Date: Fri, 14 Mar 2014 16:35:38 +0530 Subject: fpga: Guard the LOADMK functionality with CMD_FPGA_LOADMK Guard the LOADMK functionality with config to provide an option to enable or disable it. Enable it for all platforms in mainline which enable CONFIG_CMD_FPGA. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- common/cmd_fpga.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'common/cmd_fpga.c') diff --git a/common/cmd_fpga.c b/common/cmd_fpga.c index 010cd24e63..68b54277ad 100644 --- a/common/cmd_fpga.c +++ b/common/cmd_fpga.c @@ -126,10 +126,12 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) if (!fpga_data || !data_size) wrong_parms = 1; break; +#if defined(CONFIG_CMD_FPGA_LOADMK) case FPGA_LOADMK: if (!fpga_data) wrong_parms = 1; break; +#endif } if (wrong_parms) { @@ -153,6 +155,7 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) rc = fpga_loadbitstream(dev, fpga_data, data_size); break; +#if defined(CONFIG_CMD_FPGA_LOADMK) case FPGA_LOADMK: switch (genimg_get_format(fpga_data)) { case IMAGE_FORMAT_LEGACY: @@ -231,6 +234,7 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) break; } break; +#endif case FPGA_DUMP: rc = fpga_dump(dev, fpga_data, data_size); @@ -257,8 +261,10 @@ static int fpga_get_op(char *opstr) op = FPGA_LOADB; else if (!strcmp("load", opstr)) op = FPGA_LOAD; +#if defined(CONFIG_CMD_FPGA_LOADMK) else if (!strcmp("loadmk", opstr)) op = FPGA_LOADMK; +#endif else if (!strcmp("dump", opstr)) op = FPGA_DUMP; @@ -277,10 +283,12 @@ U_BOOT_CMD(fpga, 6, 1, do_fpga, " load\t[dev] [address] [size]\tLoad device from memory buffer\n" " loadb\t[dev] [address] [size]\t" "Load device from bitstream buffer (Xilinx only)\n" +#if defined(CONFIG_CMD_FPGA_LOADMK) " loadmk [dev] [address]\tLoad device generated with mkimage" #if defined(CONFIG_FIT) "\n" "\tFor loadmk operating on FIT format uImage address must include\n" "\tsubimage unit name in the form of addr:" #endif +#endif ); -- cgit v1.2.1