]>
git.ipfire.org Git - thirdparty/u-boot.git/blob - board/CZ.NIC/turris_mox/mox_sp.c
1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2018 Marek BehĂșn <kabel@kernel.org>
7 #include <asm/arch/soc.h>
9 #include <linux/bitops.h>
10 #include <linux/delay.h>
11 #include <mach/mbox.h>
13 const char *mox_sp_get_ecdsa_public_key(void)
15 static char public_key
[135];
22 res
= mbox_do_cmd(MBOX_CMD_ECDSA_PUB_KEY
, NULL
, 0, out
, 16);
27 "%06x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x",
28 (u32
)res
, out
[0], out
[1], out
[2], out
[3], out
[4], out
[5],
29 out
[6], out
[7], out
[8], out
[9], out
[10], out
[11], out
[12],
30 out
[13], out
[14], out
[15]);
35 static inline void res_to_mac(u8
*mac
, u32 t1
, u32 t2
)
45 int mbox_sp_get_board_info(u64
*sn
, u8
*mac1
, u8
*mac2
, int *bv
, int *ram
)
50 res
= mbox_do_cmd(MBOX_CMD_BOARD_INFO
, NULL
, 0, out
, 8);
67 res_to_mac(mac1
, out
[4], out
[5]);
70 res_to_mac(mac2
, out
[6], out
[7]);