]> git.ipfire.org Git - thirdparty/u-boot.git/commit
smem: msm: Fix memory-region lookup, direct <reg> mapping and update SMEM host count
authorAswin Murugan <aswin.murugan@oss.qualcomm.com>
Wed, 12 Nov 2025 16:58:51 +0000 (22:28 +0530)
committerCasey Connolly <casey.connolly@linaro.org>
Wed, 14 Jan 2026 15:25:09 +0000 (16:25 +0100)
commit984ebe2d553ba37cd92de2c093c73a07c16ea17c
treeedb2da7fe0e9230e10bf3c8933b59ea1300a816a
parent63439561493f9159732da7be3e1f3d34ffdae030
smem: msm: Fix memory-region lookup, direct <reg> mapping and update SMEM host count

The SMEM driver was failing to resolve memory regions on some boards
because `dev_of_offset()` + `fdtdec_lookup_phandle()` did not yield a
valid DT node. Modernize the code to use driver-model/ofnode accessors
and make the probe robust for both DT styles (direct `reg` vs
`memory-region` phandle).

- qcom_smem_map_memory():
  * Drop fdtdec path; use dev_read_phandle_with_args() +
    ofnode_read_resource().
  * Use dev_read_phandle_with_args() +
    fnode_read_resource().

- qcom_smem_probe():
  * Try dev_read_addr_size() first (map via <reg>), else fall back to
    qcom_smem_map_memory() with "memory-region".
  * Check "qcom,rpm-msg-ram" presence to add second region.

- Additionally, SMEM_HOST_COUNT is increased to support newer SMEM
  versions that include more remote processors. This avoids failures
  during processor ID checks.

Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Reviewed-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com>
Link: https://patch.msgid.link/20251112165851.1561418-1-aswin.murugan@oss.qualcomm.com
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
drivers/smem/msm_smem.c