blob: e146f2c52901671d009631f237b7d9c98d8dd25a [file] [log] [blame]
Siew Chin Lim1025b532021-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
7#include <asm/arch/secure_vab.h>
8#include <command.h>
9#include <common.h>
10#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 Glass7e5f4602021-07-24 09:03:29 -060020 addr = hextoul(argv[1], NULL);
21 len = hextoul(argv[2], NULL);
Siew Chin Lim1025b532021-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);