From 6556617ce1a3c4a2ad91e5c5d1c936ee9134ed04 Mon Sep 17 00:00:00 2001 From: Niek Linnenbank Date: Wed, 11 Mar 2020 23:18:43 +0100 Subject: hw/arm/allwinner: add Security Identifier device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Security Identifier device found in various Allwinner System on Chip designs gives applications a per-board unique identifier. This commit adds support for the Allwinner Security Identifier using a 128-bit UUID value as input. Signed-off-by: Niek Linnenbank Reviewed-by: Alex Bennée Message-id: 20200311221854.30370-8-nieklinnenbank@gmail.com Signed-off-by: Peter Maydell --- hw/arm/orangepi.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'hw/arm/orangepi.c') diff --git a/hw/arm/orangepi.c b/hw/arm/orangepi.c index 3fcec1944e..4047c4c386 100644 --- a/hw/arm/orangepi.c +++ b/hw/arm/orangepi.c @@ -65,6 +65,14 @@ static void orangepi_init(MachineState *machine) object_property_set_int(OBJECT(h3), 24 * 1000 * 1000, "clk1-freq", &error_abort); + /* Setup SID properties. Currently using a default fixed SID identifier. */ + if (qemu_uuid_is_null(&h3->sid.identifier)) { + qdev_prop_set_string(DEVICE(h3), "identifier", + "02c00081-1111-2222-3333-000044556677"); + } else if (ldl_be_p(&h3->sid.identifier.data[0]) != 0x02c00081) { + warn_report("Security Identifier value does not include H3 prefix"); + } + /* Mark H3 object realized */ object_property_set_bool(OBJECT(h3), true, "realized", &error_abort); -- cgit v1.2.3