Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] configs/coolpi_4b: new defconfig
@ 2025-03-30  8:04 Andy Yan
  2025-03-30 10:31 ` Julien Olivain
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Yan @ 2025-03-30  8:04 UTC (permalink / raw)
  To: buildroot; +Cc: Andy Yan

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.

[0]https://www.cool-pi.com/product/cp4b/

Signed-off-by: Andy Yan <andyshrk@163.com>
---
 board/coolpi/coolpi-4b/extlinux.conf          |   4 +
 board/coolpi/coolpi-4b/genimage.cfg           |  35 ++++++
 board/coolpi/coolpi-4b/linux.fragment         |   2 +
 board/coolpi/coolpi-4b/post-image.sh          |   7 ++
 board/coolpi/coolpi-4b/readme.txt             |  66 ++++++++++
 .../coolpi/coolpi-4b/rootfs_overlay/etc/fstab |  10 ++
 .../coolpi-4b/rootfs_overlay/etc/profile      |  21 ++++
 .../rootfs_overlay/etc/ssh/sshd_config        | 117 ++++++++++++++++++
 configs/coolpi_4b_defconfig                   |  78 ++++++++++++
 9 files changed, 340 insertions(+)
 create mode 100644 board/coolpi/coolpi-4b/extlinux.conf
 create mode 100644 board/coolpi/coolpi-4b/genimage.cfg
 create mode 100644 board/coolpi/coolpi-4b/linux.fragment
 create mode 100755 board/coolpi/coolpi-4b/post-image.sh
 create mode 100644 board/coolpi/coolpi-4b/readme.txt
 create mode 100644 board/coolpi/coolpi-4b/rootfs_overlay/etc/fstab
 create mode 100644 board/coolpi/coolpi-4b/rootfs_overlay/etc/profile
 create mode 100644 board/coolpi/coolpi-4b/rootfs_overlay/etc/ssh/sshd_config
 create mode 100644 configs/coolpi_4b_defconfig

diff --git a/board/coolpi/coolpi-4b/extlinux.conf b/board/coolpi/coolpi-4b/extlinux.conf
new file mode 100644
index 0000000000..466ab1eed6
--- /dev/null
+++ b/board/coolpi/coolpi-4b/extlinux.conf
@@ -0,0 +1,4 @@
+label coolpi-4b-buildroot
+  kernel /Image.gz
+  devicetree /rk3588s-coolpi-4b.dtb
+  append root=/dev/mmcblk1p2 rw rootfstype=ext4 earlycon earlyprintk console=ttyS2,1500000n8 rootwait
diff --git a/board/coolpi/coolpi-4b/genimage.cfg b/board/coolpi/coolpi-4b/genimage.cfg
new file mode 100644
index 0000000000..826d899c95
--- /dev/null
+++ b/board/coolpi/coolpi-4b/genimage.cfg
@@ -0,0 +1,35 @@
+# SD card image for Cool PI 4b
+
+image boot.vfat {
+	vfat {
+		files = {
+			"Image.gz",
+			"rk3588s-coolpi-4b.dtb",
+			"extlinux"
+		}
+	}
+	size = 32M
+}
+
+image sdcard.img {
+	hdimage {
+		partition-table-type = "hybrid"
+	}
+
+	partition uboot {
+		in-partition-table = "false"
+		image = "u-boot-rockchip.bin"
+		offset = 32K
+	}
+
+	partition boot {
+		partition-type = "0xC"
+		bootable = "true"
+		image = "boot.vfat"
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext2"
+	}
+}
diff --git a/board/coolpi/coolpi-4b/linux.fragment b/board/coolpi/coolpi-4b/linux.fragment
new file mode 100644
index 0000000000..17f8276182
--- /dev/null
+++ b/board/coolpi/coolpi-4b/linux.fragment
@@ -0,0 +1,2 @@
+CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY=y
+CONFIG_R8169=y
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
+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
+          Remember to replace you own ip addres on this board.
+
+Eanble Wayland Desktop: weston --backend=drm-backend.so -i 0
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
@@ -0,0 +1,10 @@
+# <file system>	<mount pt>	<type>	<options>	<dump>	<pass>
+/dev/root	/		ext2	rw,noauto	0	1
+proc		/proc		proc	defaults	0	0
+devpts		/dev/pts	devpts	defaults,gid=5,mode=620,ptmxmode=0666	0	0
+tmpfs		/dev/shm	tmpfs	mode=0777	0	0
+tmpfs		/tmp		tmpfs	mode=1777	0	0
+tmpfs		/run		tmpfs	mode=0755,nosuid,nodev	0	0
+sysfs		/sys		sysfs	defaults	0	0
+debug           /sys/kernel/debug debugfs         defaults                0       0
+
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
@@ -0,0 +1,21 @@
+export PATH="/bin:/sbin:/usr/bin:/usr/sbin"
+
+if [ "$PS1" ]; then
+	if [ "`id -u`" -eq 0 ]; then
+		export PS1='# '
+	else
+		export PS1='$ '
+	fi
+fi
+
+export EDITOR='/bin/vi'
+
+# Source configuration files from /etc/profile.d
+for i in /etc/profile.d/*.sh ; do
+	if [ -r "$i" ]; then
+		. $i
+	fi
+done
+unset i
+export XDG_RUNTIME_DIR=/tmp
+export WAYLAND_DISPLAY=wayland-1
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
@@ -0,0 +1,117 @@
+#	$OpenBSD: sshd_config,v 1.104 2021/07/02 05:11:21 dtucker Exp $
+
+# This is the sshd server system-wide configuration file.  See
+# sshd_config(5) for more information.
+
+# This sshd was compiled with PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+# The strategy used for options in the default sshd_config shipped with
+# OpenSSH is to specify options with their default value where
+# possible, but leave them commented.  Uncommented options override the
+# default value.
+
+#Port 22
+#AddressFamily any
+#ListenAddress 0.0.0.0
+#ListenAddress ::
+
+#HostKey /etc/ssh/ssh_host_rsa_key
+#HostKey /etc/ssh/ssh_host_ecdsa_key
+#HostKey /etc/ssh/ssh_host_ed25519_key
+
+# Ciphers and keying
+#RekeyLimit default none
+
+# Logging
+#SyslogFacility AUTH
+#LogLevel INFO
+
+# Authentication:
+
+#LoginGraceTime 2m
+#PermitRootLogin prohibit-password
+PermitRootLogin yes
+#StrictModes yes
+#MaxAuthTries 6
+#MaxSessions 10
+
+#PubkeyAuthentication yes
+
+# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
+# but this is overridden so installations will only check .ssh/authorized_keys
+AuthorizedKeysFile	.ssh/authorized_keys
+
+#AuthorizedPrincipalsFile none
+
+#AuthorizedKeysCommand none
+#AuthorizedKeysCommandUser nobody
+
+# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
+#HostbasedAuthentication no
+# Change to yes if you don't trust ~/.ssh/known_hosts for
+# HostbasedAuthentication
+#IgnoreUserKnownHosts no
+# Don't read the user's ~/.rhosts and ~/.shosts files
+#IgnoreRhosts yes
+
+# To disable tunneled clear text passwords, change to no here!
+#PasswordAuthentication yes
+PermitEmptyPasswords yes
+
+# Change to no to disable s/key passwords
+#KbdInteractiveAuthentication yes
+
+# Kerberos options
+#KerberosAuthentication no
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+#KerberosGetAFSToken no
+
+# GSSAPI options
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the KbdInteractiveAuthentication and
+# PasswordAuthentication.  Depending on your PAM configuration,
+# PAM authentication via KbdInteractiveAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and KbdInteractiveAuthentication to 'no'.
+#UsePAM no
+
+#AllowAgentForwarding yes
+#AllowTcpForwarding yes
+#GatewayPorts no
+#X11Forwarding no
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+#PermitTTY yes
+#PrintMotd yes
+#PrintLastLog yes
+#TCPKeepAlive yes
+#PermitUserEnvironment no
+#Compression delayed
+#ClientAliveInterval 0
+#ClientAliveCountMax 3
+#UseDNS no
+#PidFile /var/run/sshd.pid
+#MaxStartups 10:30:100
+#PermitTunnel no
+#ChrootDirectory none
+#VersionAddendum none
+
+# no default banner path
+#Banner none
+
+# override default of no subsystems
+Subsystem	sftp	/usr/libexec/sftp-server
+
+# Example of overriding settings on a per-user basis
+#Match User anoncvs
+#	X11Forwarding no
+#	AllowTcpForwarding no
+#	PermitTTY no
+#	ForceCommand cvs server
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
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+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
+BR2_SYSTEM_DHCP="enP4p65s0"
+BR2_ROOTFS_OVERLAY="board/coolpi/coolpi-4b/rootfs_overlay"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/coolpi/coolpi-4b/post-image.sh"
+BR2_LINUX_KERNEL=y
+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
+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
+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"
+BR2_PACKAGE_LIBDRM_INSTALL_TESTS=y
+BR2_PACKAGE_OPENSSH=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="512M"
+BR2_TARGET_UBOOT=y
+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
+BR2_PACKAGE_HOST_UBOOT_TOOLS=y
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-31  7:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox