Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp540765lqs; Tue, 5 Mar 2024 09:02:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWY2ELhYWfK4uLe8VA7K9yVy7TXSb948CAt21M9SirMGnDgc5YNgQTygyS9ZOOeYEfWyBGb8u3wznsZtn/7vU0BxEqxRKEp1P9jj3Hwlw== X-Google-Smtp-Source: AGHT+IG5eK/ySsvOMTeuMdJEcUl8auoKtnEabZDTq6HMTvaPR3hxO7H1g+YZWGKW/yRRFia2PCyg X-Received: by 2002:a05:6102:38d4:b0:472:b188:30ad with SMTP id k20-20020a05610238d400b00472b18830admr2722812vst.1.1709658121748; Tue, 05 Mar 2024 09:02:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709658121; cv=pass; d=google.com; s=arc-20160816; b=kj5nPTJ2pf8G2iXKRky+fyh/GdJnPYwH3SSuSRzc467mbcoQ1J3gdGhEIFun227uJr YBHVjxN3SBngGW8v67KZ3UOdURqaqXDxFAyIdx5zvfCjcChMg+BYuqDKxEW0tlj81fMm Qzj4ZyyCurwEVFQgF8WhmP/1d2Mw2tdDWlnMZPD1gnVj7PGYkmOFBCBOOES3/ACqODHB CUelpuEs2H+CmN4XViAq7PcYFzYmPZS9pfM2qBsL/bhVXO/9TaIVWEwm/3D1M9QGq763 A2lcPkn76suH3v/RxwzurY5WONgbABdWjxwss4qGPG9A9vN8Dw9z7cS+yJ2Nz8PEht4L jSDw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tkGY4wb7z/8af09XgyAHlxLcioa2H5GB58yzRRu1SfI=; fh=4/JTEC+YnOfpkb6LCdM0eYgBHoKF99L2pau7yBCJScw=; b=DTETZmqixkHi+INi6azXgYKkyMbsyOv2BlL7wiaWxNDRFo9eIGhF62XJGdC5YS8NEE aiBuK9k76dR8dU3zjjsKbIzPZAYvOL7UciMQl/8akCLWfqRN0pKm8tyDXgxp0H3p6v2c ojN5YkHFTZDZu6YFe8tERvkBwRK+N+S0Zmn85oCv3d3V6l4LUABGraZqTNUc06YGMnjt IRbDOsrkep2Ij0hh+1iKj40zgnT2FWAqWNuYgCLXdM3+IaLGixdmwV3z3TGLWQtOHCAl E9yIXvjWNAhdhn0aNwhhtyhu2uMA+DvtCzNWe9i5Fc94qXeU1zo7VRqOJAVmmqMorKW0 y1Tg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fU42HUNX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-92733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id p22-20020a67f356000000b0046d20cd0405si1732879vsm.713.2024.03.05.09.02.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 09:02:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fU42HUNX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-92733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AD6641C232A1 for ; Tue, 5 Mar 2024 17:01:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F04E12E7E; Tue, 5 Mar 2024 17:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fU42HUNX" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2B5AFDDAD; Tue, 5 Mar 2024 17:01:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709658099; cv=none; b=RJu+jwE+swOfo6mdu8WfvQVYj28m9PpcvPqT6YklfdREKTzuMf+vBci22pveYS/22g9dA++iw9tGPNPURmDcBHjoNOco+3U1UcztC5iaGu0ygJF4W63Z43vbtsNJgX8AaK7U0BXhiKJSOZxR7Z0HoBq0INwpweaSVws3xHjMI88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709658099; c=relaxed/simple; bh=4qZMQUT97qziMrbEkR0c+mNUfDn+AAkaDuZWbsUSINQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=b5C5JDGT5JzyROyx0VTFliLoW2ob8859BWdpgPMWnVSDwiRsU7NiV83rGVw1iZDQy5DKB5pr38/P1voOwRLYO7/1+JHmo4+iu0jixXaak/M4lAXVZh0zswjRnx7+aIR/x8emDHVIAJRodd8ITwa7Xcu6auddBWDuA3TmgQ3iOZY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fU42HUNX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F502C433F1; Tue, 5 Mar 2024 17:01:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709658098; bh=4qZMQUT97qziMrbEkR0c+mNUfDn+AAkaDuZWbsUSINQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fU42HUNXNJ2YEmsFtU0BPLIyXXoSJjZmBlfqPyEq1dHLm9X3835jn+VMyfHVT+/1y A0ZCzfbXW9Se2xrf/Kn+gVNWPzxaENVbUSrIl2Bz64IKKGOaPa6u7gsTItt5XgOoPa s5nyJ69oQhhZZazxcFpA6TGBUPhoUHusXjf+cD3thL+qWodMJ/YKtkckTvzMxhYarg 34zbBKhN1NBLTr0JU0x6hKmr7ktJeSDPSpAc9lZwSJk/UN7WgOxzktJKk1YVM5hJG2 GlOZgjF3qnO7l4Y7fgj+mk0hFBhLQrhhbFBQANDh9gaA1zuRbGZ1GhryE0Drl3k+a7 RL9pB9EDhaZ7A== Date: Tue, 5 Mar 2024 17:01:34 +0000 From: Conor Dooley To: Yangyu Chen Cc: Palmer Dabbelt , linux-riscv@lists.infradead.org, dlemoal@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, Paul Walmsley , Albert Ou , guoren@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 6/7] riscv: dts: add initial canmv-k230 and k230-evb dts Message-ID: <20240305-shorten-disallow-eae65fdc8fdb@spud> References: <7A86D933-B85F-4B29-8D6D-AB414A42AC06@cyyself.name> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7/iNqzShui/y+tHK" Content-Disposition: inline In-Reply-To: --7/iNqzShui/y+tHK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey, Just chiming so that things don't get misinterpreted. On Wed, Mar 06, 2024 at 12:37:16AM +0800, Yangyu Chen wrote: > > On Mar 6, 2024, at 00:22, Yangyu Chen wrote: > >> On Mar 5, 2024, at 23:54, Palmer Dabbelt wrote: > >> On Mon, 04 Mar 2024 13:06:00 PST (-0800), cyy@cyyself.name wrote: > >>> - Svpbmt and T-Head MAEE both supported > >>>=20 > >>> T-Head C908 does support both Svpbmt and T-Head MAEE for page-based m= emory > >>> attributes and is controlled by csr.mxstatus. If the kernel wants to = use > >>> svpbmt, the m-mode software should set BIT(21) of csr.mxstatus to zero > >>> before entering the s-mode kernel. Otherwise, the kernel will not boo= t as 0 > >>> on T-Head MAEE represent to NonCachable Memory and it will lose dirty= cache > >>> lines modification that haven't been written back to the memory. > >>=20 > >> So I guess we need the bootloader to just be accurate here? ie: whate= ver > >> extension it tells S-mode kernels is enabled is how S-mode behaves, and > >> then this should just work itself out. Correct, the bootloader/firmware "just" needs to write this bit to match what it passes to onwards in the devicetree. > > Yes. Currently, I have patched OpenSBI to disable MAEE. Conor Dooley sa= id > > from a public irc group that he wants to control the enable of T-Head (#riscv on libera, the usual location) I also suggested that that, given we can use the standard extensions, we should use them instead of the custom extensions/errata. > > variation of zicbom and svpbmt from dts, in addition to mimplid or > > something now. Correct. I'm find with the impid =3D=3D archid =3D=3D 0 condition, given th= at's what we need to keep to avoid regressions, but if any future T-Head CPUs want to enable MAEE (ERRATA_THEAD_PBMT) or the custom CMOs (ERRATA_THEAD_CMO) these should be enabled from DT. Particularly when these CPUs can be configured to either use the T-Head versions or the standard extensions. > > I think that will be a better way for the bootloader to tell > > the kernel whether the T-Head MAEE should be enabled. You've got three options I guess. You could patch the DT in the bootloader, or use a fixed DT that matches the bootloader, or you could use the DT passed to the bootloader and parse the extensions to decide whether or not to enable MAEE or Svpbmt. Seems you're going for option 2. > > Link: https://github.com/cyyself/opensbi/commit/b113c1c01d700314a4a6962= 97ec09031a9399354 > >=20 > > Furthermore, I wonder whether a CPU node like this would be acceptable. > > I don't have any other details of how another CPU from K230 SoC works on > > Linux. A CPU node like what? It is not clear to me. --7/iNqzShui/y+tHK Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZedP7gAKCRB4tDGHoIJi 0vlUAQDOzEPBUwFNFekPyZA1wxs/XJG2IBFzn18OERTkISZkDQEArky2FzLuZ9b1 IyeQgq4Qy6fuiT9qN796R8RzZPoXDwg= =mHae -----END PGP SIGNATURE----- --7/iNqzShui/y+tHK--