From patchwork Sun Oct 24 11:39:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gilles Talis X-Patchwork-Id: 1545376 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=P86C4R++; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HcbjN4PQpz9sR4 for ; Sun, 24 Oct 2021 22:39:52 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 9816980E65; Sun, 24 Oct 2021 11:39:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gapdw7gEhGL2; Sun, 24 Oct 2021 11:39:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id C407A80E60; Sun, 24 Oct 2021 11:39:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id F321C1BF406 for ; Sun, 24 Oct 2021 11:39:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E31A380E5F for ; Sun, 24 Oct 2021 11:39:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C3sQfv8pbfmV for ; Sun, 24 Oct 2021 11:39:44 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by smtp1.osuosl.org (Postfix) with ESMTPS id D1D0E80E4C for ; Sun, 24 Oct 2021 11:39:43 +0000 (UTC) Received: by mail-ed1-x535.google.com with SMTP id l13so9493076edi.8 for ; Sun, 24 Oct 2021 04:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pPQmQ/B3NBEMgZu4RqcYvQIioBUkS24/GO32OrNHkMA=; b=P86C4R++DS99Ekot5VQwatEMZoMEYqLF3EwuCk8lcnv5bHkWvfQbhoajI43THbBHQY pWGX5/Ak4MakQclXTIDjmEn9y6GU7OiIPkO5Sdh6AiFA85ba6LB8Ncevy5IdJG9PAM2m zrfkiGJMLjr1sglxNXc5UzPGQifK2Cy5/2dxdCCwSl2gIJJyQ9Iw1hYL6mWeZ0dujkF/ WMMWJJe8OClKvpk4DqvwvVLVU3x5v2c8B0uGX32Gl4xbtHG+RHKlNb2PlZiqg6mufVpH lwl3IauI7CBZQQvejcVxHNYJ5dpaeFfBK/saeA9OhQX0gssF/SgIj05eGxvVYxYlTbix wA6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pPQmQ/B3NBEMgZu4RqcYvQIioBUkS24/GO32OrNHkMA=; b=UciFnDgV6Ee7mcIlGYAEOt4fZnY0CE6ZtkSE59qHMvbwkX0nSzo1/UinsR766Ei8d9 B5VqfEHwuJEq1a9Of7bEzHKP8t7OQMX5sd5i+xlmQCB02PwCSrHQZllYOXy+aZMvIAP8 lyFhjlEzoOhJ1hNPsx3B5eSUyXwgHW79ylM8LxSty2SbETykmVdn3lXryK+ESP85fxk+ kW1pq7AHsAbpukOwk6tHk/7D0vNTDBZ3wLiykcTLNf7POHWlocW6lzCROv2D/lw6NJK6 GDZ+6XSVg5gN6Z0VRVrPg1iPCUnYPZjBXNcwwb/4deEhs3sjDOD9ue/0wtBIxf/kBhGC FT+Q== X-Gm-Message-State: AOAM5335kcQylci+w5A6fJ+tOYwqTlc4SJnHWJ+4UKp8NYuPi+uqZSID CAhKNqiknsvCKGx6sKYsOewbRx5n7uk= X-Google-Smtp-Source: ABdhPJznmUw0CrYeo6EXT4J/1JOP9SqwNO8Hs+VqUbDD6hZzrdJHuhwOykQh3lAH2hZ19OCJsdam3g== X-Received: by 2002:a05:6402:270b:: with SMTP id y11mr17633109edd.116.1635075581682; Sun, 24 Oct 2021 04:39:41 -0700 (PDT) Received: from localhost.localdomain (138.23.87.79.rev.sfr.net. [79.87.23.138]) by smtp.gmail.com with ESMTPSA id f18sm5144587edd.69.2021.10.24.04.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Oct 2021 04:39:41 -0700 (PDT) From: Gilles Talis To: buildroot@buildroot.org Date: Sun, 24 Oct 2021 13:39:31 +0200 Message-Id: <20211024113931.88898-1-gilles.talis@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] configs/friendlyarm_nanopi_r2s: new defconfig 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: Gilles Talis Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" The NanoPi R2S is a FriendlyElec mini-router based on: - Rockchip RK3328 SoC - 1GB (or 2GB) DDR4 RAM - Gigabit Ethernet (WAN) - Gigabit Ethernet (USB3) (LAN) - USB 2.0 Host Port - MicroSD slot - Reset button - WAN - LAN - SYS LED https://www.friendlyarm.com/index.php?route=product/product&path=69&product_id=282 Signed-off-by: Gilles Talis --- DEVELOPERS | 2 + board/friendlyarm/nanopi-r2s/extlinux.conf | 4 ++ board/friendlyarm/nanopi-r2s/genimage.cfg | 39 +++++++++++++++ board/friendlyarm/nanopi-r2s/post-build.sh | 5 ++ board/friendlyarm/nanopi-r2s/readme.txt | 57 ++++++++++++++++++++++ configs/friendlyarm_nanopi_r2s_defconfig | 33 +++++++++++++ 6 files changed, 140 insertions(+) create mode 100644 board/friendlyarm/nanopi-r2s/extlinux.conf create mode 100644 board/friendlyarm/nanopi-r2s/genimage.cfg create mode 100755 board/friendlyarm/nanopi-r2s/post-build.sh create mode 100644 board/friendlyarm/nanopi-r2s/readme.txt create mode 100644 configs/friendlyarm_nanopi_r2s_defconfig diff --git a/DEVELOPERS b/DEVELOPERS index f864f7ef47..bf9b0abd89 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1032,7 +1032,9 @@ F: configs/qemu_* N: Gilles Talis F: board/freescale/imx8mmevk/ +F: board/friendlyarm/nanopi-r2s/ F: configs/freescale_imx8mmevk_defconfig +F: configs/friendlyarm_nanopi_r2s_defconfig F: package/cctz/ F: package/faad2/ F: package/fdk-aac/ diff --git a/board/friendlyarm/nanopi-r2s/extlinux.conf b/board/friendlyarm/nanopi-r2s/extlinux.conf new file mode 100644 index 0000000000..8fccf0419b --- /dev/null +++ b/board/friendlyarm/nanopi-r2s/extlinux.conf @@ -0,0 +1,4 @@ +label NanoPi R2S linux + kernel /Image + devicetree /rk3328-nanopi-r2s.dtb + append root=/dev/mmcblk0p4 rw rootwait diff --git a/board/friendlyarm/nanopi-r2s/genimage.cfg b/board/friendlyarm/nanopi-r2s/genimage.cfg new file mode 100644 index 0000000000..4280039ab8 --- /dev/null +++ b/board/friendlyarm/nanopi-r2s/genimage.cfg @@ -0,0 +1,39 @@ +image boot.vfat { + vfat { + files = { + "Image", + "rk3328-nanopi-r2s.dtb", + "extlinux" + } + } + size = 64M +} + +image sdcard.img { + + hdimage { + gpt = true + } + + partition loader1 { + image = "idbloader.img" + offset = 32K + } + + partition loader2 { + image = "u-boot.itb" + offset = 8M + } + + partition boot { + partition-type = 0xC + bootable = "true" + image = "boot.vfat" + offset = 16M + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext4" + } +} diff --git a/board/friendlyarm/nanopi-r2s/post-build.sh b/board/friendlyarm/nanopi-r2s/post-build.sh new file mode 100755 index 0000000000..ba29375c05 --- /dev/null +++ b/board/friendlyarm/nanopi-r2s/post-build.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +BOARD_DIR="$(dirname $0)" + +install -m 0644 -D $BOARD_DIR/extlinux.conf $BINARIES_DIR/extlinux/extlinux.conf diff --git a/board/friendlyarm/nanopi-r2s/readme.txt b/board/friendlyarm/nanopi-r2s/readme.txt new file mode 100644 index 0000000000..6d291cdd60 --- /dev/null +++ b/board/friendlyarm/nanopi-r2s/readme.txt @@ -0,0 +1,57 @@ +Intro +===== + +This default configuration will allow you to start experimenting with the +buildroot environment for the Nanopi R2S. With the current configuration +it will bring-up the board, and allow access through the serial console. + +Nanopi R2S link: +https://www.friendlyarm.com/index.php?route=product/product&path=69&product_id=282 + +This configuration uses ATF, U-Boot mainline and kernel mainline. + +How to build +============ + + $ make friendlyarm_nanopi_r2s_defconfig + $ make + +Note: you will need access to the internet to download the required +sources. + +Files created in output directory +================================= + +output/images + +├── bl31.elf +├── boot.vfat +├── extlinux +├── idbloader.img +├── Image +├── rk3328-nanopi-r2s.dtb +├── rootfs.ext2 +├── rootfs.ext4 -> rootfs.ext2 +├── rootfs.tar +├── sdcard.img +├── u-boot.bin +└── u-boot.itb + +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 + $ sudo sync + +Insert the micro SDcard in your Nanopi R2S and power it up. The console +is on the serial line, 1500000 8N1. + +Notes +===== + +This configuration can also be used to drive the Friendlyarm Nanopi Neo3 board. diff --git a/configs/friendlyarm_nanopi_r2s_defconfig b/configs/friendlyarm_nanopi_r2s_defconfig new file mode 100644 index 0000000000..4f5102c9f4 --- /dev/null +++ b/configs/friendlyarm_nanopi_r2s_defconfig @@ -0,0 +1,33 @@ +BR2_aarch64=y +BR2_ARM_FPU_VFPV4=y +BR2_TARGET_GENERIC_HOSTNAME="rk3328-nanopi-r2s" +BR2_TARGET_GENERIC_ISSUE="Welcome to Nanopi R2S RK3328" +BR2_ROOTFS_POST_BUILD_SCRIPT="board/friendlyarm/nanopi-r2s/post-build.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" +BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/friendlyarm/nanopi-r2s/genimage.cfg" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="rockchip/rk3328-nanopi-r2s" +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="120M" +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="rk3328" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN=y +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="nanopi-r2s-rk3328" +BR2_TARGET_UBOOT_NEEDS_DTC=y +BR2_TARGET_UBOOT_NEEDS_PYTHON3=y +BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y +BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF=y +BR2_TARGET_UBOOT_FORMAT_CUSTOM=y +BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb" +BR2_TARGET_UBOOT_SPL=y +BR2_TARGET_UBOOT_SPL_NAME="idbloader.img" +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y +BR2_PACKAGE_HOST_UBOOT_TOOLS=y