From dcc4f9623e27b92a1e0b97326631b0d5841c49cb Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Tue, 22 Mar 2022 16:59:22 -0400 Subject: arm: smh: Remove smhload command This command's functionality is now completely implemented by the standard fs load command. Convert the vexpress64 boot command (which is the only user) and remove the implementation. Signed-off-by: Sean Anderson --- arch/arm/lib/semihosting.c | 76 ---------------------------------------------- 1 file changed, 76 deletions(-) (limited to 'arch/arm/lib/semihosting.c') diff --git a/arch/arm/lib/semihosting.c b/arch/arm/lib/semihosting.c index 45cd566cfc8..57ab25294fa 100644 --- a/arch/arm/lib/semihosting.c +++ b/arch/arm/lib/semihosting.c @@ -10,8 +10,6 @@ * available in silicon now, fastmodel usage makes less sense for them. */ #include -#include -#include #include #include @@ -169,77 +167,3 @@ long smh_seek(long fd, long pos) return smh_errno(); return 0; } - -static int smh_load_file(const char * const name, ulong load_addr, - ulong *size) -{ - long fd; - long len; - long ret; - - fd = smh_open(name, MODE_READ | MODE_BINARY); - if (fd < 0) - return fd; - - len = smh_flen(fd); - if (len < 0) { - smh_close(fd); - return len; - } - - ret = smh_read(fd, (void *)load_addr, len); - smh_close(fd); - - if (ret == len) { - *size = len; - printf("loaded file %s from %08lX to %08lX, %08lX bytes\n", - name, - load_addr, - load_addr + len - 1, - len); - } else if (ret >= 0) { - ret = -EAGAIN; - } - - if (ret < 0) { - printf("read failed: %ld\n", ret); - return ret; - } - - return 0; -} - -static int do_smhload(struct cmd_tbl *cmdtp, int flag, int argc, - char *const argv[]) -{ - if (argc == 3 || argc == 4) { - ulong load_addr; - ulong size = 0; - int ret; - char size_str[64]; - - load_addr = hextoul(argv[2], NULL); - if (!load_addr) - return -1; - - ret = smh_load_file(argv[1], load_addr, &size); - if (ret < 0) - return CMD_RET_FAILURE; - - /* Optionally save returned end to the environment */ - if (argc == 4) { - sprintf(size_str, "0x%08lx", size); - env_set(argv[3], size_str); - } - } else { - return CMD_RET_USAGE; - } - return 0; -} - -U_BOOT_CMD(smhload, 4, 0, do_smhload, "load a file using semihosting", - " 0x
[end var]\n" - " - load a semihosted file to the address specified\n" - " if the optional [end var] is specified, the end\n" - " address of the file will be stored in this environment\n" - " variable.\n"); -- cgit v1.2.3