All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] configs/friendlyarm_nanopi_r2s: new defconfig
@ 2022-01-15 20:26 Gilles Talis
  2022-01-26 20:57 ` Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Gilles Talis @ 2022-01-15 20:26 UTC (permalink / raw)
  To: buildroot; +Cc: Gilles Talis

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 <gilles.talis@gmail.com>
---
 DEVELOPERS                                 |  2 +
 board/friendlyarm/nanopi-r2s/extlinux.conf |  4 ++
 board/friendlyarm/nanopi-r2s/genimage.cfg  | 22 +++++++++
 board/friendlyarm/nanopi-r2s/post-build.sh |  5 ++
 board/friendlyarm/nanopi-r2s/readme.txt    | 57 ++++++++++++++++++++++
 configs/friendlyarm_nanopi_r2s_defconfig   | 34 +++++++++++++
 6 files changed, 124 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 a91e2dfcde..ca52c0cff2 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1073,7 +1073,9 @@ F:	configs/qemu_*
 
 N:	Gilles Talis <gilles.talis@gmail.com>
 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..1ea0cdd8a5
--- /dev/null
+++ b/board/friendlyarm/nanopi-r2s/extlinux.conf
@@ -0,0 +1,4 @@
+label NanoPi R2S linux
+  kernel /boot/Image
+  devicetree /boot/rk3328-nanopi-r2s.dtb
+  append root=/dev/mmcblk0p1 rw rootwait
diff --git a/board/friendlyarm/nanopi-r2s/genimage.cfg b/board/friendlyarm/nanopi-r2s/genimage.cfg
new file mode 100644
index 0000000000..a686b4f14e
--- /dev/null
+++ b/board/friendlyarm/nanopi-r2s/genimage.cfg
@@ -0,0 +1,22 @@
+image sdcard.img {
+	hdimage {
+	}
+
+	partition u-boot-tpl-spl-dtb {
+		in-partition-table = "no"
+		image = "idbloader.img"
+		offset = 32K
+	}
+
+	partition u-boot-dtb {
+		in-partition-table = "no"
+		image = "u-boot.itb"
+		offset = 8M
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		offset = 16M
+		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..1f5ff6a611
--- /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 $TARGET_DIR/boot/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..a167a39898
--- /dev/null
+++ b/configs/friendlyarm_nanopi_r2s_defconfig
@@ -0,0 +1,34 @@
+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_INSTALL_TARGET=y
+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
-- 
2.32.0

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

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

* Re: [Buildroot] [PATCH v2] configs/friendlyarm_nanopi_r2s: new defconfig
  2022-01-15 20:26 [Buildroot] [PATCH v2] configs/friendlyarm_nanopi_r2s: new defconfig Gilles Talis
@ 2022-01-26 20:57 ` Thomas Petazzoni
  2022-01-30  9:58   ` Gilles Talis
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2022-01-26 20:57 UTC (permalink / raw)
  To: Gilles Talis; +Cc: buildroot

Hello Gilles,

On Sat, 15 Jan 2022 21:26:17 +0100
Gilles Talis <gilles.talis@gmail.com> wrote:

> +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_INSTALL_TARGET=y
> +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

Thanks for this v2. Unfortunately, there is one thing I did not notice
when reviewing v1: you should use fixed versions of the Linux kernel,
U-Boot and TF-A. Here your defconfig uses whatever is the latest, which
is not the policy we have chosen for our defconfigs.

Could you fix that up by using fixed versions?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2] configs/friendlyarm_nanopi_r2s: new defconfig
  2022-01-26 20:57 ` Thomas Petazzoni
@ 2022-01-30  9:58   ` Gilles Talis
  0 siblings, 0 replies; 3+ messages in thread
From: Gilles Talis @ 2022-01-30  9:58 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: buildroot

Hi Thomas,

thanks for the review.

Le mer. 26 janv. 2022 à 21:57, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> a écrit :
>
> Hello Gilles,
>
> On Sat, 15 Jan 2022 21:26:17 +0100
> Gilles Talis <gilles.talis@gmail.com> wrote:
>
> > +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_INSTALL_TARGET=y
> > +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
>
> Thanks for this v2. Unfortunately, there is one thing I did not notice
> when reviewing v1: you should use fixed versions of the Linux kernel,
> U-Boot and TF-A. Here your defconfig uses whatever is the latest, which
> is not the policy we have chosen for our defconfigs.
>
> Could you fix that up by using fixed versions?
Yes. Will send a v3 shortly.

>
> Thanks a lot!
>
> Thomas
> --
> Thomas Petazzoni, co-owner and CEO, Bootlin
> Embedded Linux and Kernel engineering and training
> https://bootlin.com
Thanks!
Gilles.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2022-01-30  9:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-15 20:26 [Buildroot] [PATCH v2] configs/friendlyarm_nanopi_r2s: new defconfig Gilles Talis
2022-01-26 20:57 ` Thomas Petazzoni
2022-01-30  9:58   ` Gilles Talis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.