Message ID | 20231121193448.1151936-5-gael.portay@rtone.fr |
---|---|
State | New |
Headers | show |
Series | Add support for Pi5 | expand |
Hi Gaël, On 21/11/23 20:34, Gaël PORTAY wrote: > This configuration builds an image for the RaspberryPi 5. can you please point an URL to the product page and briefly description of the board? > Signed-off-by: Gaël PORTAY <gael.portay@rtone.fr> > --- > board/raspberrypi/cmdline_5.txt | 1 + > board/raspberrypi/config_5.txt | 24 ++++++++++++++++++++ > board/raspberrypi/readme.txt | 8 ++++++- > board/raspberrypi5 | 1 + > configs/raspberrypi5_defconfig | 39 +++++++++++++++++++++++++++++++++ > 5 files changed, 72 insertions(+), 1 deletion(-) > create mode 100644 board/raspberrypi/cmdline_5.txt > create mode 100644 board/raspberrypi/config_5.txt > create mode 120000 board/raspberrypi5 > create mode 100644 configs/raspberrypi5_defconfig > > diff --git a/board/raspberrypi/cmdline_5.txt b/board/raspberrypi/cmdline_5.txt > new file mode 100644 > index 0000000000..ac457353e2 > --- /dev/null > +++ b/board/raspberrypi/cmdline_5.txt > @@ -0,0 +1 @@ > +root=/dev/mmcblk0p2 rootwait console=tty1 console=ttyAMA10,115200 > diff --git a/board/raspberrypi/config_5.txt b/board/raspberrypi/config_5.txt > new file mode 100644 > index 0000000000..d25c29558d > --- /dev/null > +++ b/board/raspberrypi/config_5.txt > @@ -0,0 +1,24 @@ > +# Please note that this is only a sample, we recommend you to change it to fit > +# your needs. > +# You should override this file using BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE. > +# See http://buildroot.org/manual.html#rootfs-custom > +# and http://elinux.org/RPiconfig for a description of config.txt syntax > + > +kernel=Image > + > +# To use an external initramfs file > +#initramfs rootfs.cpio.gz > + > +# Disable overscan assuming the display supports displaying the full resolution > +# If the text shown on the screen disappears off the edge, comment this out > +disable_overscan=1 > + > +# How much memory in MB to assign to the GPU on Pi models having > +# 256, 512 or 1024 MB total memory > +gpu_mem_256=100 > +gpu_mem_512=100 > +gpu_mem_1024=100 > + > +dtoverlay=vc4-kms-v3d-pi5 > +dtoverlay=imx219 > +#dtoverlay=ov5647 please drop this last line ^^^ > diff --git a/board/raspberrypi/readme.txt b/board/raspberrypi/readme.txt > index c81fd801ae..4bdd7b3e8c 100644 > --- a/board/raspberrypi/readme.txt > +++ b/board/raspberrypi/readme.txt > @@ -10,6 +10,7 @@ These instructions apply to all models of the Raspberry Pi: > - the model B3 (aka Raspberry Pi 3). > - the model B4 (aka Raspberry Pi 4). > - the model CM4 (aka Raspberry Pi Compute Module 4 and IO Board). > + - the model B5 (aka Raspberry Pi 5). > > How to build it > =============== > @@ -17,7 +18,7 @@ How to build it > Configure Buildroot > ------------------- > > -There are two RaspberryPi defconfig files in Buildroot, one for each > +There are serveral RaspberryPi defconfig files in Buildroot, one for each > major variant, which you should base your work on: > > For models A, B, A+ or B+: > @@ -60,6 +61,10 @@ or for CM4 (on IO Board - 64 bit): > > $ make raspberrypicm4io_64_defconfig > > +For model 5 B (64 bit): > + > + $ make raspberrypi5_64_defconfig > + > Build the rootfs > ---------------- > > @@ -90,6 +95,7 @@ After building, you should obtain this tree: > +-- bcm2710-rpi-cm3.dtb [1] > +-- bcm2711-rpi-4-b.dtb [1] > +-- bcm2711-rpi-cm4.dtb [1] > + +-- bcm2712-rpi-5-b.dtb [1] > +-- bcm2837-rpi-3-b.dtb [1] > +-- boot.vfat > +-- rootfs.ext4 > diff --git a/board/raspberrypi5 b/board/raspberrypi5 > new file mode 120000 > index 0000000000..fcdafc81ed > --- /dev/null > +++ b/board/raspberrypi5 > @@ -0,0 +1 @@ > +raspberrypi > \ No newline at end of file Please add newline > diff --git a/configs/raspberrypi5_defconfig b/configs/raspberrypi5_defconfig > new file mode 100644 > index 0000000000..391df9696a > --- /dev/null > +++ b/configs/raspberrypi5_defconfig > @@ -0,0 +1,39 @@ > +BR2_aarch64=y > +BR2_cortex_a76_a55=y I've found that BCM2712 is a quad-cortex A76 and not A76+A55, so if I'm correct with BCM2712 on Raspberry 5 SoC model you should enable: BR2_cortex_a76=y > +BR2_ARM_FPU_VFPV4=y I can't find informations on which type of FPU implementation BCM2712 has but here: https://en.wikipedia.org/wiki/Raspberry_Pi I see: that all Raspberry up to version 4 support VFPV4 so it makes sense to enable VFPV4. Have you tested some package that uses FPU extensively? > +BR2_ARM64_PAGE_SIZE_16K=y > + > +BR2_TOOLCHAIN_BUILDROOT_CXX=y Is there a reason for CXX to be added? > + > +BR2_SYSTEM_DHCP="eth0" > + > +# Linux headers same as kernel, a 6.1 series > +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_1=y > + > +BR2_LINUX_KERNEL=y > +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y > +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,feb4ea51e77af09c1a4c7c3e5dd33237750f95cd)/linux-feb4ea51e77af09c1a4c7c3e5dd33237750f95cd.tar.gz" > +BR2_LINUX_KERNEL_DEFCONFIG="bcm2712" > + > +# Build the DTB from the kernel sources > +BR2_LINUX_KERNEL_DTS_SUPPORT=y > +BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2712-rpi-5-b" > + > +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y > + > +BR2_PACKAGE_RPI_FIRMWARE=y > +BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="board/raspberrypi5/config_5.txt" > +BR2_PACKAGE_RPI_FIRMWARE_CMDLINE_FILE="board/raspberrypi5/cmdline_5.txt" > + > +# Required tools to create the SD image > +BR2_PACKAGE_HOST_DOSFSTOOLS=y > +BR2_PACKAGE_HOST_GENIMAGE=y > +BR2_PACKAGE_HOST_MTOOLS=y > + > +# Filesystem / image > +BR2_TARGET_ROOTFS_EXT2=y > +BR2_TARGET_ROOTFS_EXT2_4=y > +BR2_TARGET_ROOTFS_EXT2_SIZE="120M" > +# BR2_TARGET_ROOTFS_TAR is not set > +BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi5/post-build.sh" > +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi5/post-image.sh" Best regards
diff --git a/board/raspberrypi/cmdline_5.txt b/board/raspberrypi/cmdline_5.txt new file mode 100644 index 0000000000..ac457353e2 --- /dev/null +++ b/board/raspberrypi/cmdline_5.txt @@ -0,0 +1 @@ +root=/dev/mmcblk0p2 rootwait console=tty1 console=ttyAMA10,115200 diff --git a/board/raspberrypi/config_5.txt b/board/raspberrypi/config_5.txt new file mode 100644 index 0000000000..d25c29558d --- /dev/null +++ b/board/raspberrypi/config_5.txt @@ -0,0 +1,24 @@ +# Please note that this is only a sample, we recommend you to change it to fit +# your needs. +# You should override this file using BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE. +# See http://buildroot.org/manual.html#rootfs-custom +# and http://elinux.org/RPiconfig for a description of config.txt syntax + +kernel=Image + +# To use an external initramfs file +#initramfs rootfs.cpio.gz + +# Disable overscan assuming the display supports displaying the full resolution +# If the text shown on the screen disappears off the edge, comment this out +disable_overscan=1 + +# How much memory in MB to assign to the GPU on Pi models having +# 256, 512 or 1024 MB total memory +gpu_mem_256=100 +gpu_mem_512=100 +gpu_mem_1024=100 + +dtoverlay=vc4-kms-v3d-pi5 +dtoverlay=imx219 +#dtoverlay=ov5647 diff --git a/board/raspberrypi/readme.txt b/board/raspberrypi/readme.txt index c81fd801ae..4bdd7b3e8c 100644 --- a/board/raspberrypi/readme.txt +++ b/board/raspberrypi/readme.txt @@ -10,6 +10,7 @@ These instructions apply to all models of the Raspberry Pi: - the model B3 (aka Raspberry Pi 3). - the model B4 (aka Raspberry Pi 4). - the model CM4 (aka Raspberry Pi Compute Module 4 and IO Board). + - the model B5 (aka Raspberry Pi 5). How to build it =============== @@ -17,7 +18,7 @@ How to build it Configure Buildroot ------------------- -There are two RaspberryPi defconfig files in Buildroot, one for each +There are serveral RaspberryPi defconfig files in Buildroot, one for each major variant, which you should base your work on: For models A, B, A+ or B+: @@ -60,6 +61,10 @@ or for CM4 (on IO Board - 64 bit): $ make raspberrypicm4io_64_defconfig +For model 5 B (64 bit): + + $ make raspberrypi5_64_defconfig + Build the rootfs ---------------- @@ -90,6 +95,7 @@ After building, you should obtain this tree: +-- bcm2710-rpi-cm3.dtb [1] +-- bcm2711-rpi-4-b.dtb [1] +-- bcm2711-rpi-cm4.dtb [1] + +-- bcm2712-rpi-5-b.dtb [1] +-- bcm2837-rpi-3-b.dtb [1] +-- boot.vfat +-- rootfs.ext4 diff --git a/board/raspberrypi5 b/board/raspberrypi5 new file mode 120000 index 0000000000..fcdafc81ed --- /dev/null +++ b/board/raspberrypi5 @@ -0,0 +1 @@ +raspberrypi \ No newline at end of file diff --git a/configs/raspberrypi5_defconfig b/configs/raspberrypi5_defconfig new file mode 100644 index 0000000000..391df9696a --- /dev/null +++ b/configs/raspberrypi5_defconfig @@ -0,0 +1,39 @@ +BR2_aarch64=y +BR2_cortex_a76_a55=y +BR2_ARM_FPU_VFPV4=y +BR2_ARM64_PAGE_SIZE_16K=y + +BR2_TOOLCHAIN_BUILDROOT_CXX=y + +BR2_SYSTEM_DHCP="eth0" + +# Linux headers same as kernel, a 6.1 series +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_1=y + +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL=y +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,feb4ea51e77af09c1a4c7c3e5dd33237750f95cd)/linux-feb4ea51e77af09c1a4c7c3e5dd33237750f95cd.tar.gz" +BR2_LINUX_KERNEL_DEFCONFIG="bcm2712" + +# Build the DTB from the kernel sources +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="broadcom/bcm2712-rpi-5-b" + +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y + +BR2_PACKAGE_RPI_FIRMWARE=y +BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="board/raspberrypi5/config_5.txt" +BR2_PACKAGE_RPI_FIRMWARE_CMDLINE_FILE="board/raspberrypi5/cmdline_5.txt" + +# Required tools to create the SD image +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y + +# Filesystem / image +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="120M" +# BR2_TARGET_ROOTFS_TAR is not set +BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi5/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi5/post-image.sh"
This configuration builds an image for the RaspberryPi 5. Signed-off-by: Gaël PORTAY <gael.portay@rtone.fr> --- board/raspberrypi/cmdline_5.txt | 1 + board/raspberrypi/config_5.txt | 24 ++++++++++++++++++++ board/raspberrypi/readme.txt | 8 ++++++- board/raspberrypi5 | 1 + configs/raspberrypi5_defconfig | 39 +++++++++++++++++++++++++++++++++ 5 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 board/raspberrypi/cmdline_5.txt create mode 100644 board/raspberrypi/config_5.txt create mode 120000 board/raspberrypi5 create mode 100644 configs/raspberrypi5_defconfig