Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:mbrugger:branches:RPi5
u-boot
0023-rpi5-initial-support.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0023-rpi5-initial-support.patch of Package u-boot
From 734295e9fcff16b2a3b2d469adeb7cca53c73510 Mon Sep 17 00:00:00 2001 From: Dmitry Malkin <dmitry@bedrocksystems.com> Date: Tue, 21 Nov 2023 23:54:37 +0100 Subject: [PATCH] rpi5: initial support rpi5: add alternative way to get MBOX address via FDT node MBOX on RPI5/bcm2712 has a different offset. Find it via "brcm,bcm2835-mbox" node. Signed-off-by: Dmitry Malkin <dmitry@bedrocksystems.com> --- arch/arm/mach-bcm283x/include/mach/base.h | 1 + arch/arm/mach-bcm283x/include/mach/mbox.h | 4 ++-- arch/arm/mach-bcm283x/init.c | 14 +++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-bcm283x/include/mach/base.h b/arch/arm/mach-bcm283x/include/mach/base.h index 4ccaf69693d..8cd224921e2 100644 --- a/arch/arm/mach-bcm283x/include/mach/base.h +++ b/arch/arm/mach-bcm283x/include/mach/base.h @@ -7,6 +7,7 @@ #define _BCM283x_BASE_H_ extern unsigned long rpi_bcm283x_base; +extern unsigned long rpi_bcm283x_mbox_addr; #ifdef CONFIG_ARMV7_LPAE #ifdef CONFIG_TARGET_RPI_4_32B diff --git a/arch/arm/mach-bcm283x/include/mach/mbox.h b/arch/arm/mach-bcm283x/include/mach/mbox.h index 490664f878f..8b4c5f9c81f 100644 --- a/arch/arm/mach-bcm283x/include/mach/mbox.h +++ b/arch/arm/mach-bcm283x/include/mach/mbox.h @@ -38,8 +38,8 @@ /* Raw mailbox HW */ -#define BCM2835_MBOX_PHYSADDR ({ BUG_ON(!rpi_bcm283x_base); \ - rpi_bcm283x_base + 0x0000b880; }) +#define BCM2835_MBOX_PHYSADDR ({ BUG_ON(!rpi_bcm283x_mbox_addr); \ + rpi_bcm283x_mbox_addr; }) struct bcm2835_mbox_regs { u32 read; diff --git a/arch/arm/mach-bcm283x/init.c b/arch/arm/mach-bcm283x/init.c index fa9427e101b..9f7f076b125 100644 --- a/arch/arm/mach-bcm283x/init.c +++ b/arch/arm/mach-bcm283x/init.c @@ -146,6 +146,11 @@ static void rpi_update_mem_map(void) {} unsigned long rpi_bcm283x_base = 0x3f000000; +/* This is intialized before relocation. Enforce .data section usage. + * Otherwise it's going to .bss and will be zero after relocation. + */ +unsigned long __section(".data") rpi_bcm283x_mbox_addr; + int arch_cpu_init(void) { icache_enable(); @@ -155,7 +160,7 @@ int arch_cpu_init(void) int mach_cpu_init(void) { - int ret, soc_offset; + int ret, soc_offset, mbox_offset; u64 io_base, size; rpi_update_mem_map(); @@ -171,6 +176,13 @@ int mach_cpu_init(void) return ret; rpi_bcm283x_base = io_base; + rpi_bcm283x_mbox_addr = rpi_bcm283x_base + 0xb880; + + mbox_offset = fdt_node_offset_by_compatible((void*)gd->fdt_blob, + soc_offset, "brcm,bcm2835-mbox"); + if (mbox_offset > soc_offset) + rpi_bcm283x_mbox_addr = + fdt_get_base_address((void*)gd->fdt_blob, mbox_offset); return 0; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor