[Buildroot] [RFC PATCH 0/3] Add support for Pi5

Gaël PORTAY gael.portay at rtone.fr
Fri Oct 13 18:01:42 UTC 2023


Hello world,

This patch series starts the initial support for the Pi5 for both
variants 32-bit and 64-bit.

It compiles fine with an external toolchain, but the images are not
tested on target yet as I do not own an hardware for now (crossed
fingers to get it by the end of the month).

The first patch bumps the package rpi-firmware to get the dtb overlays
to the commit 7e9c2063fc15274fbc4dab1ca614f9228834d881[4]; that commit
states "Add support for PI 5" and bumps the kernel files but it does
**NOT** bump the files for VideoCore. It is not clear for now if the
BCM2712/VC7 reuses the files from the BCM2711/VC6. I assume it does it
for now. Therefore, that patch updates the comments of Pi4 variants for
Pi5. If someone knows something about it, information is welcomed :)

The second patch adds the defconfig for the Pi5 64-bit; it uses the
raspberrypi kernel 6.1 up to commit[1]. The branch rpi-6.1 is the only
one supporting the Pi5. It contains the defconfig bcm2712_defconfig[2]
and the device-tree source bcm2712-rpi-5-b.dts[3].

The third patch is analogous to the first one but for supporting Pi5
32-bit.

Question 1: should I bump all the Pi defconfigs to use the current
stable downstream kernel 6.1? 5.10 is pretty old isn't it, is there any
good reason to stay on that 22-month old release[5]?

Question 2: if I am right, the device-tree overlays are taken from the
rpi-firmware; is there a plan to compile the one from the downstream
kernel sources instead? by tweaking the linux.mk maybe?

For the curious, here are the differences between the BCM2711 and
BCM2712 defconfigs (Pi4 and the Pi5):

	gportay at archlinux ~/src/linux-raspberrypi $ diff -Nurd arch/arm64/configs/bcm271*
	--- arch/arm64/configs/bcm2711_defconfig	2023-10-08 11:45:20.470238993 +0200
	+++ arch/arm64/configs/bcm2712_defconfig	2023-10-08 11:45:20.470238993 +0200
	@@ -1,4 +1,4 @@
	-CONFIG_LOCALVERSION="-v8"
	+CONFIG_LOCALVERSION="-v8_16k"
	 # CONFIG_LOCALVERSION_AUTO is not set
	 CONFIG_SYSVIPC=y
	 CONFIG_POSIX_MQUEUE=y
	@@ -41,6 +41,7 @@
	 # CONFIG_CAVIUM_ERRATUM_22375 is not set
	 # CONFIG_CAVIUM_ERRATUM_23154 is not set
	 # CONFIG_CAVIUM_ERRATUM_27456 is not set
	+CONFIG_ARM64_16K_PAGES=y
	 CONFIG_COMPAT=y
	 CONFIG_ARMV8_DEPRECATED=y
	 CONFIG_SWP_EMULATION=y
	@@ -65,6 +66,8 @@
	 CONFIG_VIRTUALIZATION=y
	 CONFIG_KVM=y
	 CONFIG_JUMP_LABEL=y
	+CONFIG_ARCH_MMAP_RND_BITS=18
	+CONFIG_ARCH_MMAP_RND_COMPAT_BITS=11
	 CONFIG_MODULES=y
	 CONFIG_MODULE_UNLOAD=y
	 CONFIG_MODVERSIONS=y

The defconfig bcm2711_defconfig sets the following values for the
CONFIG_ARCH_MMAP_RND_* configs:

	CONFIG_ARCH_MMAP_RND_BITS_MIN=18                                                
	CONFIG_ARCH_MMAP_RND_BITS_MAX=24                                                
	CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11                                         
	CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16

Here is a diff between the full .config:

	gportay at archlinux ~/src/linux-raspberrypi $ diff -Nurd output-bcm2711_defconfig/.config output-bcm2712_defconfig/.config
	--- output-bcm2711_defconfig/.config	2023-10-09 09:35:36.460206163 +0200
	+++ output-bcm2712_defconfig/.config	2023-10-09 09:37:57.050577252 +0200
	@@ -28,7 +28,7 @@
	 CONFIG_INIT_ENV_ARG_LIMIT=32
	 # CONFIG_COMPILE_TEST is not set
	 # CONFIG_WERROR is not set
	-CONFIG_LOCALVERSION="-v8"
	+CONFIG_LOCALVERSION="-v8_16k"
	 # CONFIG_LOCALVERSION_AUTO is not set
	 CONFIG_BUILD_SALT=""
	 CONFIG_DEFAULT_INIT=""
	@@ -268,12 +268,12 @@
	 CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS=y
	 CONFIG_64BIT=y
	 CONFIG_MMU=y
	-CONFIG_ARM64_PAGE_SHIFT=12
	-CONFIG_ARM64_CONT_PTE_SHIFT=4
	-CONFIG_ARM64_CONT_PMD_SHIFT=4
	-CONFIG_ARCH_MMAP_RND_BITS_MIN=18
	-CONFIG_ARCH_MMAP_RND_BITS_MAX=24
	-CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
	+CONFIG_ARM64_PAGE_SHIFT=14
	+CONFIG_ARM64_CONT_PTE_SHIFT=7
	+CONFIG_ARM64_CONT_PMD_SHIFT=5
	+CONFIG_ARCH_MMAP_RND_BITS_MIN=16
	+CONFIG_ARCH_MMAP_RND_BITS_MAX=30
	+CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=9
	 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
	 CONFIG_STACKTRACE_SUPPORT=y
	 CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
	@@ -388,12 +388,13 @@
	 CONFIG_SOCIONEXT_SYNQUACER_PREITS=y
	 # end of ARM errata workarounds via the alternatives framework
	 
	-CONFIG_ARM64_4K_PAGES=y
	-# CONFIG_ARM64_16K_PAGES is not set
	+# CONFIG_ARM64_4K_PAGES is not set
	+CONFIG_ARM64_16K_PAGES=y
	 # CONFIG_ARM64_64K_PAGES is not set
	-CONFIG_ARM64_VA_BITS_39=y
	+# CONFIG_ARM64_VA_BITS_36 is not set
	+CONFIG_ARM64_VA_BITS_47=y
	 # CONFIG_ARM64_VA_BITS_48 is not set
	-CONFIG_ARM64_VA_BITS=39
	+CONFIG_ARM64_VA_BITS=47
	 CONFIG_ARM64_PA_BITS_48=y
	 CONFIG_ARM64_PA_BITS=48
	 # CONFIG_CPU_BIG_ENDIAN is not set
	@@ -417,7 +418,7 @@
	 # CONFIG_KEXEC_FILE is not set
	 # CONFIG_CRASH_DUMP is not set
	 # CONFIG_XEN is not set
	-CONFIG_ARCH_FORCE_MAX_ORDER=11
	+CONFIG_ARCH_FORCE_MAX_ORDER=12
	 CONFIG_UNMAP_KERNEL_AT_EL0=y
	 CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY=y
	 CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
	@@ -865,7 +866,6 @@
	 CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
	 CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y
	 # CONFIG_MEMORY_FAILURE is not set
	-CONFIG_ARCH_WANTS_THP_SWAP=y
	 # CONFIG_TRANSPARENT_HUGEPAGE is not set
	 CONFIG_FRONTSWAP=y
	 CONFIG_CMA=y

[1]: https://github.com/raspberrypi/linux/commit/feb4ea51e77af09c1a4c7c3e5dd33237750f95cd
[2]: https://github.com/raspberrypi/linux/commit/9cfb379147f803b0362b0fe249e5b145d232bea3
[3]: https://github.com/raspberrypi/linux/commit/1196bf1a7736ff0ab79f5012fa84082e298031a7
[4]: https://github.com/raspberrypi/firmware/commit/7e9c2063fc15274fbc4dab1ca614f9228834d881
[5]: https://github.com/raspberrypi/linux/commit/0b54dbda3cca2beb51e236a25738784e90853b64

Best Regards,
Gaël PORTAY (3):
  package/rpi-firmware: bump version for pi5 support
  configs: add raspberrypi 5 64-bit defconfig
  configs: add raspberrypi 5 32-bit defconfig

 board/raspberrypi/config_5.txt         | 23 ++++++++++++++++
 board/raspberrypi/config_5_64bit.txt   | 30 ++++++++++++++++++++
 board/raspberrypi/readme.txt           |  2 ++
 board/raspberrypi5                     |  1 +
 board/raspberrypi5-64                  |  1 +
 configs/raspberrypi5_64_defconfig      | 38 ++++++++++++++++++++++++++
 configs/raspberrypi5_defconfig         | 38 ++++++++++++++++++++++++++
 package/rpi-firmware/Config.in         | 22 +++++++--------
 package/rpi-firmware/rpi-firmware.hash |  2 +-
 package/rpi-firmware/rpi-firmware.mk   |  2 +-
 10 files changed, 146 insertions(+), 13 deletions(-)
 create mode 100644 board/raspberrypi/config_5.txt
 create mode 100644 board/raspberrypi/config_5_64bit.txt
 create mode 120000 board/raspberrypi5
 create mode 120000 board/raspberrypi5-64
 create mode 100644 configs/raspberrypi5_64_defconfig
 create mode 100644 configs/raspberrypi5_defconfig

-- 
2.42.0




More information about the buildroot mailing list