Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Andy Yan" <andyshrk@163.com>
To: "Julien Olivain" <ju.o@free.fr>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] configs/coolpi_4b: new defconfig
Date: Mon, 31 Mar 2025 15:14:23 +0800 (CST)	[thread overview]
Message-ID: <6f3de205.733b.195eb0d28f6.Coremail.andyshrk@163.com> (raw)
In-Reply-To: <45f6ae2212d8341b4e0fa99e7ec16482@free.fr>


Hi Julien,

At 2025-03-30 18:31:00, "Julien Olivain" <ju.o@free.fr> wrote:
>Hi Andy,
>
>Thanks for the patch. I have comments, see below.
>
>On 30/03/2025 10:04, Andy Yan wrote:
>> CoolPi 4B is a rk3588s based SBC[0].
>> Specification:
>> - Rockchip RK3588S
>> - LPDDR4 2/4/8/16 GB
>> - TF scard slot
>> - eMMC 8/32/64/128 GB module
>> - Gigabit ethernet drived by PCIE with RTL8111HS
>> - HDMI Type D out
>> - Mini DP out
>> - USB 2.0 Host x 2
>> - USB 3.0 OTG x 1
>> - USB 3.0 Host x 1
>> - WIFI/BT module AIC8800
>> - 40 pin header
>> 
>> Add support for it with latest mainline Linux/U-Boot.
>> And also Enable network, Weston, Gstreamer packages.
>
>This defconfig selects too many packages.
>Quoting the Buildroot documentation:
>https://buildroot.org/downloads/manual/manual.html#adding-board-support
>"""
>No specific package should be selected: the configuration should be
>as minimal as possible, and should only build a working basic BusyBox
>system for the target platform.
>"""
>
>You can keep hardware support (linux config fragment,
>linux firmware), but gstreamer, glmark2, igt-gpu-tools, kmscube,
>mesa3d, weston and openssh should be removed.

Thanks for your careful  review. I didn't know before that Buildroot has such a rule.
 I will do the update in V2.

But my board was broken today,  I will send a new version  after I
get a new board and have a test on it.

>
>Alternatively, you can add recommendations in the readme.txt,
>create your own Buildroot fork or a br2-external project
>enabling all the packages you need.
>
>> [0]https://www.cool-pi.com/product/cp4b/
>> 
>> Signed-off-by: Andy Yan <andyshrk@163.com>
>> ---
>
>[...]
>
>> diff --git a/board/coolpi/coolpi-4b/post-image.sh 
>> b/board/coolpi/coolpi-4b/post-image.sh
>> new file mode 100755
>> index 0000000000..f8f17e0716
>> --- /dev/null
>> +++ b/board/coolpi/coolpi-4b/post-image.sh
>> @@ -0,0 +1,7 @@
>> +#!/usr/bin/env bash
>
>Running the command "utils/docker-run make check-package" reports
>an error:
>
>     board/coolpi/coolpi-4b/post-image.sh:0: run 'shellcheck' and fix the 
>warnings
>
>Could you fix those ShellCheck warnings, please?
>
>> +set -e
>> +
>> +BOARD_DIR="$(dirname $0)"
>> +gzip -fk "${BINARIES_DIR}/Image"
>> +install -m 0644 -D $BOARD_DIR/extlinux.conf 
>> $BINARIES_DIR/extlinux/extlinux.conf
>> +support/scripts/genimage.sh -c board/coolpi/coolpi-4b/genimage.cfg
>> diff --git a/board/coolpi/coolpi-4b/readme.txt 
>> b/board/coolpi/coolpi-4b/readme.txt
>> new file mode 100644
>> index 0000000000..7896de50a2
>> --- /dev/null
>> +++ b/board/coolpi/coolpi-4b/readme.txt
>> @@ -0,0 +1,66 @@
>> +Cool Pi 4B
>> +==============
>> +https://cool-pi.com/topic/145/coolpi-4b-hardware-info
>> +
>> +Build:
>> +======
>> +  $ make coolpi_4b_defconfig
>> +  $ make
>> +
>> +Files created in output directory
>> +=================================
>> +
>> +output/images
>> +.
>> +output/images/
>> +├── boot.vfat
>> +├── extlinux
>> +│   └── extlinux.conf
>> +├── Image
>> +├── Image.gz
>> +├── rk3588_bl31_v1.40.elf
>> +├── rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v1.12.bin
>> +├── rk3588s-coolpi-4b.dtb
>> +├── rootfs.ext2
>> +├── rootfs.ext4 -> rootfs.ext2
>> +├── rootfs.tar
>> +├── sdcard.img
>> +├── u-boot.bin
>> +└── u-boot-rockchip.bin
>> +
>> +Creating bootable SD card:
>> +==========================
>> +
>> +Simply invoke (as root)
>> +
>> +sudo dd if=output/images/sdcard.img of=/dev/sdX && sync
>> +
>> +Where X is your SD card device.
>> +
>> +Booting:
>> +========
>> +
>> +Serial console:
>> +---------------
>> +The Cool Pi 4B has a 40-pin GPIO header.
>> +
>> +The Uart pins are as follows:
>> +
>> +pin 6:  gnd
>> +pin 8:  tx
>> +pin 10: rx
>> +
>> +Baudrate for this board is 1500000.
>> +
>> +Login:
>> +------
>> +Enter 'root' as login user, and the prompt is ready.
>> +
>> +Network:
>> +WIFI:     Cool Pi 4B has a aic8800 sdio wifi on board, but
>> +          aic8800 is not supported by linux mainine yet.
>> +Ethernet: A RJ-45 interface drivered by PCIE Realtek Ethernet adapter 
>> R8169.
>> +          So we can login it by ssh: ssh root@172.16.12.166
>
>If openssh is removed from the defconfig, this comment
>should be removed too.
>
>> +          Remember to replace you own ip addres on this board.
>> +
>> +Eanble Wayland Desktop: weston --backend=drm-backend.so -i 0
>
>Same comment for weston.
>
>> diff --git a/board/coolpi/coolpi-4b/rootfs_overlay/etc/fstab 
>> b/board/coolpi/coolpi-4b/rootfs_overlay/etc/fstab
>> new file mode 100644
>> index 0000000000..120a1cec02
>> --- /dev/null
>> +++ b/board/coolpi/coolpi-4b/rootfs_overlay/etc/fstab
>
>The fstab can be removed. The default Buildroot skeleton provides
>a minimal fstab.
>
>> diff --git a/board/coolpi/coolpi-4b/rootfs_overlay/etc/profile 
>> b/board/coolpi/coolpi-4b/rootfs_overlay/etc/profile
>> new file mode 100644
>> index 0000000000..4ed68310af
>> --- /dev/null
>> +++ b/board/coolpi/coolpi-4b/rootfs_overlay/etc/profile
>
>This profile customization can also be removed.
>
>> diff --git a/board/coolpi/coolpi-4b/rootfs_overlay/etc/ssh/sshd_config 
>> b/board/coolpi/coolpi-4b/rootfs_overlay/etc/ssh/sshd_config
>> new file mode 100644
>> index 0000000000..87faf28884
>> --- /dev/null
>> +++ b/board/coolpi/coolpi-4b/rootfs_overlay/etc/ssh/sshd_config
>
>This sshd_config can also be removed, since openssh will be removed.
>
>> diff --git a/configs/coolpi_4b_defconfig b/configs/coolpi_4b_defconfig
>> new file mode 100644
>> index 0000000000..f4e0cd4bea
>> --- /dev/null
>> +++ b/configs/coolpi_4b_defconfig
>> @@ -0,0 +1,78 @@
>> +BR2_aarch64=y
>> +BR2_cortex_a76_a55=y
>
>The defconfigs should define a specific Kernel version.
>You introduced this board DTS in Kernel v6.8, in:
>https://web.git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3f5d336d64d634426b8733848d840ceb8fe96610
>
>So I recommend to select the latest lts kernel, for example
>v6.12.21. Then, you should have a config line:
>
>BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_12=y
>
>> +BR2_TOOLCHAIN_BUILDROOT_CXX=y
>
>With the extra packages removed, I think this
>BR2_TOOLCHAIN_BUILDROOT_CXX is no longer needed and can be removed.
>
>> +BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
>> +BR2_TARGET_GENERIC_HOSTNAME="coolpi"
>> +BR2_TARGET_GENERIC_ISSUE="Welcome to the CoolPi 4B"
>> +BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y
>
>With weston and other package removed, I think
>BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y can be removed too.
>
>> +BR2_SYSTEM_DHCP="enP4p65s0"
>> +BR2_ROOTFS_OVERLAY="board/coolpi/coolpi-4b/rootfs_overlay"
>
>If all the customization are removed, then the BR2_ROOTFS_OVERLAY
>can be removed too.
>
>> +BR2_ROOTFS_POST_IMAGE_SCRIPT="board/coolpi/coolpi-4b/post-image.sh"
>> +BR2_LINUX_KERNEL=y
>
>And also here, you should also set a specific kernel version:
>
>BR2_LINUX_KERNEL_CUSTOM_VERSION=y
>BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.21"
>
>Note that, since you selected BR2_DOWNLOAD_FORCE_CHECK_HASHES=y
>you will need to add custom hash files.
>
>See:
>https://buildroot.org/downloads/manual/manual.html#_adding_project_specific_patches_and_hashes
>
>See also an example commit just enabling hashes:
>https://gitlab.com/buildroot.org/buildroot/-/commit/4ca8f0ea762061ad04016d065f37e0c351d578f1
>
>> +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
>> +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/coolpi/coolpi-4b/linux.fragment"
>> +BR2_LINUX_KERNEL_DTS_SUPPORT=y
>> +BR2_LINUX_KERNEL_INTREE_DTS_NAME="rockchip/rk3588s-coolpi-4b"
>> +BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT=y
>
>Below, the packages should be removed:
>gstreamer, glmark2, igt-gpu-tools, kmscube, mesa3d-demos, mesa3d and 
>weston.
>Remove from here...
>
>> +BR2_PACKAGE_GSTREAMER1=y
>> +BR2_PACKAGE_GST1_PLUGINS_BASE_INSTALL_TOOLS=y
>> +BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_APP=y
>> +BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEOTESTSRC=y
>> +BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_VIDEORATE=y
>> +BR2_PACKAGE_GST1_PLUGINS_BASE_LIB_OPENGL=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAYER2RGB_NEON=y
>> +BR2_PACKAGE_GST1_PLUGINS_GOOD=y
>> +BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_AUTODETECT=y
>> +BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_DEINTERLACE=y
>> +BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_V4L2=y
>> +BR2_PACKAGE_GST1_PLUGINS_GOOD_PLUGIN_V4L2_PROBE=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_AUTOCONVERT=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_CODECALPHA=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_DEBUGUTILS=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_INTERLACE=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_MPEGDEMUX=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_MPEGTSDEMUX=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_MPEGTSMUX=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_MPEGPSMUX=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_VIDEOFILTERS=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_VIDEOPARSERS=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_VIDEOSIGNAL=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_KMS=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_V4L2CODECS=y
>> +BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_X265=y
>> +BR2_PACKAGE_GST1_LIBAV=y
>> +BR2_PACKAGE_GLMARK2=y
>> +BR2_PACKAGE_IGT_GPU_TOOLS=y
>> +BR2_PACKAGE_KMSCUBE=y
>> +BR2_PACKAGE_MESA3D_DEMOS=y
>> +BR2_PACKAGE_MESA3D=y
>> +BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_PANFROST=y
>> +BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_SOFTPIPE=y
>> +BR2_PACKAGE_MESA3D_OPENGL_EGL=y
>> +BR2_PACKAGE_MESA3D_OPENGL_ES=y
>> +BR2_PACKAGE_WESTON=y
>> +BR2_PACKAGE_WESTON_SIMPLE_CLIENTS=y
>> +BR2_PACKAGE_WESTON_DEMO_CLIENTS=y
>
>...to here.
>
>> +BR2_PACKAGE_LINUX_FIRMWARE=y
>> +BR2_PACKAGE_LINUX_FIRMWARE_RTL_8169=y
>> +BR2_PACKAGE_LINUX_FIRMWARE_ARM_MALI_CSF=y
>> +BR2_PACKAGE_ROCKCHIP_RKBIN=y
>> +BR2_PACKAGE_ROCKCHIP_RKBIN_TPL_FILENAME="bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v1.12.bin"
>> +BR2_PACKAGE_ROCKCHIP_RKBIN_BL31_FILENAME="bin/rk35/rk3588_bl31_v1.40.elf"
>
>Below, libdrm and openssh should be removed. From here...
>
>> +BR2_PACKAGE_LIBDRM_INSTALL_TESTS=y
>> +BR2_PACKAGE_OPENSSH=y
>
>...to here.
>
>> +BR2_TARGET_ROOTFS_EXT2=y
>> +BR2_TARGET_ROOTFS_EXT2_4=y
>> +BR2_TARGET_ROOTFS_EXT2_SIZE="512M"
>
>With the removal of the packages, you can reduce the filesystem
>size, if you want.
>
>> +BR2_TARGET_UBOOT=y
>
>Same comment for U-Boot as for the Kernel. The defconfig should define a
>specific version. Since you introduced this board support upstream in
>version v2024.07 in:
>https://source.denx.de/u-boot/u-boot/-/commit/341f13e469063d3b8d0316f36c0d4836c74e1ac1
>
>I recommend you add here:
>
>BR2_TARGET_UBOOT_CUSTOM_VERSION=y
>BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2025.01"
>
>The custom hashes should also be added.
>
>> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="coolpi-4b-rk3588s"
>> +BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
>> +BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS=y
>> +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
>> +BR2_TARGET_UBOOT_NEEDS_ROCKCHIP_RKBIN=y
>> +BR2_PACKAGE_HOST_DOSFSTOOLS=y
>> +BR2_PACKAGE_HOST_GENIMAGE=y
>> +BR2_PACKAGE_HOST_MTOOLS=y
>> +BR2_PACKAGE_HOST_PYTHON3=y
>
>This config BR2_PACKAGE_HOST_PYTHON3=y can be removed. None of the post
>build script are using python. If a package needs python, it will pull
>the dependency. If the kernel needs python3, then the configuration
>should be BR2_LINUX_KERNEL_NEEDS_HOST_PYTHON3=y (there is optimizations
>to skip the compilation of host-python3 if a host version is usable).
>
>> +BR2_PACKAGE_HOST_UBOOT_TOOLS=y
>
>Could you send an updated patch addressing those comments, please?
>
>Best regards,
>
>Julien.
>_______________________________________________
>buildroot mailing list
>buildroot@buildroot.org
>https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2025-03-31  7:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-30  8:04 [Buildroot] [PATCH] configs/coolpi_4b: new defconfig Andy Yan
2025-03-30 10:31 ` Julien Olivain
2025-03-31  7:14   ` Andy Yan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6f3de205.733b.195eb0d28f6.Coremail.andyshrk@163.com \
    --to=andyshrk@163.com \
    --cc=buildroot@buildroot.org \
    --cc=ju.o@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox