summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-06-09 07:59:14 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-06-17 08:28:55 +0200
commit402a9a090b3143b7c63a695dd8211ee124fe4d15 (patch)
treec1958b087bba1d26b63844d840e5fec26f1be27b /arch
parent397a8edb7daafde37d8677f28f5023baf6101e97 (diff)
downloadbarebox-402a9a090b3143b7c63a695dd8211ee124fe4d15.tar.gz
barebox-402a9a090b3143b7c63a695dd8211ee124fe4d15.tar.xz
ARM: rpi: add Raspberry Pi 3 64-bit build support
Have the subarch select the needed symbols to display a 32-bit/64-bit menu and hide the boards that aren't capable of 64-bit when CONFIG_64BIT=y. Building for 64-bit throws some warning about mismatched type sizes, so fix those as well. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220609055922.667016-14-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/mach-bcm283x/Kconfig21
-rw-r--r--arch/arm/mach-bcm283x/include/mach/platform.h4
-rw-r--r--arch/arm/mach-bcm283x/mbox.c2
4 files changed, 22 insertions, 7 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index a96692b14d..f4213f48f4 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -60,6 +60,8 @@ config ARCH_BCM283X
select OFTREE
select OFDEVICE
select HAVE_PBL_MULTI_IMAGES
+ select CPU_SUPPORTS_32BIT_KERNEL
+ select CPU_SUPPORTS_64BIT_KERNEL
config ARCH_CLPS711X
bool "Cirrus Logic EP711x/EP721x/EP731x"
diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig
index 5be236a684..af34d1c973 100644
--- a/arch/arm/mach-bcm283x/Kconfig
+++ b/arch/arm/mach-bcm283x/Kconfig
@@ -10,29 +10,42 @@ config MACH_RPI_COMMON
bool
select ARM_USE_COMPRESSED_DTB
+config MACH_RPI_AARCH_32_64
+ select MACH_RPI_COMMON
+ select CPU_V7 if 32BIT
+ select ARM_SECURE_MONITOR if 32BIT
+ select CPU_V8 if 64BIT
+ select BOARD_ARM_GENERIC_DT if 64BIT
+ bool
+ help
+ Select this from CPUs that support both AArch32 and AArch64
+ execution modes. barebox can be compiled for only one of
+ these states, depending on the value of
+ CONFIG_32BIT/CONFIG_64BIT.
+
menu "select Broadcom BCM283X boards to be built"
config MACH_RPI
bool "RaspberryPi (BCM2835/ARM1176JZF-S)"
+ depends on 32BIT
select CPU_V6
select MACH_RPI_COMMON
config MACH_RPI2
bool "RaspberryPi 2 (BCM2836/CORTEX-A7)"
+ depends on 32BIT
select CPU_V7
select MACH_RPI_COMMON
config MACH_RPI3
bool "RaspberryPi 3 (BCM2837/CORTEX-A53)"
- select CPU_V7
+ select MACH_RPI_AARCH_32_64
select MACH_RPI_COMMON
- select ARM_SECURE_MONITOR
config MACH_RPI_CM3
bool "RaspberryPi Compute Module 3 (BCM2837/CORTEX-A53)"
- select CPU_V7
+ select MACH_RPI_AARCH_32_64
select MACH_RPI_COMMON
- select ARM_SECURE_MONITOR
endmenu
diff --git a/arch/arm/mach-bcm283x/include/mach/platform.h b/arch/arm/mach-bcm283x/include/mach/platform.h
index 310f2463f2..6917e1f345 100644
--- a/arch/arm/mach-bcm283x/include/mach/platform.h
+++ b/arch/arm/mach-bcm283x/include/mach/platform.h
@@ -31,9 +31,9 @@
#define BCM2835_CACHELINE_SIZE 64
#define BCM2835_PL011_BASE 0x20201000
-#define BCM2836_PL011_BASE 0x3f201000
+#define BCM2836_PL011_BASE 0x3f201000UL
#define BCM2835_MINIUART_BASE 0x20215040
-#define BCM2836_MINIUART_BASE 0x3f215040
+#define BCM2836_MINIUART_BASE 0x3f215040UL
#endif
diff --git a/arch/arm/mach-bcm283x/mbox.c b/arch/arm/mach-bcm283x/mbox.c
index b77065ab30..4959a1a652 100644
--- a/arch/arm/mach-bcm283x/mbox.c
+++ b/arch/arm/mach-bcm283x/mbox.c
@@ -151,7 +151,7 @@ int bcm2835_mbox_call_prop(u32 chan, struct bcm2835_mbox_hdr *buffer)
ret = bcm2835_mbox_call_raw(chan, buffer, &rbuffer);
if (ret)
return ret;
- if (rbuffer != (u32)buffer) {
+ if (rbuffer != (uintptr_t)buffer) {
pr_err("mbox: Response buffer mismatch\n");
return -EIO;
}