summaryrefslogtreecommitdiff
path: root/arch/arm/mach-socfpga/vab.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-03-08 07:11:26 -0500
committerTom Rini <trini@konsulko.com>2021-03-08 07:41:40 -0500
commitb0a75dda7e542c9ddea685ceb2251118638829d5 (patch)
treee08d4455441a4c1391264f3def8d71354510633a /arch/arm/mach-socfpga/vab.c
parent90964ab5acb29ec6617a9ff340886230b2fce8c7 (diff)
parent9773ebcfbca23c7d6fe1dc202913b005bc23cc89 (diff)
Merge branch 'v2021.04-rc4' of https://github.com/lftan/u-boot
- Add VAB support
Diffstat (limited to 'arch/arm/mach-socfpga/vab.c')
-rw-r--r--arch/arm/mach-socfpga/vab.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-socfpga/vab.c b/arch/arm/mach-socfpga/vab.c
new file mode 100644
index 00000000000..85b3f302111
--- /dev/null
+++ b/arch/arm/mach-socfpga/vab.c
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2020 Intel Corporation <www.intel.com>
+ *
+ */
+
+#include <asm/arch/secure_vab.h>
+#include <command.h>
+#include <common.h>
+#include <linux/ctype.h>
+
+static int do_vab(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
+{
+ unsigned long addr, len;
+
+ if (argc < 3)
+ return CMD_RET_USAGE;
+
+ addr = simple_strtoul(argv[1], NULL, 16);
+ len = simple_strtoul(argv[2], NULL, 16);
+
+ if (socfpga_vendor_authentication((void *)&addr, (size_t *)&len) != 0)
+ return CMD_RET_FAILURE;
+
+ return 0;
+}
+
+U_BOOT_CMD(
+ vab, 3, 2, do_vab,
+ "perform vendor authorization",
+ "addr len - authorize 'len' bytes starting at\n"
+ " 'addr' via vendor public key"
+);