From patchwork Mon Jul 15 16:09:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Athaariq Ardhiansyah X-Patchwork-Id: 1960720 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WN6c65HRQz1xr4 for ; Tue, 16 Jul 2024 02:10:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id C2CC9404FF; Mon, 15 Jul 2024 16:10:12 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Yr6eKY6qYF8y; Mon, 15 Jul 2024 16:10:11 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org E7676404D9 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id E7676404D9; Mon, 15 Jul 2024 16:10:10 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 655671BF401 for ; Mon, 15 Jul 2024 16:10:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 53525403E4 for ; Mon, 15 Jul 2024 16:10:07 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id aQQdMoMlAAA5 for ; Mon, 15 Jul 2024 16:10:06 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=117.53.144.211; helo=mail.selirafood.com; envelope-from=foss@athaariq.my.id; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 5D273403CE DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 5D273403CE Received: from mail.selirafood.com (mail.selirafood.com [117.53.144.211]) by smtp4.osuosl.org (Postfix) with ESMTPS id 5D273403CE for ; Mon, 15 Jul 2024 16:10:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.selirafood.com (Postfix) with ESMTP id 33A82102DA; Mon, 15 Jul 2024 23:10:01 +0700 (WIB) Received: from localhost.localdomain (unknown [192.168.100.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mail.selirafood.com (Postfix) with ESMTPSA id 6C7DF10281; Mon, 15 Jul 2024 23:10:00 +0700 (WIB) From: Athaariq Ardhiansyah To: buildroot@buildroot.org Date: Mon, 15 Jul 2024 23:09:38 +0700 Message-ID: <20240715160941.90353-3-foss@athaariq.my.id> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240715160941.90353-1-foss@athaariq.my.id> References: <20240715160941.90353-1-foss@athaariq.my.id> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=athaariq.my.id; h=content-transfer-encoding:content-type:content-type :mime-version:references:in-reply-to:x-mailer:message-id:date :date:subject:subject:from:from:received; s=dkim20240121; t= 1721059801; x=1722269402; bh=vq2O8D0vGefWvUtA+IrFkK8CkhWcNaRPIOo CgNhgu14=; b=DZfeyelQIJwel+Yd5fTRmYvOy/KzdXlznLAuDZBbSEDk9s1awQB rgNQW/MnMN/rfdtcr1uq4EvX3S4PvmtUHWM2JyfA+N3vr85obP0Tdo/hZRJ5UYid r/61dwPpt1VFPjOhRjEyvEqiSn3hZQ0a6wclvV03bhNc8b737tj6PQz62CgaiOaj y0LaPOPwqFJPI+fblgT/SmUUc1tPCWNHbo/xml8gLd3kLj8zhlgQkGSGTDNnl5Py 4XkElf8oP3jx1C7+cFcHLRuGSkONoBzMuZn1FPp3fO2+CQxga/Yjw2UPDbY+zT5t rbLqAedjoTA8hsWg5nMp1mpBVmchDGWw7AA== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=athaariq.my.id X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=athaariq.my.id header.i=@athaariq.my.id header.a=rsa-sha256 header.s=dkim20240121 header.b=DZfeyelQ X-Mailman-Original-Authentication-Results: mail.selirafood.com (amavisd-new); dkim=pass (2048-bit key) reason="pass (just generated, assumed good)" header.d=athaariq.my.id Subject: [Buildroot] [PATCH v5 3/3] board/raspberrypi: add support for Raspberry Pi 5 X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Athaariq Ardhiansyah , Martin Bark , Julien Grossholtz Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Since the last Raspberry Pi 5 submission has no progress, I'm submitting these patches anyway. The newly released Raspberry Pi 5 board shares similar software structure except it has less proprietary API. Therefore, rpi-userland and all of raspberry-centric GPIO utilities are no longer supported. Keep in mind that RPi 5 has no native 32-bit support due to Cortex-A76 processor specification. That is the reason why I did not add _64. Signed-off-by: Athaariq Ardhiansyah --- Changes v1 -> v2: - Fix missing newlines due to terminal issue Changes v3 -> v4: - Rebase to master - Drop 4K page size, until we figured out how to run 32bit userspace on top of 64bit kernel - Change back from commit ID to commit tag - Rewrite the commit description - Fix incorrect CPU from upstream config, RPi5 has no LITTLE.big - Revert the config_5.txt to keep the GPU and UART working Changes v4 -> v5: - Remove the commented line for better clarity - Remove miniuart-bt due to different console for RPi5 (suggested by Gaël PORTAY) - Fix mistake on git send-email command which causes duplicated 'Signed-off-by' at the bottom - Default UART should be RPi5's default UART, which is UART0 - Change Linux commit ID to currently latest tag and must match with its DTB firmware version, which is stable_20240529 (suggested by Gaël PORTAY) --- board/raspberrypi/cmdline_5.txt | 1 - board/raspberrypi/config_5.txt | 36 +++++++++++++++++++ board/raspberrypi/linux-4k-page-size.fragment | 1 - .../patches/linux-headers/linux-headers.hash | 1 - board/raspberrypi/patches/linux/linux.hash | 2 +- configs/raspberrypi5_defconfig | 19 ++++------ 6 files changed, 44 insertions(+), 16 deletions(-) delete mode 100644 board/raspberrypi/cmdline_5.txt delete mode 100644 board/raspberrypi/linux-4k-page-size.fragment delete mode 120000 board/raspberrypi/patches/linux-headers/linux-headers.hash diff --git a/board/raspberrypi/cmdline_5.txt b/board/raspberrypi/cmdline_5.txt deleted file mode 100644 index ac457353e2..0000000000 --- a/board/raspberrypi/cmdline_5.txt +++ /dev/null @@ -1 +0,0 @@ -root=/dev/mmcblk0p2 rootwait console=tty1 console=ttyAMA10,115200 diff --git a/board/raspberrypi/config_5.txt b/board/raspberrypi/config_5.txt index bbed19fe46..e624086247 100644 --- a/board/raspberrypi/config_5.txt +++ b/board/raspberrypi/config_5.txt @@ -9,6 +9,42 @@ kernel=Image # To use an external initramfs file #initramfs rootfs.cpio.gz +# Automatically load initramfs files, if found +auto_initramfs=1 + +# Uncomment some or all of these to enable the optional hardware interfaces +#dtparam=i2c_arm=on +#dtparam=i2s=on +#dtparam=spi=on + +# Enable audio (loads snd_bcm2835) +dtparam=audio=on + +# Automatically load overlays for detected cameras +camera_auto_detect=1 + +# Automatically load overlays for detected DSI displays +display_auto_detect=1 + +# Enable DRM VC4 V3D driver +dtoverlay=vc4-kms-v3d-pi5 +max_framebuffers=2 + +# Don't have the firmware create an initial video= setting in cmdline.txt. +# Use the kernel's default instead. +disable_fw_kms_setup=1 + # 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 + +# enable 64bits support +arm_64bit=1 + +# Run as fast as firmware / board allows +arm_boost=1 + +# Raspberry PI 5 won't use UART0 as terminal out of the box. We need to enable +# this through config.txt +enable_uart=1 +dtoverlay=uart0-pi5 diff --git a/board/raspberrypi/linux-4k-page-size.fragment b/board/raspberrypi/linux-4k-page-size.fragment deleted file mode 100644 index 5df91df1aa..0000000000 --- a/board/raspberrypi/linux-4k-page-size.fragment +++ /dev/null @@ -1 +0,0 @@ -CONFIG_ARM64_4K_PAGES=y diff --git a/board/raspberrypi/patches/linux-headers/linux-headers.hash b/board/raspberrypi/patches/linux-headers/linux-headers.hash deleted file mode 120000 index 5808d92afe..0000000000 --- a/board/raspberrypi/patches/linux-headers/linux-headers.hash +++ /dev/null @@ -1 +0,0 @@ -../linux/linux.hash \ No newline at end of file diff --git a/board/raspberrypi/patches/linux/linux.hash b/board/raspberrypi/patches/linux/linux.hash index 8d43c25151..fc7338d0d0 100644 --- a/board/raspberrypi/patches/linux/linux.hash +++ b/board/raspberrypi/patches/linux/linux.hash @@ -1,2 +1,2 @@ # Locally calculated -sha256 dab3052783c68c46a5bc645b1c38d9705da995ab42823566518b62eb1fa1ef97 linux-576cc10e1ed50a9eacffc7a05c796051d7343ea4.tar.gz +sha256 05ac851ea9b720ba44c66eb88cdcb7cbd280401b1dd1fab3391a3883e4719197 linux-stable_20240529.tar.gz diff --git a/configs/raspberrypi5_defconfig b/configs/raspberrypi5_defconfig index 3c88ce46cd..10cbe6fea3 100644 --- a/configs/raspberrypi5_defconfig +++ b/configs/raspberrypi5_defconfig @@ -1,8 +1,9 @@ BR2_aarch64=y -BR2_cortex_a76_a55=y -BR2_ARM_FPU_VFPV4=y +BR2_cortex_a76=y -BR2_TOOLCHAIN_BUILDROOT_CXX=y +# patches +BR2_GLOBAL_PATCH_DIR="board/raspberrypi/patches" +BR2_DOWNLOAD_FORCE_CHECK_HASHES=y BR2_SYSTEM_DHCP="eth0" @@ -10,9 +11,8 @@ BR2_SYSTEM_DHCP="eth0" BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y BR2_LINUX_KERNEL=y -BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/raspberrypi/linux-4k-page-size.fragment" BR2_LINUX_KERNEL_CUSTOM_TARBALL=y -BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,576cc10e1ed50a9eacffc7a05c796051d7343ea4)/linux-576cc10e1ed50a9eacffc7a05c796051d7343ea4.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="$(call github,raspberrypi,linux,stable_20240529)/linux-stable_20240529.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="bcm2712" # Build the DTB from the kernel sources @@ -23,8 +23,6 @@ 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" -# BR2_PACKAGE_RPI_FIRMWARE_INSTALL_DTB_OVERLAYS is not set # Required tools to create the SD image BR2_PACKAGE_HOST_DOSFSTOOLS=y @@ -34,8 +32,8 @@ 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_TARGET_ROOTFS_EXT2_SIZE="256M" +BR2_TARGET_ROOTFS_EXT2_MKFS_OPTIONS="-O 64bit" BR2_ROOTFS_POST_BUILD_SCRIPT="board/raspberrypi5/post-build.sh" BR2_ROOTFS_POST_IMAGE_SCRIPT="board/raspberrypi5/post-image.sh" @@ -45,6 +43,3 @@ BR2_PACKAGE_KMOD_TOOLS=y BR2_PACKAGE_XZ=y BR2_PACKAGE_KMOD=y BR2_PACKAGE_HOST_KMOD_XZ=y - -BR2_DOWNLOAD_FORCE_CHECK_HASHES=y -BR2_GLOBAL_PATCH_DIR="board/raspberrypi5/patches"