All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 1/9] arch/config: Make RISC-V MMU optional
Date: Sat, 17 Jul 2021 17:46:51 +0200	[thread overview]
Message-ID: <20210717154651.GU12203@scaer> (raw)
In-Reply-To: <20210715004843.337268-2-damien.lemoal@wdc.com>

Damien, All,

On 2021-07-15 09:48 +0900, Damien Le Moal spake thusly:
> Linux supports No-MMU RISC-V since kernel version 5.8. Make MMU optional
> to enable building for RISC-V boards that do not have one.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  arch/Config.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/Config.in b/arch/Config.in
> index 1853e26bb4..82d3b01980 100644
> --- a/arch/Config.in
> +++ b/arch/Config.in
> @@ -210,7 +210,7 @@ config BR2_powerpc64le
>  
>  config BR2_riscv
>  	bool "RISCV"
> -	select BR2_ARCH_HAS_MMU_MANDATORY
> +	select BR2_ARCH_HAS_MMU_OPTIONAL

I am a bit confused with this: the elf2flt patch only adds support for
riscv64 (excerpts):

    Makefile.in:
    +else ifeq ($(strip $(CPU)),riscv64)
and:
    elf2flt.c:
    +#elif defined(TARGET_riscv64)
    +#include <elf/riscv.h>
and:
    +#elif defined(TARGET_riscv64)
    +#define ARCH    "riscv64"

However, this change will make it possible to select noMMU for riscv32
too... Is this supposed to be supported?

If not, then I think the following patch would be a better starting
point to add noMMU support only for riscv64:

    diff --git a/arch/Config.in b/arch/Config.in
    index 1853e26bb4..2e95b6e76c 100644
    --- a/arch/Config.in
    +++ b/arch/Config.in
    @@ -210,7 +210,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
     

Also, the ordering is weird: first you allow a noMMU configuration, then
you add support for it in elf2flt. If only the first patch (this one) is
applied, and not the second (e.g. because there is an issue with it),
then the build is broken.

Ditto with the patch to fix TARGET_OS.

The series should be bisectable, i.e. we should be able to apply number
of the first patches without breaking the build.

So, instead, I would think it is better to:

 1. backport the elf2flt upstream support for riscv(64--only?)
 2. fix TARGET_OS for noMMU riscv(64-only?)
 3. allow selecting noMMU for riscv(64-only?)

And I think that patches 2 and 3 could even be squashed together. But I
am not opposed to having them separate either; do as you feel best.

Also, I wil be replying to the elft2flt patch separately...

Regards,
Yann E. MORIN.

>  	select BR2_ARCH_NEEDS_GCC_AT_LEAST_7
>  	help
>  	  RISC-V is an open, free Instruction Set Architecture created
> -- 
> 2.31.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2021-07-17 15:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15  0:48 [Buildroot] [PATCH v2 0/9] Add RISC-V NOMMU and Canaan K210 SoC support Damien Le Moal
2021-07-15  0:48 ` [Buildroot] [PATCH v2 1/9] arch/config: Make RISC-V MMU optional Damien Le Moal
2021-07-17 15:46   ` Yann E. MORIN [this message]
2021-07-15  0:48 ` [Buildroot] [PATCH v2 2/9] package/elf2flt: add RISC-V support Damien Le Moal
2021-07-17 15:54   ` Yann E. MORIN
2021-07-15  0:48 ` [Buildroot] [PATCH v2 3/9] package make: build RISC-V nommu builds as linux Damien Le Moal
2021-07-15  4:45   ` Alistair Francis
2021-07-15  0:48 ` [Buildroot] [PATCH v2 4/9] board: Add Sipeed MAIX-bit support Damien Le Moal
2021-07-23 22:25   ` Arnout Vandecappelle
2021-07-23 22:35     ` Thomas Petazzoni
2021-07-23 22:43       ` Damien Le Moal
2021-07-24 14:56         ` Arnout Vandecappelle
2021-07-23 22:40     ` Damien Le Moal
2021-07-24 14:53       ` Arnout Vandecappelle
2021-07-15  0:48 ` [Buildroot] [PATCH v2 5/9] board: Add Sipeed MAIX-Go support Damien Le Moal
2021-07-15  0:48 ` [Buildroot] [PATCH v2 6/9] board: Add Sipeed MAIXDUINO support Damien Le Moal
2021-07-15  0:48 ` [Buildroot] [PATCH v2 7/9] board: Add Sipeed MAIX-Dock support Damien Le Moal
2021-07-15  0:48 ` [Buildroot] [PATCH v2 8/9] board: Add Canaan KD233 support Damien Le Moal
2021-07-15  0:48 ` [Buildroot] [PATCH v2 9/9] board: Document Canaan K210 based boards support Damien Le Moal
2021-07-23 22:25 ` [Buildroot] [PATCH v2 0/9] Add RISC-V NOMMU and Canaan K210 SoC support Arnout Vandecappelle
2021-07-23 22:40   ` Damien Le Moal
2021-08-28 13:48     ` Thomas Petazzoni
2021-08-29 22:44       ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210717154651.GU12203@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.