[PATCH] scmi: correctly configure MMU for SCMI buffer
Etienne Carriere
etienne.carriere at linaro.org
Tue Mar 16 16:13:10 CET 2021
Hello Patrick,
On Tue, 16 Mar 2021 at 09:29, Patrick Delaunay
<patrick.delaunay at foss.st.com> wrote:
>
> Align the MMU area for SCMI shared buffer on section size;
> use the ALIGN macro in mmu_set_region_dcache_behaviour call.
>
> Since commit d877f8fd0f09 ("arm: provide a function for boards init
> code to modify MMU virtual-physical map") the parameter of
> mmu_set_region_dcache_behaviour need to be MMU_SECTION_SIZE
> aligned.
>
> Fixes: 240720e9052f ("firmware: scmi: mailbox/smt agent device")
> Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
> ---
>
> drivers/firmware/scmi/smt.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/firmware/scmi/smt.c b/drivers/firmware/scmi/smt.c
> index d25478796a..3c41013bca 100644
> --- a/drivers/firmware/scmi/smt.c
> +++ b/drivers/firmware/scmi/smt.c
> @@ -54,8 +54,10 @@ int scmi_dt_get_smt_buffer(struct udevice *dev, struct scmi_smt *smt)
>
> #ifdef CONFIG_ARM
> if (dcache_status())
> - mmu_set_region_dcache_behaviour((uintptr_t)smt->buf,
> - smt->size, DCACHE_OFF);
> + mmu_set_region_dcache_behaviour(ALIGN_DOWN((uintptr_t)smt->buf, MMU_SECTION_SIZE),
> + ALIGN(smt->size, MMU_SECTION_SIZE),
> + DCACHE_OFF);
> +
> #endif
>
> return 0;
> --
> 2.17.1
>
Reviewed-by: Etienne Carriere <etienne.carriere at linaro.org>
This indeed fixes the scmi smt driver.
Thanks Patrick.
Regards,
Etienne
More information about the U-Boot
mailing list