From: Damien Le Moal <dlemoal@kernel.org>
To: Yangyu Chen <cyy@cyyself.name>
Cc: Conor Dooley <conor@kernel.org>,
linux-riscv@lists.infradead.org, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>, Guo Ren <guoren@kernel.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Conor Dooley <conor.dooley@microchip.com>
Subject: Re: [PATCH v3 5/7] riscv: Kconfig.socs: Allow SOC_CANAAN with MMU for K230
Date: Fri, 15 Mar 2024 17:19:04 +0900 [thread overview]
Message-ID: <2b0511af-1b5b-4c90-a673-c9113bb58142@kernel.org> (raw)
In-Reply-To: <tencent_9543398AE3BAC424842837CEF01508D6680A@qq.com>
On 3/14/24 01:56, Yangyu Chen wrote:
>> Hi,
>>
>> Thanks for the review comments. After thinking about it for a while,
>> I think we don't need to change it as we have changed the help
>> message which deleted the "K210". And the dts on k210.dtsi shows
>> mmu-type is riscv.none, I think if someone noticed this would know
>> why it fails to boot on the S-Mode MMU Kernel on K210. The only
>> special thing for ARCH_CANAAN is that a loader.bin will be built
>> when M-Mode is on arch/riscv/Makefile. However, Canaan has no other
>> M-Mode chips except for K210. So I think we don't need to change
>> it.
You completely lost me here. I do not understand what you are trying to say.
>> Another reason is that SOC_CANAAN for K210 is somehow hard to change.
>> If we continue using SOC_CANAAN for K210 but not for other Canaan
>> SoCs such as K230, it will cause some confusion to users. If we
>> rename SOC_CANAAN to SOC_CANAAN_K210, it will change many drivers
>> in many subsystems like my patch v5 [1]. So I don't think we need
>> to fix it.
>>
>>
>> If we don't change it, A concern for this is that some drivers for
>> K210 will be built when SOC_CANAAN=y and if we add this to defconfig,
>> all riscv builds will also build some K210 drivers even on MMU. But
>> I think this will not be a problem just need some memory/storage
>> for a slightly bigger kernel. Also, we will enable some new configs
>> in defconfig when a new soc gets supported, it's normal for K210
>> SoC drivers.
>>
>> Thus, I think we don't need to change it. If you have some other
>> opinions, please let me know.
1) Rename SOC_CANAAN to SOC_CANAAN_K210 and use that for any conditional code or
driver selection that is specific to the K210, which is what's done now.
2) Create a "new" SOC_CANAAN config and make SOC_CANAAN_K210 depend on it and on
!MMU
You could also add SOC_CANAAN_K230 if needed and make it depend on SOC_CANAAN &&
MMU.
With that, dirvers common to both the K210 and K230 can easilly be selected and
selecting SOC_CANAAN will end up either building for the K230 or the K210,
depending on MMU being set or not.
That's my 2 cents. Feel free to ignore. I am not involved that much with riscv
these days and I am far too busy with other kernel areas to be of any help. But
I really think that allowing building the K210 when MMU is enabled and "hoping
that the user understand his mistake" is not a great approach.
--
Damien Le Moal
Western Digital Research
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2024-03-15 8:19 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-04 21:03 [PATCH v3 0/7] riscv: add initial support for Canaan Kendryte K230 Yangyu Chen
2024-03-04 21:05 ` [PATCH v3 1/7] dt-bindings: riscv: Add T-HEAD C908 compatible Yangyu Chen
2024-03-04 21:05 ` [PATCH v3 2/7] dt-bindings: add Canaan K230 boards compatible strings Yangyu Chen
2024-03-04 23:44 ` Damien Le Moal
2024-03-04 21:05 ` [PATCH v3 3/7] dt-bindings: timer: Add Canaan K230 CLINT Yangyu Chen
2024-03-05 14:47 ` Rob Herring
2024-03-04 21:05 ` [PATCH v3 4/7] dt-bindings: interrupt-controller: Add Canaan K230 PLIC Yangyu Chen
2024-03-05 14:48 ` Rob Herring
2024-03-04 21:05 ` [PATCH v3 5/7] riscv: Kconfig.socs: Allow SOC_CANAAN with MMU for K230 Yangyu Chen
2024-03-04 23:46 ` Damien Le Moal
2024-03-05 7:47 ` Yangyu Chen
2024-03-05 17:20 ` Conor Dooley
2024-03-05 17:50 ` Resend: " Yangyu Chen
2024-03-05 18:32 ` Yangyu Chen
2024-03-05 23:58 ` Damien Le Moal
2024-03-07 21:03 ` Yangyu Chen
2024-03-13 16:56 ` Yangyu Chen
2024-03-15 8:19 ` Damien Le Moal [this message]
2024-03-04 21:06 ` [PATCH v3 6/7] riscv: dts: add initial canmv-k230 and k230-evb dts Yangyu Chen
2024-03-05 15:54 ` Palmer Dabbelt
2024-03-05 16:22 ` Yangyu Chen
[not found] ` <7A86D933-B85F-4B29-8D6D-AB414A42AC06@cyyself.name>
2024-03-05 16:37 ` Yangyu Chen
2024-03-05 17:01 ` Conor Dooley
2024-03-05 17:17 ` Yangyu Chen
2024-03-05 17:24 ` Conor Dooley
2024-03-04 21:06 ` [PATCH v3 7/7] riscv: config: enable SOC_CANAAN in defconfig Yangyu Chen
2024-03-04 23:50 ` Damien Le Moal
2024-03-05 16:55 ` Yangyu Chen
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=2b0511af-1b5b-4c90-a673-c9113bb58142@kernel.org \
--to=dlemoal@kernel.org \
--cc=aou@eecs.berkeley.edu \
--cc=conor.dooley@microchip.com \
--cc=conor@kernel.org \
--cc=cyy@cyyself.name \
--cc=devicetree@vger.kernel.org \
--cc=guoren@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh+dt@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox