diff mbox

[U-Boot,v3,3/3] bcm2835: Reserve the spin table in efi memory map

Message ID 1478079380-176304-4-git-send-email-agraf@suse.de
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Alexander Graf Nov. 2, 2016, 9:36 a.m. UTC
Firmware provides a spin table on the raspberry pi. This table shouldn't
get overwritten by payloads, so we need to mark it as reserved.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 board/raspberrypi/rpi/rpi.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Stephen Warren Nov. 6, 2016, 3:07 a.m. UTC | #1
On 11/02/2016 03:36 AM, Alexander Graf wrote:
> Firmware provides a spin table on the raspberry pi. This table shouldn't
> get overwritten by payloads, so we need to mark it as reserved.

This is probably fine for now so,
Acked-by: Stephen Warren <swarren@wwwdotorg.org>

However in the long term I wonder if U-Boot shouldn't find out the spin 
table address from the FW-provided DTB, then boot all CPUs into a 
spin-table implementation that's provided by U-Boot. That would avoid 
having to hard-code the address/size of the spin table code/data in 
U-Boot, which in theory at least could change to an arbitrary location 
in a future FW release.
Alexander Graf Nov. 6, 2016, 10:27 a.m. UTC | #2
On 05/11/2016 23:07, Stephen Warren wrote:
> On 11/02/2016 03:36 AM, Alexander Graf wrote:
>> Firmware provides a spin table on the raspberry pi. This table shouldn't
>> get overwritten by payloads, so we need to mark it as reserved.
>
> This is probably fine for now so,
> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
>
> However in the long term I wonder if U-Boot shouldn't find out the spin
> table address from the FW-provided DTB, then boot all CPUs into a
> spin-table implementation that's provided by U-Boot. That would avoid
> having to hard-code the address/size of the spin table code/data in
> U-Boot, which in theory at least could change to an arbitrary location
> in a future FW release.

I think in the long term, it would make much more sense to use PSCI on 
the RPi3. Then we wouldn't have to worry about any of the above, except 
for an EL3 reserved memory region that we could also enquire using PSCI.

For 32bit systems, yes, probably :).


Alex
Tom Rini Nov. 29, 2016, 6:01 p.m. UTC | #3
On Wed, Nov 02, 2016 at 10:36:20AM +0100, Alexander Graf wrote:

> Firmware provides a spin table on the raspberry pi. This table shouldn't
> get overwritten by payloads, so we need to mark it as reserved.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>
> Acked-by: Stephen Warren <swarren@wwwdotorg.org>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
index 6245b36..7f057e1 100644
--- a/board/raspberrypi/rpi/rpi.c
+++ b/board/raspberrypi/rpi/rpi.c
@@ -8,6 +8,7 @@ 
 #include <inttypes.h>
 #include <config.h>
 #include <dm.h>
+#include <efi_loader.h>
 #include <fdt_support.h>
 #include <fdt_simplefb.h>
 #include <lcd.h>
@@ -514,5 +515,10 @@  int ft_board_setup(void *blob, bd_t *bd)
 	 */
 	lcd_dt_simplefb_add_node(blob);
 
+#ifdef CONFIG_EFI_LOADER
+	/* Reserve the spin table */
+	efi_add_memory_map(0, 1, EFI_RESERVED_MEMORY_TYPE, 0);
+#endif
+
 	return 0;
 }