回复: 回复: [PATCH] firmware: scmi: Drop mmu_set_region_dcache_behaviour() misuse
    Alice Guo (OSS) 
    alice.guo at oss.nxp.com
       
    Thu Oct 30 04:58:43 CET 2025
    
    
  
> -----邮件原件-----
> 发件人: Marek Vasut <marek.vasut at mailbox.org>
> 发送时间: 2025年10月28日 22:39
> 收件人: Alice Guo (OSS) <alice.guo at oss.nxp.com>; Marek Vasut
> <marek.vasut+renesas at mailbox.org>; u-boot at lists.denx.de
> 抄送: Alice Guo <alice.guo at nxp.com>; Etienne Carriere
> <etienne.carriere at linaro.org>; Patrick Delaunay
> <patrick.delaunay at foss.st.com>; Peng Fan <peng.fan at nxp.com>; Tom Rini
> <trini at konsulko.com>; Vinh Nguyen <vinh.nguyen.xz at renesas.com>; Viorel
> Suman <viorel.suman at nxp.com>; Ye Li <ye.li at nxp.com>
> 主题: Re: 回复: [PATCH] firmware: scmi: Drop
> mmu_set_region_dcache_behaviour() misuse
> 
> On 10/28/25 9:00 AM, Alice Guo (OSS) wrote:
> >> -----邮件原件-----
> >> 发件人: U-Boot <u-boot-bounces at lists.denx.de> 代表 Marek Vasut
> >> 发送时间: 2025年10月26日 5:35
> >> 收件人: u-boot at lists.denx.de
> >> 抄送: Marek Vasut <marek.vasut+renesas at mailbox.org>; Alice Guo
> >> <alice.guo at nxp.com>; Etienne Carriere <etienne.carriere at linaro.org>;
> >> Patrick Delaunay <patrick.delaunay at foss.st.com>; Peng Fan
> >> <peng.fan at nxp.com>; Tom Rini <trini at konsulko.com>; Vinh Nguyen
> >> <vinh.nguyen.xz at renesas.com>; Viorel Suman <viorel.suman at nxp.com>;
> Ye
> >> Li <ye.li at nxp.com>
> >> 主题: [PATCH] firmware: scmi: Drop mmu_set_region_dcache_behaviour()
> >> misuse
> >>
> >> MMU region cache behavior configuration for SCMI/SMT mailboxes is
> >> platform specific. Even on ARM systems, the mailbox memory may not
> >> even be located in any cacheable MMU region and may instead reside in
> >> some SRAM. Remove this non-generic cache behavior configuration code
> from generic code path.
> >>
> >> It is unlikely that any platform is affected by this change if it did
> >> configure its MMU regions correctly on start up. Platforms which
> >> might be affected are
> >> i.MX94/95 and STM32MP.
> >>
> >> Fixes: 240720e9052f ("firmware: scmi: mailbox/smt agent device")
> >> Fixes: 2a3f161c8b16 ("scmi: correctly configure MMU for SCMI buffer")
> >> Fixes: b2ae10970d40 ("firmware: scmi: use PAGE_SIZE alignment for
> >> ARM64")
> >> Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
> >> ---
> >> Cc: Alice Guo <alice.guo at nxp.com>
> >> Cc: Etienne Carriere <etienne.carriere at linaro.org>
> >> Cc: Patrick Delaunay <patrick.delaunay at foss.st.com>
> >> Cc: Peng Fan <peng.fan at nxp.com>
> >> Cc: Tom Rini <trini at konsulko.com>
> >> Cc: Vinh Nguyen <vinh.nguyen.xz at renesas.com>
> >> Cc: Viorel Suman <viorel.suman at nxp.com>
> >> Cc: Ye Li <ye.li at nxp.com>
> >> Cc: u-boot at lists.denx.de
> >> ---
> >>   drivers/firmware/scmi/smt.c | 14 --------------
> >>   1 file changed, 14 deletions(-)
> >>
> >> diff --git a/drivers/firmware/scmi/smt.c
> >> b/drivers/firmware/scmi/smt.c index
> >> 237871559f0..cd1c0801f72 100644
> >> --- a/drivers/firmware/scmi/smt.c
> >> +++ b/drivers/firmware/scmi/smt.c
> >> @@ -61,20 +61,6 @@ int scmi_dt_get_smt_buffer(struct udevice *dev,
> >> struct scmi_smt *smt)
> >>   	if (device_is_compatible(dev, "arm,scmi") &&
> >> ofnode_has_property(dev_ofnode(dev), "mboxes"))
> >>   		scmi_smt_enable_intr(smt, true);
> >>
> >> -#ifdef CONFIG_ARM
> >> -	if (dcache_status()) {
> >> -		u32 align_size;
> >> -
> >> -		if (IS_ENABLED(CONFIG_ARM64))
> >> -			align_size = PAGE_SIZE;
> >> -		else
> >> -			align_size = MMU_SECTION_SIZE;
> >> -
> >> -
> >> 	mmu_set_region_dcache_behaviour(ALIGN_DOWN((uintptr_t)smt->buf,
> >> align_size),
> >> -						ALIGN(smt->size, align_size), DCACHE_OFF);
> >> -	}
> >> -#endif
> >> -
> >>   	return 0;
> >>   }
> >>
> >> --
> >> 2.51.0
> >
> > Tested-by: Alice Guo <alice.guo at nxp.com>
> >
> > Tested on two boards: IMX94 and IMX95. No regressions were observed
> during boot. Looks good to me.
> Thank you !
Hi Marek,
Applied this patch on the U-Boot NXP tree and found that it affects the i.MX8ULP. On i.MX8ULP, the SCMI buffer is in SRAM and mapped as normal memory.
U-Boot 2025.04-g26a24f1a2fe6-dirty (Oct 29 2025 - 18:07:13 +0800)
M33 Sync: OK
CPU:   i.MX8ULP(Dual 7) rev1.1 at 800MHz
CPU current temperature: 28
Reset cause: POR
Boot mode: Single boot
Model: NXP i.MX8ULP EVK
DRAM:  2 GiB
scmi-over-smccc scmi: Channel unexpectedly busy scmi_base_drv scmi-base.0: getting protocol version failed scmi-over-smccc scmi: failed to probe base protocol initcall failed at call 000000008022a890 (err=-16) ### ERROR ### Please RESET the board ###
Best regards,
Alice Guo
    
    
More information about the U-Boot
mailing list