From patchwork Thu Feb 22 13:07:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Fan X-Patchwork-Id: 1902779 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 4TgYMm27w6z23d2 for ; Fri, 23 Feb 2024 00:07:32 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 71EBF4089C; Thu, 22 Feb 2024 13:07:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S8low-j5IeP7; Thu, 22 Feb 2024 13:07:29 +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 60BF740A03 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 60BF740A03; Thu, 22 Feb 2024 13:07:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 99B961BF40B for ; Thu, 22 Feb 2024 13:07:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 8554C40441 for ; Thu, 22 Feb 2024 13:07:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Aof7srCNwCCw for ; Thu, 22 Feb 2024 13:07:27 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::12e; helo=mail-il1-x12e.google.com; envelope-from=fancp2007@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org D21EA418CB DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org D21EA418CB Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by smtp2.osuosl.org (Postfix) with ESMTPS id D21EA418CB for ; Thu, 22 Feb 2024 13:07:26 +0000 (UTC) Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-364f794f237so33020505ab.1 for ; Thu, 22 Feb 2024 05:07:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708607245; x=1709212045; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W/i1XUha5A2twaxrhHfZsiWRhfQJ2r/eRhd/d/VF9FU=; b=HTefq3fYuwvUsv0u4Fq50irjMOMe1jRspbXtmdz69rzckpaF6yMvr8U7fECIJ+EZXr 11IV5tVpbk4LiQ3Fdy1Z8djVezrftdo1zpFT/HE0bvgpICljqAlKu7U5g4EVRt1F7tzg +fuZ20TMGV4wPdMFfoh48CNk5tJOOvqWI4TD2imzmZKlT7LZZ27geqze73fC/Q6RnCmP RHA/rmH5xdwf9qk3Ao5d+D8C4AYmgIKNLaSqnG2UrxKnqbh3084hkgFg2/cQHN8KrPJI ILOcBDfVS9beCcK6MdOkEbY29ym9K39j6k+1GR6BI4rlkEeIbwuNZF5qwnYSq8uXjowP zLCg== X-Gm-Message-State: AOJu0YzzPZoCzZWJ8aQdFnehcWL03xAmTpZiNFeS5RGAUCMsmhm9x4PB UPZg6wRgfljAa55uYnixTtSG2w+dEa/KnsV7y6TXQWEWox98che6n/xivRME4Mg= X-Google-Smtp-Source: AGHT+IGgLP6i1xa4pyLkVdA3B7souG0BbENDn9KsRmZuHk4q1GMCc74xls93HjBwlX512r3Sv1m85A== X-Received: by 2002:a05:6e02:592:b0:363:d6be:c87e with SMTP id c18-20020a056e02059200b00363d6bec87emr19499149ils.27.1708607244465; Thu, 22 Feb 2024 05:07:24 -0800 (PST) Received: from localhost ([142.171.12.18]) by smtp.gmail.com with ESMTPSA id e24-20020a656898000000b005ce998b9391sm8980556pgt.67.2024.02.22.05.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 05:07:23 -0800 (PST) From: Scott Fan To: buildroot@buildroot.org Date: Thu, 22 Feb 2024 21:07:15 +0800 Message-Id: <20240222130716.1311432-1-fancp2007@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231208003746.9505-1-fancp2007@gmail.com> References: <20231208003746.9505-1-fancp2007@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708607245; x=1709212045; darn=buildroot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W/i1XUha5A2twaxrhHfZsiWRhfQJ2r/eRhd/d/VF9FU=; b=kMVHN6AO0H9XEDqK+j1Tsjf5gFwFDmdgimLg3u/DpIF6hPaGTAzh/oP1DaGuKEenPw MlG9VZdVmnjoEQfqEqAoH6wCrnZd8aM2XvFPjyxE9XjKShYfIO7FIQUkhyQgQOgqY2w3 siUyOV86E24BdwTOediCjh/Y5DCetsjdUtHW1fJia5hQH9ZDnXKKcwFQ4Y7blQ2ZFPFa bLDghupCjuzP+IJED9C4NBMz+HjGlC2QAuYX/waV+mUeHtwpxH+UICo3K3AfKxyyFKkE /Lt5Adsemj6uASYTb5ofur1/liT/nJVUFnyj3rRAOx9ZTISjDotZdt/cp3Id/8BwuqYs PSxA== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=kMVHN6AO Subject: [Buildroot] [PATCH v6] configs/friendlyarm_nanopi_neo2_defconfig: new board 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: giulio.benetti@benettiengineering.com, Scott Fan Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Add support for the FriendlyARM NanoPi NEO2 with mainline components: - U-Boot 2024.01 - Linux 6.6.17 Board's wiki page: - https://wiki.friendlyelec.com/wiki/index.php/NanoPi_NEO2 Signed-off-by: Scott Fan Reviewed-by: Giulio Benetti Tested-by: Giulio Benetti --- Changes v1 -> v2: - Fix issues from 'utils/docker-run make check-package' - Add atf custom version in the defconfig - No need for sudo to run sync Changes v2 -> v3: - Update patch file, add the upstream tag Changes v3 -> v4: - Use a single integrated image file (u-boot-sunxi-with-spl.bin) - Remove patch file for uboot, switch to binman - Merge boot partition into rootfs partition - Bump kernel version to 6.1.61 Changes v4 -> v5: - Bump kernel version to 6.1.65 Changes v5 -> v6: - Bump kernel version to 6.6.17 - Bump uboot version to 2024.01 - Add option BR2_TARGET_UBOOT_NEEDS_OPENSSL=y --- board/friendlyarm/nanopi-neo2/extlinux.conf | 4 ++ board/friendlyarm/nanopi-neo2/genimage.cfg | 16 +++++++ board/friendlyarm/nanopi-neo2/post-build.sh | 5 +++ board/friendlyarm/nanopi-neo2/readme.txt | 34 ++++++++++++++ configs/friendlyarm_nanopi_neo2_defconfig | 49 +++++++++++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 board/friendlyarm/nanopi-neo2/extlinux.conf create mode 100644 board/friendlyarm/nanopi-neo2/genimage.cfg create mode 100755 board/friendlyarm/nanopi-neo2/post-build.sh create mode 100644 board/friendlyarm/nanopi-neo2/readme.txt create mode 100644 configs/friendlyarm_nanopi_neo2_defconfig diff --git a/board/friendlyarm/nanopi-neo2/extlinux.conf b/board/friendlyarm/nanopi-neo2/extlinux.conf new file mode 100644 index 0000000000..482a069f74 --- /dev/null +++ b/board/friendlyarm/nanopi-neo2/extlinux.conf @@ -0,0 +1,4 @@ +label friendlyarm-nanopi-buildroot + kernel /boot/Image + devicetree /boot/sun50i-h5-nanopi-neo2.dtb + append console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p1 rootwait diff --git a/board/friendlyarm/nanopi-neo2/genimage.cfg b/board/friendlyarm/nanopi-neo2/genimage.cfg new file mode 100644 index 0000000000..67e4e5efdb --- /dev/null +++ b/board/friendlyarm/nanopi-neo2/genimage.cfg @@ -0,0 +1,16 @@ +image sdcard.img { + hdimage { + } + + partition u-boot-tpl-spl-dtb { + in-partition-table = "no" + image = "u-boot-sunxi-with-spl.bin" + offset = 8K + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + offset = 1M + } +} diff --git a/board/friendlyarm/nanopi-neo2/post-build.sh b/board/friendlyarm/nanopi-neo2/post-build.sh new file mode 100755 index 0000000000..c7ec875068 --- /dev/null +++ b/board/friendlyarm/nanopi-neo2/post-build.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +BOARD_DIR="$(dirname "$0")" + +install -m 0644 -D "${BOARD_DIR}/extlinux.conf" "${TARGET_DIR}/boot/extlinux/extlinux.conf" diff --git a/board/friendlyarm/nanopi-neo2/readme.txt b/board/friendlyarm/nanopi-neo2/readme.txt new file mode 100644 index 0000000000..c896a57525 --- /dev/null +++ b/board/friendlyarm/nanopi-neo2/readme.txt @@ -0,0 +1,34 @@ +Intro +===== + +This default configuration will allow you to start experimenting with the +buildroot environment for the NanoPi NEO2. With the current configuration +it will bring-up the board, and allow access through the serial console. + +Wiki link: +https://wiki.friendlyelec.com/wiki/index.php/NanoPi_NEO2 + +This configuration uses U-Boot mainline and kernel mainline. + +How to build +============ + + $ make friendlyarm_nanopi_neo2_defconfig + $ make + +Note: you will need access to the internet to download the required +sources. + +How to write the SD card +======================== + +Once the build process is finished you will have an image called "sdcard.img" +in the output/images/ directory. + +Copy the bootable "sdcard.img" onto an SD card with "dd": + + $ sudo dd if=output/images/sdcard.img of=/dev/sdX + $ sync + +Insert the micro SDcard in your NanoPi NEO2 and power it up. The console +is on the serial line, 115200 8N1. diff --git a/configs/friendlyarm_nanopi_neo2_defconfig b/configs/friendlyarm_nanopi_neo2_defconfig new file mode 100644 index 0000000000..a60aba06d9 --- /dev/null +++ b/configs/friendlyarm_nanopi_neo2_defconfig @@ -0,0 +1,49 @@ +BR2_aarch64=y +BR2_cortex_a53=y +BR2_ARM_FPU_VFPV4=y + +# Linux headers same as kernel, a 6.6 series +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y + +# Firmware +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.7" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="sun50i_a64" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y + +# Bootloader +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_VERSION=y +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2024.01" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="nanopi_neo2" +BR2_TARGET_UBOOT_NEEDS_DTC=y +BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y +BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y +BR2_TARGET_UBOOT_SPL=y +BR2_TARGET_UBOOT_SPL_NAME="u-boot-sunxi-with-spl.bin" +BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="SCP=/dev/null" + +# Kernel +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_VERSION=y +BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.17" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="allwinner/sun50i-h5-nanopi-neo2" +BR2_LINUX_KERNEL_INSTALL_TARGET=y +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y + +# Filesystem +BR2_TARGET_GENERIC_ISSUE="Welcome to FriendlyARM NanoPi NEO2" +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="120M" +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y +BR2_ROOTFS_POST_BUILD_SCRIPT="board/friendlyarm/nanopi-neo2/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/friendlyarm/nanopi-neo2/genimage.cfg"