From: Robin Murphy <robin.murphy@arm.com>
To: aiyengar1990@gmail.com, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Heiko Stuebner <heiko@sntech.de>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
David Wu <david.wu@rock-chips.com>,
Damien Le Moal <dlemoal@kernel.org>,
Niklas Cassel <cassel@kernel.org>,
Serge Semin <fancer.lancer@gmail.com>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
linux-ide@vger.kernel.org, Pranjal Shrivastava <praan@google.com>,
Will Deacon <will@kernel.org>,
iommu@lists.linux.dev, Shawn Lin <shawn.lin@rock-chips.com>,
Sebastian Reichel <sebastian.reichel@collabora.com>
Subject: Re: [PATCH 4/9] soc: rockchip: grf: Assign the StreamIDs of the RK3588 PHP SMMU masters
Date: Fri, 27 Nov 2026 18:16:48 +0000 [thread overview]
Message-ID: <03b2548c-e451-408e-b5df-a5dec8c290f8@arm.com> (raw)
In-Reply-To: <20261113-mmu600-php-v1-4-231196049a3b@gmail.com>
On 13/11/2026 4:38 pm, Arun Iyengar via B4 Relay wrote:
> From: Arun Iyengar <aiyengar1990@gmail.com>
>
> The StreamIDs of the six masters behind the RK3588 PHP SMMU come from
> PHP GRF registers that reset to 0 and are never programmed, so the SMMU
> can not tell the masters apart.
>
> Assign StreamIDs 1-6 on both AXI channels. 0 stays unused, so a master
> that loses its ID is aborted instead of using another device's tables.
Urgh... could you at least hide this in U-Boot and have that inject the
corresponding "iommus" entries into the DTB it's passing, similar to
what the NXP Layerscape platforms do for their "iommu-map" generation?
StreamIDs are really not meant to be programmable, and even if they are
then that is not supposed to be exposed to OSes. The Arm Base System
Architecture[1] explicitly calls this out:
R_ITS_DEV_9: The relationships between a device, its StreamID and
its DeviceID are considered static by OS or hypervisor software. If
the mapping is not fixed by hardware, the relationship between a
StreamID and a DeviceID must not change after system initialization,
and OS drivers must not be required to set it up.
Even just in practical terms, how is this going to work if someone boots
a new kernel with an older DT or vice-versa, and one set of hard-coded
values then fails to correspond to the other?
Thanks,
Robin.
[1] https://support.arm.com/documentation/den0094/latest/
> Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
> ---
> drivers/soc/rockchip/grf.c | 37 +++++++++++++++++++++++++++++++++++++
> 1 file changed, 37 insertions(+)
>
> diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c
> index b459607c118a..3f0f82a2119f 100644
> --- a/drivers/soc/rockchip/grf.c
> +++ b/drivers/soc/rockchip/grf.c
> @@ -168,6 +168,40 @@ static const struct rockchip_grf_info rk3588_sysgrf __initconst = {
> .num_values = ARRAY_SIZE(rk3588_defaults),
> };
>
> +/* PHP SMMU StreamIDs: bits 15:0, no write-enable mask */
> +#define RK3588_PHP_GRF_GMAC0_SID_AW 0x0074
> +#define RK3588_PHP_GRF_GMAC1_SID_AW 0x007c
> +#define RK3588_PHP_GRF_SATA0_SID_AW 0x0084
> +#define RK3588_PHP_GRF_SATA1_SID_AW 0x008c
> +#define RK3588_PHP_GRF_SATA2_SID_AW 0x0094
> +#define RK3588_PHP_GRF_GMAC0_SID_AR 0x009c
> +#define RK3588_PHP_GRF_GMAC1_SID_AR 0x00a4
> +#define RK3588_PHP_GRF_SATA0_SID_AR 0x00ac
> +#define RK3588_PHP_GRF_SATA1_SID_AR 0x00b4
> +#define RK3588_PHP_GRF_SATA2_SID_AR 0x00bc
> +#define RK3588_PHP_GRF_USB3OTG2_SID_AR 0x00c4
> +#define RK3588_PHP_GRF_USB3OTG2_SID_AW 0x00cc
> +
> +static const struct rockchip_grf_value rk3588_defaults_php_grf[] __initconst = {
> + { "gmac0 write streamid", RK3588_PHP_GRF_GMAC0_SID_AW, 1 },
> + { "gmac0 read streamid", RK3588_PHP_GRF_GMAC0_SID_AR, 1 },
> + { "gmac1 write streamid", RK3588_PHP_GRF_GMAC1_SID_AW, 2 },
> + { "gmac1 read streamid", RK3588_PHP_GRF_GMAC1_SID_AR, 2 },
> + { "sata0 write streamid", RK3588_PHP_GRF_SATA0_SID_AW, 3 },
> + { "sata0 read streamid", RK3588_PHP_GRF_SATA0_SID_AR, 3 },
> + { "sata1 write streamid", RK3588_PHP_GRF_SATA1_SID_AW, 4 },
> + { "sata1 read streamid", RK3588_PHP_GRF_SATA1_SID_AR, 4 },
> + { "sata2 write streamid", RK3588_PHP_GRF_SATA2_SID_AW, 5 },
> + { "sata2 read streamid", RK3588_PHP_GRF_SATA2_SID_AR, 5 },
> + { "usb3otg2 write streamid", RK3588_PHP_GRF_USB3OTG2_SID_AW, 6 },
> + { "usb3otg2 read streamid", RK3588_PHP_GRF_USB3OTG2_SID_AR, 6 },
> +};
> +
> +static const struct rockchip_grf_info rk3588_phpgrf __initconst = {
> + .values = rk3588_defaults_php_grf,
> + .num_values = ARRAY_SIZE(rk3588_defaults_php_grf),
> +};
> +
> static const struct of_device_id rockchip_grf_dt_match[] __initconst = {
> {
> .compatible = "rockchip,rk3036-grf",
> @@ -202,6 +236,9 @@ static const struct of_device_id rockchip_grf_dt_match[] __initconst = {
> }, {
> .compatible = "rockchip,rk3576-ioc-grf",
> .data = (void *)&rk3576_iocgrf,
> + }, {
> + .compatible = "rockchip,rk3588-php-grf",
> + .data = (void *)&rk3588_phpgrf,
> }, {
> .compatible = "rockchip,rk3588-sys-grf",
> .data = (void *)&rk3588_sysgrf,
>
next prev parent reply other threads:[~2026-11-27 18:17 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-13 16:38 [PATCH 0/9] RK3588: Enable the PHP SMMU Arun Iyengar via B4 Relay
2026-11-13 16:38 ` [PATCH 1/9] dt-bindings: net: rockchip-dwmac: Allow iommus Arun Iyengar via B4 Relay
2026-11-17 17:35 ` netdev-bot+sashiko
2026-11-23 8:28 ` Krzysztof Kozlowski
2026-11-26 8:55 ` Arun Iyengar
2026-11-26 14:36 ` Krzysztof Kozlowski
2026-11-13 16:38 ` [PATCH 2/9] dt-bindings: ata: rockchip,dwc-ahci: " Arun Iyengar via B4 Relay
2026-11-17 17:35 ` netdev-bot+sashiko
2026-11-23 8:28 ` Krzysztof Kozlowski
2026-11-13 16:38 ` [PATCH 3/9] dt-bindings: soc: rockchip: grf: Allow a clock for the RK3588 PHP GRF Arun Iyengar via B4 Relay
2026-11-17 17:35 ` netdev-bot+sashiko
2026-11-23 8:30 ` Krzysztof Kozlowski
2026-11-13 16:38 ` [PATCH 4/9] soc: rockchip: grf: Assign the StreamIDs of the RK3588 PHP SMMU masters Arun Iyengar via B4 Relay
2026-11-27 18:16 ` Robin Murphy [this message]
2026-11-13 16:38 ` [PATCH 5/9] arm64: dts: rockchip: Add the PHP GRF clock on RK3588 Arun Iyengar via B4 Relay
2026-11-17 17:35 ` netdev-bot+sashiko
2026-11-13 16:38 ` [PATCH 6/9] soc: rockchip: grf: Restore the RK3588 PHP StreamIDs after system suspend Arun Iyengar via B4 Relay
2026-11-17 17:35 ` netdev-bot+sashiko
2026-11-13 16:38 ` [PATCH 7/9] arm64: dts: rockchip: Add the clock and reset of the RK3588 PHP SMMU Arun Iyengar via B4 Relay
2026-11-17 17:35 ` netdev-bot+sashiko
2026-11-13 16:38 ` [PATCH 8/9] arm64: dts: rockchip: Attach the masters " Arun Iyengar via B4 Relay
2026-11-17 17:35 ` netdev-bot+sashiko
2026-11-13 16:38 ` [PATCH 9/9] arm64: dts: rockchip: Enable " Arun Iyengar via B4 Relay
2026-11-17 17:35 ` netdev-bot+sashiko
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=03b2548c-e451-408e-b5df-a5dec8c290f8@arm.com \
--to=robin.murphy@arm.com \
--cc=aiyengar1990@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=cassel@kernel.org \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=david.wu@rock-chips.com \
--cc=devicetree@vger.kernel.org \
--cc=dlemoal@kernel.org \
--cc=edumazet@kernel.org \
--cc=fancer.lancer@gmail.com \
--cc=heiko@sntech.de \
--cc=iommu@lists.linux.dev \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=praan@google.com \
--cc=robh@kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=shawn.lin@rock-chips.com \
--cc=will@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