hw/arm/aspeed: Unlock SCU when running kernel
commitb6e70d1d7fea681306a3c8e74934b66dc9524969
authorJoel Stanley <joel@jms.id.au>
Tue, 14 Nov 2017 12:20:18 +0000 (14 22:50 +1030)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 20 Nov 2017 13:47:49 +0000 (20 13:47 +0000)
tree1ad8a5b7c4ed72c29e8dea8386f11cf396cc8ad8
parent50cd71b0d347c74517dcb7da447fe657fca57d9c
hw/arm/aspeed: Unlock SCU when running kernel

The ASPEED hardware contains a lock register for the SCU that disables
any writes to the SCU when it is locked. The machine comes up with the
lock enabled, but on all known hardware u-boot will unlock it and leave
it unlocked when loading the kernel.

This means the kernel expects the SCU to be unlocked. When booting from
an emulated ROM the normal u-boot unlock path is executed. Things don't
go well when booting using the -kernel command line, as u-boot does not
run first.

Change behaviour so that when a kernel is passed to the machine, set the
reset value of the SCU to be unlocked.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-id: 20171114122018.12204-1-joel@jms.id.au
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/aspeed.c
hw/arm/aspeed_soc.c
hw/misc/aspeed_scu.c
include/hw/misc/aspeed_scu.h