summaryrefslogtreecommitdiffstats
path: root/hw/arm/orangepi.c
diff options
context:
space:
mode:
authorNiek Linnenbank2020-03-11 23:18:43 +0100
committerPeter Maydell2020-03-12 17:27:33 +0100
commit6556617ce1a3c4a2ad91e5c5d1c936ee9134ed04 (patch)
tree95634e46e06d68d41ea7a8caa6ada1794007d2d0 /hw/arm/orangepi.c
parenthw/arm/allwinner: add CPU Configuration module (diff)
downloadqemu-6556617ce1a3c4a2ad91e5c5d1c936ee9134ed04.tar.gz
qemu-6556617ce1a3c4a2ad91e5c5d1c936ee9134ed04.tar.xz
qemu-6556617ce1a3c4a2ad91e5c5d1c936ee9134ed04.zip
hw/arm/allwinner: add Security Identifier device
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 <nieklinnenbank@gmail.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 20200311221854.30370-8-nieklinnenbank@gmail.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/arm/orangepi.c')
-rw-r--r--hw/arm/orangepi.c8
1 files changed, 8 insertions, 0 deletions
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);