From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out203-205-221-191.mail.qq.com (out203-205-221-191.mail.qq.com [203.205.221.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 173A117BD5 for ; Tue, 5 Mar 2024 17:50:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.205.221.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709661054; cv=none; b=ZB8BPkoB6OVZqXFXHFd93eJCbQl5fSA6soDRoEHamh0hWfMhBDK4vEBlmHpnKrffsB1kC6aueNCgmar5namZkjQ+RoRqTcdumHEmQPVFXURfuQwmIjx2U84snBLWPLqdVC1Gfg8gAA8+XJCsoWnenzm9wVH9AtovHV4YPTf/MF8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709661054; c=relaxed/simple; bh=gaD5NGVa0EnCxj9c3TXhPd/2JfBhznddbAsKW3/SWM0=; h=Message-ID:Content-Type:Mime-Version:Subject:From:In-Reply-To: Date:Cc:References:To; b=Zm2Czxr3CVMsTTp4pssQKzEGP2OueO9ywRXHOTBa1DiezDomjvxPLsMneLkQypRscUe/kMYtdt3ZLCTDdcNoo8qjV1kd7CS69sdv3uGH277/Q0NdHdDSYSF9fIgVBGQXwJYHLJIj/ht8mtthOZdqbg5LgTI6WANYdPrhGPzTbbc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cyyself.name; spf=none smtp.mailfrom=cyyself.name; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b=svBNJ8o3; arc=none smtp.client-ip=203.205.221.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cyyself.name Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=cyyself.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b="svBNJ8o3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1709661039; bh=g0VikDDZHRPX1F+raT86tLLC0uFSiNwgf0RrjwgjTDQ=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=svBNJ8o3d+bbf8B6s3jzYt92tvyGNr3k04oMMXGszHCWhcV+grLEu4nIgLYysgT1m 4bT04oOtinym5ew8wMgfe+kkOWpwX0Qx+qEqvIauzoEQqrPO1iYGcdmVt1d5QmVY/G lE8j9LfoPP1EIEYBVhWFPKVh57ccO55VQ+TfLeRo= Received: from smtpclient.apple ([2001:da8:c800:d084:84f7:c158:bab8:8899]) by newxmesmtplogicsvrsza1-0.qq.com (NewEsmtp) with SMTP id CA3A6E33; Wed, 06 Mar 2024 01:50:35 +0800 X-QQ-mid: xmsmtpt1709661035tuur2m1ml Message-ID: X-QQ-XMAILINFO: MqG4KXyEKpQye6Sjmokj1B8vEqsYsqQnANZBIE4uyKBM4b5RwTTrbxPOnZHCQE KRRrkBsbf1ueRLgIJ7T5wutix5QYmVTMCSqaXaljN8cql0RcxLes6XLihiYdbzps4oDNvTZOA9Fu CBVavCNUSqx4vcYwRBtCCOt8vAEyJVyMJqQRhzR7R4gNR8oe3og50qFzGCntxAVPNiLcFXoT2cXA Vn5HAln+26uVyyXY4hX0dRRtat24JWwKnOiNsZehzXslBakYPNM/Mp5D38c1ip/6wEaHzai5L3Sj 04VHEi6a/wWDyyt+Fes1wM1KauEkaAQMB/BwRNb2b5P9gR5lkSpVUSJbnGM28EyaQl5X9IcmquE9 8rRifQolFDLvNi3aVyVvZ9I5j5ggoSS9yvRORyBtCQddSVeCK52fHn0Af9XO0JLWs5D8YOcD6kzI ppY2rTiLFnrn9Ylq4pAo0m0PaOckv1FzTlfRBguih3tze5JTyOAme/kfXFbymLmiWp07GCSxi6bs 8ZmIQy4mlbUJphJW8vpuCW8xnLeKPAnJLRAaNBn/1vXYvsy+pNZopKsMeb0/HoIYHhKmsCHbnbBX u31zi24Hj3Pz4pp9D+eVPixgXHDowZRB/NtpXp0qykbDFZ/l5A/EzK9dUezWAxr3hMZFCWbUMEeu LQp7e4K2R9/lYf1Ue49cAD2ICig/OIS26EFTFo9wHdpvQZwCz/rOuJXh9CfV9FIaQtkN8K80nPKK /45G5FmwHjkGMGXXHDs2b2HnqfSNFT4YTDcNoNT0IJ10Q4bbFvCYUwWQ+/muBk9TBhQbhs6NSaWD QyfqrAloAxFlSwQuLKZMHkdr2Zd6ulYYW+yLgsH9gDDsdgPtu2kYw+MLKMgnT4UsDpUtUHubxrhs WBvPuW16BnOPtUWzPiUy45TLXrxu6clqdu1x/sBdZDqGdvYIXboSCuzgh3zTd6k3u2gf7qEKJA/b p1JkaQyAAMprbAZFxFm17RoryXI97zMfGZYu59RkCeLC6Hre2FlUaCpWZA0MzE71teFaVsELU= X-QQ-XMRINFO: NyFYKkN4Ny6FSmKK/uo/jdU= Content-Type: text/plain; charset=utf-8 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.400.31\)) Subject: Resend: Re: [PATCH v3 5/7] riscv: Kconfig.socs: Allow SOC_CANAAN with MMU for K230 From: Yangyu Chen In-Reply-To: <20240305-fascism-enrich-06483ddeb149@spud> Date: Wed, 6 Mar 2024 01:50:25 +0800 Cc: Damien Le Moal , linux-riscv@lists.infradead.org, Rob Herring , Krzysztof Kozlowski , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Conor Dooley Content-Transfer-Encoding: quoted-printable X-OQ-MSGID: <066CA89A-31BD-47DF-B540-D1D5844B8597@cyyself.name> References: <20240305-fascism-enrich-06483ddeb149@spud> To: Conor Dooley X-Mailer: Apple Mail (2.3774.400.31) The last email was not received in the list due to I didn=E2=80=99t = change the mode to plaintext. Sorry for that. This is a resend email. > On Mar 6, 2024, at 01:20, Conor Dooley wrote: >=20 > On Tue, Mar 05, 2024 at 03:47:15PM +0800, Yangyu Chen wrote: >> On 2024/3/5 07:46, Damien Le Moal wrote: >>> On 3/5/24 06:05, Yangyu Chen wrote: >>>> Since K230 was released, SOC_CANAAN is no longer only referred to = the K210. >>>> Remove it depends on !MMU will allow building dts for K230 and = remove the >>>> K210 string from the help message. >>>>=20 >>>> Signed-off-by: Yangyu Chen >>>> Reviewed-by: Conor Dooley >>>> --- >>>> arch/riscv/Kconfig.socs | 5 ++--- >>>> 1 file changed, 2 insertions(+), 3 deletions(-) >>>>=20 >>>> diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs >>>> index 623de5f8a208..b4e9b7f75510 100644 >>>> --- a/arch/riscv/Kconfig.socs >>>> +++ b/arch/riscv/Kconfig.socs >>>> @@ -75,13 +75,12 @@ config ARCH_CANAAN >>>> def_bool SOC_CANAAN >>>> config SOC_CANAAN >>>> - bool "Canaan Kendryte K210 SoC" >>>> - depends on !MMU >>>=20 >>> This seems wrong to me. The k210 support does require no-mmu. So why = remove >>> this ? >>=20 >> It just allows SOC_CANAAN to be selected when MMU=3Dy. With this = patch, >> nommu_k210_defconfig still works. >=20 > I think the concern here is that this would allow people to build a > kernel for the k120 with the MMU enabled, not that the existing nommu > build will be affected. >=20 Aha. I don't think is there anyone will try a build with MMU on K210. It only has 6MB of memory available to the CPU. For rv64 if the S-Mode software starts at 2MB, it will only have 4MB for S-Mode Linux. It's hard to trim the kernel and fit in 4MB and even preserve some memory for userspace. I also tried to make nommu_k210_defconfig on gcc 13.2.0, it produced a 1.6M kernel in arch/riscv/boot/Image. But if I use nconfig to set CONFIG_MMU=3Dy and rebuild, the kernel file will increase to 11M. > Maybe you could squash in something like the following? >=20 > diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs > index b4e9b7f75510..75d55059163f 100644 > --- a/arch/riscv/Kconfig.socs > +++ b/arch/riscv/Kconfig.socs > @@ -72,15 +72,19 @@ config SOC_VIRT > This enables support for QEMU Virt Machine. >=20 > config ARCH_CANAAN > - def_bool SOC_CANAAN > + bool "Canaan Kendryte SoCs" > + help > + This enables support for Canaan Kendryte SoC platform hardware. >=20 > config SOC_CANAAN > - bool "Canaan Kendryte SoC" > + bool "Canaan Kendryte K210 SoC" > + depends on !MMU > + depends on ARCH_CANAAN > select CLINT_TIMER if RISCV_M_MODE > select ARCH_HAS_RESET_CONTROLLER > select PINCTRL > select COMMON_CLK > help > - This enables support for Canaan Kendryte SoC platform hardware. > + This enables support for Canaan Kendryte K210 SoC platform = hardware. >=20 > endmenu # "SoC selection" >=20 > (Which reminds me, I really need to go and finish sorting out the = ARCH_ > stuff) Seems like an idea if we want this consideration. But I don't think we = need this as the opinions shown above. If it should be, I think SOC_CANAAN should be renamed to SOC_K210 or SOC_CANAAN_K210.