From patchwork Tue Oct 26 07:17:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1546273 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=apWxLL/d; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hdjy45Btmz9sRR for ; Tue, 26 Oct 2021 18:24:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 9D86580E03; Tue, 26 Oct 2021 07:24:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0lW_CvU0oC6r; Tue, 26 Oct 2021 07:24:41 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id 1979880DF7; Tue, 26 Oct 2021 07:24:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 5058D1BF30B for ; Tue, 26 Oct 2021 07:24:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 37E7140262 for ; Tue, 26 Oct 2021 07:24:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=wdc.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QdwyOjwIbaGn for ; Tue, 26 Oct 2021 07:24:37 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by smtp4.osuosl.org (Postfix) with ESMTPS id D33914023F for ; Tue, 26 Oct 2021 07:24:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1635233075; x=1666769075; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yvlg42eplvZnI5R5qRD0CUN+BtbK8BOT9sZgaYQtY2Y=; b=apWxLL/dx5wINQevW/usJJelCOwUKzbH7lTVfWfAbWSUJyHgfQqlPlkL CzE3IFtDkNKyIhOBQVCHql9lozAniGbGDIyjtxqndguDz2Y6uLhwZwegy x+lbtx0n/YOtL4HZWgrmThqdwj34ZOUbEBgV373rkXfkz4YOnjjSQjuq2 BvjoobyZ/SXnWiUXAv9eKGDwdXiipo6pgU2LuXjImsC47/JRuSAWJ3rcU l3e4IhrsTQHSf3n/iC51GinYh0fLIFuivUoFY7mrfA5aCaiT+t6t1I8gM 9J7IUwYHwRdQsQO62Y7QpcuOzeXAeS4yki5d0xAoDM4AVsHvcQQwyGRsc w==; X-IronPort-AV: E=Sophos;i="5.87,182,1631548800"; d="scan'208";a="188623058" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Oct 2021 15:17:30 +0800 IronPort-SDR: 8vdfL9waniqx1D/hkq3QbG/Dh4+x+hyvQfz+5357lnnpS9tNy8Af7zeCx6bqMPicbjK99MT21k 0FLUCfz5BYFIzbGoNY+zZktPT64JoNktNI7Mv5d8ZRoV/6UsJL3iP4chtksGMF6NqcunQw8Xa2 P5m8jKpxLM7WNGlUu84ytAprg9qPWX6JaIiVk2uYki6qPge2yFhkRxU2eyjMcmmOy04984luPU APaqCcfFII6o7d0XGWTIIm08mgbYevJLyyia5IRYDYrJhaSFsV2Lg+rhhULl/+bwIEgdpRMQsW sEsfwEm7PDGGYP9U/FFgs0ob Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 23:51:28 -0700 IronPort-SDR: JjBiqaKhwzufu7sArfo3zZGL7Uw63UamUvGeAd0MpcVcV5YooGvHKO6i8WirSDO+P4PcpylGCD 4VNyneENBFTeng+6+b0XlEgTaTXbr7txlK4NnwHdr6XwqC8zTwNAGerrQFPCGmVZRjlSVyqrb3 dNQs1S1JGp2NGRrqy7HlVmWlskjj+gBxcDBGcYNqIhDKhwhsV8ZO6bluZuKqBlqu/AWHtyj52v rFwFEs1NwwzPU7y/J9NIUBe9OvJDHqFvBNvdCuW6nOIciZMl7nVNsxfEPWfD/Z4IlxrZsJKATL 81s= WDCIronportException: Internal Received: from unknown (HELO twashi.fujisawa.hgst.com) ([10.225.163.73]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Oct 2021 00:17:31 -0700 From: Damien Le Moal To: buildroot , Thomas Petazzoni Date: Tue, 26 Oct 2021 16:17:19 +0900 Message-Id: <20211026071728.954356-2-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211026071728.954356-1-damien.lemoal@wdc.com> References: <20211026071728.954356-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 01/10] package: Makefile.in: fix elf2flt invocation options X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , "Yann E . MORIN" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" 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 --- 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) From patchwork Tue Oct 26 07:17:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1546275 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=oaqU4Kax; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HdjyZ63Dbz9sRR for ; Tue, 26 Oct 2021 18:25:10 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id B4008403A7; Tue, 26 Oct 2021 07:25:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yyqAIp66WbBO; Tue, 26 Oct 2021 07:25:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 559B7403E5; Tue, 26 Oct 2021 07:25:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 144E41BF30B for ; Tue, 26 Oct 2021 07:24:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 370BE40259 for ; Tue, 26 Oct 2021 07:24:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=wdc.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9uBda0oVczCf for ; Tue, 26 Oct 2021 07:24:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by smtp4.osuosl.org (Postfix) with ESMTPS id F418F4024E for ; Tue, 26 Oct 2021 07:24:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1635233075; x=1666769075; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gDNEdeSfbG8MflCGyuWtwzVarcoqBeZOR1ITXGum2DQ=; b=oaqU4KaxOT6E2cpWbxNp53++4DVDw+5SdF/ge34jBcMKF3XZH+DwSu3+ YivIhsKPjFJQh3FqwMK9Fdeh7bNr3soV2fACJN/8L0oDPAut6JYoYUjPX WT6s+jzmhG/EtxokF1+9VWoUuStpiAh8dBz7EDN3L4xYvNLfERIKSEHHz e1ACvSBplW2de9LrlWgjAFjJStlW0uhVv+udKhBRJHo9gBUzTmr0qZcok FchEHd4VTOV6Er0FTIKtHDHPH8AGTp1UZHNQF+d6HlRhG1XnVnb3NU2e6 DfonaC+o2m7Jzp9o/HroCZez+kBowyqx3VOa/tLLFPYTXSzNNqNCKgeN8 A==; X-IronPort-AV: E=Sophos;i="5.87,182,1631548800"; d="scan'208";a="188623061" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Oct 2021 15:17:31 +0800 IronPort-SDR: v9XiykxiQ/7hkL4wRCM0lAnr2DpS5ELigj5GBquSlK/soeorW7BZQ1ugPvlaYjB3jX+dPzbRlU cVCnYlvnN1HATILRt1zFpe54nduSwMt6Z0rX0FNHfelyp6eWl1tlR724E9yd3btUQ/bmkobvxF 4muXjH2veAlQwTjX1QfFPNsale3pnAsRbFUEUwLPToGw0W3HkkFVrxX2FNX+3SzUXzgzc49unm CuSbwI5Hwyc3IJKl77YJvJivAmySbl4Rh5+xlvJ1RREUJimXnNe/99FPht8v/fX9uqRScP4vya UdaAcHR43kaS/4S5GGs2b5Lx Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 23:51:29 -0700 IronPort-SDR: +JDggZb0mmkLQ0rkzRzZi/4kycdb678oiOdP8KuSPNhRhFAvimXoIBMMx6Gd28DZcTgSGpGEIk wXuVLt/GFuJmR7Y5YQGPEfnXUBJt5FTkdVjqrMrZSWuV6WGzUJUymLkiMWcc/vzUglLZsZska8 ZtRk7DHNnCCUZOWjejg+nO0V21rQYzSOr4W2v7zikNvKTtxt+U93/bjRdYxbK0SyLmC7EoM3o/ TdLiZKCvNnwPG0uw+wGr9FkHkUjnT08EPyZ4vNva7cNFvmoNiRj9LWqT1c5cx5ChYQalYgwKfj h1g= WDCIronportException: Internal Received: from unknown (HELO twashi.fujisawa.hgst.com) ([10.225.163.73]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Oct 2021 00:17:32 -0700 From: Damien Le Moal To: buildroot , Thomas Petazzoni Date: Tue, 26 Oct 2021 16:17:20 +0900 Message-Id: <20211026071728.954356-3-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211026071728.954356-1-damien.lemoal@wdc.com> References: <20211026071728.954356-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 02/10] package/elf2flt: add RISC-V 64-bits support X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , "Yann E . MORIN" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" 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 . Signed-off-by: Damien Le Moal --- 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 +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 . + +Signed-off-by: Damien Le Moal +--- + 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 + #elif defined(TARGET_xtensa) + #include ++#elif defined(TARGET_riscv64) ++#include + #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 From patchwork Tue Oct 26 07:17:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1546277 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=SsB9Nfgu; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hdjz21hzmz9sRR for ; Tue, 26 Oct 2021 18:25:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 6A5A5404DF; Tue, 26 Oct 2021 07:25:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K_UvO7k7pZbA; Tue, 26 Oct 2021 07:25:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id D5C98404D3; Tue, 26 Oct 2021 07:25:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 136B81BF30B for ; Tue, 26 Oct 2021 07:24:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D534140262 for ; Tue, 26 Oct 2021 07:24:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jHzk67MMdP3p for ; Tue, 26 Oct 2021 07:24:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by smtp4.osuosl.org (Postfix) with ESMTPS id 3B2A340257 for ; Tue, 26 Oct 2021 07:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1635233076; x=1666769076; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9295OeBBas0A0votrxUs1hTzC1qjfdk4pM6FTB9CIA8=; b=SsB9Nfgu8OJuBuYFrYfAUuHVs9oqdYB6NWXvDnFtdbosDtQeFfeob1xh PgOJUmsyNDEZjdKZsK0yej8UmYtb4vir8EFwemN31K2+Z6h1ws4FCImjU LPp6Ffm3ICLF2binem0oxLDa5HcCT/WZRP6oZKZ6e44PuzBpr5oVXHGqx iiGaJrrqtd0B9Hwb3t8jKxl+XlomJ3WhV15nGXp5ASunCmeKI2ao+eRhN cETfy3C/nj8/Bn8kJ3U0sTD9O3LZyhMchaENHR7F/3j3CEO7tlaZIE9A9 Fu5JaRuKTlObmhRw9a9GdTto6yOxCpRyaoINdc2USLpVFiereIMZK8Uzl Q==; X-IronPort-AV: E=Sophos;i="5.87,182,1631548800"; d="scan'208";a="188623063" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Oct 2021 15:17:31 +0800 IronPort-SDR: 5SFmv64xR62SM4ohqBSjEAQ6g1pdzg2/EQIL0kXRDButY2M91JKCBS8WUkON1scC9MSkpl5K4F NWSdHGY6yJYP65qz2bgbAk5kMH5UpAcoBMUYS+hLI7ls5XzmIKT395Ob2xWLCNL4tE9VD7cKc1 hTk5DiSYmAqaj/bTpYHNA+BqIHn9kSQtnOcUMEVIaVHMgjUc4oa8GhQIz7BM/vA8iYR7VMzjnA BdT5j4riWWkbx8iAandg1pa/zTfiwJpsNtCvr6T7jR+PGaWEFd0di4+FXr6MqIqsDKWEiDPw9N 1i7RPYhm4llqubhnyNEAO+Bl Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 23:51:30 -0700 IronPort-SDR: jxR6bJYqTQgNzFSUaaRLvF1bU3Yfdk8ELPWiDfQ21ZKfTDKYTjy3iMiOXPImcSOXSKC8sDJXwk HpZYcOaMm6tZZU7oBXPSAfLMwxYgHCn7tq67Si7Vs+Td7StWPo54UgMR6yxgFnOsUDze4Zo1LP yiXoZiUfCYXofq0fOhiJl86sBppMk/ZxthSO/1cuIVQfHw+2hB1Pygjur2LiT39Xux/+OLlK/o /HA1l6yhnp5GkaJGZ+PEBOOkse8nsxchL2lxvnTI8eSk4DyUV+TBqfPh4jw34eKnk9Lam8wSui 7i0= WDCIronportException: Internal Received: from unknown (HELO twashi.fujisawa.hgst.com) ([10.225.163.73]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Oct 2021 00:17:33 -0700 From: Damien Le Moal To: buildroot , Thomas Petazzoni Date: Tue, 26 Oct 2021 16:17:21 +0900 Message-Id: <20211026071728.954356-4-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211026071728.954356-1-damien.lemoal@wdc.com> References: <20211026071728.954356-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 03/10] package/Makefile.in: Fix NOMMU RISC-V 64-bits toolchain base name X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , "Yann E . MORIN" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" From: Christoph Hellwig 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 [Damien] * Make the change conditional on BR2_RISCV_64 being "y". Signed-off-by: Damien Le Moal Acked-by: Alistair Francis --- 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 From patchwork Tue Oct 26 07:17:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1546274 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=KMyyyQIr; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HdjyK3Tksz9sRR for ; Tue, 26 Oct 2021 18:24:57 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 9588A40220; Tue, 26 Oct 2021 07:24:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jNWupRSLKYPE; Tue, 26 Oct 2021 07:24:53 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id B1B9540225; Tue, 26 Oct 2021 07:24:52 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 4924D1BF30B for ; Tue, 26 Oct 2021 07:24:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E8D064023F for ; Tue, 26 Oct 2021 07:24:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=wdc.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 21JI_Dcp1exZ for ; Tue, 26 Oct 2021 07:24:38 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by smtp4.osuosl.org (Postfix) with ESMTPS id 620CD40259 for ; Tue, 26 Oct 2021 07:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1635233076; x=1666769076; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/R9ul6e/1iFb/g7zsQnJ9wxw3o53LzHWFRae1obXFM4=; b=KMyyyQIru3Im1Moqe2NyYrLnniUe6HAlZg4QFcA4TJYmbRjUJmGFMgj/ QDMVqX6ymdmikBCNSCSsKJJubpZQXAbzDzhbMAczJMxoaREvi6FtldWgc anM1lER5X9bEpfn/nS+ViPDptlMraSs17LlgVxOsqQqHCy/Kyriu8MIjr kE6orgTJSRlj5bO4mA2IAsthVufvAIXcPYgTblODSTSd7ULlaopKVjMNW whhK1/dHYe/Tj70n2HAl0FEZeHqbeSD0o2rIBVoDwsrbnP6J+6cAfx8I1 8bbLfAwgoTg+jBNN5wkpXCxv2cG7tjXwq3+1sbD8/+aNs9YEBMASwc8nh Q==; X-IronPort-AV: E=Sophos;i="5.87,182,1631548800"; d="scan'208";a="188623066" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Oct 2021 15:17:32 +0800 IronPort-SDR: eO6DRRR9B26ALUBgI8hd8TYJRJkcAJsY381y95tBCRoVvn6PwjsK486YEkB0xMXDujvYbNDAMP QixnGcCuBWEkGIW+B952qMXSUvoqpe7AtmVHIZpCZbrcYvSOXMy3Sor36vKlZtvD3ECIWW0eLP zPNbuAoILYAm/fu9wygEOTJ5iXLp7aBK+plEh73iNk1GaDyt//mVIbQlY095wlyGhADHkXbLuw 391YIK/Urso7Otx9wmBYCRtMFVlybpBlyCmBnMP7UPq8975Dy7YBS7YAlugHAEM51ScMGh7sZQ VhP94G1fb+p/P6QkXmqU36ci Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 23:51:31 -0700 IronPort-SDR: PfNuhct2vcMMtCKVLd63e2wrolQ4FA2a5A88+7UBinMi6SH8hV8/JGw2AWo99wpROqcHf0wpa1 I8mZoFcJ8/HtZ+2ndSUPe5N3VP1ioPHWXt4GgAxkw1rHi0exxg37DwT4kyPOLLyeNgn4M3p0tc RyrGQuutYZ2LkxdktHRgSP5Gl7/31lwLRD82AFv3P/AJBnOg0ZdvtszSjerc0aOj+5zS1owTi9 OSoQoFZOaNZY1MSc5mVbiFm2gyuMY6ksWisHZdlM/FFKrVLiJ4XuVY/r8jKVLo3Fhl36CxW+Z9 ytI= WDCIronportException: Internal Received: from unknown (HELO twashi.fujisawa.hgst.com) ([10.225.163.73]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Oct 2021 00:17:34 -0700 From: Damien Le Moal To: buildroot , Thomas Petazzoni Date: Tue, 26 Oct 2021 16:17:22 +0900 Message-Id: <20211026071728.954356-5-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211026071728.954356-1-damien.lemoal@wdc.com> References: <20211026071728.954356-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 04/10] arch/config: Make RISC-V 64-bits MMU optional X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , "Yann E . MORIN" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" 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 Reviewed-by: Alistair Francis --- 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 From patchwork Tue Oct 26 07:17:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1546279 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=HigZUHva; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HdjzV1cfnz9sRR for ; Tue, 26 Oct 2021 18:25:58 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id E753B404D3; Tue, 26 Oct 2021 07:25:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Jqb2MYEyD_pU; Tue, 26 Oct 2021 07:25:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id F2573404DF; Tue, 26 Oct 2021 07:25:53 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 0B7621BF30B for ; Tue, 26 Oct 2021 07:24:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 4C06440234 for ; Tue, 26 Oct 2021 07:24:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eP4tAHT845mH for ; Tue, 26 Oct 2021 07:24:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by smtp4.osuosl.org (Postfix) with ESMTPS id 513C54023F for ; Tue, 26 Oct 2021 07:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1635233078; x=1666769078; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Tl9FXrYIcS5wPYfr+xSt/ZvpM+UPBuC5Dtg1beQ82gQ=; b=HigZUHvazYq+vVRpjcsHqcMR9FVYyXBTBqyMw1+04HapTxHJbR70iDFQ mZ2SkAcPNkEjpKVJHdFTLm9K4bfoErNU87w0gEV4uRAxGQlV/iSx/p94q q+fBRmIirXvCh7dee5CmQhDGpB6rEbZd8uuzUOeVUulCPRGnJVhQSx0hT 76Xlft1IDvJloIFBUZU/b+ToWUD9QD0DEoVYdF9XPS2lW5VF2CkpL1zHJ d2tQbAUaT8+OfyqkTT7qUrgnahMX4qODmsIp6eLtmEsCvnIt73e2P+Zbq Ulx5ba+BYgBOBRwAxDOEl1OcVT8LcijortuA7nXShadrLa7qC/rUA/3YQ Q==; X-IronPort-AV: E=Sophos;i="5.87,182,1631548800"; d="scan'208";a="188623070" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Oct 2021 15:17:33 +0800 IronPort-SDR: wFs7U1oTboghPiz8BxtFbeZCJLqxxaaWvUlZh9UzOSAt3H3UB3DowxNMKjIc1ORCWfyHHlIB9m 8erWrYKFYPvFXnF7arJBNf7rLGbdHul4gFjhemZmFBibpVhtrdBDuq8s6t6/CaxlAPv/wqNtud CNMzArTytgw/ZTeZU9iXJXEDPGbm+Qq9lEg/eDJHb8baNu3Uvo1Yfy5Gv4/bfRZ/JlXim5frQr +jiz97NAdTsejzUQdqPQ/TLmH2/O5yHmB8rOwVP6AP9vptDxymD4X1ZKMPwVvHoQAvwmMVx0jx jcwJuDY+ijrL1WsleVPFkabc Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 23:51:32 -0700 IronPort-SDR: qw4usUrWozN7JzgdoH34R4gY7WReFKTS88hcThudNRd6vQUwFc6Uxf2xwhimklQfQ2d9Pg4eT8 N/e5UVElHLQtJ9MgV/K2S+8AFic5VDpWMwd2aC3q9yC2IJ0NgOYPldnYGZO+dJvOhAKRB7Ux3i H5q7prNNX2RTJ9XP/e+oPqx4diJDOQ7YJ71WGf7PRBhg+ETcW3lu6MkoMSZJUkgsRouB7bzXIq yGPXNl92XXozfMAiA0i/M2dgnyEYUU++Eb9+uG8KE3z+jY9+WrLhWWMgjkPsP1sznt6jP1O1Za yr4= WDCIronportException: Internal Received: from unknown (HELO twashi.fujisawa.hgst.com) ([10.225.163.73]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Oct 2021 00:17:35 -0700 From: Damien Le Moal To: buildroot , Thomas Petazzoni Date: Tue, 26 Oct 2021 16:17:23 +0900 Message-Id: <20211026071728.954356-6-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211026071728.954356-1-damien.lemoal@wdc.com> References: <20211026071728.954356-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 05/10] board: Add Sipeed MAIX-bit support X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , "Yann E . MORIN" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" 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 --- 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/null; then + exec 0/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 From patchwork Tue Oct 26 07:17:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1546278 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=RYW0zbYz; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HdjzF141Zz9sRR for ; Tue, 26 Oct 2021 18:25:45 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 70797403A7; Tue, 26 Oct 2021 07:25:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kB_O0YvIDco0; Tue, 26 Oct 2021 07:25:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 793FD40225; Tue, 26 Oct 2021 07:25:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 232F31BF30B for ; Tue, 26 Oct 2021 07:24:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 1292B40257 for ; Tue, 26 Oct 2021 07:24:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=wdc.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7Q6Sk1xCuwee for ; Tue, 26 Oct 2021 07:24:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by smtp4.osuosl.org (Postfix) with ESMTPS id 8414D40234 for ; Tue, 26 Oct 2021 07:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1635233078; x=1666769078; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jRcr3kvC9DB0dBW89FGwop7dIQ6CmKDQllrLA6/vh2w=; b=RYW0zbYzrJBZdgOvS1SaVuDuj0J1CcEa98RlDEQdrhBRSESiMIUmTy2/ cxplRsBO0mFFk0n6yRNoYTo6QiylUZnRadLx52p044Zj5foUPCinjhTcJ v2aYmw6YSuvBECOBLNI7I88KIWWMfLyFgDStM2PvNnkuBj7FtSaL5AfrW Xg7VJYQXTgs5JhmkqKWjtMlJju0xEw1/Arx1VlL69p2Q/6Q0RTgvhYYS5 v/gOBZGfDwyWc5WkHmcSyLnogTP4TPFg5Gil3mgsqergmbsdBNiDDYR+u nBnudQOmjLMnqWgpuAKmSuObXglm5ldVkLdBQA3hWQNJGyvE5+g5g4kXA g==; X-IronPort-AV: E=Sophos;i="5.87,182,1631548800"; d="scan'208";a="188623074" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Oct 2021 15:17:34 +0800 IronPort-SDR: oIN/RbVWgnXj0rvQ98J003dXSDeZnIF/kJPgJDFDhPhLCcZU62eWewfv+pnkwGsuVDy+xGItJF CCHM6ywJxLU8Uwvt8Xevy7FG6qm1jWnwWE80T0nYjImZkcsCWun1iL9OwP+cXAVT75ZhMl+GEN VMawdcBoCVHUP9jKXVc2QX3jN0P3MQLFaeYCBUGdsaZtqiV4zbXxKNGOrrMtSuxt24WnZdu/At 7vJO5njPrNaBJUrh3KFW1JlzoOl01V2Ic8G2MAqYSQfLIpzd74OZm0Ta5PMATuZ5PLE5GPfpK9 DWNZ373++FLS1AwOzHWBZAM3 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 23:51:33 -0700 IronPort-SDR: 2UF+wcEyIYcQXsO7YsCjVKQFNpRec/zVs557ujnXKT5gcBJCEE8L7wSWaBT/S3skhnrweQUQmS NXnk30xDYV8aS6I6RmL4uGUMknBEBRWHwI5umkhNolLeFyFF3yomwpLE/4A0SnyJ5VtOT7JGxX EVL+LLYc8cJLaa7EQEo7X7uDkpjUSR7q6D2FdD4fiy8iop3ApR6yblHEa9w6s0wX3VZF0NThpZ 4QPYUuVTaBOV40hmg9QU+CwuwMgk5zw8yWOfu1Dow3lcy7CaLJbgjRhvwzJB/JxFTjfPr/toO8 AKg= WDCIronportException: Internal Received: from unknown (HELO twashi.fujisawa.hgst.com) ([10.225.163.73]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Oct 2021 00:17:36 -0700 From: Damien Le Moal To: buildroot , Thomas Petazzoni Date: Tue, 26 Oct 2021 16:17:24 +0900 Message-Id: <20211026071728.954356-7-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211026071728.954356-1-damien.lemoal@wdc.com> References: <20211026071728.954356-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 06/10] board: Add Sipeed MAIX-Go support X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , "Yann E . MORIN" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" 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 --- 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 From patchwork Tue Oct 26 07:17:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1546280 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=jIx79ycT; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hdjzk0znrz9sRR for ; Tue, 26 Oct 2021 18:26:10 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A6C87404EB; Tue, 26 Oct 2021 07:26:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dOY2bIaM1zxK; Tue, 26 Oct 2021 07:26:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id CB6BE404F0; Tue, 26 Oct 2021 07:26:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 1E0811BF30B for ; Tue, 26 Oct 2021 07:24:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D70F940259 for ; Tue, 26 Oct 2021 07:24:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7rDcMSD8SiFl for ; Tue, 26 Oct 2021 07:24:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by smtp4.osuosl.org (Postfix) with ESMTPS id 520664023F for ; Tue, 26 Oct 2021 07:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1635233080; x=1666769080; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5CjqeVdXYrpOSEKEuWn5l4oPaFXrOOaR+tJ9o1OVMlg=; b=jIx79ycTLj8geRVHfHrxDOSfCQ+iSMCOWoanwkE9L7ZOcNQdalf9mO3c QWBKIJS/qbLuwiXobrmgnwKnjKepPqquE1iAaBAtOdEXtRIJpXd5bsJYH z8mwCvWWCN3yyvp9Zz/9yOE5Zbaai+xEGfExvDLBHHwmKGTpVzyfpJdjg ADjOjX98qxUMWF6nw7tnQ31rlJqX6/17SBBMAJD/Fa/46FwsQcGTqQDpi Oxw3a0I5QBpEH/UTAk8oHCTKnskFIoCSnprpqoRnpxLkuaCS3N89O/QW7 KAlzdP2hiLLr3hF4doQ46TFU5egXgIrspaOdVTBW0in5v/gGbFeViRV+D Q==; X-IronPort-AV: E=Sophos;i="5.87,182,1631548800"; d="scan'208";a="188623077" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Oct 2021 15:17:35 +0800 IronPort-SDR: xP4hSEXg4sHcQn0C8ss3ohBCGmCTeJOhmEl5t1a8WmEvbXIPnc1LwA+CDSrq77M+KaZxG6DWnq wSy7TCrQLYrsxRGBEhk+6/pHh2hs0oWaOcPx8cjDldALGz4zN4p4XlZZtqZKn45YUapiPbQJDc byEV2oGj0w2xgLHvgw2xk7I5KvDswfMolb/VlzX0b/X0BgSwawjlrLJ29ywAJMxr5z781RzMUD 9sDrc3L4RC6Ew2qw21Cz1Iu+4wUWHyGqeYrQWMj97nMHK5ilDezcR8xgkq0GrK/27EeRnrkmIm Tiwf204aj3KaVeroSEQNouur Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 23:51:34 -0700 IronPort-SDR: VuxW002Dl2waduCcygGIpyRMEffjW8RAkHbXEs5IWQqPwSX/Wn+/gu8cOdNi2zx24MU0RZoMWY +63eA6NllZP8zLHdo+W0DPpREHv4vXI6aEkdUjfurDcxJzf0inpJfLFk7A1eKBcp4RoZDQNW/P BAIxU3Zhi1Zt/mepNBan15eMXN9mfvCxVtNByRFO71YZvzBYwY2IdrCy6FqzpXWgVXbbNSmfAk Eh5z0WQLvtbr4Npq4QH8yZ0PSZFOGY4cY5VpzR9BAndMoFkGu/XEC4YTzt7Q9akVamw03S+7T/ B6g= WDCIronportException: Internal Received: from unknown (HELO twashi.fujisawa.hgst.com) ([10.225.163.73]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Oct 2021 00:17:37 -0700 From: Damien Le Moal To: buildroot , Thomas Petazzoni Date: Tue, 26 Oct 2021 16:17:25 +0900 Message-Id: <20211026071728.954356-8-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211026071728.954356-1-damien.lemoal@wdc.com> References: <20211026071728.954356-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 07/10] board: Add Sipeed MAIXDUINO support X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , "Yann E . MORIN" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" 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 --- 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 From patchwork Tue Oct 26 07:17:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1546281 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=WFpiSHS3; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hdjzx2kM2z9sRR for ; Tue, 26 Oct 2021 18:26:21 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 5DDD0404DF; Tue, 26 Oct 2021 07:26:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cpY5asccpUzz; Tue, 26 Oct 2021 07:26:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id B3168404F7; Tue, 26 Oct 2021 07:26:17 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 30C9C1BF30B for ; Tue, 26 Oct 2021 07:24:48 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 119224023F for ; Tue, 26 Oct 2021 07:24:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pOnDqBNCTQjX for ; Tue, 26 Oct 2021 07:24:42 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by smtp4.osuosl.org (Postfix) with ESMTPS id 6EF974024E for ; Tue, 26 Oct 2021 07:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1635233080; x=1666769080; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2EKbkFMnioKoMAamzJnZaC7sgXt7rAlMDwrbcakxlXA=; b=WFpiSHS31UUi/6jhIJD3IPe+LAvhVChdN8z7bGuRtV0+1Ps+YZSovPF4 FZRvYHaVad5NLR7X4S/k2s7req7O/FgWz6L2qDFG8tfdz8zULC/bTWMWJ R4fYadvOFvhw5jbpOZzXX+m0n4W4Cw7SOo3NxAapN8mX40UL+66PFQGDt ZdtFRRxK10jl35L7mkBuwrU32jm0tlzqUWHMAtJyJyRCi8Zb+5fqyxE7B 5HklN1KXsiU9cVz5RC0EuqzrftSukTvnkAof4RwOlVsg3KQalFgUjvc2C AP32+t/n9zIqA8P5rPk83iaXug2lZ/35uqdfW/48EkCDy+so1Pa5wxhsS A==; X-IronPort-AV: E=Sophos;i="5.87,182,1631548800"; d="scan'208";a="188623079" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Oct 2021 15:17:36 +0800 IronPort-SDR: PL5RdafHVU/2iP1tHEaChmM2fvqqFttolUHV2yBn01qI/XFfoj1p6Ud6t0XJQtFcIdXTJZibIj HiigiIuVwMdr1b09l7gvG9HU7QbSFSckLriHBKgFTTbTlTpAsOUEUj0b4HykJQ/hOPvNhuJUBQ 1MG/2ivOovJhpxvDxEHMTl8oYKtm9zyB/BHkE3RPfPbwXr8PLrjEm3Vf7hnIAa2resJv8ZZ84Q 1D8bd7YrcqwROGQH32MdVekUd+rmqb8XYcZ8/cUjU/Q9T8WvBlZrN3bKCNWgwMgozWfIrhpHcK Wl4KRB68BrT3hGIS57n81G1o Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 23:51:35 -0700 IronPort-SDR: YE/w+lsOBItnr1CClFoH1iXHJNiPOtfBBCME94MSPE0ADOb2OArTcIaRfxLKcVbg9/JtXoMSY6 i+n/SnwF1GpX974i+jzThd7LIwirbN7zfrKcDPggNA1CuFJjW0lTuXeNjvGL7d+6rcskrXc8Nm wjKxMj+9T7nn080ulbs5oD7P1DN79ivYgAy6iR811AiycMCW/JR0vQRYAmdL+CH2NoJGY5sHqr pPLX8dnZYt2V8o8nAjqkEoWXXQ7Bl6XjH9UjxXSInvFFdxvw7BPkIchD5cmhGIdApHBVv2YV/n oI8= WDCIronportException: Internal Received: from unknown (HELO twashi.fujisawa.hgst.com) ([10.225.163.73]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Oct 2021 00:17:38 -0700 From: Damien Le Moal To: buildroot , Thomas Petazzoni Date: Tue, 26 Oct 2021 16:17:26 +0900 Message-Id: <20211026071728.954356-9-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211026071728.954356-1-damien.lemoal@wdc.com> References: <20211026071728.954356-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 08/10] board: Add Sipeed MAIX-Dock support X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , "Yann E . MORIN" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" 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 --- 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 From patchwork Tue Oct 26 07:17:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1546282 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=nWSIT6sh; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hdk091tQWz9sRR for ; Tue, 26 Oct 2021 18:26:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 6E81040220; Tue, 26 Oct 2021 07:26:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qpnar_9UaI4C; Tue, 26 Oct 2021 07:26:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 6FF3C40239; Tue, 26 Oct 2021 07:26:29 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 3380C1BF30B for ; Tue, 26 Oct 2021 07:24:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id EE66D40257 for ; Tue, 26 Oct 2021 07:24:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=wdc.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X2v2F8z1SXb5 for ; Tue, 26 Oct 2021 07:24:44 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by smtp4.osuosl.org (Postfix) with ESMTPS id 5F7304024E for ; Tue, 26 Oct 2021 07:24:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1635233083; x=1666769083; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hebTBSncUXbgpWhhgXf0WtRRB2aTXODO1IPsDOO9kxE=; b=nWSIT6sh4xxvvDz6RADKPjzPRHLV0C9U/Rf2CmDzxG3qneKUe1CDMXGV H6RQOFEDANRWoicwHC6DLvTLfHL0P+vqgW/yMq8E/AieQ7q/Tyr+WoBjH XSVz7kVPzkzM6n3kOMSn7uGOIglDq/0MGbr8Q1yOJEjI1dTOS+T+2AERe OWfWXcLBwBaBTPwGAwoAGqFTj4g3kSeBmPTElBV72XAGk9fPomVs7tU8W WCAx3CJGa1X9l0j12hVobXBqh8ooLvhyZtHkrOCbT1PoNKpDkvDm8z+0j /bmHXB9RNLsioTkGdhT/Iqf75EBPtw9kTd1Fo6r8MuH+BA66LD2dh6YrS w==; X-IronPort-AV: E=Sophos;i="5.87,182,1631548800"; d="scan'208";a="188623081" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Oct 2021 15:17:37 +0800 IronPort-SDR: oqcIrGQxkNAV3QyQnWy3wtr9C9wGuO0W1IePemvPZwKr5LmlBSE6U9Vhvm3yqBEcPkfShdHaF+ XPlzOM41ujWajEfVXP3F78lsEv9F6evBBdnCV2eRD0of2+1j513v+er5n0m4V8BVC57cdrVr0+ CsTKWrrL1lO95oOlyL6lGdUNyjEsGd/JrpcqJ9mFHw1ymMkB19QG+AcesO6GIadPARt6PtcvJD C2DqrzEwlOj1H+aWSIMQadpSgpkEJHGTXrxdlzvvcKt27BTvcbsUFqQOTX/T4lKeqgyXbwVJVr 3DYX1Lp0k2CKakHywmm++Qy4 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 23:51:36 -0700 IronPort-SDR: 2ESNMN+f/2Ormxl2q7yNzhy5zw3v9c7ToSD7t0T2NKw+qjbpA4hRgfwxLG+o0lxRbttZGcvCi+ Og5FkZnItDepZIQ0VnT3rYfl9sJlo1v8dv4Gjfqb5F3RriAPEz6XIyVa+UlQ0KiKmPoHAYyPyo PbfOjUMEwQklwdUhrHo1GlPU2Q5pwVFstphflocOEBFa/Oeb2CIQgEba+VRhYGNPd2Asplgmco r6DrqoZNO+4yfuHeiNMVoAFQcZIZV4yr3J2Gtb5iGloW+t8e8IXpbu/6p9GbYkAXPX6j6cqRJk T2U= WDCIronportException: Internal Received: from unknown (HELO twashi.fujisawa.hgst.com) ([10.225.163.73]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Oct 2021 00:17:39 -0700 From: Damien Le Moal To: buildroot , Thomas Petazzoni Date: Tue, 26 Oct 2021 16:17:27 +0900 Message-Id: <20211026071728.954356-10-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211026071728.954356-1-damien.lemoal@wdc.com> References: <20211026071728.954356-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 09/10] board: Add Canaan KD233 support X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , "Yann E . MORIN" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" 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 --- 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 From patchwork Tue Oct 26 07:17:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Le Moal X-Patchwork-Id: 1546283 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.a=rsa-sha256 header.s=dkim.wdc.com header.b=hBqbxG3S; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Hdk0Q14GPz9sRR for ; Tue, 26 Oct 2021 18:26:46 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 3154980E17; Tue, 26 Oct 2021 07:26:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kkwbBCB9wjfc; Tue, 26 Oct 2021 07:26:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id E927581028; Tue, 26 Oct 2021 07:26:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 4009E1BF30B for ; Tue, 26 Oct 2021 07:24:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 2AE1780DF7 for ; Tue, 26 Oct 2021 07:24:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QBDjjOKSll3T for ; Tue, 26 Oct 2021 07:24:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by smtp1.osuosl.org (Postfix) with ESMTPS id 8C23380DD3 for ; Tue, 26 Oct 2021 07:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1635233091; x=1666769091; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hjMbqdwhgwl5WIzFb/frbt1DEhSFGH2v9gGh5YDOsQM=; b=hBqbxG3SO7wHaiah5OhgoER/AQPhxg7RCFYiI1qLZ8q92IMcOSB5kZkA 5hGQCNK60BPdqwEGKOrZwuDA6JUc29k5c53Vm6Pn0y++t6BOWRlQQTkZY H6ojLrzDcGlM50nZXca2Y+HJEVaJQhlFVvQA/SdjzvHhFTDKVVKz4/iQ5 w9rbRSuPMw2nS38JMFUFzv70J9UXUfjKlZgjEsf8GfcYHqqyLhaprHnT3 GxzCzhoNcG5MTFpsdMW+jWFcd5yJfIFxEmJSjW+sSvL/09OYG8c3m31iz OHGTTbbr5CCVxw+UkRYIFAbX0DZ8FOBkdnNpEtqAIlTM8LINpp/z+1amN A==; X-IronPort-AV: E=Sophos;i="5.87,182,1631548800"; d="scan'208";a="188623084" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 26 Oct 2021 15:17:38 +0800 IronPort-SDR: KQPAwrywQUycGg7dICL9jtnMbe2jD2z8uK+BY0Q5TJ8KjlAvHCxASjjMNZz/FeBDNKgZVY/cSo SAKinz/HbNmgTVnKMqL8TJV1Ueam0zEXijolj8QLU3WPcHLaFYWHTRS+t2fXyJS8flCT4og6UT 6cougjfuSDVFyzc9fMkikL2+a5KQoIleZ1SPvzVpcg2+K7c5Dq1T9LoUhEn+6xYbQ8lg7flRyz /JyIgFq8upxuXJMGwDekFaXxksnAR0OxFMNckV/TpwLPXQB7QfL8Q219EjPxdJCUHzugT0B+po wENXsoh5fRhmSO/QD06hjTiK Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2021 23:51:37 -0700 IronPort-SDR: ewXln+Wb7EhjwFBZb0ZZuC6gX1QPjnNwNakYEQ9VUc5+NZd7kDuZ9l3ye+cVIN7it4nlo1K1sq 0Z9uBHv1g2LatLA08XyZOlbVjuEckl47gInutGRiLCSPVUNa07rjbfQ6PUiR5Z+Oso3JIGUxZm ForLnYbkAlgNZ8ZweO7zf2sPoDvC24TUbTzYNBk2TrqOkYOWXLY4MSq0+XaLngyOJH7zJIuoRP ffT79WvlIva0ydHP1NPiJZi3ZfHs76mBoAhvXrl8tLtxm2Rnh5GAQmLt/2k6CKppAxkxAK/IW2 IFU= WDCIronportException: Internal Received: from unknown (HELO twashi.fujisawa.hgst.com) ([10.225.163.73]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Oct 2021 00:17:40 -0700 From: Damien Le Moal To: buildroot , Thomas Petazzoni Date: Tue, 26 Oct 2021 16:17:28 +0900 Message-Id: <20211026071728.954356-11-damien.lemoal@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211026071728.954356-1-damien.lemoal@wdc.com> References: <20211026071728.954356-1-damien.lemoal@wdc.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v5 10/10] board: Document Canaan K210 based boards support X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , "Yann E . MORIN" Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" 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 Reviewed-by: Alistair Francis --- 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 +$ 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 +$ 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).