From: Patrick Delaunay Date: Tue, 30 Mar 2021 13:29:03 +0000 (+0200) Subject: scmi: translate the resource only when livetree is not activated X-Git-Tag: v2025.01-rc5-pxa1908~1923^2~1 X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=7062d4e815d255891d96aafe617a264c4c4a8a02;p=u-boot.git scmi: translate the resource only when livetree is not activated Call the translation function on the ofnode_read_resource result only when the livetree is not activated. Today of_address_to_resource() calls ofnode_read_resource() for livetree support and fdt_get_resource() when livetree is not supported. The fdt_get_resource() doesn't do the address translation so when it is required when livetree is activated but this address translation is already done by ofnode_read_resource(). Fixes: 240720e9052f ("firmware: scmi: mailbox/smt agent device") Signed-off-by: Patrick Delaunay --- diff --git a/drivers/firmware/scmi/smt.c b/drivers/firmware/scmi/smt.c index 4954355c1a..f1915c0074 100644 --- a/drivers/firmware/scmi/smt.c +++ b/drivers/firmware/scmi/smt.c @@ -41,8 +41,13 @@ int scmi_dt_get_smt_buffer(struct udevice *dev, struct scmi_smt *smt) if (ret) return ret; - faddr = cpu_to_fdt32(resource.start); - paddr = ofnode_translate_address(args.node, &faddr); + /* TEMP workaround for ofnode_read_resource translation issue */ + if (of_live_active()) { + paddr = resource.start; + } else { + faddr = cpu_to_fdt32(resource.start); + paddr = ofnode_translate_address(args.node, &faddr); + } smt->size = resource_size(&resource); if (smt->size < sizeof(struct scmi_smt_header)) {