[U-Boot] [PATCH v3 1/3] ARM: bcm283x: Implement EFI RTS reset_system

Stephen Warren swarren at wwwdotorg.org
Sun Nov 6 04:01:46 CET 2016


On 11/02/2016 03:36 AM, Alexander Graf wrote:
> The rpi has a pretty simple way of resetting the whole system. All it takes
> is to poke a few registers at a well defined location in MMIO space.
>
> This patch adds support for the EFI loader implementation to allow an OS to
> reset and power off the system when we're outside of boot time.

(As an aside, I'm not sure why someone wanting EFI wouldn't just use a 
complete EFI implementation such as TianoCore.)

> diff --git a/arch/arm/mach-bcm283x/reset.c b/arch/arm/mach-bcm283x/reset.c

> +__efi_runtime_data struct bcm2835_wdog_regs *wdog_regs =
> +	(struct bcm2835_wdog_regs *)BCM2835_WDOG_PHYSADDR;
> +
> +void __efi_runtime reset_cpu(ulong addr)
>  {
> -	struct bcm2835_wdog_regs *regs =
> -		(struct bcm2835_wdog_regs *)BCM2835_WDOG_PHYSADDR;

I'm not sure why that change is required. The value of the variable is 
the same in both cases?

Perhaps it's trying to ensure that if this gets compiled into an ldr 
instruction, the referenced data value is in a linker section that's 
still around when EFI runs? If so fine, but how is that ensured for all 
the other constants that this code uses, and if that happens 
automatically due to the __efi_runtime marker above, why doesn't it work 
for this one constant?

Does U-Boot have a halt/poweroff/shutdown shell command? If so, it might 
be nice to enable it as part of this series, since the code to perform 
that operation is now present.


More information about the U-Boot mailing list