From nobody Fri Apr 3 08:34:56 2026 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 26C073FBEA6; Tue, 24 Mar 2026 16:44:02 +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=1774370643; cv=none; b=sgxZVoyrOW0z7rSa0UkqcipnNHgM6QN0itHSLPEKIUZtj9izovb6G64Je6TaCS9/mlSB0vS4ebQiP3ZdNvxv/e1OnGGKx5/hisK6LHetqID0B+75yZjQIdXfhb6BWI7xlGfKFB61TvoV8e1mdr16eas+HkMTntAaBmVYmYFhznw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774370643; c=relaxed/simple; bh=uALeBIQ9srGWNXN1FhxlvCEa7dBhMf1seaxU46RBbec=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F0yULse744i10Lxu89SDC4kkCCaGQgOypHfdPcB9nLdxucfcNrwFXgYyBn/1V4kRpplNDG2kZauzsFNR/YxMNjqjnrK+AGk53CX51ZLuRJSKpxtWh/4dG/rnBQUJacOdXPnY3AwHApwWXT8jA5sa+zIHVHzw0mGW9RGlRv2R7Ts= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MKd/bY+q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MKd/bY+q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC74CC19424; Tue, 24 Mar 2026 16:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774370642; bh=uALeBIQ9srGWNXN1FhxlvCEa7dBhMf1seaxU46RBbec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MKd/bY+q7kW3h9G/0vdZWfPBXTRclabRpkl9UVKyk92HESgdxGDki/8TyS9AVIXCJ lSAFfNUIYo0nb1xUWkEWeENwSkw+vi/RLWbD1x5nEN0XP8Wvem5ocAf6wnmBcH2IjT ReiStKF/+/+YJoVFQ6eeDppiUnevBTLsre8qoW/au0niqzuAeOhvMcwwZWNm/OC1Jq 7KzdXf8Z6w27klffegiC+p5puoU4UuV2snqYUZoKaNPVPYDhh28rnBQDhr3wIp/5fU MgkB8faRY+bseQU9CEOhRdGtC9GGqYITU5lRIDJf++OcKayqnrqicPm0S0oZi4ZY6a XTxMlq7NVXEcA== Received: by wens.tw (Postfix, from userid 1000) id 9FD5E5F9F8; Wed, 25 Mar 2026 00:44:00 +0800 (CST) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/7] dt-bindings: sram: Document Allwinner H616 VE SRAM Date: Wed, 25 Mar 2026 00:43:49 +0800 Message-ID: <20260324164357.1607247-2-wens@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260324164357.1607247-1-wens@kernel.org> References: <20260324164357.1607247-1-wens@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Allwinner H616 has two switchable peripheral SRAM regions: - The VE SRAM is a 2 MB dedicated SRAM for the Video Engine. CPU access to this region is enabled by default. CPU access can be disabled, after which reads will show the same stale value for all addresses, while writes are ignored. The mux value for this region is different from previous generations, and thus needs a completely new compatible. - The SRAM C region is an alias of the first 128 KB of VE SRAM, plus 64 KB of DE SRAM. The latter is otherwise unaccessible from the CPU. When CPU access is disabled, the whole region reads as zero, while writes are ignored. The mux value for this region is the same as on the A64 and H6. The existing compatible for the A64 already covers this. Add the compatible for the VE SRAM to the list of covered compatibles in the generic SRAM region binding. Signed-off-by: Chen-Yu Tsai Acked-by: Jernej Skrabec --- Documentation/devicetree/bindings/sram/sram.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/sram/sram.yaml b/Documentati= on/devicetree/bindings/sram/sram.yaml index c451140962c8..ddaab84f7ba0 100644 --- a/Documentation/devicetree/bindings/sram/sram.yaml +++ b/Documentation/devicetree/bindings/sram/sram.yaml @@ -81,6 +81,7 @@ patternProperties: - allwinner,sun4i-a10-sram-d - allwinner,sun9i-a80-smp-sram - allwinner,sun50i-a64-sram-c + - allwinner,sun50i-h616-ve-sram - amlogic,meson8-ao-arc-sram - amlogic,meson8b-ao-arc-sram - amlogic,meson8-smp-sram --=20 2.47.3 From nobody Fri Apr 3 08:34:56 2026 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 26C9B3FBEB9; Tue, 24 Mar 2026 16:44:03 +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=1774370643; cv=none; b=oB4YOOJusOT4xCR+axkQ1xqsiGwsyWMYoRufKu3/pK1MfBHZM16o3R87SI2Ph+dK4LAUFjRefbUvcdwD0Fz5FsMOYIKdWxgGTr4p22IaXAx/1oaoWX4UTscmLex3q6jjaUnwGRMUoivmIlUBHx4w8t4kOXXHxE1XrKdLwMxalac= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774370643; c=relaxed/simple; bh=iRKS7gv8fCvjYKMqPMFIbD72v7V5hcNF6WcvPrFlSRo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FtgkWeLgPLd+FujuttYDNbtBLJ6D9qFdlEPUFGLIYvab3FoQzj9jtCJcJfTg80tgF55Cbnj/pNJvqKV30ogMAQGiAxyDoeXTwqiSQKc4H0WeQr+iFJL3FfPwhFua2IH092dLVELqA2pNNjSL+Vboon44efrsRqk+zpMSlBRArlo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aZC1wnIq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aZC1wnIq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C16FFC2BC87; Tue, 24 Mar 2026 16:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774370642; bh=iRKS7gv8fCvjYKMqPMFIbD72v7V5hcNF6WcvPrFlSRo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aZC1wnIqpt390sXCOeAD1YZhNVDEobbPtbLhavgjyVncHx+fw4LAXMLVlYf05pdE/ 0HS/vMx1srrnsL4/fR4Br3IwKK4lSgo5hvP+w0H8kzeK715ScmVQNw7QjKoIG1YhUV OvV8L8bakZ60LWvzbeauvAPsxlGCAcgg5uvWivDLoRystMAGmoXuCaYhBgyk2F7c6V VTAopkjvzFp9IlonJhWVa6JnyWfYtleA89/YBO9bLoyUJ/qcDcr3Q3pCTUctD/3Zir pQARZnGCx4oA/wuw5hljpxC2TbYDPMyZG+nRfR89Pt4YRwn6sqPk5oWLe1YeDJ8jEE 00MFpRc1uQq2Q== Received: by wens.tw (Postfix, from userid 1000) id A81265FEB2; Wed, 25 Mar 2026 00:44:00 +0800 (CST) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/7] dt-bindings: sram: sunxi-sram: Add H616 SRAM regions Date: Wed, 25 Mar 2026 00:43:50 +0800 Message-ID: <20260324164357.1607247-3-wens@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260324164357.1607247-1-wens@kernel.org> References: <20260324164357.1607247-1-wens@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Allwinner H616 has two switchable peripheral SRAM regions: - The VE SRAM is a 2 MB dedicated SRAM for the Video Engine. CPU access to this region is enabled by default. CPU access can be disabled, after which reads will show the same stale value for all addresses, while writes are ignored. The mux value for this region is different from previous generations. - The SRAM C region is an alias of the first 128 KB of VE SRAM, plus 64 KB of DE SRAM. The latter is otherwise unaccessible from the CPU. When CPU access is disabled, the whole region reads as zero, while writes are ignored. The mux value for this region is the same as on the A64 and H6. Add compatible strings for both of them. Signed-off-by: Chen-Yu Tsai Acked-by: Jernej Skrabec --- .../bindings/sram/allwinner,sun4i-a10-system-control.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-sys= tem-control.yaml b/Documentation/devicetree/bindings/sram/allwinner,sun4i-a= 10-system-control.yaml index e7f7cf72719e..6e6ab2168a2a 100644 --- a/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-con= trol.yaml +++ b/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-con= trol.yaml @@ -80,6 +80,7 @@ patternProperties: - const: allwinner,sun4i-a10-sram-c1 - const: allwinner,sun4i-a10-sram-d - const: allwinner,sun50i-a64-sram-c + - const: allwinner,sun50i-h616-ve-sram - items: - enum: - allwinner,sun5i-a13-sram-a3-a4 @@ -103,7 +104,9 @@ patternProperties: - allwinner,sun7i-a20-sram-d - const: allwinner,sun4i-a10-sram-d - items: - - const: allwinner,sun50i-h6-sram-c + - enum: + - allwinner,sun50i-h6-sram-c + - allwinner,sun50i-h616-sram-c - const: allwinner,sun50i-a64-sram-c =20 required: --=20 2.47.3 From nobody Fri Apr 3 08:34:56 2026 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 26B603FB7FF; Tue, 24 Mar 2026 16:44:02 +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=1774370643; cv=none; b=DKtydD3FEvIjEXgaTIWQC5lhTz9/XZ8DuhioPjLQMSKP21jZT945uqVh3Zwg81dB4+lKV/0l6EsoOLykDeVOd4mHay1d3jg/xUuuQaDz9eQ8KeriTDEsZlJ8jtJIBAX0Veg4uFaz8YIQT5HxrP6WDOH/RDJiqQMH8LeRDAVDi1o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774370643; c=relaxed/simple; bh=U61+dRHYuGxHw4u9pXFuFuZiDuMWELHNCtj0Nylxc0Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R2bLbs3pYlhwuIzltLxbhFfJQtL8gUCkAYcdCkyApkzCW/CgHJr8AuTE+8ITSZC1Oh/vwO5sv8qWoIs1ui58Mr9arZp6BLfRYPIgqLqzx32gJBTvGh+O/IsLA195k5CIFVQ8Rx30lU/fiMuxpOSA8KlOna5AsmQuMXP/GwxeQqc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tsClmxy4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tsClmxy4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B35F7C2BCB2; Tue, 24 Mar 2026 16:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774370642; bh=U61+dRHYuGxHw4u9pXFuFuZiDuMWELHNCtj0Nylxc0Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tsClmxy4M9zi3pMxpUGq3hxYRSZ4og2rH3NnK9WSJE+kTch0rT9za2dEVurIEIHKq VbX7Lb6/U1gjTqAUOzLAJOKbGEl69JQtOEyuJg62O46z9jRZA4yGmV6mb5c6CopUtO mYbRbmqo3Jm59Mu89FgntzTfaQlsAhglopEXSBGMMI3V1cxL67L5otRhmiPjM2NiFE FE0dskqUWWH2ldK948OprtoogAP3SfcBt9gArYdz5Tj3x3N3Ml5QdN5HzivawjxeGn UzsM7Zap8uftLrLhLP2UMI8Cmh1MPWEs9Hai3MN+kBI6PylkgCfziMsYX7A94QbHK4 4tmrUMoYxNuvA== Received: by wens.tw (Postfix, from userid 1000) id B0B825FFAB; Wed, 25 Mar 2026 00:44:00 +0800 (CST) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/7] soc: sunxi: sram: Const-ify sunxi_sram_func data and references Date: Wed, 25 Mar 2026 00:43:51 +0800 Message-ID: <20260324164357.1607247-4-wens@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260324164357.1607247-1-wens@kernel.org> References: <20260324164357.1607247-1-wens@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" sunxi_sram_func contains value mapping that do not change at runtime. Const-ify them. Signed-off-by: Chen-Yu Tsai Reviewed-by: Jernej Skrabec --- drivers/soc/sunxi/sunxi_sram.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c index 446b9fc1f175..5e8c80ae3509 100644 --- a/drivers/soc/sunxi/sunxi_sram.c +++ b/drivers/soc/sunxi/sunxi_sram.c @@ -29,11 +29,11 @@ struct sunxi_sram_func { }; =20 struct sunxi_sram_data { - char *name; - u8 reg; - u8 offset; - u8 width; - struct sunxi_sram_func *func; + char *name; + u8 reg; + u8 offset; + u8 width; + const struct sunxi_sram_func *func; }; =20 struct sunxi_sram_desc { @@ -54,7 +54,7 @@ struct sunxi_sram_desc { .reg =3D _reg, \ .offset =3D _off, \ .width =3D _width, \ - .func =3D (struct sunxi_sram_func[]){ \ + .func =3D (const struct sunxi_sram_func[]){ \ __VA_ARGS__, { } }, \ } =20 @@ -111,7 +111,7 @@ static int sunxi_sram_show(struct seq_file *s, void *da= ta) struct device_node *sram_node, *section_node; const struct sunxi_sram_data *sram_data; const struct of_device_id *match; - struct sunxi_sram_func *func; + const struct sunxi_sram_func *func; const __be32 *sram_addr_p, *section_addr_p; u32 val; =20 @@ -169,7 +169,7 @@ static const struct sunxi_sram_data *sunxi_sram_of_pars= e(struct device_node *nod { const struct of_device_id *match; const struct sunxi_sram_data *data; - struct sunxi_sram_func *func; + const struct sunxi_sram_func *func; struct of_phandle_args args; u8 val; int ret; --=20 2.47.3 From nobody Fri Apr 3 08:34:56 2026 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 4D0353FE644; Tue, 24 Mar 2026 16:44:03 +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=1774370643; cv=none; b=tZmINWm0/ZBndNMjLtv4YxodcCBFiMCOguAc82ur/uCyUrzq8sEVKMqlea0Tr+9paapanP2GrFt6hVNNkRxCuaMSV1rUpPJMbM7bxKBIH0KgNvewt0+Hy8Bo4/Zeyf51r0ucUr0f7TEy+K0i5zmVbpR0qp5Y16bZ+Y9SQB3fnBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774370643; c=relaxed/simple; bh=uNk+5l4j5lYbYuM0VQJOR8shYhm489bqZiHsaW/YJrg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SaW2XBGp/7vQSWWQ4yl/wJIFrQ67Suddo5JYK6JFcz5DeJu/0qLccsXP1GxQkiCj7JTwx/hSI2Nxtn1TObj5d2QbCiLZX4g0u4EB2+5PFUmmLgCR8uamx8HKk5imYyfZce493zCt06CDpQRJv/PAmB+yGJUYIj60Wd6GxYpEIEM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gnmMkuLI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gnmMkuLI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC357C2BCC7; Tue, 24 Mar 2026 16:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774370643; bh=uNk+5l4j5lYbYuM0VQJOR8shYhm489bqZiHsaW/YJrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gnmMkuLIPy/3dOerLZTV5S9nifmLUuXUBt129KvZCUgiuvT5AR7PRnkgLwOzsl9YE vNFMk3Xuhhv+zaJz2gK15DayDFcFTwNg/O/s6Ubtd6fgBxW8u5I5JmSqp5w2zGnEEE AyfdhQgdTQbymfSYQk8ZXYx/IowOksUxdzuXhqo7C9265L3pI/GRQ9hiNk7P8AGPce 2o9b6JPJ0ljamfWCpMCrq5/s8qiDZugyhabkOuKahenbdVMgG1wPOdzVluAkib0Oqc lwwM78NZ1IQVf9Bc3oUJOmig9LtB1US3PxTIKN63JgV0LD3n9gpC4WFLkxGnp2YMs4 OH0BAewXE9rVw== Received: by wens.tw (Postfix, from userid 1000) id C06785FEC0; Wed, 25 Mar 2026 00:44:00 +0800 (CST) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/7] soc: sunxi: sram: Allow SRAM to be claimed multiple times Date: Wed, 25 Mar 2026 00:43:52 +0800 Message-ID: <20260324164357.1607247-5-wens@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260324164357.1607247-1-wens@kernel.org> References: <20260324164357.1607247-1-wens@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On the H616, the SRAM C region is an alias mapping to part of the VE SRAM (accessible in whole at a different address) and part of the DE SRAM (otherwise unaccessible). As such both the VE and DE need to claim this SRAM region to prevent access from the CPU. The SRAM claim API is designed so that a "claim" routes the SRAM to the peripheral device, disabling access from the CPU. So long as the written register value is the same for all the claimants involved, allowing multiple or repeated claims is trivial. This is indeed the case for all supported SRAM regions. The only known SRAM region to have multiple different settings is the SRAM C2 region; this can be claimed by the AE, CE, or ACE (assumed to be AE + CE). This region is not supported, and likely will never be needed nor supported, as there is no documentation for the peripherals involved. Change the SRAM region "claimed" field from a boolean to a reference count. A claim will increment the count, while a release decreases it. The first claim will trigger the register value write. The driver otherwise behaves as before. Signed-off-by: Chen-Yu Tsai Reviewed-by: Jernej Skrabec --- drivers/soc/sunxi/sunxi_sram.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c index 5e8c80ae3509..aba155379ccc 100644 --- a/drivers/soc/sunxi/sunxi_sram.c +++ b/drivers/soc/sunxi/sunxi_sram.c @@ -12,6 +12,7 @@ =20 #include #include +#include #include #include #include @@ -38,7 +39,7 @@ struct sunxi_sram_data { =20 struct sunxi_sram_desc { struct sunxi_sram_data data; - bool claimed; + u8 claim_cnt; }; =20 #define SUNXI_SRAM_MAP(_reg_val, _val, _func) \ @@ -244,9 +245,11 @@ int sunxi_sram_claim(struct device *dev) =20 spin_lock(&sram_lock); =20 - if (sram_desc->claimed) { + if (sram_desc->claim_cnt) { + if (!WARN_ON(sram_desc->claim_cnt =3D=3D U8_MAX)) + sram_desc->claim_cnt++; spin_unlock(&sram_lock); - return -EBUSY; + return 0; } =20 mask =3D GENMASK(sram_data->offset + sram_data->width - 1, @@ -256,7 +259,7 @@ int sunxi_sram_claim(struct device *dev) writel(val | ((device << sram_data->offset) & mask), base + sram_data->reg); =20 - sram_desc->claimed =3D true; + sram_desc->claim_cnt++; spin_unlock(&sram_lock); =20 return 0; @@ -278,7 +281,8 @@ void sunxi_sram_release(struct device *dev) sram_desc =3D to_sram_desc(sram_data); =20 spin_lock(&sram_lock); - sram_desc->claimed =3D false; + if (!WARN_ON(sram_desc->claim_cnt =3D=3D 0)) + sram_desc->claim_cnt--; spin_unlock(&sram_lock); } EXPORT_SYMBOL(sunxi_sram_release); --=20 2.47.3 From nobody Fri Apr 3 08:34:56 2026 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 7A906407101; Tue, 24 Mar 2026 16:44:05 +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=1774370645; cv=none; b=isHaq0I+rRuEZT8c6v+l6y+9FZ0u6WLVqkU5PB7JLhvQGL80/wJG2Rqz4SlQCR/zKgajStfHxyC/wTdYNGb8S5bPjGjIDG7g2rItWayQNYcobSuy+DDNwQBFEUStDsidCrQIHr3amn24f+BPmzstMZhat0Xcjn2yweW4ltzh5v0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774370645; c=relaxed/simple; bh=b0m0FnMqUK3YcK+u1bAXX+KhD9qbCEgekt0QI4jDH9Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IZQ1UhvEELnRP2DuKPr53BONlhFU22hnJxwb7P91CtrL6tsfN+/c06D0kG2T561DwS8jlZlmNKNzhfEEsrxBI5bdCFmkX8ShnT9hgQTLtGD+922GW9dtegIp9me9/8G/aAE6+wofMdNt1xU7p4f7tOoAH1ZxA9OXgEepNF3to4M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=C3o8s0Ol; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="C3o8s0Ol" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36C6AC2BCB6; Tue, 24 Mar 2026 16:44:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774370645; bh=b0m0FnMqUK3YcK+u1bAXX+KhD9qbCEgekt0QI4jDH9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C3o8s0Ol4By0oYHYu2S85is0Yw89BKW8tT0wJQwH6GAicXAoVwsw9NyoEqTrGrmT3 d6lQ7pzdiVGr4OPazoq7jhAC68KzgOBKtXlJLFcpOUNdxvSRLPCaEE235HqCUJAnN6 mlKtv/132wg0q6Qmq3bqCNaRG7m3nc877Q8S+K9xYumBzTdG5JFcPY8mPGhaBU9FNb 4wBkwNfDU6rwcdBSIt/2L3XWjsn0bXGtrDCQDNHEWS14VlTXRuDLeWD0C9HrDnzGtQ gG7xfCX3rSGROT0LfF8/uISCwAWzK711a7YLVhfWP82qZ9tkTmbRdBKcMmBsZDX39M 48wsqiXWrwuFg== Received: by wens.tw (Postfix, from userid 1000) id D76AD5FFBF; Wed, 25 Mar 2026 00:44:00 +0800 (CST) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] soc: sunxi: sram: Support claiming multiple regions per device Date: Wed, 25 Mar 2026 00:43:53 +0800 Message-ID: <20260324164357.1607247-6-wens@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260324164357.1607247-1-wens@kernel.org> References: <20260324164357.1607247-1-wens@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On the H616, the video engine needs to claim two SRAM regions. Support claiming multiple regions per device. Signed-off-by: Chen-Yu Tsai Reviewed-by: Jernej Skrabec --- drivers/soc/sunxi/sunxi_sram.c | 164 +++++++++++++++++++-------------- 1 file changed, 96 insertions(+), 68 deletions(-) diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c index aba155379ccc..4d81897179e7 100644 --- a/drivers/soc/sunxi/sunxi_sram.c +++ b/drivers/soc/sunxi/sunxi_sram.c @@ -165,79 +165,48 @@ static inline struct sunxi_sram_desc *to_sram_desc(co= nst struct sunxi_sram_data return container_of(data, struct sunxi_sram_desc, data); } =20 -static const struct sunxi_sram_data *sunxi_sram_of_parse(struct device_nod= e *node, - unsigned int *reg_value) +static const struct sunxi_sram_data *sunxi_sram_get_match(struct device_no= de *np, u8 val, + unsigned int *reg_value) { const struct of_device_id *match; const struct sunxi_sram_data *data; const struct sunxi_sram_func *func; - struct of_phandle_args args; - u8 val; - int ret; - - ret =3D of_parse_phandle_with_fixed_args(node, "allwinner,sram", 1, 0, - &args); - if (ret) - return ERR_PTR(ret); =20 - if (!of_device_is_available(args.np)) { - ret =3D -EBUSY; - goto err; - } + if (!of_device_is_available(np)) + return ERR_PTR(-ENODEV); =20 - val =3D args.args[0]; - - match =3D of_match_node(sunxi_sram_dt_ids, args.np); - if (!match) { - ret =3D -EINVAL; - goto err; - } + match =3D of_match_node(sunxi_sram_dt_ids, np); + if (!match) + return ERR_PTR(-ENODEV); =20 data =3D match->data; - if (!data) { - ret =3D -EINVAL; - goto err; - } - - for (func =3D data->func; func->func; func++) { - if (val =3D=3D func->val) { - if (reg_value) - *reg_value =3D func->reg_val; + if (!data) + return ERR_PTR(-EINVAL); =20 + for (func =3D data->func; func->func; func++) + if (val =3D=3D func->val) break; - } - } =20 - if (!func->func) { - ret =3D -EINVAL; - goto err; - } + if (!func->func) + return ERR_PTR(-EINVAL); =20 - of_node_put(args.np); - return match->data; + if (reg_value) + *reg_value =3D func->reg_val; =20 -err: - of_node_put(args.np); - return ERR_PTR(ret); + return data; } =20 -int sunxi_sram_claim(struct device *dev) +#define SUNXI_SRAM_PROP "allwinner,sram" +#define SUNXI_SRAM_CELLS 1 + +static int sunxi_sram_claim_one(struct device_node *np, u8 arg) { const struct sunxi_sram_data *sram_data; struct sunxi_sram_desc *sram_desc; unsigned int device; u32 val, mask; =20 - if (IS_ERR(base)) - return PTR_ERR(base); - - if (!base) - return -EPROBE_DEFER; - - if (!dev || !dev->of_node) - return -EINVAL; - - sram_data =3D sunxi_sram_of_parse(dev->of_node, &device); + sram_data =3D sunxi_sram_get_match(np, arg, &device); if (IS_ERR(sram_data)) return PTR_ERR(sram_data); =20 @@ -248,33 +217,28 @@ int sunxi_sram_claim(struct device *dev) if (sram_desc->claim_cnt) { if (!WARN_ON(sram_desc->claim_cnt =3D=3D U8_MAX)) sram_desc->claim_cnt++; - spin_unlock(&sram_lock); - return 0; + } else { + mask =3D GENMASK(sram_data->offset + sram_data->width - 1, + sram_data->offset); + val =3D readl(base + sram_data->reg); + val &=3D ~mask; + writel(val | ((device << sram_data->offset) & mask), + base + sram_data->reg); + + sram_desc->claim_cnt++; } =20 - mask =3D GENMASK(sram_data->offset + sram_data->width - 1, - sram_data->offset); - val =3D readl(base + sram_data->reg); - val &=3D ~mask; - writel(val | ((device << sram_data->offset) & mask), - base + sram_data->reg); - - sram_desc->claim_cnt++; spin_unlock(&sram_lock); =20 return 0; } -EXPORT_SYMBOL(sunxi_sram_claim); =20 -void sunxi_sram_release(struct device *dev) +static void sunxi_sram_release_one(struct device_node *np, u8 arg) { const struct sunxi_sram_data *sram_data; struct sunxi_sram_desc *sram_desc; =20 - if (!dev || !dev->of_node) - return; - - sram_data =3D sunxi_sram_of_parse(dev->of_node, NULL); + sram_data =3D sunxi_sram_get_match(np, arg, NULL); if (IS_ERR(sram_data)) return; =20 @@ -285,6 +249,70 @@ void sunxi_sram_release(struct device *dev) sram_desc->claim_cnt--; spin_unlock(&sram_lock); } + +int sunxi_sram_claim(struct device *dev) +{ + struct of_phandle_iterator it; + int err; + int count =3D 0; + + if (IS_ERR(base)) + return PTR_ERR(base); + + if (!base) + return -EPROBE_DEFER; + + if (!dev || !dev->of_node) + return -EINVAL; + + of_for_each_phandle(&it, err, dev->of_node, SUNXI_SRAM_PROP, + NULL, SUNXI_SRAM_CELLS) { + u32 args[SUNXI_SRAM_CELLS]; + + of_phandle_iterator_args(&it, args, SUNXI_SRAM_CELLS); + + err =3D sunxi_sram_claim_one(it.node, args[0]); + if (err) + goto err; + + count++; + } + + if (count =3D=3D 0) + return -ENOENT; + + return 0; + +err: + while (count--) { + struct of_phandle_args args; + + of_parse_phandle_with_fixed_args(dev->of_node, SUNXI_SRAM_PROP, + SUNXI_SRAM_CELLS, count, &args); + sunxi_sram_release_one(args.np, args.args[0]); + } + + return err; +} +EXPORT_SYMBOL(sunxi_sram_claim); + +void sunxi_sram_release(struct device *dev) +{ + struct of_phandle_iterator it; + int err; + + if (!dev || !dev->of_node) + return; + + of_for_each_phandle(&it, err, dev->of_node, SUNXI_SRAM_PROP, + NULL, SUNXI_SRAM_CELLS) { + u32 args[SUNXI_SRAM_CELLS]; + + of_phandle_iterator_args(&it, args, SUNXI_SRAM_CELLS); + + sunxi_sram_release_one(it.node, args[0]); + } +} EXPORT_SYMBOL(sunxi_sram_release); =20 struct sunxi_sramc_variant { --=20 2.47.3 From nobody Fri Apr 3 08:34:56 2026 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 6410B4070F6; Tue, 24 Mar 2026 16:44:05 +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=1774370645; cv=none; b=mlTFJNR8yilpHhM82rcNmRXyMlte7lTj38hPB1dfJtsH5rM4no4rl4vA8wqMuRJa1/Q1XCsQUkkNkw6XiTUc5vimNJeA2X7ycmcrtlEsRr/jnm7BlZ9VApheJA4h4rs/ypLeIwNj5oX9aw37sjzmSmb7Lbx0/kJTAaHyVfN9xfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774370645; c=relaxed/simple; bh=QYFXFUR/8WwRSwrV3QqrRDABUI+S+t3w7aA/W4XCZ70=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t50WywW+D4UMts7t2lOe+eabfp/VYaTEck2k5ysL4JZWUW+zCBn3P15YJ5CNSW2A19Hy36S6m3WnR8N1Z0e8ASNrjm0tyZqq7XnOQJdVbeGbn0a0qk1ZJ/3lOPPWGaCTRgMO42lDUHu+N/Z/UFeuEh7d3hwsV2gic4f8oKtE+c0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=trMKu6dh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="trMKu6dh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D55AAC2BC9E; Tue, 24 Mar 2026 16:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774370645; bh=QYFXFUR/8WwRSwrV3QqrRDABUI+S+t3w7aA/W4XCZ70=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=trMKu6dhD9+hUG8hyWqzyKsWtEjf8n4BKqDA5IXDjOt3J3V4NLJOdBbOavv9Ta7J2 5vtjU80y72ml+oAes8iOCC/QmiN5hvLumBE6ixJROD+Lapsurrrf48s83cRgZ/kReb SuaWQDtpVT//zX/TNFffVfZNkKrujd3jsQo34CsMUvA6aZpFaIsKTS+DEFa+tCBj2D 4RoRIZgT3Zekvxuvv96wX1Gjvgk9Oj5paQvB8Btm/yYmKxwX15VdybgaoMVpDC6A9L 7npZKoOJPuDa67EAevfO1TbQgGWGResDtaqq1U+l/5ZD7+Atb0RnPFolase33cFNT/ NREQu9xJFR6CQ== Received: by wens.tw (Postfix, from userid 1000) id E6C8A60003; Wed, 25 Mar 2026 00:44:00 +0800 (CST) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] soc: sunxi: sram: Add H616 SRAM regions Date: Wed, 25 Mar 2026 00:43:54 +0800 Message-ID: <20260324164357.1607247-7-wens@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260324164357.1607247-1-wens@kernel.org> References: <20260324164357.1607247-1-wens@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Allwinner H616 has two switchable peripheral SRAM regions: - The VE SRAM is a 2 MB dedicated SRAM for the Video Engine. CPU access to this region is enabled by default. CPU access can be disabled, after which reads will show the same stale value for all addresses, while writes are ignored. The mux value for this region is different from previous generations. - The SRAM C region is an alias of the first 128 KB of VE SRAM, plus 64 KB of DE SRAM. The latter is otherwise unaccessible from the CPU. When CPU access is disabled, the whole region reads as zero, while writes are ignored. The mux value for this region is the same as on the A64 and H6. Add data for the VE SRAM. The register values were taken from the BSP vendor kernel. Signed-off-by: Chen-Yu Tsai Reviewed-by: Jernej Skrabec --- drivers/soc/sunxi/sunxi_sram.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c index 4d81897179e7..2ccaeacf8c70 100644 --- a/drivers/soc/sunxi/sunxi_sram.c +++ b/drivers/soc/sunxi/sunxi_sram.c @@ -83,6 +83,12 @@ static struct sunxi_sram_desc sun50i_a64_sram_c =3D { SUNXI_SRAM_MAP(0, 1, "de2")), }; =20 +static struct sunxi_sram_desc sun50i_h616_ve_sram =3D { + .data =3D SUNXI_SRAM_DATA("VE", 0x0, 0, 1, + SUNXI_SRAM_MAP(1, 0, "cpu"), + SUNXI_SRAM_MAP(0, 1, "ve")), +}; + static const struct of_device_id sunxi_sram_dt_ids[] =3D { { .compatible =3D "allwinner,sun4i-a10-sram-a3-a4", @@ -100,6 +106,10 @@ static const struct of_device_id sunxi_sram_dt_ids[] = =3D { .compatible =3D "allwinner,sun50i-a64-sram-c", .data =3D &sun50i_a64_sram_c.data, }, + { + .compatible =3D "allwinner,sun50i-h616-ve-sram", + .data =3D &sun50i_h616_ve_sram.data, + }, {} }; =20 --=20 2.47.3 From nobody Fri Apr 3 08:34:56 2026 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 128BD406291; Tue, 24 Mar 2026 16:44:05 +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=1774370645; cv=none; b=ictswYhMlfEL7Jg+h94CLc+v7GGeqXNSICtOsYuoJD9/X1nHIkzgRo7qmA/yzWlkRBwRRc79/3aTHt3m23d3n9cjPebqBHJ345t2+m1XcIwy4vNuyeDhxGRRNxVKVL3G5fUvtZAqdSvp5Dp0gztJ+KVTzgYA7EtC40aqi+aICZk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774370645; c=relaxed/simple; bh=d2usvZzl3iy+LSd+yBZb4LfU83ScHAI81Xk1hz8xX44=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ceCykdOSYXmvmXB73HSkyQ3DWbBNYXaUPpFPzfZkPuuyS3zi18nXK4eF96CzSrptryfi4LyqRSdWe/S0mojosm9IvEy+FHzRuyMAkyX4TEUMfe3TDuvDFqTNzGW9fpuc7tXT9KSfML96I0owcsFrmtQLrWVVP4tWctN0RsM1mpE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KQaehjJr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KQaehjJr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CACDBC2BC87; Tue, 24 Mar 2026 16:44:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774370645; bh=d2usvZzl3iy+LSd+yBZb4LfU83ScHAI81Xk1hz8xX44=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KQaehjJr8t4bUSbUTEGVQT2xDGVv40IiShtPC8uoYCf0awgsoDTrwcYKHDbfREA+K 34UqJSiTmESYONEWMDK7dV6YNZUMqCzYTvVO02zVtp1I9TTiC5/gNa2p+ul7huAWxf WFjl0c8qXVGFqh/hFdH9J5AsByPb2qW7MCAq0RpUIxLRzLPcfVPuCQ6xQcS0vn4rOX VW31rGBGIcuhmbnw6J8YomWxFmFQGDjjBpW1ehkX32EnXiF7XNZyUlF+Q+hLEVOt+l iignnGxW2yVpB5JEtsOjG6YcWqlEB50QJkOubK6CmFEWIhEiy8jCVf+nWaVYLGNxvD L86M3xvBbXXAw== Received: by wens.tw (Postfix, from userid 1000) id F22F75FFE0; Wed, 25 Mar 2026 00:44:00 +0800 (CST) From: Chen-Yu Tsai To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Jernej Skrabec , devicetree@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/7] arm64: dts: allwinner: sun50i-h616: Add SRAM nodes Date: Wed, 25 Mar 2026 00:43:55 +0800 Message-ID: <20260324164357.1607247-8-wens@kernel.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260324164357.1607247-1-wens@kernel.org> References: <20260324164357.1607247-1-wens@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Jernej Skrabec The H616 SoC has a video engine, and two SRAM regions needed by it. Add the SRAM regions to the dtsi file. The video engine will be added in a separate change. Signed-off-by: Jernej Skrabec [wens@kernel.org: Add VE SRAM region, commit message, and split into two] Signed-off-by: Chen-Yu Tsai Reviewed-by: Jernej Skrabec --- .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/bo= ot/dts/allwinner/sun50i-h616.dtsi index 8d1110c14bad..0c50a73def65 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi @@ -182,12 +182,38 @@ syscon: syscon@3000000 { #size-cells =3D <1>; ranges; =20 - sram_c: sram@28000 { + /* SRAM C */ + sram@28000 { compatible =3D "mmio-sram"; reg =3D <0x00028000 0x30000>; #address-cells =3D <1>; #size-cells =3D <1>; ranges =3D <0 0x00028000 0x30000>; + + /* + * 0x0 ~ 0x20000 is partial alias of VE SRAM below. + * 0x20000 ~ 0x2ffff is (partial?) alias of DE SRAM. + * However the whole region is toggled together. + */ + sram_c: sram-section@0 { + compatible =3D "allwinner,sun50i-h616-sram-c", + "allwinner,sun50i-a64-sram-c"; + reg =3D <0x00000 0x30000>; + }; + }; + + /* VE SRAM */ + sram@1a00000 { + compatible =3D "mmio-sram"; + reg =3D <0x01a00000 0x200000>; + #address-cells =3D <1>; + #size-cells =3D <1>; + ranges =3D <0 0x01a00000 0x200000>; + + ve_sram: sram-section@0 { + compatible =3D "allwinner,sun50i-h616-ve-sram"; + reg =3D <0x000000 0x200000>; + }; }; }; =20 --=20 2.47.3