All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5 00/10] Add RV64 NOMMU and Canaan K210 SoC support
@ 2021-10-26  7:17 Damien Le Moal
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 01/10] package: Makefile.in: fix elf2flt invocation options Damien Le Moal
                   ` (9 more replies)
  0 siblings, 10 replies; 28+ messages in thread
From: Damien Le Moal @ 2021-10-26  7:17 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Alistair Francis, Yann E . MORIN

This series adds support for building 64-bits RISC-V NOMMU kernel
bootable images for boards using the dual-core RISC-V 64-bits Cannan
Kendryte K210 SoC.

The first patch fixes invocation of elf2flt with NOMMU builds to fit the
requirements of RV64 builds. The second patch adds support for RV64 to
the elf2flt package. Patch 3 changes the base name of the toolchain
cross-compilation executables to avoid build errors. With these
preparatory patches in place, patch 4 makes MMU builds optional for
RISC-V 64-bits architecture.

The following 5 patches add default build configuration files for
various boards based on the Canaan K210 SoC: MAIX-bit, MAIX-go,
MAIX-dock (Dan Dock) and MAIXDUINO from Sipeed and the Canaan KD233
development board.

Finally, patch 10 documents how to build and install images for these
boards.

Changes from v4:
* Added patch 1 to address build options specification common to all
  packages.
* Removed busybox additional CFLAGS and LDFLAGS options from the
  busybox-tiny config file.

Changes from v3:
* Rebased on latest tree

Changes from v2:
* Reorder patches: former patch 1 is now patch 3.
* Clearly state in the first 3 patch commit messages that the NOMMU
  support introduced is for RISC-V 64-bits only and does not affect
  RV32.
* Modify patch 3 to allow NOMMU builds only for RV64 as opposed to both
  RV32 and RV64 before.
* Add reference to upstream elf2flt pull request in patch 1.
* Simplify the configurations for all boards, keeping default settings
  when a special value is not needed (e.g. gcc version).
* Dropped busybox-tiny-initramfs.config configuration and replaced it
  with a busybox fragment configuration file updating the default
  busybox-minimal.config configuration (used now for all boards).
* Changed common k210 rootfs overlay to replace the default /init script
  with a symbolic link pointing to the overlay provided /sbin/init
  script.

Changes from v1:
* Rebased on latest master
* Simplified patch 3 as suggested by Baruch
* Fixed typos in documentation (patch 9)
* Added reviewed-by tags

Christoph Hellwig (1):
  package/Makefile.in: Fix NOMMU RISC-V 64-bits toolchain base name

Damien Le Moal (9):
  package: Makefile.in: fix elf2flt invocation options
  package/elf2flt: add RISC-V 64-bits support
  arch/config: Make RISC-V 64-bits MMU optional
  board: Add Sipeed MAIX-bit support
  board: Add Sipeed MAIX-Go support
  board: Add Sipeed MAIXDUINO support
  board: Add Sipeed MAIX-Dock support
  board: Add Canaan KD233 support
  board: Document Canaan K210 based boards support

 arch/Config.in                                |   1 -
 arch/Config.in.riscv                          |   2 +
 board/canaan/k210-common/README.md            | 318 ++++++++++++++++++
 board/canaan/k210-common/busybox-tiny.config  | 241 +++++++++++++
 board/canaan/k210-common/rootfs_overlay/init  |   1 +
 .../k210-common/rootfs_overlay/sbin/init      |  27 ++
 board/canaan/kd233/README.md                  |   4 +
 board/canaan/kd233/linux-dtb.config           |   2 +
 board/sipeed/maix-bit/README.md               |   4 +
 board/sipeed/maix-bit/linux-dtb.config        |   2 +
 board/sipeed/maix-dock/README.md              |   4 +
 board/sipeed/maix-dock/linux-dtb.config       |   2 +
 board/sipeed/maix-go/README.md                |   4 +
 board/sipeed/maix-go/linux-dtb.config         |   2 +
 board/sipeed/maixduino/README.md              |   4 +
 board/sipeed/maixduino/linux-dtb.config       |   2 +
 configs/canaan_kd233_defconfig                |  14 +
 configs/canaan_kd233_sdcard_defconfig         |  13 +
 configs/sipeed_maix_bit_defconfig             |  14 +
 configs/sipeed_maix_bit_sdcard_defconfig      |  13 +
 configs/sipeed_maix_dock_defconfig            |  14 +
 configs/sipeed_maix_dock_sdcard_defconfig     |  13 +
 configs/sipeed_maix_go_defconfig              |  14 +
 configs/sipeed_maix_go_sdcard_defconfig       |  13 +
 configs/sipeed_maixduino_defconfig            |  14 +
 configs/sipeed_maixduino_sdcard_defconfig     |  13 +
 package/Makefile.in                           |  26 +-
 ...04-elf2flt-add-riscv-64-bits-support.patch | 137 ++++++++
 package/elf2flt/Config.in.host                |   2 +-
 29 files changed, 910 insertions(+), 10 deletions(-)
 create mode 100644 board/canaan/k210-common/README.md
 create mode 100644 board/canaan/k210-common/busybox-tiny.config
 create mode 120000 board/canaan/k210-common/rootfs_overlay/init
 create mode 100755 board/canaan/k210-common/rootfs_overlay/sbin/init
 create mode 100644 board/canaan/kd233/README.md
 create mode 100644 board/canaan/kd233/linux-dtb.config
 create mode 100644 board/sipeed/maix-bit/README.md
 create mode 100644 board/sipeed/maix-bit/linux-dtb.config
 create mode 100644 board/sipeed/maix-dock/README.md
 create mode 100644 board/sipeed/maix-dock/linux-dtb.config
 create mode 100644 board/sipeed/maix-go/README.md
 create mode 100644 board/sipeed/maix-go/linux-dtb.config
 create mode 100644 board/sipeed/maixduino/README.md
 create mode 100644 board/sipeed/maixduino/linux-dtb.config
 create mode 100644 configs/canaan_kd233_defconfig
 create mode 100644 configs/canaan_kd233_sdcard_defconfig
 create mode 100644 configs/sipeed_maix_bit_defconfig
 create mode 100644 configs/sipeed_maix_bit_sdcard_defconfig
 create mode 100644 configs/sipeed_maix_dock_defconfig
 create mode 100644 configs/sipeed_maix_dock_sdcard_defconfig
 create mode 100644 configs/sipeed_maix_go_defconfig
 create mode 100644 configs/sipeed_maix_go_sdcard_defconfig
 create mode 100644 configs/sipeed_maixduino_defconfig
 create mode 100644 configs/sipeed_maixduino_sdcard_defconfig
 create mode 100644 package/elf2flt/0004-elf2flt-add-riscv-64-bits-support.patch

-- 
2.31.1

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

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

* [Buildroot] [PATCH v5 01/10] package: Makefile.in: fix elf2flt invocation options
  2021-10-26  7:17 [Buildroot] [PATCH v5 00/10] Add RV64 NOMMU and Canaan K210 SoC support Damien Le Moal
@ 2021-10-26  7:17 ` Damien Le Moal
  2021-10-27 13:37   ` Peter Korsgaard
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 02/10] package/elf2flt: add RISC-V 64-bits support Damien Le Moal
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Damien Le Moal @ 2021-10-26  7:17 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Alistair Francis, Yann E . MORIN

When BR2_BINFMT_FLAT_ONE is selected, elf2flt must be invoked with the
"-r" option to ensure that a single contiguous binary image is created,
regardless of the architecture default image format implemented by
elf2flt.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 package/Makefile.in | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index 86db62ba5b..50ccd0f25d 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -178,13 +178,19 @@ TARGET_CXXFLAGS += -fno-dwarf2-cfi-asm
 endif
 
 ifeq ($(BR2_BINFMT_FLAT),y)
-TARGET_CFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\
-	-Wl$(comma)-elf2flt)
-TARGET_CXXFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\
-	-Wl$(comma)-elf2flt)
-TARGET_FCFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\
+ifeq ($(BR2_BINFMT_FLAT_ONE),y)
+ELF2FLT_FLAGS = $(if $($(PKG)_FLAT_STACKSIZE),\
+	-Wl$(comma)-elf2flt="-r -s$($(PKG)_FLAT_STACKSIZE)",\
+        -Wl$(comma)-elf2flt=-r)
+else
+ELF2FLT_FLAGS = $(if $($(PKG)_FLAT_STACKSIZE),\
+	-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),\
 	-Wl$(comma)-elf2flt)
-TARGET_LDFLAGS += $(if $($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt=-s$($(PKG)_FLAT_STACKSIZE),-Wl$(comma)-elf2flt)
+endif
+TARGET_CFLAGS += $(ELF2FLT_FLAGS)
+TARGET_CXXFLAGS += $(ELF2FLT_FLAGS)
+TARGET_FCFLAGS += $(ELF2FLT_FLAGS)
+TARGET_LDFLAGS += $(ELF2FLT_FLAGS)
 endif
 
 ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
-- 
2.31.1

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

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

* [Buildroot] [PATCH v5 02/10] package/elf2flt: add RISC-V 64-bits support
  2021-10-26  7:17 [Buildroot] [PATCH v5 00/10] Add RV64 NOMMU and Canaan K210 SoC support Damien Le Moal
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 01/10] package: Makefile.in: fix elf2flt invocation options Damien Le Moal
@ 2021-10-26  7:17 ` Damien Le Moal
  2021-10-27 13:38   ` Peter Korsgaard
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 03/10] package/Makefile.in: Fix NOMMU RISC-V 64-bits toolchain base name Damien Le Moal
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Damien Le Moal @ 2021-10-26  7:17 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Alistair Francis, Yann E . MORIN

Enable selecting elf2flt for RISC-V 64-bits no MMU builds and add
support for it in the form of an additional patch (upstream pull request
https://github.com/uclinux-dev/elf2flt/pull/22).

Also modify the package Makefile.in file to add the -fPIC option to
the target CFLAGS for RISC-V 64-bits no MMU builds.

This patch is based on initial work by Christoph Hellwig <hch@lst.de>.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 package/Makefile.in                           |   3 +
 ...04-elf2flt-add-riscv-64-bits-support.patch | 137 ++++++++++++++++++
 package/elf2flt/Config.in.host                |   2 +-
 3 files changed, 141 insertions(+), 1 deletion(-)
 create mode 100644 package/elf2flt/0004-elf2flt-add-riscv-64-bits-support.patch

diff --git a/package/Makefile.in b/package/Makefile.in
index 50ccd0f25d..04347d2d84 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -178,6 +178,9 @@ TARGET_CXXFLAGS += -fno-dwarf2-cfi-asm
 endif
 
 ifeq ($(BR2_BINFMT_FLAT),y)
+ifeq ($(BR2_RISCV_64),y)
+TARGET_CFLAGS += -fPIC
+endif
 ifeq ($(BR2_BINFMT_FLAT_ONE),y)
 ELF2FLT_FLAGS = $(if $($(PKG)_FLAT_STACKSIZE),\
 	-Wl$(comma)-elf2flt="-r -s$($(PKG)_FLAT_STACKSIZE)",\
diff --git a/package/elf2flt/0004-elf2flt-add-riscv-64-bits-support.patch b/package/elf2flt/0004-elf2flt-add-riscv-64-bits-support.patch
new file mode 100644
index 0000000000..4b00758446
--- /dev/null
+++ b/package/elf2flt/0004-elf2flt-add-riscv-64-bits-support.patch
@@ -0,0 +1,137 @@
+From 1dea576eac4289602adc4a37f48c80330bf82e63 Mon Sep 17 00:00:00 2001
+From: Damien Le Moal <damien.lemoal@wdc.com>
+Date: Wed, 9 Sep 2020 17:31:33 +0900
+Subject: [PATCH] elf2flt: add riscv 64-bits support
+
+Add support for riscv 64bits ISA by defining the relocation types
+R_RISCV_32_PCREL, R_RISCV_ADD32, R_RISCV_SUB32, R_RISCV_32 and
+R_RISCV_64. riscv64 support also needs the __global_pointer$ symbol to
+be defined right after the relocation tables in the data section.
+Furthermore, the .got and .got.plt sections must be reversed. These 2
+requirements are handled with runtime modifications of the default
+linker script using the append_sed() function.
+(1) For the .got.plt and .got sections order swap, append_sed() is used
+to rename "(.got.plt)" to "(.got.tmp)" and to rename "(.got)" to
+"(.got.plt)". A last call finalize the name swap by replacing
+"(.got.tmp)" with "(.got)"
+(2) For the global pointer synbol, a definition line starting with
+"RISCV_GP" is added. The "RISCV_GP" string is removed if the target CPU
+type is riscv64. The definition line is dropped for other CPU types.
+
+With these changes, buildroot/busybox builds and run on NOMMU
+systems with kernel 5.13. Tested on Canaan Kendryte K210 boards.
+
+This patch is based on earlier work by Christoph Hellwig <hch@lst.de>.
+
+Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
+---
+ elf2flt.c     | 23 +++++++++++++++++++++++
+ elf2flt.ld.in |  9 +++++----
+ ld-elf2flt.c  | 16 ++++++++++++++++
+ 3 files changed, 44 insertions(+), 4 deletions(-)
+
+diff --git a/elf2flt.c b/elf2flt.c
+index f87f1fc..dbce467 100644
+--- a/elf2flt.c
++++ b/elf2flt.c
+@@ -80,6 +80,8 @@ const char *elf2flt_progname;
+ #include <elf/v850.h>
+ #elif defined(TARGET_xtensa)
+ #include <elf/xtensa.h>
++#elif defined(TARGET_riscv64)
++#include <elf/riscv.h>
+ #endif
+ 
+ #if defined(__MINGW32__)
+@@ -122,6 +124,8 @@ const char *elf2flt_progname;
+ #define ARCH	"nios2"
+ #elif defined(TARGET_xtensa)
+ #define ARCH	"xtensa"
++#elif defined(TARGET_riscv64)
++#define ARCH	"riscv64"
+ #else
+ #error "Don't know how to support your CPU architecture??"
+ #endif
+@@ -797,6 +801,16 @@ output_relocs (
+ 					goto good_32bit_resolved_reloc;
+ 				default:
+ 					goto bad_resolved_reloc;
++#elif defined(TARGET_riscv64)
++				case R_RISCV_32_PCREL:
++				case R_RISCV_ADD32:
++				case R_RISCV_SUB32:
++					continue;
++				case R_RISCV_32:
++				case R_RISCV_64:
++					goto good_32bit_resolved_reloc;
++				default:
++					goto bad_resolved_reloc;
+ #else
+ 				default:
+ 					/* The default is to assume that the
+@@ -1806,6 +1820,15 @@ int main(int argc, char *argv[])
+   if (!load_to_ram && !pfile)
+     load_to_ram = 1;
+ 
++#if defined(TARGET_riscv64)
++  /*
++   * riscv only supports loading text and data contiguously.
++   * So fail if load_to_ram is false.
++   */
++  if (!load_to_ram)
++    fatal("Loading to RAM ('-r' option) is required");
++#endif
++
+   fname = argv[argc-1];
+ 
+   if (pfile) {
+diff --git a/elf2flt.ld.in b/elf2flt.ld.in
+index ec1fe6f..c0c44b8 100644
+--- a/elf2flt.ld.in
++++ b/elf2flt.ld.in
+@@ -70,10 +70,11 @@ W_RODAT		*(.gnu.linkonce.r*)
+ 		. = ALIGN(0x20) ;
+ 		LONG(-1)
+ 		. = ALIGN(0x20) ;
+-R_RODAT		*(.rodata)
+-R_RODAT		*(.rodata1)
+-R_RODAT		*(.rodata.*)
+-R_RODAT		*(.gnu.linkonce.r*)
++RISCV_GP:	__global_pointer$ = . + 0x800 ;
++R_RODAT 	*(.rodata)
++R_RODAT 	*(.rodata1)
++R_RODAT 	*(.rodata.*)
++R_RODAT 	*(.gnu.linkonce.r*)
+ 		*(.data)
+ 		*(.data1)
+ 		*(.data.*)
+diff --git a/ld-elf2flt.c b/ld-elf2flt.c
+index e5de506..31b565f 100644
+--- a/ld-elf2flt.c
++++ b/ld-elf2flt.c
+@@ -324,6 +324,22 @@ static int do_final_link(void)
+ 		append_option(&other_options, concat(got_offset, "=", buf, NULL));
+ 	}
+ 
++	if (streq(TARGET_CPU, "riscv64")) {
++		/*
++		 * The .got section must come before the .got.plt section
++		 * (gcc/ld bug ?).
++		 */
++		append_sed(&sed, "(.got.plt)", "(.got.tmp)");
++		append_sed(&sed, "(.got.plt)", "(.got)");
++		append_sed(&sed, "(.got.tmp)", "(.got.plt)");
++
++		/* The global pointer symbol is defined after the GOT. */
++		append_sed(&sed, "^RISCV_GP:", "");
++	} else {
++		/* Get rid of the global pointer definition. */
++		append_sed(&sed, "^RISCV_GP:", NULL);
++	}
++
+ 	/* Locate the default linker script, if we don't have one provided. */
+ 	if (!linker_script)
+ 		linker_script = concat(ldscriptpath, "/elf2flt.ld", NULL);
+-- 
+2.31.1
+
diff --git a/package/elf2flt/Config.in.host b/package/elf2flt/Config.in.host
index d6685a7ff6..2bab0095c2 100644
--- a/package/elf2flt/Config.in.host
+++ b/package/elf2flt/Config.in.host
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_HOST_ELF2FLT
 	bool "Enable elf2flt support?"
-	depends on BR2_arm || BR2_sh || BR2_sparc || BR2_xtensa
+	depends on BR2_arm || BR2_sh || BR2_sparc || BR2_xtensa || BR2_RISCV_64
 	depends on !BR2_USE_MMU
 	help
 	  uCLinux uses a Binary Flat format commonly known as BFLT. It
-- 
2.31.1

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

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

* [Buildroot] [PATCH v5 03/10] package/Makefile.in: Fix NOMMU RISC-V 64-bits toolchain base name
  2021-10-26  7:17 [Buildroot] [PATCH v5 00/10] Add RV64 NOMMU and Canaan K210 SoC support Damien Le Moal
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 01/10] package: Makefile.in: fix elf2flt invocation options Damien Le Moal
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 02/10] package/elf2flt: add RISC-V 64-bits support Damien Le Moal
@ 2021-10-26  7:17 ` Damien Le Moal
  2021-10-27  3:26   ` Alistair Francis
  2021-10-27 13:38   ` Peter Korsgaard
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 04/10] arch/config: Make RISC-V 64-bits MMU optional Damien Le Moal
                   ` (6 subsequent siblings)
  9 siblings, 2 replies; 28+ messages in thread
From: Damien Le Moal @ 2021-10-26  7:17 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Alistair Francis, Yann E . MORIN

From: Christoph Hellwig <hch@lst.de>

Using *-uclinux-* seems like an only partially followed convention.
And at least RISC-V 64-bits gcc does not know about uclinux tuples.
So switch back to the normal "linux" one for now.

Signed-off-by: Christoph Hellwig <hch@lst.de>

[Damien]
* Make the change conditional on BR2_RISCV_64 being "y".

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 package/Makefile.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index 04347d2d84..dae7a859fd 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -39,8 +39,9 @@ endif
 # Compute GNU_TARGET_NAME
 GNU_TARGET_NAME = $(ARCH)-$(TARGET_VENDOR)-$(TARGET_OS)-$(LIBC)$(ABI)
 
-# FLAT binary format needs uclinux
-ifeq ($(BR2_BINFMT_FLAT),y)
+# FLAT binary format needs uclinux, except RISC-V 64-bits which needs
+# the regular linux name.
+ifeq ($(BR2_BINFMT_FLAT):$(BR2_RISCV_64),y:)
 TARGET_OS = uclinux
 else
 TARGET_OS = linux
-- 
2.31.1

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

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

* [Buildroot] [PATCH v5 04/10] arch/config: Make RISC-V 64-bits MMU optional
  2021-10-26  7:17 [Buildroot] [PATCH v5 00/10] Add RV64 NOMMU and Canaan K210 SoC support Damien Le Moal
                   ` (2 preceding siblings ...)
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 03/10] package/Makefile.in: Fix NOMMU RISC-V 64-bits toolchain base name Damien Le Moal
@ 2021-10-26  7:17 ` Damien Le Moal
  2021-10-27 13:38   ` Peter Korsgaard
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support Damien Le Moal
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Damien Le Moal @ 2021-10-26  7:17 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Alistair Francis, Yann E . MORIN

Linux supports No-MMU RISC-V 64-bits since kernel version 5.8. Make
MMU optional to enable building for RISC-V 64-bits boards that do not
have one. MMU use of RISC-V 32-bits builds remains mandatory for now.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
 arch/Config.in       | 1 -
 arch/Config.in.riscv | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/Config.in b/arch/Config.in
index d50718e2d4..c99af89efa 100644
--- a/arch/Config.in
+++ b/arch/Config.in
@@ -209,7 +209,6 @@ config BR2_powerpc64le
 
 config BR2_riscv
 	bool "RISCV"
-	select BR2_ARCH_HAS_MMU_MANDATORY
 	select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
 	help
 	  RISC-V is an open, free Instruction Set Architecture created
diff --git a/arch/Config.in.riscv b/arch/Config.in.riscv
index 1fc20e5de7..e6436d7c39 100644
--- a/arch/Config.in.riscv
+++ b/arch/Config.in.riscv
@@ -71,10 +71,12 @@ choice
 
 config BR2_RISCV_32
 	bool "32-bit"
+	select BR2_ARCH_HAS_MMU_MANDATORY
 
 config BR2_RISCV_64
 	bool "64-bit"
 	select BR2_ARCH_IS_64
+	select BR2_ARCH_HAS_MMU_OPTIONAL
 
 endchoice
 
-- 
2.31.1

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

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

* [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support
  2021-10-26  7:17 [Buildroot] [PATCH v5 00/10] Add RV64 NOMMU and Canaan K210 SoC support Damien Le Moal
                   ` (3 preceding siblings ...)
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 04/10] arch/config: Make RISC-V 64-bits MMU optional Damien Le Moal
@ 2021-10-26  7:17 ` Damien Le Moal
  2021-10-27 13:51   ` Peter Korsgaard
  2021-12-30 20:27   ` Thomas Petazzoni
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 06/10] board: Add Sipeed MAIX-Go support Damien Le Moal
                   ` (4 subsequent siblings)
  9 siblings, 2 replies; 28+ messages in thread
From: Damien Le Moal @ 2021-10-26  7:17 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Alistair Francis, Yann E . MORIN

Add two configuration files to support the dual-core RV64 Canaan K210
SoC based Sipeed MAIX-bit board.

The first configuration file, sipeed_maix_bit_defconfig, enables
building a bootable kernel 5.13 image with the root file system
initramfs linked with the kernel. This configuration modifies the
default busybox configuration busybox-minimal.config using the fragment
file board/canaan/k210-common/busybox-tiny.config. This reduces the
size of the busybox executable to save memory when executing shell
commands.

The second configuration file (sipeed_maix_bit_sdcard_defconfig) builds
a bootable kernel 5.13 image that uses the board SD card for the root
file system. This configuration uses the default busybox minimal
configuration.

Both configurations share the same device tree which is provided by and
built-in the kernel. This configuration is set with the kernel
configuration snippet provided by the configuration file
board/sipeed/maix-bit/linux-dtb.config.

Both configurations also share the same init script provided using the
rootfs_overlay root file system overlay. This provides the /sbin/init
script which replaces the default init process as it causes failures
due to excessive memory usage.

busybox-tiny.config and the rootfs overlay will be reused for all
Canaan K210 SoC based boards. These 2 files are thus placed in the
directory board/canaan/k210-common while the Sipeed MAIX-bit board
specific kernel config snippet is added under the directory
board/sipeed/maix-bit.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 board/canaan/k210-common/busybox-tiny.config  | 241 ++++++++++++++++++
 board/canaan/k210-common/rootfs_overlay/init  |   1 +
 .../k210-common/rootfs_overlay/sbin/init      |  27 ++
 board/sipeed/maix-bit/linux-dtb.config        |   2 +
 configs/sipeed_maix_bit_defconfig             |  14 +
 configs/sipeed_maix_bit_sdcard_defconfig      |  13 +
 6 files changed, 298 insertions(+)
 create mode 100644 board/canaan/k210-common/busybox-tiny.config
 create mode 120000 board/canaan/k210-common/rootfs_overlay/init
 create mode 100755 board/canaan/k210-common/rootfs_overlay/sbin/init
 create mode 100644 board/sipeed/maix-bit/linux-dtb.config
 create mode 100644 configs/sipeed_maix_bit_defconfig
 create mode 100644 configs/sipeed_maix_bit_sdcard_defconfig

diff --git a/board/canaan/k210-common/busybox-tiny.config b/board/canaan/k210-common/busybox-tiny.config
new file mode 100644
index 0000000000..7adcaf1db9
--- /dev/null
+++ b/board/canaan/k210-common/busybox-tiny.config
@@ -0,0 +1,241 @@
+#
+# Additional config changes for busybox-minimal.config
+# to reduce the size of the busybox executable.
+#
+
+#
+# Settings
+#
+# CONFIG_INCLUDE_SUSv2 is not set
+# CONFIG_LONG_OPTS is not set
+# CONFIG_LFS is not set
+# CONFIG_FEATURE_DEVPTS is not set
+# CONFIG_FEATURE_SYSLOG_INFO is not set
+# CONFIG_FEATURE_SYSLOG is not set
+
+#
+# Build Options
+#
+CONFIG_NOMMU=y
+# CONFIG_STACK_OPTIMIZATION_386 is not set
+
+#
+# Library Tuning
+#
+# CONFIG_FEATURE_RTMINMAX is not set
+# CONFIG_FEATURE_RTMINMAX_USE_LIBC_DEFINITIONS is not set
+# CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set
+CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y
+# CONFIG_FEATURE_EDITING_VI is not set
+# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set
+# CONFIG_FEATURE_REVERSE_SEARCH is not set
+# CONFIG_FEATURE_EDITING_WINCH is not set
+# CONFIG_FEATURE_HWIB is not set
+
+#
+# Applets
+#
+
+#
+# Archival Utilities
+#
+# CONFIG_ZCAT is not set
+# CONFIG_BZCAT is not set
+# CONFIG_LZCAT is not set
+# CONFIG_XZCAT is not set
+# CONFIG_UNLZOP is not set
+# CONFIG_LZOPCAT is not set
+
+#
+# Coreutils
+#
+# CONFIG_CKSUM is not set
+# CONFIG_DOS2UNIX is not set
+# CONFIG_UNIX2DOS is not set
+# CONFIG_DU is not set
+# CONFIG_FACTOR is not set
+# CONFIG_FOLD is not set
+# CONFIG_HEAD is not set
+# CONFIG_INSTALL is not set
+# CONFIG_LINK is not set
+# CONFIG_LOGNAME is not set
+# CONFIG_MD5SUM is not set
+# CONFIG_SHA1SUM is not set
+# CONFIG_SHA256SUM is not set
+# CONFIG_SHA512SUM is not set
+# CONFIG_SHA3SUM is not set
+# CONFIG_MKFIFO is not set
+# CONFIG_NICE is not set
+# CONFIG_NL is not set
+# CONFIG_NOHUP is not set
+# CONFIG_OD is not set
+# CONFIG_PASTE is not set
+# CONFIG_SHRED is not set
+# CONFIG_SORT is not set
+# CONFIG_TAIL is not set
+# CONFIG_TEE is not set
+# CONFIG_TIMEOUT is not set
+# CONFIG_TR is not set
+# CONFIG_UNIQ is not set
+# CONFIG_UUDECODE is not set
+# CONFIG_BASE32 is not set
+# CONFIG_UUENCODE is not set
+# CONFIG_WC is not set
+# CONFIG_WHOAMI is not set
+# CONFIG_WHO is not set
+# CONFIG_W is not set
+# CONFIG_USERS is not set
+# CONFIG_YES is not set
+
+#
+# Common options
+#
+# CONFIG_FEATURE_VERBOSE is not set
+
+#
+# Debian Utilities
+#
+# CONFIG_RUN_PARTS is not set
+# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set
+# CONFIG_FEATURE_RUN_PARTS_FANCY is not set
+# CONFIG_START_STOP_DAEMON is not set
+# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set
+# CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set
+# CONFIG_WHICH is not set
+
+#
+# klibc-utils
+#
+# CONFIG_NUKE is not set
+# CONFIG_RESUME is not set
+# CONFIG_RUN_INIT is not set
+
+#
+# Editors
+#
+# CONFIG_SED is not set
+CONFIG_VI=y
+CONFIG_FEATURE_VI_MAX_LEN=4096
+CONFIG_FEATURE_VI_COLON=y
+CONFIG_FEATURE_VI_YANKMARK=y
+CONFIG_FEATURE_VI_USE_SIGNALS=y
+CONFIG_FEATURE_VI_DOT_CMD=y
+CONFIG_FEATURE_VI_READONLY=y
+CONFIG_FEATURE_VI_SETOPTS=y
+CONFIG_FEATURE_VI_SET=y
+CONFIG_FEATURE_VI_WIN_RESIZE=y
+CONFIG_FEATURE_VI_ASK_TERMINAL=y
+CONFIG_FEATURE_VI_UNDO=y
+
+#
+# Finding Utilities
+#
+CONFIG_GREP=y
+# CONFIG_EGREP is not set
+# CONFIG_FGREP is not set
+# CONFIG_XARGS is not set
+
+#
+# Init Utilities
+#
+# CONFIG_HALT is not set
+# CONFIG_POWEROFF is not set
+# CONFIG_FEATURE_WAIT_FOR_INIT is not set
+# CONFIG_FEATURE_CALL_TELINIT is not set
+# CONFIG_INIT is not set
+# CONFIG_LINUXRC is not set
+
+#
+# Login/Password Management Utilities
+#
+# CONFIG_FEATURE_SHADOWPASSWDS is not set
+# CONFIG_USE_BB_CRYPT is not set
+# CONFIG_USE_BB_CRYPT_SHA is not set
+# CONFIG_ADDUSER is not set
+# CONFIG_GETTY is not set
+# CONFIG_LOGIN is not set
+# CONFIG_PASSWD is not set
+
+#
+# Linux System Utilities
+#
+# CONFIG_FALLOCATE is not set
+# CONFIG_FREERAMDISK is not set
+# CONFIG_FSFREEZE is not set
+# CONFIG_GETOPT is not set
+# CONFIG_XXD is not set
+# CONFIG_MESG is not set
+# CONFIG_MKE2FS is not set
+# CONFIG_MKDOSFS is not set
+# CONFIG_FEATURE_MOUNT_CIFS is not set
+# CONFIG_FEATURE_MOUNT_FSTAB is not set
+# CONFIG_FEATURE_MOUNT_OTHERTAB is not set
+# CONFIG_NOLOGIN is not set
+# CONFIG_LINUX32 is not set
+# CONFIG_LINUX64 is not set
+# CONFIG_SETPRIV is not set
+
+#
+# Common options for mount/umount
+#
+# CONFIG_FEATURE_MOUNT_LOOP is not set
+# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set
+
+#
+# Miscellaneous Utilities
+#
+# CONFIG_BC is not set
+# CONFIG_HEXEDIT is not set
+# CONFIG_I2CTRANSFER is not set
+# CONFIG_LSSCSI is not set
+# CONFIG_MIM is not set
+# CONFIG_PARTPROBE is not set
+# CONFIG_SETFATTR is not set
+# CONFIG_SETSERIAL is not set
+# CONFIG_TS is not set
+
+#
+# Networking Utilities
+#
+# CONFIG_HOSTNAME is not set
+# CONFIG_DNSDOMAINNAME is not set
+# CONFIG_IFCONFIG is not set
+# CONFIG_IFUP is not set
+# CONFIG_IFDOWN is not set
+# CONFIG_IP is not set
+# CONFIG_IPADDR is not set
+# CONFIG_IPLINK is not set
+# CONFIG_IPROUTE is not set
+# CONFIG_NC is not set
+# CONFIG_NETSTAT is not set
+# CONFIG_PING is not set
+# CONFIG_ROUTE is not set
+# CONFIG_TC is not set
+# CONFIG_TELNET is not set
+# CONFIG_WGET is not set
+# CONFIG_UDHCPC is not set
+
+#
+# Process Utilities
+#
+# CONFIG_KILLALL is not set
+# CONFIG_KILLALL5 is not set
+
+#
+# Runit Utilities
+#
+# CONFIG_SVC is not set
+# CONFIG_SVOK is not set
+
+#
+# Shells
+#
+CONFIG_BASH_IS_HUSH=y
+# CONFIG_BASH_IS_NONE is not set
+# CONFIG_HUSH_SAVEHISTORY is not set
+
+#
+# Options common to all shells
+#
+# CONFIG_FEATURE_SH_READ_FRAC is not set
+# CONFIG_FEATURE_SH_EMBEDDED_SCRIPTS is not set
diff --git a/board/canaan/k210-common/rootfs_overlay/init b/board/canaan/k210-common/rootfs_overlay/init
new file mode 120000
index 0000000000..a0b71977c0
--- /dev/null
+++ b/board/canaan/k210-common/rootfs_overlay/init
@@ -0,0 +1 @@
+/sbin/init
\ No newline at end of file
diff --git a/board/canaan/k210-common/rootfs_overlay/sbin/init b/board/canaan/k210-common/rootfs_overlay/sbin/init
new file mode 100755
index 0000000000..6ec4748c03
--- /dev/null
+++ b/board/canaan/k210-common/rootfs_overlay/sbin/init
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# Mount sysfs and procfs
+/bin/mount -t sysfs sysfs /sys
+/bin/mount -t proc proc /proc
+
+# Use the /dev/console device node from devtmpfs if possible to not
+# confuse glibc's ttyname_r().
+# This may fail (E.G. booted with console=), and errors from exec will
+# terminate the shell, so use a subshell for the test
+if (exec 0</dev/console) 2>/dev/null; then
+    exec 0</dev/console
+    exec 1>/dev/console
+    exec 2>/dev/console
+fi
+
+# Print a fun logo :)
+echo "          __  _"
+echo "         / / (_) ____   _   _ __  __"
+echo "        / /  | ||  _ \\ | | | |\\ \\/ /"
+echo "       / /___| || | | || |_| | >  < "
+echo "      /_____/|_||_| |_| \\____|/_/\\_\\"
+echo "    64-bits RISC-V Kendryte K210 NOMMU"
+echo ""
+
+# Start interactive shell
+exec /bin/sh
diff --git a/board/sipeed/maix-bit/linux-dtb.config b/board/sipeed/maix-bit/linux-dtb.config
new file mode 100644
index 0000000000..de2f8fd074
--- /dev/null
+++ b/board/sipeed/maix-bit/linux-dtb.config
@@ -0,0 +1,2 @@
+CONFIG_SOC_CANAAN_K210_DTB_BUILTIN=y
+CONFIG_SOC_CANAAN_K210_DTB_SOURCE="sipeed_maix_bit"
diff --git a/configs/sipeed_maix_bit_defconfig b/configs/sipeed_maix_bit_defconfig
new file mode 100644
index 0000000000..bbbe00d44d
--- /dev/null
+++ b/configs/sipeed_maix_bit_defconfig
@@ -0,0 +1,14 @@
+BR2_riscv=y
+BR2_PACKAGE_HOST_ELF2FLT=y
+# BR2_USE_MMU is not set
+BR2_INIT_NONE=y
+BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maix-bit/linux-dtb.config"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
+BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="board/canaan/k210-common/busybox-tiny.config"
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+BR2_TARGET_ROOTFS_INITRAMFS=y
diff --git a/configs/sipeed_maix_bit_sdcard_defconfig b/configs/sipeed_maix_bit_sdcard_defconfig
new file mode 100644
index 0000000000..dd01dcfebb
--- /dev/null
+++ b/configs/sipeed_maix_bit_sdcard_defconfig
@@ -0,0 +1,13 @@
+BR2_riscv=y
+BR2_PACKAGE_HOST_ELF2FLT=y
+# BR2_USE_MMU is not set
+BR2_INIT_NONE=y
+BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210_sdcard"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maix-bit/linux-dtb.config"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+BR2_TARGET_ROOTFS_EXT2=y
-- 
2.31.1

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

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

* [Buildroot] [PATCH v5 06/10] board: Add Sipeed MAIX-Go support
  2021-10-26  7:17 [Buildroot] [PATCH v5 00/10] Add RV64 NOMMU and Canaan K210 SoC support Damien Le Moal
                   ` (4 preceding siblings ...)
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support Damien Le Moal
@ 2021-10-26  7:17 ` Damien Le Moal
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 07/10] board: Add Sipeed MAIXDUINO support Damien Le Moal
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 28+ messages in thread
From: Damien Le Moal @ 2021-10-26  7:17 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Alistair Francis, Yann E . MORIN

Add two configuration files to support the dual-core RV64 Canaan K210
SoC based Sipeed MAIX-Go board. These configurations are similar to
the Sipeed MAIX-bit board configurations, differing only by the
built-in kernel device tree used.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 board/sipeed/maix-go/linux-dtb.config   |  2 ++
 configs/sipeed_maix_go_defconfig        | 14 ++++++++++++++
 configs/sipeed_maix_go_sdcard_defconfig | 13 +++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 board/sipeed/maix-go/linux-dtb.config
 create mode 100644 configs/sipeed_maix_go_defconfig
 create mode 100644 configs/sipeed_maix_go_sdcard_defconfig

diff --git a/board/sipeed/maix-go/linux-dtb.config b/board/sipeed/maix-go/linux-dtb.config
new file mode 100644
index 0000000000..ea8c30e266
--- /dev/null
+++ b/board/sipeed/maix-go/linux-dtb.config
@@ -0,0 +1,2 @@
+CONFIG_SOC_CANAAN_K210_DTB_BUILTIN=y
+CONFIG_SOC_CANAAN_K210_DTB_SOURCE="sipeed_maix_go"
diff --git a/configs/sipeed_maix_go_defconfig b/configs/sipeed_maix_go_defconfig
new file mode 100644
index 0000000000..fd841c682d
--- /dev/null
+++ b/configs/sipeed_maix_go_defconfig
@@ -0,0 +1,14 @@
+BR2_riscv=y
+BR2_PACKAGE_HOST_ELF2FLT=y
+# BR2_USE_MMU is not set
+BR2_INIT_NONE=y
+BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maix-go/linux-dtb.config"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
+BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="board/canaan/k210-common/busybox-tiny.config"
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+BR2_TARGET_ROOTFS_INITRAMFS=y
diff --git a/configs/sipeed_maix_go_sdcard_defconfig b/configs/sipeed_maix_go_sdcard_defconfig
new file mode 100644
index 0000000000..8a6d76ca0e
--- /dev/null
+++ b/configs/sipeed_maix_go_sdcard_defconfig
@@ -0,0 +1,13 @@
+BR2_riscv=y
+BR2_PACKAGE_HOST_ELF2FLT=y
+# BR2_USE_MMU is not set
+BR2_INIT_NONE=y
+BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210_sdcard"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maix-go/linux-dtb.config"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+BR2_TARGET_ROOTFS_EXT2=y
-- 
2.31.1

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

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

* [Buildroot] [PATCH v5 07/10] board: Add Sipeed MAIXDUINO support
  2021-10-26  7:17 [Buildroot] [PATCH v5 00/10] Add RV64 NOMMU and Canaan K210 SoC support Damien Le Moal
                   ` (5 preceding siblings ...)
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 06/10] board: Add Sipeed MAIX-Go support Damien Le Moal
@ 2021-10-26  7:17 ` Damien Le Moal
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 08/10] board: Add Sipeed MAIX-Dock support Damien Le Moal
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 28+ messages in thread
From: Damien Le Moal @ 2021-10-26  7:17 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Alistair Francis, Yann E . MORIN

Add two configuration files to support the dual-core RV64 Canaan K210
SoC based Sipeed MAIXDUINO board. These configurations are similar to
the Sipeed MAIX-bit board configurations, differing only by the
built-in kernel device tree used.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 board/sipeed/maixduino/linux-dtb.config   |  2 ++
 configs/sipeed_maixduino_defconfig        | 14 ++++++++++++++
 configs/sipeed_maixduino_sdcard_defconfig | 13 +++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 board/sipeed/maixduino/linux-dtb.config
 create mode 100644 configs/sipeed_maixduino_defconfig
 create mode 100644 configs/sipeed_maixduino_sdcard_defconfig

diff --git a/board/sipeed/maixduino/linux-dtb.config b/board/sipeed/maixduino/linux-dtb.config
new file mode 100644
index 0000000000..049a2550c5
--- /dev/null
+++ b/board/sipeed/maixduino/linux-dtb.config
@@ -0,0 +1,2 @@
+CONFIG_SOC_CANAAN_K210_DTB_BUILTIN=y
+CONFIG_SOC_CANAAN_K210_DTB_SOURCE="sipeed_maixduino"
diff --git a/configs/sipeed_maixduino_defconfig b/configs/sipeed_maixduino_defconfig
new file mode 100644
index 0000000000..c353b1fc2a
--- /dev/null
+++ b/configs/sipeed_maixduino_defconfig
@@ -0,0 +1,14 @@
+BR2_riscv=y
+BR2_PACKAGE_HOST_ELF2FLT=y
+# BR2_USE_MMU is not set
+BR2_INIT_NONE=y
+BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maixduino/linux-dtb.config"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
+BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="board/canaan/k210-common/busybox-tiny.config"
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+BR2_TARGET_ROOTFS_INITRAMFS=y
diff --git a/configs/sipeed_maixduino_sdcard_defconfig b/configs/sipeed_maixduino_sdcard_defconfig
new file mode 100644
index 0000000000..dc9644f928
--- /dev/null
+++ b/configs/sipeed_maixduino_sdcard_defconfig
@@ -0,0 +1,13 @@
+BR2_riscv=y
+BR2_PACKAGE_HOST_ELF2FLT=y
+# BR2_USE_MMU is not set
+BR2_INIT_NONE=y
+BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210_sdcard"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maixduino/linux-dtb.config"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+BR2_TARGET_ROOTFS_EXT2=y
-- 
2.31.1

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

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

* [Buildroot] [PATCH v5 08/10] board: Add Sipeed MAIX-Dock support
  2021-10-26  7:17 [Buildroot] [PATCH v5 00/10] Add RV64 NOMMU and Canaan K210 SoC support Damien Le Moal
                   ` (6 preceding siblings ...)
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 07/10] board: Add Sipeed MAIXDUINO support Damien Le Moal
@ 2021-10-26  7:17 ` Damien Le Moal
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 09/10] board: Add Canaan KD233 support Damien Le Moal
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 10/10] board: Document Canaan K210 based boards support Damien Le Moal
  9 siblings, 0 replies; 28+ messages in thread
From: Damien Le Moal @ 2021-10-26  7:17 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Alistair Francis, Yann E . MORIN

Add two configuration files to support the dual-core RV64 Canaan K210
SoC based Sipeed MAIX-Dock board. These configurations are similar to
the Sipeed MAIX-bit board configurations, differing only by the
built-in kernel device tree used.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 board/sipeed/maix-dock/linux-dtb.config   |  2 ++
 configs/sipeed_maix_dock_defconfig        | 14 ++++++++++++++
 configs/sipeed_maix_dock_sdcard_defconfig | 13 +++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 board/sipeed/maix-dock/linux-dtb.config
 create mode 100644 configs/sipeed_maix_dock_defconfig
 create mode 100644 configs/sipeed_maix_dock_sdcard_defconfig

diff --git a/board/sipeed/maix-dock/linux-dtb.config b/board/sipeed/maix-dock/linux-dtb.config
new file mode 100644
index 0000000000..b1ca3166f8
--- /dev/null
+++ b/board/sipeed/maix-dock/linux-dtb.config
@@ -0,0 +1,2 @@
+CONFIG_SOC_CANAAN_K210_DTB_BUILTIN=y
+CONFIG_SOC_CANAAN_K210_DTB_SOURCE="sipeed_maix_dock"
diff --git a/configs/sipeed_maix_dock_defconfig b/configs/sipeed_maix_dock_defconfig
new file mode 100644
index 0000000000..b4f0a74d0a
--- /dev/null
+++ b/configs/sipeed_maix_dock_defconfig
@@ -0,0 +1,14 @@
+BR2_riscv=y
+BR2_PACKAGE_HOST_ELF2FLT=y
+# BR2_USE_MMU is not set
+BR2_INIT_NONE=y
+BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maix-dock/linux-dtb.config"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
+BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="board/canaan/k210-common/busybox-tiny.config"
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+BR2_TARGET_ROOTFS_INITRAMFS=y
diff --git a/configs/sipeed_maix_dock_sdcard_defconfig b/configs/sipeed_maix_dock_sdcard_defconfig
new file mode 100644
index 0000000000..f80e61d801
--- /dev/null
+++ b/configs/sipeed_maix_dock_sdcard_defconfig
@@ -0,0 +1,13 @@
+BR2_riscv=y
+BR2_PACKAGE_HOST_ELF2FLT=y
+# BR2_USE_MMU is not set
+BR2_INIT_NONE=y
+BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210_sdcard"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maix-dock/linux-dtb.config"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+BR2_TARGET_ROOTFS_EXT2=y
-- 
2.31.1

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

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

* [Buildroot] [PATCH v5 09/10] board: Add Canaan KD233 support
  2021-10-26  7:17 [Buildroot] [PATCH v5 00/10] Add RV64 NOMMU and Canaan K210 SoC support Damien Le Moal
                   ` (7 preceding siblings ...)
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 08/10] board: Add Sipeed MAIX-Dock support Damien Le Moal
@ 2021-10-26  7:17 ` Damien Le Moal
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 10/10] board: Document Canaan K210 based boards support Damien Le Moal
  9 siblings, 0 replies; 28+ messages in thread
From: Damien Le Moal @ 2021-10-26  7:17 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Alistair Francis, Yann E . MORIN

Add two configuration files to support the dual-core RV64 Canaan K210
SoC based KD233 development board. These configurations are similar to
the configurations defined for the Sipeed boards, differing only by the
built-in kernel device tree used.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 board/canaan/kd233/linux-dtb.config   |  2 ++
 configs/canaan_kd233_defconfig        | 14 ++++++++++++++
 configs/canaan_kd233_sdcard_defconfig | 13 +++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 board/canaan/kd233/linux-dtb.config
 create mode 100644 configs/canaan_kd233_defconfig
 create mode 100644 configs/canaan_kd233_sdcard_defconfig

diff --git a/board/canaan/kd233/linux-dtb.config b/board/canaan/kd233/linux-dtb.config
new file mode 100644
index 0000000000..d5b107124a
--- /dev/null
+++ b/board/canaan/kd233/linux-dtb.config
@@ -0,0 +1,2 @@
+CONFIG_SOC_CANAAN_K210_DTB_BUILTIN=y
+CONFIG_SOC_CANAAN_K210_DTB_SOURCE="canaan_kd233"
diff --git a/configs/canaan_kd233_defconfig b/configs/canaan_kd233_defconfig
new file mode 100644
index 0000000000..6f665495ba
--- /dev/null
+++ b/configs/canaan_kd233_defconfig
@@ -0,0 +1,14 @@
+BR2_riscv=y
+BR2_PACKAGE_HOST_ELF2FLT=y
+# BR2_USE_MMU is not set
+BR2_INIT_NONE=y
+BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/canaan/kd233/linux-dtb.config"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
+BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES="board/canaan/k210-common/busybox-tiny.config"
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+BR2_TARGET_ROOTFS_INITRAMFS=y
diff --git a/configs/canaan_kd233_sdcard_defconfig b/configs/canaan_kd233_sdcard_defconfig
new file mode 100644
index 0000000000..a106077dc5
--- /dev/null
+++ b/configs/canaan_kd233_sdcard_defconfig
@@ -0,0 +1,13 @@
+BR2_riscv=y
+BR2_PACKAGE_HOST_ELF2FLT=y
+# BR2_USE_MMU is not set
+BR2_INIT_NONE=y
+BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210_sdcard"
+BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/canaan/kd233/linux-dtb.config"
+BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
+BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
+BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+BR2_TARGET_ROOTFS_EXT2=y
-- 
2.31.1

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

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

* [Buildroot] [PATCH v5 10/10] board: Document Canaan K210 based boards support
  2021-10-26  7:17 [Buildroot] [PATCH v5 00/10] Add RV64 NOMMU and Canaan K210 SoC support Damien Le Moal
                   ` (8 preceding siblings ...)
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 09/10] board: Add Canaan KD233 support Damien Le Moal
@ 2021-10-26  7:17 ` Damien Le Moal
  9 siblings, 0 replies; 28+ messages in thread
From: Damien Le Moal @ 2021-10-26  7:17 UTC (permalink / raw)
  To: buildroot, Thomas Petazzoni; +Cc: Alistair Francis, Yann E . MORIN

Add a generic board/canaan/k210-common/README.md file documenting how to
generate and install buildroot images for boards based on the dual-core
RV64 Canaan K210 SoC. A simple README.md file pointing to this generic
documentation is also added under each K210 SoC board directory.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
---
 board/canaan/k210-common/README.md | 318 +++++++++++++++++++++++++++++
 board/canaan/kd233/README.md       |   4 +
 board/sipeed/maix-bit/README.md    |   4 +
 board/sipeed/maix-dock/README.md   |   4 +
 board/sipeed/maix-go/README.md     |   4 +
 board/sipeed/maixduino/README.md   |   4 +
 6 files changed, 338 insertions(+)
 create mode 100644 board/canaan/k210-common/README.md
 create mode 100644 board/canaan/kd233/README.md
 create mode 100644 board/sipeed/maix-bit/README.md
 create mode 100644 board/sipeed/maix-dock/README.md
 create mode 100644 board/sipeed/maix-go/README.md
 create mode 100644 board/sipeed/maixduino/README.md

diff --git a/board/canaan/k210-common/README.md b/board/canaan/k210-common/README.md
new file mode 100644
index 0000000000..b9a4eca3b0
--- /dev/null
+++ b/board/canaan/k210-common/README.md
@@ -0,0 +1,318 @@
+# Canaan Kendryte K210 SoC Based Board Support
+
+Buildroot provides support for Canaan RISC-V Kendryte K210 SoC based boards.
+Configurations for different K210 Soc board variants are available. The boards
+supported are as follows.
+
+* From Sipeed: MAIX Bit, MAIX Dock (Dan Dock), MAIX Go and MAIXDUINO boards.
+
+* From Canaan: KD233 development board.
+
+For each board, two configurations are provided:
+
+* Configuration to build a bootable kernel image with built-in initramfs root
+file system (SD card is not used)
+
+* Configuration to build a bootable kernel image with the root file system
+on the board SD card.
+
+In all cases, the build process generates a bootable kernel image that can be
+directly flashed to the board boot flash. A boot loader (e.g. U-Boot) and
+OpenSBI are not necessary.
+
+## Bootable Kernel Image With A Built-In Initramfs Root File System
+
+The following table lists the default configuration provided for each board
+supported.
+
+| Board vendor and model | configuration name          |
+| ---------------------- | --------------------------- |
+| Canaan KD233           | canaan_kd233_defconfig      |
+| Sipeed MAIX bit        | sipeed_maix_bit_defconfig   |
+| Sipeed MAIX Go         | sipeed_maix_go_defconfig    |
+| Sipeed MAIX dock       | sipeed_maix_dock_defconfig  |
+| Sipeed MAIXDUINO       | sipeed_maixduino_defconfig  |
+
+The build procedure is similar for all boards. The steps to create the kernel
+bootable image are as follows:
+
+```
+$ make <config name>
+$ make
+```
+
+The build process will generate the bootable binary image file
+*output/images/loader.bin*. This image file must be written to the board boot
+flash using the
+[Sipeed kflash python utility](https://github.com/sipeed/kflash.py).
+
+```
+$ sudo python3 kflash.py -p /dev/ttyUSB0 -b 1500000 -t output/images/loader.bin
+```
+
+The above command will open a terminal console and reboot the board once the
+image is written. The output will be similar to the following (example obtained
+with the Sipeed MAIX Bit board).
+
+```
+[INFO] COM Port Selected Manually:  /dev/ttyUSB0
+[INFO] Default baudrate is 115200 , later it may be changed to the value you set.
+[INFO] Trying to Enter the ISP Mode...
+._
+[INFO] Automatically detected goE/kd233
+
+[INFO] Greeting Message Detected, Start Downloading ISP
+Downloading ISP: |=================================================================| 100.0% 10kiB/s
+[INFO] Booting From 0x80000000
+[INFO] Wait For 0.1 second for ISP to Boot
+[INFO] Boot to Flashmode Successfully
+[INFO] Selected Baudrate:  1500000
+[INFO] Baudrate changed, greeting with ISP again ...
+[INFO] Boot to Flashmode Successfully
+[INFO] Selected Flash:  On-Board
+[INFO] Initialization flash Successfully
+Programming BIN: |=================================================================| 100.0% 50kiB/s
+[INFO] Rebooting...
+--- forcing DTR inactive
+--- forcing RTS inactive
+--- Miniterm on /dev/ttyUSB0  115200,8,N,1 ---
+--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
+[    0.000000] Linux version 5.13.0 (xxx@yyy.com) (riscv64-buildroot-linux-uclibc-gcc.br_real (Buildroot 2021.05-rc3-447-g26fab79296-dirty) 11.1.0, GNU ld (GNU Binutils) 2.32) #2 SMP Fri Jul 9 10:59:05 JST 2021
+[    0.000000] Machine model: SiPeed MAIX BiT
+[    0.000000] earlycon: sifive0 at MMIO 0x0000000038000000 (options '115200n8')
+[    0.000000] printk: bootconsole [sifive0] enabled
+[    0.000000] Zone ranges:
+[    0.000000]   DMA32    [mem 0x0000000080000000-0x00000000807fffff]
+[    0.000000]   Normal   empty
+[    0.000000] Movable zone start for each node
+[    0.000000] Early memory node ranges
+[    0.000000]   node   0: [mem 0x0000000080000000-0x00000000807fffff]
+[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000807fffff]
+[    0.000000] riscv: ISA extensions acdfim
+[    0.000000] riscv: ELF capabilities acdfim
+[    0.000000] percpu: max_distance=0x18000 too large for vmalloc space 0x0
+[    0.000000] percpu: Embedded 12 pages/cpu s19360 r0 d29792 u49152
+[    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 2020
+[    0.000000] Kernel command line: earlycon console=ttySIF0
+[    0.000000] Dentry cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
+[    0.000000] Inode-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
+[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
+[    0.000000] Memory: 6052K/8192K available (950K kernel code, 140K rwdata, 200K rodata, 480K init, 66K bss, 2140K reserved, 0K cma-reserved)
+[    0.000000] rcu: Hierarchical RCU implementation.
+[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
+[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
+[    0.000000] riscv-intc: 64 local interrupts mapped
+[    0.000000] plic: interrupt-controller@c000000: mapped 65 interrupts with 2 handlers for 2 contexts.
+[    0.000000] k210-clk: clock-controller: CPU running at 390 MHz
+[    0.000000] clint: timer@2000000: timer running at 7800000 Hz
+[    0.000000] clocksource: clint_clocksource: mask: 0xffffffffffffffff max_cycles: 0x3990be68b, max_idle_ns: 881590404272 ns
+[    0.000002] sched_clock: 64 bits at 7MHz, resolution 128ns, wraps every 4398046511054ns
+[    0.008183] Calibrating delay loop (skipped), value calculated using timer frequency.. 15.60 BogoMIPS (lpj=31200)
+[    0.018250] pid_max: default: 4096 minimum: 301
+[    0.022865] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
+[    0.029971] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
+[    0.040316] rcu: Hierarchical SRCU implementation.
+[    0.045151] smp: Bringing up secondary CPUs ...
+[    0.050271] smp: Brought up 1 node, 2 CPUs
+[    0.054355] devtmpfs: initialized
+[    0.071852] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
+[    0.080926] pinctrl core: initialized pinctrl subsystem
+[    0.117980] clocksource: Switched to clocksource clint_clocksource
+[    0.130392] workingset: timestamp_bits=62 max_order=11 bucket_order=0
+[    0.162498] k210-fpioa 502b0000.pinmux: K210 FPIOA pin controller
+[    0.175231] k210-sysctl 50440000.syscon: K210 system controller
+[    0.182048] k210-rst 50440000.syscon:reset-controller: K210 reset controller
+[    0.189335] 38000000.serial: ttySIF0 at MMIO 0x38000000 (irq = 1, base_baud = 115200) is a SiFive UART v0
+[    0.198258] printk: console [ttySIF0] enabled
+[    0.198258] printk: console [ttySIF0] enabled
+[    0.206899] printk: bootconsole [sifive0] disabled
+[    0.206899] printk: bootconsole [sifive0] disabled
+[    0.218821] cacheinfo: Unable to detect cache hierarchy for CPU 0
+[    0.236193] i2c /dev entries driver
+[    0.240804] random: get_random_bytes called from 0x000000008000586e with crng_init=0
+[    0.253005] Freeing unused kernel memory: 476K
+[    0.256754] This architecture does not have kernel memory protection.
+[    0.263177] Run /init as init process
+          __  _
+         / / (_) ____   _   _ __  __
+        / /  | ||  _ \ | | | |\ \/ /
+       / /___| || | | || |_| | >  <
+      /_____/|_||_| |_| \____|/_/\_\
+        RISC-V Kendryte K210 NOMMU
+
+
+BusyBox v1.33.1 (2021-07-09 10:58:24 JST) hush - the humble shell
+Enter 'help' for a list of built-in commands.
+
+/ #
+```
+
+To open a console without re-flashing the board, *miniterm.py* can be used.
+```
+sudo miniterm.py --raw --eol=LF /dev/ttyUSB0 115200
+```
+
+The options *--raw --eol=LF* are added here to avoid a double carriage return
+each time a command is entered.
+
+## Bootable Kernel Image With the Root File System On SD Card
+
+The following table lists the default configurations provided for the supported
+boards.
+
+| Board vendor and model | configuration name                 |
+| ---------------------- | ---------------------------------- |
+| Canaan KD233           | canaan_kd233_sdcard_defconfig      |
+| Sipeed MAIX bit        | sipeed_maix_bit_sdcard_defconfig   |
+| Sipeed MAIX Go         | sipeed_maix_go_sdcard_defconfig    |
+| Sipeed MAIX dock       | sipeed_maix_dock_sdcard_defconfig  |
+| Sipeed MAIXDUINO       | sipeed_maixduino_sdcard_defconfig  |
+
+The build procedure is similar to the built-in initramfs case.
+
+```
+$ make <config name>
+$ make
+```
+
+The build process will generate two files under the *output/images* directory.
+
+* *loader.bin*: This bootable kernel image file.
+
+* *rootfs.ext2*: ext2 (rev1) SD card image.
+
+Before flashing the kernel bootable image, the SD card must be prepared.
+
+```
+$ sudo dd if=output/images/rootfs.ext2 of=/dev/sdX1 bs=1M
+$ sync
+$ eject /dev/sdX
+```
+
+Where */dev/sdX* is the device file name of the SD card. The SD card must have
+at least one partition of at least 60 MB. Once completed, the SD card can be
+inserted into the board and the kernel bootable image file written to the board
+boot flash, using
+[Sipeed kflash python utility](https://github.com/sipeed/kflash.py).
+
+```
+$ sudo python3 kflash.py -p /dev/ttyUSB0 -b 1500000 -t output/image/loader.bin
+```
+
+The above command will open a terminal console and reboot the board once the
+image is written. The output will be similar to the following (example obtained
+with the Sipeed MAIX Bit board).
+
+```
+[INFO] COM Port Selected Manually:  /dev/ttyUSB0 
+[INFO] Default baudrate is 115200 , later it may be changed to the value you set. 
+[INFO] Trying to Enter the ISP Mode... 
+._
+[INFO] Automatically detected goE/kd233 
+
+[INFO] Greeting Message Detected, Start Downloading ISP 
+Downloading ISP: |=================================================================| 100.0% 10kiB/s
+[INFO] Booting From 0x80000000 
+[INFO] Wait For 0.1 second for ISP to Boot 
+[INFO] Boot to Flashmode Successfully 
+[INFO] Selected Baudrate:  1500000 
+[INFO] Baudrate changed, greeting with ISP again ...  
+[INFO] Boot to Flashmode Successfully 
+[INFO] Selected Flash:  On-Board 
+[INFO] Initialization flash Successfully 
+Programming BIN: |=================================================================| 100.0% 50kiB/s
+[INFO] Rebooting... 
+--- forcing DTR inactive
+--- forcing RTS inactive
+--- Miniterm on /dev/ttyUSB0  115200,8,N,1 ---
+--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
+[    0.000000] Linux version 5.13.0 (damien@twashi.fujisawa.hgst.com) (riscv64-buildroot-linux-uclibc-gcc.br_real (Buildroot 2021.05-rc3-447-g26fab79296-dirty) 11.1.0, GNU ld (GNU Binutils) 2.32) #1 SMP Fri Jul 9 14:50:18 JST 2021
+[    0.000000] Machine model: SiPeed MAIX BiT
+[    0.000000] earlycon: sifive0 at MMIO 0x0000000038000000 (options '115200n8')
+[    0.000000] printk: bootconsole [sifive0] enabled
+[    0.000000] Zone ranges:
+[    0.000000]   DMA32    [mem 0x0000000080000000-0x00000000807fffff]
+[    0.000000]   Normal   empty
+[    0.000000] Movable zone start for each node
+[    0.000000] Early memory node ranges
+[    0.000000]   node   0: [mem 0x0000000080000000-0x00000000807fffff]
+[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000807fffff]
+[    0.000000] riscv: ISA extensions acdfim
+[    0.000000] riscv: ELF capabilities acdfim
+[    0.000000] percpu: max_distance=0x18000 too large for vmalloc space 0x0
+[    0.000000] percpu: Embedded 12 pages/cpu s19488 r0 d29664 u49152
+[    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 2020
+[    0.000000] Kernel command line: earlycon console=ttySIF0 rootdelay=2 root=/dev/mmcblk0p1 ro
+[    0.000000] Dentry cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
+[    0.000000] Inode-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
+[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
+[    0.000000] Memory: 6184K/8192K available (1149K kernel code, 151K rwdata, 232K rodata, 105K init, 69K bss, 2008K reserved, 0K cma-reserved)
+[    0.000000] rcu: Hierarchical RCU implementation.
+[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
+[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
+[    0.000000] riscv-intc: 64 local interrupts mapped
+[    0.000000] plic: interrupt-controller@c000000: mapped 65 interrupts with 2 handlers for 2 contexts.
+[    0.000000] k210-clk: clock-controller: CPU running at 390 MHz
+[    0.000000] clint: timer@2000000: timer running at 7800000 Hz
+[    0.000000] clocksource: clint_clocksource: mask: 0xffffffffffffffff max_cycles: 0x3990be68b, max_idle_ns: 881590404272 ns
+[    0.000001] sched_clock: 64 bits at 7MHz, resolution 128ns, wraps every 4398046511054ns
+[    0.008179] Calibrating delay loop (skipped), value calculated using timer frequency.. 15.60 BogoMIPS (lpj=31200)
+[    0.018252] pid_max: default: 4096 minimum: 301
+[    0.022859] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
+[    0.029972] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
+[    0.040382] rcu: Hierarchical SRCU implementation.
+[    0.045234] smp: Bringing up secondary CPUs ...
+[    0.050345] smp: Brought up 1 node, 2 CPUs
+[    0.054419] devtmpfs: initialized
+[    0.071317] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
+[    0.080392] pinctrl core: initialized pinctrl subsystem
+[    0.119377] clocksource: Switched to clocksource clint_clocksource
+[    0.131238] workingset: timestamp_bits=62 max_order=11 bucket_order=0
+[    0.159389] k210-fpioa 502b0000.pinmux: K210 FPIOA pin controller
+[    0.171494] k210-sysctl 50440000.syscon: K210 system controller
+[    0.178193] k210-rst 50440000.syscon:reset-controller: K210 reset controller
+[    0.186800] 38000000.serial: ttySIF0 at MMIO 0x38000000 (irq = 1, base_baud = 115200) is a SiFive UART v0
+[    0.195764] printk: console [ttySIF0] enabled
+[    0.195764] printk: console [ttySIF0] enabled
+[    0.204377] printk: bootconsole [sifive0] disabled
+[    0.204377] printk: bootconsole [sifive0] disabled
+[    0.216056] cacheinfo: Unable to detect cache hierarchy for CPU 0
+[    0.232882] i2c /dev entries driver
+[    0.263551] mmc_spi spi2.0: SD/MMC host mmc0, no WP, no poweroff, cd polling
+[    0.271167] random: get_random_bytes called from 0x0000000080005d60 with crng_init=0
+[    0.289511] Waiting 2 sec before mounting root device...
+[    0.312217] mmc0: host does not support reading read-only switch, assuming write-enable
+[    0.319565] mmc0: new SDHC card on SPI
+[    0.326205] mmcblk0: mmc0:0000 SA16G 14.5 GiB 
+[    0.333339] random: fast init done
+[    0.337935]  mmcblk0: p1 p2
+[    2.311900] VFS: Mounted root (ext2 filesystem) readonly on device 179:1.
+[    2.321555] devtmpfs: mounted
+[    2.324099] Freeing unused kernel memory: 100K
+[    2.328227] This architecture does not have kernel memory protection.
+[    2.334652] Run /sbin/init as init process
+[    2.491565] random: crng init done
+          __  _
+         / / (_) ____   _   _ __  __
+        / /  | ||  _ \ | | | |\ \/ /
+       / /___| || | | || |_| | >  < 
+      /_____/|_||_| |_| \____|/_/\_\
+        RISC-V Kendryte K210 NOMMU
+
+
+BusyBox v1.33.1 (2021-07-09 10:58:24 JST) hush - the humble shell
+Enter 'help' for a list of built-in commands.
+
+/ # 
+```
+
+Of note is that the kernel command line arguments, specified in the kernel
+*nommu_k210_sdcard* default configuration, mount the SD card as read-only to
+avoid corruptions of the ext2 root file system. This is recommended as this
+board does not isupport clean shutdown or halt.
+
+Similarly to the initramfs build case, a console can be open without
+re-flashing the board using *miniterm.py*.
+```
+sudo miniterm.py --raw --eol=LF /dev/ttyUSB0 115200
+```
diff --git a/board/canaan/kd233/README.md b/board/canaan/kd233/README.md
new file mode 100644
index 0000000000..e622d121c2
--- /dev/null
+++ b/board/canaan/kd233/README.md
@@ -0,0 +1,4 @@
+# Canaan KD233 Board
+
+See the common documentation for
+[Canaan K210 SoC based boards](../k210-common/README.md).
diff --git a/board/sipeed/maix-bit/README.md b/board/sipeed/maix-bit/README.md
new file mode 100644
index 0000000000..c9132bcc76
--- /dev/null
+++ b/board/sipeed/maix-bit/README.md
@@ -0,0 +1,4 @@
+# Sipeed MAIX-Bit Board
+
+See the common documentation for
+[Canaan K210 SoC based boards](../../canaan/k210-common/README.md).
diff --git a/board/sipeed/maix-dock/README.md b/board/sipeed/maix-dock/README.md
new file mode 100644
index 0000000000..fec6fb9939
--- /dev/null
+++ b/board/sipeed/maix-dock/README.md
@@ -0,0 +1,4 @@
+# Sipeed MAIX-Dock Board
+
+See the common documentation for
+[Canaan K210 SoC based boards](../../canaan/k210-common/README.md).
diff --git a/board/sipeed/maix-go/README.md b/board/sipeed/maix-go/README.md
new file mode 100644
index 0000000000..1f14f65410
--- /dev/null
+++ b/board/sipeed/maix-go/README.md
@@ -0,0 +1,4 @@
+# Sipeed MAIX-Go Board
+
+See the common documentation for
+[Canaan K210 SoC based boards](../../canaan/k210-common/README.md).
diff --git a/board/sipeed/maixduino/README.md b/board/sipeed/maixduino/README.md
new file mode 100644
index 0000000000..daf0f763c9
--- /dev/null
+++ b/board/sipeed/maixduino/README.md
@@ -0,0 +1,4 @@
+# Sipeed MAIXDUINO Board
+
+See the common documentation for
+[Canaan K210 SoC based boards](../../canaan/k210-common/README.md).
-- 
2.31.1

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

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

* Re: [Buildroot] [PATCH v5 03/10] package/Makefile.in: Fix NOMMU RISC-V 64-bits toolchain base name
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 03/10] package/Makefile.in: Fix NOMMU RISC-V 64-bits toolchain base name Damien Le Moal
@ 2021-10-27  3:26   ` Alistair Francis
  2021-10-27 13:38   ` Peter Korsgaard
  1 sibling, 0 replies; 28+ messages in thread
From: Alistair Francis @ 2021-10-27  3:26 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Alistair Francis, Yann E . MORIN, Thomas Petazzoni, buildroot

On Tue, Oct 26, 2021 at 5:25 PM Damien Le Moal <damien.lemoal@wdc.com> wrote:
>
> From: Christoph Hellwig <hch@lst.de>
>
> Using *-uclinux-* seems like an only partially followed convention.
> And at least RISC-V 64-bits gcc does not know about uclinux tuples.
> So switch back to the normal "linux" one for now.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> [Damien]
> * Make the change conditional on BR2_RISCV_64 being "y".
>
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>

Acked-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  package/Makefile.in | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 04347d2d84..dae7a859fd 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -39,8 +39,9 @@ endif
>  # Compute GNU_TARGET_NAME
>  GNU_TARGET_NAME = $(ARCH)-$(TARGET_VENDOR)-$(TARGET_OS)-$(LIBC)$(ABI)
>
> -# FLAT binary format needs uclinux
> -ifeq ($(BR2_BINFMT_FLAT),y)
> +# FLAT binary format needs uclinux, except RISC-V 64-bits which needs
> +# the regular linux name.
> +ifeq ($(BR2_BINFMT_FLAT):$(BR2_RISCV_64),y:)
>  TARGET_OS = uclinux
>  else
>  TARGET_OS = linux
> --
> 2.31.1
>
> _______________________________________________
> 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

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

* Re: [Buildroot] [PATCH v5 01/10] package: Makefile.in: fix elf2flt invocation options
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 01/10] package: Makefile.in: fix elf2flt invocation options Damien Le Moal
@ 2021-10-27 13:37   ` Peter Korsgaard
  0 siblings, 0 replies; 28+ messages in thread
From: Peter Korsgaard @ 2021-10-27 13:37 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Alistair Francis, Yann E . MORIN, Thomas Petazzoni, buildroot

>>>>> "Damien" == Damien Le Moal <damien.lemoal@wdc.com> writes:

 > When BR2_BINFMT_FLAT_ONE is selected, elf2flt must be invoked with the
 > "-r" option to ensure that a single contiguous binary image is created,
 > regardless of the architecture default image format implemented by
 > elf2flt.

 > Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 02/10] package/elf2flt: add RISC-V 64-bits support
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 02/10] package/elf2flt: add RISC-V 64-bits support Damien Le Moal
@ 2021-10-27 13:38   ` Peter Korsgaard
  2021-10-28  0:35     ` Damien Le Moal
  0 siblings, 1 reply; 28+ messages in thread
From: Peter Korsgaard @ 2021-10-27 13:38 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Alistair Francis, Yann E . MORIN, Thomas Petazzoni, buildroot

>>>>> "Damien" == Damien Le Moal <damien.lemoal@wdc.com> writes:

 > Enable selecting elf2flt for RISC-V 64-bits no MMU builds and add
 > support for it in the form of an additional patch (upstream pull request
 > https://github.com/uclinux-dev/elf2flt/pull/22).

 > Also modify the package Makefile.in file to add the -fPIC option to
 > the target CFLAGS for RISC-V 64-bits no MMU builds.

 > This patch is based on initial work by Christoph Hellwig <hch@lst.de>.

 > Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 03/10] package/Makefile.in: Fix NOMMU RISC-V 64-bits toolchain base name
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 03/10] package/Makefile.in: Fix NOMMU RISC-V 64-bits toolchain base name Damien Le Moal
  2021-10-27  3:26   ` Alistair Francis
@ 2021-10-27 13:38   ` Peter Korsgaard
  1 sibling, 0 replies; 28+ messages in thread
From: Peter Korsgaard @ 2021-10-27 13:38 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Alistair Francis, Yann E . MORIN, Thomas Petazzoni, buildroot

>>>>> "Damien" == Damien Le Moal <damien.lemoal@wdc.com> writes:

 > From: Christoph Hellwig <hch@lst.de>
 > Using *-uclinux-* seems like an only partially followed convention.
 > And at least RISC-V 64-bits gcc does not know about uclinux tuples.
 > So switch back to the normal "linux" one for now.

 > Signed-off-by: Christoph Hellwig <hch@lst.de>

 > [Damien]
 > * Make the change conditional on BR2_RISCV_64 being "y".

 > Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 04/10] arch/config: Make RISC-V 64-bits MMU optional
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 04/10] arch/config: Make RISC-V 64-bits MMU optional Damien Le Moal
@ 2021-10-27 13:38   ` Peter Korsgaard
  0 siblings, 0 replies; 28+ messages in thread
From: Peter Korsgaard @ 2021-10-27 13:38 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Alistair Francis, Yann E . MORIN, Thomas Petazzoni, buildroot

>>>>> "Damien" == Damien Le Moal <damien.lemoal@wdc.com> writes:

 > Linux supports No-MMU RISC-V 64-bits since kernel version 5.8. Make
 > MMU optional to enable building for RISC-V 64-bits boards that do not
 > have one. MMU use of RISC-V 32-bits builds remains mandatory for now.

 > Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
 > Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Committed, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support Damien Le Moal
@ 2021-10-27 13:51   ` Peter Korsgaard
  2021-10-28  1:07     ` Damien Le Moal
  2021-12-30 20:27   ` Thomas Petazzoni
  1 sibling, 1 reply; 28+ messages in thread
From: Peter Korsgaard @ 2021-10-27 13:51 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Alistair Francis, Yann E . MORIN, Thomas Petazzoni, buildroot

>>>>> "Damien" == Damien Le Moal <damien.lemoal@wdc.com> writes:

 > Add two configuration files to support the dual-core RV64 Canaan K210
 > SoC based Sipeed MAIX-bit board.

 > The first configuration file, sipeed_maix_bit_defconfig, enables
 > building a bootable kernel 5.13 image with the root file system
 > initramfs linked with the kernel. This configuration modifies the
 > default busybox configuration busybox-minimal.config using the fragment
 > file board/canaan/k210-common/busybox-tiny.config. This reduces the
 > size of the busybox executable to save memory when executing shell
 > commands.

 > The second configuration file (sipeed_maix_bit_sdcard_defconfig) builds
 > a bootable kernel 5.13 image that uses the board SD card for the root
 > file system. This configuration uses the default busybox minimal
 > configuration.

 > Both configurations share the same device tree which is provided by and
 > built-in the kernel. This configuration is set with the kernel
 > configuration snippet provided by the configuration file
 > board/sipeed/maix-bit/linux-dtb.config.

 > Both configurations also share the same init script provided using the
 > rootfs_overlay root file system overlay. This provides the /sbin/init
 > script which replaces the default init process as it causes failures
 > due to excessive memory usage.

 > busybox-tiny.config and the rootfs overlay will be reused for all
 > Canaan K210 SoC based boards. These 2 files are thus placed in the
 > directory board/canaan/k210-common while the Sipeed MAIX-bit board
 > specific kernel config snippet is added under the directory
 > board/sipeed/maix-bit.

 > Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
 > ---
 >  board/canaan/k210-common/busybox-tiny.config  | 241 ++++++++++++++++++
 >  board/canaan/k210-common/rootfs_overlay/init  |   1 +
 >  .../k210-common/rootfs_overlay/sbin/init      |  27 ++
 >  board/sipeed/maix-bit/linux-dtb.config        |   2 +
 >  configs/sipeed_maix_bit_defconfig             |  14 +
 >  configs/sipeed_maix_bit_sdcard_defconfig      |  13 +
 >  6 files changed, 298 insertions(+)
 >  create mode 100644 board/canaan/k210-common/busybox-tiny.config
 >  create mode 120000 board/canaan/k210-common/rootfs_overlay/init
 >  create mode 100755 board/canaan/k210-common/rootfs_overlay/sbin/init
 >  create mode 100644 board/sipeed/maix-bit/linux-dtb.config
 >  create mode 100644 configs/sipeed_maix_bit_defconfig
 >  create mode 100644 configs/sipeed_maix_bit_sdcard_defconfig

 > diff --git a/board/canaan/k210-common/busybox-tiny.config b/board/canaan/k210-common/busybox-tiny.config
 > new file mode 100644
 > index 0000000000..7adcaf1db9
 > --- /dev/null
 > +++ b/board/canaan/k210-common/busybox-tiny.config
 > @@ -0,0 +1,241 @@
 > +#
 > +# Additional config changes for busybox-minimal.config
 > +# to reduce the size of the busybox executable.
 > +#
 > +
 > +#
 > +# Settings
 > +#
 > +# CONFIG_INCLUDE_SUSv2 is not set
 > +# CONFIG_LONG_OPTS is not set
 > +# CONFIG_LFS is not set
 > +# CONFIG_FEATURE_DEVPTS is not set
 > +# CONFIG_FEATURE_SYSLOG_INFO is not set
 > +# CONFIG_FEATURE_SYSLOG is not set
 > +
 > +#
 > +# Build Options
 > +#
 > +CONFIG_NOMMU=y

That is already taken care of in package/busybox/busybox.mk

Did you verify if all of these tweaks are needed? This looks pretty
extensive. Perhaps we should update busybox-minimal with some of these
instead?

 > diff --git a/board/canaan/k210-common/rootfs_overlay/init b/board/canaan/k210-common/rootfs_overlay/init
 > new file mode 120000
 > index 0000000000..a0b71977c0
 > --- /dev/null
 > +++ b/board/canaan/k210-common/rootfs_overlay/init
 > @@ -0,0 +1 @@
 > +/sbin/init
 > \ No newline at end of file

Why? Isn't fs/cpio/init suitable?


 > diff --git a/board/canaan/k210-common/rootfs_overlay/sbin/init b/board/canaan/k210-common/rootfs_overlay/sbin/init
 > new file mode 100755
 > index 0000000000..6ec4748c03
 > --- /dev/null
 > +++ b/board/canaan/k210-common/rootfs_overlay/sbin/init
 > @@ -0,0 +1,27 @@
 > +#!/bin/sh
 > +
 > +# Mount sysfs and procfs
 > +/bin/mount -t sysfs sysfs /sys
 > +/bin/mount -t proc proc /proc
 > +
 > +# Use the /dev/console device node from devtmpfs if possible to not
 > +# confuse glibc's ttyname_r().
 > +# This may fail (E.G. booted with console=), and errors from exec will
 > +# terminate the shell, so use a subshell for the test
 > +if (exec 0</dev/console) 2>/dev/null; then
 > +    exec 0</dev/console
 > +    exec 1>/dev/console
 > +    exec 2>/dev/console
 > +fi
 > +
 > +# Print a fun logo :)
 > +echo "          __  _"
 > +echo "         / / (_) ____   _   _ __  __"
 > +echo "        / /  | ||  _ \\ | | | |\\ \\/ /"
 > +echo "       / /___| || | | || |_| | >  < "
 > +echo "      /_____/|_||_| |_| \\____|/_/\\_\\"
 > +echo "    64-bits RISC-V Kendryte K210 NOMMU"
 > +echo ""
 > +
 > +# Start interactive shell
 > +exec /bin/sh

Cute, but why can't we use the normal busybox init / inittab?


 > diff --git a/configs/sipeed_maix_bit_defconfig b/configs/sipeed_maix_bit_defconfig
 > new file mode 100644
 > index 0000000000..bbbe00d44d
 > --- /dev/null
 > +++ b/configs/sipeed_maix_bit_defconfig
 > @@ -0,0 +1,14 @@
 > +BR2_riscv=y
 > +BR2_PACKAGE_HOST_ELF2FLT=y
 > +# BR2_USE_MMU is not set
 > +BR2_INIT_NONE=y
 > +BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
 > +BR2_LINUX_KERNEL=y

You don't specify the kernel version, so it will change every time we
bump it, please specify a known good version.

I gave it a try here, and it fails to boot with 5.14.14:

[    0.000000] Linux version 5.14.14 (peko@dell) (riscv64-buildroot-linux-uclibc-gcc.br_real (Buildroot 2021.08-1048-g5e9960e97a) 10.3.0, GNU ld (GNU Binutils) 2.32) #2 SMP Wed Oct 27 15:23:57 CEST 2021
[    0.000000] Machine model: SiPeed MAIX BiT
[    0.000000] earlycon: sifive0 at MMIO 0x0000000038000000 (options '115200n8')
[    0.000000] printk: bootconsole [sifive0] enabled
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080000000-0x00000000807fffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x00000000807fffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000807fffff]
[    0.000000] riscv: ISA extensions acdfim
[    0.000000] riscv: ELF capabilities acdfim
[    0.000000] percpu: max_distance=0x18000 too large for vmalloc space 0x0
[    0.000000] percpu: Embedded 12 pages/cpu s19488 r0 d29664 u49152
[    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 2020
[    0.000000] Kernel command line: earlycon console=ttySIF0
[    0.000000] Dentry cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.000000] Inode-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 5924K/8192K available (954K kernel code, 130K rwdata, 203K rodata, 612K init, 66K bss, 2268K reserved, 0K cma-reserved)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: interrupt-controller@c000000: mapped 65 interrupts with 2 handlers for 2 contexts.
[    0.000000] k210-clk: clock-controller: CPU running at 390 MHz
[    0.000000] clint: timer@2000000: timer running at 7800000 Hz
[    0.000000] clocksource: clint_clocksource: mask: 0xffffffffffffffff max_cycles: 0x3990be68b, max_idle_ns: 881590404272 ns
[    0.000001] sched_clock: 64 bits at 7MHz, resolution 128ns, wraps every 4398046511054ns
[    0.008190] Calibrating delay loop (skipped), value calculated using timer frequency.. 15.60 BogoMIPS (lpj=31200)
[    0.018252] pid_max: default: 4096 minimum: 301
[    0.022864] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.029971] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.040317] rcu: Hierarchical SRCU implementation.
[    0.045164] smp: Bringing up secondary CPUs ...
[    0.050277] smp: Brought up 1 node, 2 CPUs
[    0.054394] devtmpfs: initialized
[    0.071455] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.080529] pinctrl core: initialized pinctrl subsystem
[    0.118390] clocksource: Switched to clocksource clint_clocksource
[    0.130717] workingset: timestamp_bits=62 max_order=11 bucket_order=0
[    0.179654] k210-fpioa 502b0000.pinmux: K210 FPIOA pin controller
[    0.192098] k210-sysctl 50440000.syscon: K210 system controller
[    0.198640] k210-rst 50440000.syscon:reset-controller: K210 reset controller
[    0.205661] 38000000.serial: ttySIF0 at MMIO 0x38000000 (irq = 1, base_baud = 115200) is a SiFive UART v0
[    0.214615] printk: console [ttySIF0] enabled
[    0.214615] printk: console [ttySIF0] enabled
[    0.223228] printk: bootconsole [sifive0] disabled
[    0.223228] printk: bootconsole [sifive0] disabled
[    0.234774] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.252477] i2c /dev entries driver
[    0.257111] random: get_random_bytes called from 0x000000008000569a with crng_init=0
[    0.270302] Freeing unused kernel image (initmem) memory: 608K
[    0.275461] This architecture does not have kernel memory protection.
[    0.281864] Run /init as init process
[    0.288105] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
[    0.295040] SMP: stopping secondary CPUs
[    0.298959] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]---
[    0.000000] Linux version 5.14.14 (peko@dell) (riscv64-buildroot-linux-uclibc-gcc.br_real (Buildroot 2021.08-1048-g5e9960e97a) 10.3.0, GNU ld (GNU Binutils) 2.32) #2 SMP Wed Oct 27 15:23:57 CEST 2021
[    0.000000] Machine model: SiPeed MAIX BiT
[    0.000000] earlycon: sifive0 at MMIO 0x0000000038000000 (options '115200n8')
[    0.000000] printk: bootconsole [sifive0] enabled
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080000000-0x00000000807fffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x00000000807fffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000807fffff]
[    0.000000] riscv: ISA extensions acdfim
[    0.000000] riscv: ELF capabilities acdfim
[    0.000000] percpu: max_distance=0x18000 too large for vmalloc space 0x0
[    0.000000] percpu: Embedded 12 pages/cpu s19488 r0 d29664 u49152
[    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 2020
[    0.000000] Kernel command line: earlycon console=ttySIF0
[    0.000000] Dentry cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.000000] Inode-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 5924K/8192K available (954K kernel code, 130K rwdata, 203K rodata, 612K init, 66K bss, 2268K reserved, 0K cma-reserved)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: interrupt-controller@c000000: mapped 65 interrupts with 2 handlers for 2 contexts.
[    0.000000] k210-clk: clock-controller: CPU running at 390 MHz
[    0.000000] clint: timer@2000000: timer running at 7800000 Hz
[    0.000000] clocksource: clint_clocksource: mask: 0xffffffffffffffff max_cycles: 0x3990be68b, max_idle_ns: 881590404272 ns
[    0.000001] sched_clock: 64 bits at 7MHz, resolution 128ns, wraps every 4398046511054ns
[    0.008190] Calibrating delay loop (skipped), value calculated using timer frequency.. 15.60 BogoMIPS (lpj=31200)
[    0.018252] pid_max: default: 4096 minimum: 301
[    0.022864] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.029971] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.040304] rcu: Hierarchical SRCU implementation.
[    0.045147] smp: Bringing up secondary CPUs ...
[    0.050247] smp: Brought up 1 node, 2 CPUs
[    0.054362] devtmpfs: initialized
[    0.071442] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.080516] pinctrl core: initialized pinctrl subsystem
[    0.118372] clocksource: Switched to clocksource clint_clocksource
[    0.130700] workingset: timestamp_bits=62 max_order=11 bucket_order=0
[    0.180388] k210-fpioa 502b0000.pinmux: K210 FPIOA pin controller
[    0.192630] k210-sysctl 50440000.syscon: K210 system controller
[    0.199205] k210-rst 50440000.syscon:reset-controller: K210 reset controller
[    0.206469] 38000000.serial: ttySIF0 at MMIO 0x38000000 (irq = 1, base_baud = 115200) is a SiFive UART v0
[    0.215380] printk: console [ttySIF0] enabled
[    0.215380] printk: console [ttySIF0] enabled
[    0.224034] printk: bootconsole [sifive0] disabled
[    0.224034] printk: bootconsole [sifive0] disabled
[    0.235632] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.253373] i2c /dev entries driver
[    0.258022] random: get_random_bytes called from 0x000000008000569a with crng_init=0
[    0.271672] Freeing unused kernel image (initmem) memory: 608K
[    0.276809] This architecture does not have kernel memory protection.
[    0.283241] Run /init as init process
[    0.289488] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
[    0.296422] SMP: stopping secondary CPUs
[    0.300340] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]---

Any idea why?


 > +BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210"
 > +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maix-bit/linux-dtb.config"
 > +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
 > +BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"

I see you are adding documentation at the end of the series, but perhaps
it would make sense to add a host package for python3-kflash to make
this work out of the box?


 > +++ b/configs/sipeed_maix_bit_sdcard_defconfig
 > @@ -0,0 +1,13 @@
 > +BR2_riscv=y
 > +BR2_PACKAGE_HOST_ELF2FLT=y
 > +# BR2_USE_MMU is not set
 > +BR2_INIT_NONE=y
 > +BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
 > +BR2_LINUX_KERNEL=y

Same comment about the kernel version.


 > +BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210_sdcard"
 > +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maix-bit/linux-dtb.config"
 > +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
 > +BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
 > +BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
 > +# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
 > +BR2_TARGET_ROOTFS_EXT2=y

We have genimage in buildroot so it is easy to create a full sd card
image with the right partition as well. I also see that there is some
k210 support in u-boot nowadays, would a setup with u-boot in the SPI
flash and kernel + rootfs on the SD card not be nicer?

Any specific reason to keep the kernel in the SPI flash?

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 02/10] package/elf2flt: add RISC-V 64-bits support
  2021-10-27 13:38   ` Peter Korsgaard
@ 2021-10-28  0:35     ` Damien Le Moal
  2021-10-28  6:30       ` Peter Korsgaard
  0 siblings, 1 reply; 28+ messages in thread
From: Damien Le Moal @ 2021-10-28  0:35 UTC (permalink / raw)
  To: Peter Korsgaard
  Cc: Alistair Francis, Yann E . MORIN, Thomas Petazzoni, buildroot

On 2021/10/27 22:38, Peter Korsgaard wrote:
>>>>>> "Damien" == Damien Le Moal <damien.lemoal@wdc.com> writes:
> 
>  > Enable selecting elf2flt for RISC-V 64-bits no MMU builds and add
>  > support for it in the form of an additional patch (upstream pull request
>  > https://github.com/uclinux-dev/elf2flt/pull/22).
> 
>  > Also modify the package Makefile.in file to add the -fPIC option to
>  > the target CFLAGS for RISC-V 64-bits no MMU builds.
> 
>  > This patch is based on initial work by Christoph Hellwig <hch@lst.de>.
> 
>  > Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> 
> Committed, thanks.

Thanks. However, I may have sent this prematurely: I received additional
comments on the elf2flt pull request that I need to address. I can send an
incremental fix or you can revert this patch and the following and send an
updated series ?

See also related reply to your comments on patch 5.


-- 
Damien Le Moal
Western Digital Research
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support
  2021-10-27 13:51   ` Peter Korsgaard
@ 2021-10-28  1:07     ` Damien Le Moal
       [not found]       ` <e6eb0eda-20db-dfd6-c3d6-47db131bc247@gmail.com>
  2021-10-28  7:01       ` Peter Korsgaard
  0 siblings, 2 replies; 28+ messages in thread
From: Damien Le Moal @ 2021-10-28  1:07 UTC (permalink / raw)
  To: Peter Korsgaard
  Cc: Alistair Francis, Sean Anderson, Yann E . MORIN,
	Thomas Petazzoni, buildroot

On 2021/10/27 22:51, Peter Korsgaard wrote:
>  > diff --git a/board/canaan/k210-common/busybox-tiny.config b/board/canaan/k210-common/busybox-tiny.config
>  > new file mode 100644
>  > index 0000000000..7adcaf1db9
>  > --- /dev/null
>  > +++ b/board/canaan/k210-common/busybox-tiny.config
>  > @@ -0,0 +1,241 @@
>  > +#
>  > +# Additional config changes for busybox-minimal.config
>  > +# to reduce the size of the busybox executable.
>  > +#
>  > +
>  > +#
>  > +# Settings
>  > +#
>  > +# CONFIG_INCLUDE_SUSv2 is not set
>  > +# CONFIG_LONG_OPTS is not set
>  > +# CONFIG_LFS is not set
>  > +# CONFIG_FEATURE_DEVPTS is not set
>  > +# CONFIG_FEATURE_SYSLOG_INFO is not set
>  > +# CONFIG_FEATURE_SYSLOG is not set
>  > +
>  > +#
>  > +# Build Options
>  > +#
>  > +CONFIG_NOMMU=y
> 
> That is already taken care of in package/busybox/busybox.mk

Right. I overlooked that. This should not be needed. Will check.

> Did you verify if all of these tweaks are needed? This looks pretty
> extensive. Perhaps we should update busybox-minimal with some of these
> instead?

busybox-minimal is fine but gives a larger busybox executable. I added this tiny
config to save memory when running and avoid failures due to memory allocation
when executing complex-ish shell commands spawning multiple shells (e.g. pipes).

>  > diff --git a/board/canaan/k210-common/rootfs_overlay/init b/board/canaan/k210-common/rootfs_overlay/init
>  > new file mode 120000
>  > index 0000000000..a0b71977c0
>  > --- /dev/null
>  > +++ b/board/canaan/k210-common/rootfs_overlay/init
>  > @@ -0,0 +1 @@
>  > +/sbin/init
>  > \ No newline at end of file
> 
> Why? Isn't fs/cpio/init suitable?

In the past, I was getting errors mounting devtmpfs. Trying again now, it seems
to be working as expected. This added init does adds mount of sysfs and procfs
for convenience, but the main point is that the last exec starts the interactive
shell instead of /sbin/init. The default busybox init executable is way too big
and fails to run.

I could just overlay /sbin/init as a symlink to /bin/sh.

I do like the sysfs and proc automatic mount though, and the cute logo added :)

>  > diff --git a/board/canaan/k210-common/rootfs_overlay/sbin/init b/board/canaan/k210-common/rootfs_overlay/sbin/init
>  > new file mode 100755
>  > index 0000000000..6ec4748c03
>  > --- /dev/null
>  > +++ b/board/canaan/k210-common/rootfs_overlay/sbin/init
>  > @@ -0,0 +1,27 @@
>  > +#!/bin/sh
>  > +
>  > +# Mount sysfs and procfs
>  > +/bin/mount -t sysfs sysfs /sys
>  > +/bin/mount -t proc proc /proc
>  > +
>  > +# Use the /dev/console device node from devtmpfs if possible to not
>  > +# confuse glibc's ttyname_r().
>  > +# This may fail (E.G. booted with console=), and errors from exec will
>  > +# terminate the shell, so use a subshell for the test
>  > +if (exec 0</dev/console) 2>/dev/null; then
>  > +    exec 0</dev/console
>  > +    exec 1>/dev/console
>  > +    exec 2>/dev/console
>  > +fi
>  > +
>  > +# Print a fun logo :)
>  > +echo "          __  _"
>  > +echo "         / / (_) ____   _   _ __  __"
>  > +echo "        / /  | ||  _ \\ | | | |\\ \\/ /"
>  > +echo "       / /___| || | | || |_| | >  < "
>  > +echo "      /_____/|_||_| |_| \\____|/_/\\_\\"
>  > +echo "    64-bits RISC-V Kendryte K210 NOMMU"
>  > +echo ""
>  > +
>  > +# Start interactive shell
>  > +exec /bin/sh
> 
> Cute, but why can't we use the normal busybox init / inittab?

The default binary init is way too big and fails to run (ENOMEM). Even if we
could run it, it would stay around and consume memory for nothing.
That is why I just go straight to an interactive shell here.

>  > diff --git a/configs/sipeed_maix_bit_defconfig b/configs/sipeed_maix_bit_defconfig
>  > new file mode 100644
>  > index 0000000000..bbbe00d44d
>  > --- /dev/null
>  > +++ b/configs/sipeed_maix_bit_defconfig
>  > @@ -0,0 +1,14 @@
>  > +BR2_riscv=y
>  > +BR2_PACKAGE_HOST_ELF2FLT=y
>  > +# BR2_USE_MMU is not set
>  > +BR2_INIT_NONE=y
>  > +BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
>  > +BR2_LINUX_KERNEL=y
> 
> You don't specify the kernel version, so it will change every time we
> bump it, please specify a known good version.

Any version including and above 5.13 work fine. How do I do that ?

> 
> I gave it a try here, and it fails to boot with 5.14.14:
[...]> [    0.253373] i2c /dev entries driver
> [    0.258022] random: get_random_bytes called from 0x000000008000569a with crng_init=0
> [    0.271672] Freeing unused kernel image (initmem) memory: 608K
> [    0.276809] This architecture does not have kernel memory protection.
> [    0.283241] Run /init as init process
> [    0.289488] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
> [    0.296422] SMP: stopping secondary CPUs
> [    0.300340] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]---
> 
> Any idea why?

I was getting the same when elf2flt had problems (buggy relocation). What I sent
is working for me doing this:

make clean
make sipeed_maix_bit_defconfig
make

And flashing loader.bin gives me a working shell.

Not sure what is going on. It seems that elf2flt riscv support is still very
fragile. I need to address the comments I got on my PR and dig further to check
that I am not overlooking anything.

>  > +BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210"
>  > +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maix-bit/linux-dtb.config"
>  > +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
>  > +BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
> 
> I see you are adding documentation at the end of the series, but perhaps
> it would make sense to add a host package for python3-kflash to make
> this work out of the box?

Yes, we could. Do you want this with this series ? Or adding it later is OK ?
I need to check how to add a host package. Not sure how to do that...

>  > +BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210_sdcard"
>  > +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maix-bit/linux-dtb.config"
>  > +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
>  > +BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
>  > +BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
>  > +# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
>  > +BR2_TARGET_ROOTFS_EXT2=y
> 
> We have genimage in buildroot so it is easy to create a full sd card
> image with the right partition as well. I also see that there is some
> k210 support in u-boot nowadays, would a setup with u-boot in the SPI
> flash and kernel + rootfs on the SD card not be nicer?

+Sean who did all the k210 U-Boot work.

I have not tried but I think it should work. And as long as the final memory
usage is the same (e.g. U-Boot not sticking around in memory), things should be
all OK.

> Any specific reason to keep the kernel in the SPI flash?

Not really for now. It is just very simple to use :)

Going forward though, I hope to be able to use XIP to execute busybox from there
directly. There are patches out there for this board and got report that it is
working with nommu. But that is more for the cpio case than the sdcard case.

Let me dig again in elf2flt to see if I can get something more solid.

Thanks for the comments.


-- 
Damien Le Moal
Western Digital Research
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support
       [not found]       ` <e6eb0eda-20db-dfd6-c3d6-47db131bc247@gmail.com>
@ 2021-10-28  2:24         ` Damien Le Moal
  0 siblings, 0 replies; 28+ messages in thread
From: Damien Le Moal @ 2021-10-28  2:24 UTC (permalink / raw)
  To: Sean Anderson, Peter Korsgaard
  Cc: Alistair Francis, Yann E . MORIN, Thomas Petazzoni, buildroot

On 2021/10/28 10:21, Sean Anderson wrote:
> On 10/27/21 9:07 PM, Damien Le Moal wrote:
>> On 2021/10/27 22:51, Peter Korsgaard wrote:
>>>   > diff --git a/board/canaan/k210-common/busybox-tiny.config b/board/canaan/k210-common/busybox-tiny.config
>>>   > new file mode 100644
>>>   > index 0000000000..7adcaf1db9
>>>   > --- /dev/null
>>>   > +++ b/board/canaan/k210-common/busybox-tiny.config
>>>   > @@ -0,0 +1,241 @@
>>>   > +#
>>>   > +# Additional config changes for busybox-minimal.config
>>>   > +# to reduce the size of the busybox executable.
>>>   > +#
>>>   > +
>>>   > +#
>>>   > +# Settings
>>>   > +#
>>>   > +# CONFIG_INCLUDE_SUSv2 is not set
>>>   > +# CONFIG_LONG_OPTS is not set
>>>   > +# CONFIG_LFS is not set
>>>   > +# CONFIG_FEATURE_DEVPTS is not set
>>>   > +# CONFIG_FEATURE_SYSLOG_INFO is not set
>>>   > +# CONFIG_FEATURE_SYSLOG is not set
>>>   > +
>>>   > +#
>>>   > +# Build Options
>>>   > +#
>>>   > +CONFIG_NOMMU=y
>>>
>>> That is already taken care of in package/busybox/busybox.mk
>>
>> Right. I overlooked that. This should not be needed. Will check.
>>
>>> Did you verify if all of these tweaks are needed? This looks pretty
>>> extensive. Perhaps we should update busybox-minimal with some of these
>>> instead?
>>
>> busybox-minimal is fine but gives a larger busybox executable. I added this tiny
>> config to save memory when running and avoid failures due to memory allocation
>> when executing complex-ish shell commands spawning multiple shells (e.g. pipes).
>>
>>>   > diff --git a/board/canaan/k210-common/rootfs_overlay/init b/board/canaan/k210-common/rootfs_overlay/init
>>>   > new file mode 120000
>>>   > index 0000000000..a0b71977c0
>>>   > --- /dev/null
>>>   > +++ b/board/canaan/k210-common/rootfs_overlay/init
>>>   > @@ -0,0 +1 @@
>>>   > +/sbin/init
>>>   > \ No newline at end of file
>>>
>>> Why? Isn't fs/cpio/init suitable?
>>
>> In the past, I was getting errors mounting devtmpfs. Trying again now, it seems
>> to be working as expected. This added init does adds mount of sysfs and procfs
>> for convenience, but the main point is that the last exec starts the interactive
>> shell instead of /sbin/init. The default busybox init executable is way too big
>> and fails to run.
>>
>> I could just overlay /sbin/init as a symlink to /bin/sh.
>>
>> I do like the sysfs and proc automatic mount though, and the cute logo added :)
>>
>>>   > diff --git a/board/canaan/k210-common/rootfs_overlay/sbin/init b/board/canaan/k210-common/rootfs_overlay/sbin/init
>>>   > new file mode 100755
>>>   > index 0000000000..6ec4748c03
>>>   > --- /dev/null
>>>   > +++ b/board/canaan/k210-common/rootfs_overlay/sbin/init
>>>   > @@ -0,0 +1,27 @@
>>>   > +#!/bin/sh
>>>   > +
>>>   > +# Mount sysfs and procfs
>>>   > +/bin/mount -t sysfs sysfs /sys
>>>   > +/bin/mount -t proc proc /proc
>>>   > +
>>>   > +# Use the /dev/console device node from devtmpfs if possible to not
>>>   > +# confuse glibc's ttyname_r().
>>>   > +# This may fail (E.G. booted with console=), and errors from exec will
>>>   > +# terminate the shell, so use a subshell for the test
>>>   > +if (exec 0</dev/console) 2>/dev/null; then
>>>   > +    exec 0</dev/console
>>>   > +    exec 1>/dev/console
>>>   > +    exec 2>/dev/console
>>>   > +fi
>>>   > +
>>>   > +# Print a fun logo :)
>>>   > +echo "          __  _"
>>>   > +echo "         / / (_) ____   _   _ __  __"
>>>   > +echo "        / /  | ||  _ \\ | | | |\\ \\/ /"
>>>   > +echo "       / /___| || | | || |_| | >  < "
>>>   > +echo "      /_____/|_||_| |_| \\____|/_/\\_\\"
>>>   > +echo "    64-bits RISC-V Kendryte K210 NOMMU"
>>>   > +echo ""
>>>   > +
>>>   > +# Start interactive shell
>>>   > +exec /bin/sh
>>>
>>> Cute, but why can't we use the normal busybox init / inittab?
>>
>> The default binary init is way too big and fails to run (ENOMEM). Even if we
>> could run it, it would stay around and consume memory for nothing.
>> That is why I just go straight to an interactive shell here.
>>
>>>   > diff --git a/configs/sipeed_maix_bit_defconfig b/configs/sipeed_maix_bit_defconfig
>>>   > new file mode 100644
>>>   > index 0000000000..bbbe00d44d
>>>   > --- /dev/null
>>>   > +++ b/configs/sipeed_maix_bit_defconfig
>>>   > @@ -0,0 +1,14 @@
>>>   > +BR2_riscv=y
>>>   > +BR2_PACKAGE_HOST_ELF2FLT=y
>>>   > +# BR2_USE_MMU is not set
>>>   > +BR2_INIT_NONE=y
>>>   > +BR2_ROOTFS_OVERLAY="board/canaan/k210-common/rootfs_overlay"
>>>   > +BR2_LINUX_KERNEL=y
>>>
>>> You don't specify the kernel version, so it will change every time we
>>> bump it, please specify a known good version.
>>
>> Any version including and above 5.13 work fine. How do I do that ?
>>
>>>
>>> I gave it a try here, and it fails to boot with 5.14.14:
>> [...]> [    0.253373] i2c /dev entries driver
>>> [    0.258022] random: get_random_bytes called from 0x000000008000569a with crng_init=0
>>> [    0.271672] Freeing unused kernel image (initmem) memory: 608K
>>> [    0.276809] This architecture does not have kernel memory protection.
>>> [    0.283241] Run /init as init process
>>> [    0.289488] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
>>> [    0.296422] SMP: stopping secondary CPUs
>>> [    0.300340] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]---
>>>
>>> Any idea why?
>>
>> I was getting the same when elf2flt had problems (buggy relocation). What I sent
>> is working for me doing this:
>>
>> make clean
>> make sipeed_maix_bit_defconfig
>> make
>>
>> And flashing loader.bin gives me a working shell.
>>
>> Not sure what is going on. It seems that elf2flt riscv support is still very
>> fragile. I need to address the comments I got on my PR and dig further to check
>> that I am not overlooking anything.
>>
>>>   > +BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210"
>>>   > +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maix-bit/linux-dtb.config"
>>>   > +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
>>>   > +BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
>>>
>>> I see you are adding documentation at the end of the series, but perhaps
>>> it would make sense to add a host package for python3-kflash to make
>>> this work out of the box?
>>
>> Yes, we could. Do you want this with this series ? Or adding it later is OK ?
>> I need to check how to add a host package. Not sure how to do that...
> 
> I suggest [1]. It is faster. Though if you want to compile your own
> 'ISP' it will take a bit of tweaking.
> 
> [1] https://github.com/loboris/ktool

Just tried this and it does not work for me. I get:

Greeting fail, check serial port (SLIP receive timeout (wait frame start))

Tried different options, baudrate etc, but all give the same. Not sure what is
going on.

> 
>>>   > +BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210_sdcard"
>>>   > +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maix-bit/linux-dtb.config"
>>>   > +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
>>>   > +BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
>>>   > +BR2_PACKAGE_BUSYBOX_CONFIG="package/busybox/busybox-minimal.config"
>>>   > +# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
>>>   > +BR2_TARGET_ROOTFS_EXT2=y
>>>
>>> We have genimage in buildroot so it is easy to create a full sd card
>>> image with the right partition as well. I also see that there is some
>>> k210 support in u-boot nowadays, would a setup with u-boot in the SPI
>>> flash and kernel + rootfs on the SD card not be nicer?
>>
>> +Sean who did all the k210 U-Boot work.
> 
> This should work. I have not tested with a recent kernel. If you have
> /{uImage,k210.dtb} on the mmc it will be loaded. See
> include/configs/sipeed-maix.h for details. And feel free to send a patch
> to adapt that to your use-case.

OK. Will give it a try after revisiting elf2flt.

>> I have not tried but I think it should work. And as long as the final memory
>> usage is the same (e.g. U-Boot not sticking around in memory), things should be
>> all OK.
> 
> It doesn't stick around. No SBI either so Linux owns the whole machine
> once it comes up.

Great. There should be no issue then.

>>> Any specific reason to keep the kernel in the SPI flash?
>>
>> Not really for now. It is just very simple to use :)
>>
>> Going forward though, I hope to be able to use XIP to execute busybox from there
>> directly. There are patches out there for this board and got report that it is
>> working with nommu. But that is more for the cpio case than the sdcard case.
> 
> Can you link to that series? I made an attempt in [2] but never went
> beyond reading (and perhaps writing? I don't remember).

I do not have the patches nor a link to them. The developer mentioned that he
has it running on 5.13 on the Maixduino board. Let me ping him again to get a
status update.

> 
> [2] https://lore.kernel.org/u-boot/20210205043924.149504-1-seanga2@gmail.com/
> 
> --Sean
> 


-- 
Damien Le Moal
Western Digital Research
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 02/10] package/elf2flt: add RISC-V 64-bits support
  2021-10-28  0:35     ` Damien Le Moal
@ 2021-10-28  6:30       ` Peter Korsgaard
  0 siblings, 0 replies; 28+ messages in thread
From: Peter Korsgaard @ 2021-10-28  6:30 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Alistair Francis, Yann E . MORIN, Thomas Petazzoni, buildroot

>>>>> "Damien" == Damien Le Moal <Damien.LeMoal@wdc.com> writes:

Hi,

 >> > This patch is based on initial work by Christoph Hellwig <hch@lst.de>.
 >> 
 >> > Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
 >> 
 >> Committed, thanks.

 > Thanks. However, I may have sent this prematurely: I received additional
 > comments on the elf2flt pull request that I need to address. I can send an
 > incremental fix or you can revert this patch and the following and send an
 > updated series ?

If it is only about this one patch, then just sending an incremental
patch is fine by me.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support
  2021-10-28  1:07     ` Damien Le Moal
       [not found]       ` <e6eb0eda-20db-dfd6-c3d6-47db131bc247@gmail.com>
@ 2021-10-28  7:01       ` Peter Korsgaard
  1 sibling, 0 replies; 28+ messages in thread
From: Peter Korsgaard @ 2021-10-28  7:01 UTC (permalink / raw)
  To: Damien Le Moal
  Cc: Alistair Francis, Sean Anderson, Yann E . MORIN,
	Thomas Petazzoni, buildroot

>>>>> "Damien" == Damien Le Moal <Damien.LeMoal@wdc.com> writes:

Hi,

 >> > +CONFIG_NOMMU=y
 >> 
 >> That is already taken care of in package/busybox/busybox.mk

 > Right. I overlooked that. This should not be needed. Will check.

Thanks.

 >> Did you verify if all of these tweaks are needed? This looks pretty
 >> extensive. Perhaps we should update busybox-minimal with some of these
 >> instead?

 > busybox-minimal is fine but gives a larger busybox executable. I added this tiny
 > config to save memory when running and avoid failures due to memory allocation
 > when executing complex-ish shell commands spawning multiple shells (e.g. pipes).

Ok. Would BR2_PACKAGE_BUSYBOX_INDIVIDUAL_BINARIES make sense to save RAM
on NOMMU (I don't really have any nommu experience)?

From a maintenance PoV I would prefer to keep the number of busybox
configs to a minimum, but if we cannot get it to work properly with a
(possibly tweaked) busybox-minimal, then so be it.


 >> Why? Isn't fs/cpio/init suitable?

 > In the past, I was getting errors mounting devtmpfs. Trying again now, it seems
 > to be working as expected. This added init does adds mount of sysfs and procfs
 > for convenience, but the main point is that the last exec starts the interactive
 > shell instead of /sbin/init. The default busybox init executable is way too big
 > and fails to run.

Interesting, why does init fail but /bin/sh doesn't? It is the same
busybox binary, and init does not look that big:

size init/lib.a shell/hush.o
   text    data     bss     dec     hex filename
    635       0       0     635     27b halt.o (ex init/lib.a)
   5907       0       0    5907    1713 init.o (ex init/lib.a)
  51649     904       0   52553    cd49 shell/hush.o

Is it because of the scripts that init executes?


 > I could just overlay /sbin/init as a symlink to /bin/sh.

 > I do like the sysfs and proc automatic mount though, and the cute logo added :)

;)

If we could get the normal init working, then the mounts would be
working. A logo could be printed by getty (see our
BR2_TARGET_GENERIC_ISSUE logic).


 >> Cute, but why can't we use the normal busybox init / inittab?

 > The default binary init is way too big and fails to run (ENOMEM). Even if we
 > could run it, it would stay around and consume memory for nothing.
 > That is why I just go straight to an interactive shell here.

Ok, can you just add a small comment to the file to explain that?


 >> > +BR2_LINUX_KERNEL=y
 >> 
 >> You don't specify the kernel version, so it will change every time we
 >> bump it, please specify a known good version.

 > Any version including and above 5.13 work fine. How do I do that ?

BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="<version>"

See the other defconfigs for examples.


 >> I gave it a try here, and it fails to boot with 5.14.14:
 > [...]> [    0.253373] i2c /dev entries driver
 >> [    0.258022] random: get_random_bytes called from 0x000000008000569a with crng_init=0
 >> [    0.271672] Freeing unused kernel image (initmem) memory: 608K
 >> [    0.276809] This architecture does not have kernel memory protection.
 >> [    0.283241] Run /init as init process
 >> [    0.289488] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
 >> [    0.296422] SMP: stopping secondary CPUs
 >> [    0.300340] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000 ]---
 >> 
 >> Any idea why?

 > I was getting the same when elf2flt had problems (buggy relocation). What I sent
 > is working for me doing this:

 > make clean
 > make sipeed_maix_bit_defconfig
 > make

Odd. This was with a clean build on current master after applying your
patch 5.


 > Not sure what is going on. It seems that elf2flt riscv support is still very
 > fragile. I need to address the comments I got on my PR and dig further to check
 > that I am not overlooking anything.

Ok, thanks.


 >> > +BR2_LINUX_KERNEL_DEFCONFIG="nommu_k210"
 >> > +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/sipeed/maix-bit/linux-dtb.config"
 >> > +BR2_LINUX_KERNEL_IMAGE_TARGET_CUSTOM=y
 >> > +BR2_LINUX_KERNEL_IMAGE_NAME="loader.bin"
 >> 
 >> I see you are adding documentation at the end of the series, but perhaps
 >> it would make sense to add a host package for python3-kflash to make
 >> this work out of the box?

 > Yes, we could. Do you want this with this series ? Or adding it later is OK ?
 > I need to check how to add a host package. Not sure how to do that...

I think it makes sense to add it now, it is quite easy to do. See
package/Config.in.host and one of the packages listed there,
E.G. python-lxml. Also see the documentation:

https://buildroot.org/downloads/manual/manual.html#_literal_config_in_host_literal_file


 >> We have genimage in buildroot so it is easy to create a full sd card
 >> image with the right partition as well. I also see that there is some
 >> k210 support in u-boot nowadays, would a setup with u-boot in the SPI
 >> flash and kernel + rootfs on the SD card not be nicer?

 > +Sean who did all the k210 U-Boot work.

 > I have not tried but I think it should work. And as long as the final memory
 > usage is the same (e.g. U-Boot not sticking around in memory), things should be
 > all OK.

I believe it should be. It would make it more similar to other boards
and a bit faster/easier to update.


 >> Any specific reason to keep the kernel in the SPI flash?

 > Not really for now. It is just very simple to use :)

 > Going forward though, I hope to be able to use XIP to execute busybox from there
 > directly. There are patches out there for this board and got report that it is
 > working with nommu. But that is more for the cpio case than the sdcard case.

How does XIP work with cpio/initramfs? Isn't XIP about storing the
application uncompressed in a filesystem in the flash and executing it
directly from there?

How about XIP for the kernel?


 > Let me dig again in elf2flt to see if I can get something more solid.

Great, thanks!

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support
  2021-10-26  7:17 ` [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support Damien Le Moal
  2021-10-27 13:51   ` Peter Korsgaard
@ 2021-12-30 20:27   ` Thomas Petazzoni
  2021-12-30 20:29     ` Thomas Petazzoni
  2021-12-31  0:39     ` Damien Le Moal
  1 sibling, 2 replies; 28+ messages in thread
From: Thomas Petazzoni @ 2021-12-30 20:27 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: Alistair Francis, Yann E . MORIN, buildroot

Hello Damien,

On Tue, 26 Oct 2021 16:17:23 +0900
Damien Le Moal <damien.lemoal@wdc.com> wrote:

> Add two configuration files to support the dual-core RV64 Canaan K210
> SoC based Sipeed MAIX-bit board.

You had lots of feedback from Peter Korsgaard on your Buildroot
defconfigs. Do you think you will have the chance to post an updated
version? I will mark patches 5/10 to 10/10 as Superseded. This means
that if you don't get back to us with an updated version, we will
forget about those patches.

Just two additional notes:

 - The readme files should be readme.txt (not README.md), as we don't
   use markdown for now in our readme files.

 - The readme.txt file for each defconfig should be added in the patch
   adding the defconfig

 - The DEVELOPERS file should be updated, in each patch, to add a
   reference to you as a maintainer for these defconfigs and board/
   files.

Thanks a lot!

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

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

* Re: [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support
  2021-12-30 20:27   ` Thomas Petazzoni
@ 2021-12-30 20:29     ` Thomas Petazzoni
  2021-12-31  0:39     ` Damien Le Moal
  1 sibling, 0 replies; 28+ messages in thread
From: Thomas Petazzoni @ 2021-12-30 20:29 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: Alistair Francis, Yann E . MORIN, buildroot

On Thu, 30 Dec 2021 21:27:42 +0100
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> You had lots of feedback from Peter Korsgaard on your Buildroot
> defconfigs. Do you think you will have the chance to post an updated
> version? I will mark patches 5/10 to 10/10 as Superseded. This means
> that if you don't get back to us with an updated version, we will
> forget about those patches.

I actually marked the patches as "Changes requested".

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] 28+ messages in thread

* Re: [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support
  2021-12-30 20:27   ` Thomas Petazzoni
  2021-12-30 20:29     ` Thomas Petazzoni
@ 2021-12-31  0:39     ` Damien Le Moal
  2022-01-03 15:25       ` Thomas Petazzoni
  1 sibling, 1 reply; 28+ messages in thread
From: Damien Le Moal @ 2021-12-31  0:39 UTC (permalink / raw)
  To: thomas.petazzoni; +Cc: alistair, yann.morin.1998, buildroot

On Thu, 2021-12-30 at 21:27 +0100, Thomas Petazzoni wrote:
> Hello Damien,
> 
> On Tue, 26 Oct 2021 16:17:23 +0900
> Damien Le Moal <damien.lemoal@wdc.com> wrote:
> 
> > Add two configuration files to support the dual-core RV64 Canaan K210
> > SoC based Sipeed MAIX-bit board.
> 
> You had lots of feedback from Peter Korsgaard on your Buildroot
> defconfigs. Do you think you will have the chance to post an updated
> version? I will mark patches 5/10 to 10/10 as Superseded. This means
> that if you don't get back to us with an updated version, we will
> forget about those patches.

My apologies about the delay. I have been swamped with the kernel and other
projects. I kept at this a little though, mainly trying to address the elf2flt
issue which seems to generate unworkable binaries for Peter, while it is always
working for me... Really no clue what is going on so I am a little stuck with
that. I will work on updates addressing all of Peter's comments and see how
that work.

> Just two additional notes:
> 
>  - The readme files should be readme.txt (not README.md), as we don't
>    use markdown for now in our readme files.

OK.

>  - The readme.txt file for each defconfig should be added in the patch
>    adding the defconfig

Hmm... It is the same procedure for all boards, only the defconfig name
differs. Hence I added this README file last with all board defconfigs
mentioned. I can add the README file with the first board and update it with
each patch adding a board ?

>  - The DEVELOPERS file should be updated, in each patch, to add a
>    reference to you as a maintainer for these defconfigs and board/
>    files.

OK.

> 
> Thanks a lot!
> 
> Thomas

Happy new year to all !


-- 
Damien Le Moal
Western Digital Research

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

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

* Re: [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support
  2021-12-31  0:39     ` Damien Le Moal
@ 2022-01-03 15:25       ` Thomas Petazzoni
  2022-02-15 23:37         ` Damien Le Moal
  0 siblings, 1 reply; 28+ messages in thread
From: Thomas Petazzoni @ 2022-01-03 15:25 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: alistair, yann.morin.1998, buildroot

Hello Damien,

On Fri, 31 Dec 2021 00:39:14 +0000
Damien Le Moal <Damien.LeMoal@wdc.com> wrote:

> My apologies about the delay. I have been swamped with the kernel and other
> projects. I kept at this a little though, mainly trying to address the elf2flt
> issue which seems to generate unworkable binaries for Peter, while it is always
> working for me... Really no clue what is going on so I am a little stuck with
> that. I will work on updates addressing all of Peter's comments and see how
> that work.

No worries about the delay. I took advantage of the Christmas/New Year
quiet period to help catch up with our patch backlog, and stumbled
across your patch series, which is why I asked.

I also saw the on-going discussion with Peter who had issues with
non-working binaries produced by elf2flt.

> >  - The readme.txt file for each defconfig should be added in the patch
> >    adding the defconfig  
> 
> Hmm... It is the same procedure for all boards, only the defconfig name
> differs. Hence I added this README file last with all board defconfigs
> mentioned. I can add the README file with the first board and update it with
> each patch adding a board ?

Yes, that would work: add the README file with the first board, and
update it progressively for each board.

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] 28+ messages in thread

* Re: [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support
  2022-01-03 15:25       ` Thomas Petazzoni
@ 2022-02-15 23:37         ` Damien Le Moal
  2022-02-16  7:54           ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 28+ messages in thread
From: Damien Le Moal @ 2022-02-15 23:37 UTC (permalink / raw)
  To: thomas.petazzoni; +Cc: alistair, yann.morin.1998, buildroot

On Mon, 2022-01-03 at 16:25 +0100, Thomas Petazzoni wrote:
> Hello Damien,
> 
> On Fri, 31 Dec 2021 00:39:14 +0000
> Damien Le Moal <Damien.LeMoal@wdc.com> wrote:
> 
> > My apologies about the delay. I have been swamped with the kernel and other
> > projects. I kept at this a little though, mainly trying to address the elf2flt
> > issue which seems to generate unworkable binaries for Peter, while it is always
> > working for me... Really no clue what is going on so I am a little stuck with
> > that. I will work on updates addressing all of Peter's comments and see how
> > that work.
> 
> No worries about the delay. I took advantage of the Christmas/New Year
> quiet period to help catch up with our patch backlog, and stumbled
> across your patch series, which is why I asked.
> 
> I also saw the on-going discussion with Peter who had issues with
> non-working binaries produced by elf2flt.

Update: I think the elf2flt stability problem was sorted. It seems to have been
related to gcc arch isa options that were not set correctly. With that done, we
stumbled upon some bugs in u-boot that prevented clean boots. We have finally
found fixes for all the problems now. We will be sending patches to uboot &
kernel and update the buildroot series once that is done.

Cheers.

> 
> > >  - The readme.txt file for each defconfig should be added in the patch
> > >    adding the defconfig  
> > 
> > Hmm... It is the same procedure for all boards, only the defconfig name
> > differs. Hence I added this README file last with all board defconfigs
> > mentioned. I can add the README file with the first board and update it with
> > each patch adding a board ?
> 
> Yes, that would work: add the README file with the first board, and
> update it progressively for each board.
> 
> Thanks a lot!
> 
> Thomas

-- 
Damien Le Moal
Western Digital Research

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

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

* Re: [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support
  2022-02-15 23:37         ` Damien Le Moal
@ 2022-02-16  7:54           ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 28+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-02-16  7:54 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: alistair, yann.morin.1998, buildroot

On Tue, 15 Feb 2022 23:37:27 +0000
Damien Le Moal <Damien.LeMoal@wdc.com> wrote:

> > No worries about the delay. I took advantage of the Christmas/New Year
> > quiet period to help catch up with our patch backlog, and stumbled
> > across your patch series, which is why I asked.
> > 
> > I also saw the on-going discussion with Peter who had issues with
> > non-working binaries produced by elf2flt.  
> 
> Update: I think the elf2flt stability problem was sorted. It seems to have been
> related to gcc arch isa options that were not set correctly. With that done, we
> stumbled upon some bugs in u-boot that prevented clean boots. We have finally
> found fixes for all the problems now. We will be sending patches to uboot &
> kernel and update the buildroot series once that is done.

Excellent, thanks for the news! Looking forward to the next iteration
of the series.

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] 28+ messages in thread

end of thread, other threads:[~2022-02-16  7:54 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-26  7:17 [Buildroot] [PATCH v5 00/10] Add RV64 NOMMU and Canaan K210 SoC support Damien Le Moal
2021-10-26  7:17 ` [Buildroot] [PATCH v5 01/10] package: Makefile.in: fix elf2flt invocation options Damien Le Moal
2021-10-27 13:37   ` Peter Korsgaard
2021-10-26  7:17 ` [Buildroot] [PATCH v5 02/10] package/elf2flt: add RISC-V 64-bits support Damien Le Moal
2021-10-27 13:38   ` Peter Korsgaard
2021-10-28  0:35     ` Damien Le Moal
2021-10-28  6:30       ` Peter Korsgaard
2021-10-26  7:17 ` [Buildroot] [PATCH v5 03/10] package/Makefile.in: Fix NOMMU RISC-V 64-bits toolchain base name Damien Le Moal
2021-10-27  3:26   ` Alistair Francis
2021-10-27 13:38   ` Peter Korsgaard
2021-10-26  7:17 ` [Buildroot] [PATCH v5 04/10] arch/config: Make RISC-V 64-bits MMU optional Damien Le Moal
2021-10-27 13:38   ` Peter Korsgaard
2021-10-26  7:17 ` [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support Damien Le Moal
2021-10-27 13:51   ` Peter Korsgaard
2021-10-28  1:07     ` Damien Le Moal
     [not found]       ` <e6eb0eda-20db-dfd6-c3d6-47db131bc247@gmail.com>
2021-10-28  2:24         ` Damien Le Moal
2021-10-28  7:01       ` Peter Korsgaard
2021-12-30 20:27   ` Thomas Petazzoni
2021-12-30 20:29     ` Thomas Petazzoni
2021-12-31  0:39     ` Damien Le Moal
2022-01-03 15:25       ` Thomas Petazzoni
2022-02-15 23:37         ` Damien Le Moal
2022-02-16  7:54           ` Thomas Petazzoni via buildroot
2021-10-26  7:17 ` [Buildroot] [PATCH v5 06/10] board: Add Sipeed MAIX-Go support Damien Le Moal
2021-10-26  7:17 ` [Buildroot] [PATCH v5 07/10] board: Add Sipeed MAIXDUINO support Damien Le Moal
2021-10-26  7:17 ` [Buildroot] [PATCH v5 08/10] board: Add Sipeed MAIX-Dock support Damien Le Moal
2021-10-26  7:17 ` [Buildroot] [PATCH v5 09/10] board: Add Canaan KD233 support Damien Le Moal
2021-10-26  7:17 ` [Buildroot] [PATCH v5 10/10] board: Document Canaan K210 based boards support Damien Le Moal

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.