scmi: correctly configure MMU for SCMI buffer
PATCH 1/1 scmi: correctly configure MMU for SCMI buffer
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.
---
drivers/firmware/scmi/smt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/firmware/scmi/smt.c +4 -2
@@ -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 ;
Signature · 1 line
2.17.1
PATCH 1/1 scmi: correctly configure MMU for SCMI buffer
Hello Patrick,
Quoted 34 lines · Patrick Delaunay
Align the MMU area for SCMI shared buffer on section size; use the ALIGN macro in
mmu_set_region_dcache_behaviourcall.Since commit
d877f8fd0f09("arm: provide a function for boards init code to modify MMU virtual-physical map") the parameter ofmmu_set_region_dcache_behaviourneed to beMMU_SECTION_SIZEaligned.Fixes 240720e9052f ("firmware: scmi: mailbox/smt agent device")Signed-off-by Patrick Delaunay <[email protected]>---
drivers/firmware/scmi/smt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/firmware/scmi/smt.c +4
-3@@ -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 ; --
Quoted 2 lines
2.17.1
This indeed fixes the scmi smt driver.
Thanks Patrick.
Regards,
Etienne
PATCH 1/1 scmi: correctly configure MMU for SCMI buffer
In reply to Patrick DelaunayQuoted 11 lines · Patrick Delaunay
Align the MMU area for SCMI shared buffer on section size; use the ALIGN macro in
mmu_set_region_dcache_behaviourcall.Since commit
d877f8fd0f09("arm: provide a function for boards init code to modify MMU virtual-physical map") the parameter ofmmu_set_region_dcache_behaviourneed to beMMU_SECTION_SIZEaligned.Fixes 240720e9052f ("firmware: scmi: mailbox/smt agent device")Signed-off-by Patrick Delaunay <[email protected]>Reviewed-by Etienne Carriere <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210413/41652cfa/attachment.sig>