ARM: aspeed: Add secure boot controller support
authorJoel Stanley <joel@jms.id.au>
Wed, 17 Nov 2021 03:51:06 +0000 (11:51 +0800)
committerJoel Stanley <joel@jms.id.au>
Tue, 21 Dec 2021 05:26:30 +0000 (15:56 +1030)
commit79ee56da2e4f49adf174dd7a2e10ce488506c865
tree26b3861bdda78e385989bef3c80761b60cc09f94
parentbb818f67d3e93fdf315fe4699f65574ee3b59d73
ARM: aspeed: Add secure boot controller support

This reads out the status of the secure boot controller and exposes it
in sysfs.

An example on a AST2600A3 QEMU model:

 # grep . /sys/bus/soc/devices/soc0/*
 /sys/bus/soc/devices/soc0/abr_image:0
 /sys/bus/soc/devices/soc0/family:AST2600
 /sys/bus/soc/devices/soc0/low_security_key:0
 /sys/bus/soc/devices/soc0/machine:Rainier 2U
 /sys/bus/soc/devices/soc0/otp_protected:0
 /sys/bus/soc/devices/soc0/revision:A3
 /sys/bus/soc/devices/soc0/secure_boot:1
 /sys/bus/soc/devices/soc0/serial_number:888844441234abcd
 /sys/bus/soc/devices/soc0/soc_id:05030303
 /sys/bus/soc/devices/soc0/uart_boot:1

On boot the state of the system according to the secure boot controller
will be printed:

 [    0.037634] AST2600 secure boot enabled

or

 [    0.037935] AST2600 secure boot disabled

Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Ryan Chen <ryan_chen@aspeedtech.com>
Link: https://lore.kernel.org/r/20211117035106.321454-4-joel@jms.id.au
Signed-off-by: Joel Stanley <joel@jms.id.au>
drivers/soc/aspeed/aspeed-socinfo.c