blob: e74c71cfbb44110e2daeb1bee563bc7a7d2bfb0e [file] [log] [blame]
Siew Chin Limd8834502021-03-01 20:04:12 +08001// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2020 Intel Corporation <www.intel.com>
4 *
5 */
6
Tom Rinic77f48c2024-04-30 07:35:34 -06007#include <vsprintf.h>
Siew Chin Limd8834502021-03-01 20:04:12 +08008#include <asm/arch/secure_vab.h>
9#include <command.h>
Siew Chin Limd8834502021-03-01 20:04:12 +080010#include <linux/ctype.h>
11
12static int do_vab(struct cmd_tbl *cmdtp, int flag, int argc,
13 char *const argv[])
14{
15 unsigned long addr, len;
16
17 if (argc < 3)
18 return CMD_RET_USAGE;
19
Simon Glass3ff49ec2021-07-24 09:03:29 -060020 addr = hextoul(argv[1], NULL);
21 len = hextoul(argv[2], NULL);
Siew Chin Limd8834502021-03-01 20:04:12 +080022
23 if (socfpga_vendor_authentication((void *)&addr, (size_t *)&len) != 0)
24 return CMD_RET_FAILURE;
25
26 return 0;
27}
28
29U_BOOT_CMD(
30 vab, 3, 2, do_vab,
31 "perform vendor authorization",
32 "addr len - authorize 'len' bytes starting at\n"
33 " 'addr' via vendor public key"
34);