Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drivers: remoteproc: xlnx: Add Versal and Versal-NET support

AMD-Xilinx Versal platform is successor of ZynqMP platform.
Real-time Processing Unit R5 cluster IP on Versal is same as
of ZynqMP Platform. Power-domains ids for Versal platform is
different than ZynqMP.

AMD-Xilinx Versal-NET platform is successor of Versal platform.
Versal-NET Real-Time Processing Unit has two clusters and each
cluster contains dual core ARM Cortex-R52 processors. Each R52
core is assigned 128KB of TCM memory.

Signed-off-by: Tanmay Shah <tanmay.shah@amd.com>
Link: https://lore.kernel.org/r/20240418220125.744322-1-tanmay.shah@amd.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>

authored by

Tanmay Shah and committed by
Mathieu Poirier
a6b974b4 72c350c9

+17 -36
+17 -36
drivers/remoteproc/xlnx_r5_remoteproc.c
··· 301 301 } 302 302 303 303 /* 304 - * zynqmp_r5_set_mode() 305 - * 306 - * set RPU cluster and TCM operation mode 307 - * 308 - * @r5_core: pointer to zynqmp_r5_core type object 309 - * @fw_reg_val: value expected by firmware to configure RPU cluster mode 310 - * @tcm_mode: value expected by fw to configure TCM mode (lockstep or split) 311 - * 312 - * Return: 0 for success and < 0 for failure 313 - */ 314 - static int zynqmp_r5_set_mode(struct zynqmp_r5_core *r5_core, 315 - enum rpu_oper_mode fw_reg_val, 316 - enum rpu_tcm_comb tcm_mode) 317 - { 318 - int ret; 319 - 320 - ret = zynqmp_pm_set_rpu_mode(r5_core->pm_domain_id, fw_reg_val); 321 - if (ret < 0) { 322 - dev_err(r5_core->dev, "failed to set RPU mode\n"); 323 - return ret; 324 - } 325 - 326 - ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, tcm_mode); 327 - if (ret < 0) 328 - dev_err(r5_core->dev, "failed to configure TCM\n"); 329 - 330 - return ret; 331 - } 332 - 333 - /* 334 304 * zynqmp_r5_rproc_start() 335 305 * @rproc: single R5 core's corresponding rproc instance 336 306 * ··· 911 941 /* Maintain backward compatibility for zynqmp by using hardcode TCM address. */ 912 942 if (of_find_property(r5_core->np, "reg", NULL)) 913 943 ret = zynqmp_r5_get_tcm_node_from_dt(cluster); 914 - else 944 + else if (device_is_compatible(dev, "xlnx,zynqmp-r5fss")) 915 945 ret = zynqmp_r5_get_tcm_node(cluster); 916 946 917 947 if (ret) { ··· 930 960 return ret; 931 961 } 932 962 933 - ret = zynqmp_r5_set_mode(r5_core, fw_reg_val, tcm_mode); 934 - if (ret) { 935 - dev_err(dev, "failed to set r5 cluster mode %d, err %d\n", 936 - cluster->mode, ret); 963 + ret = zynqmp_pm_set_rpu_mode(r5_core->pm_domain_id, fw_reg_val); 964 + if (ret < 0) { 965 + dev_err(r5_core->dev, "failed to set RPU mode\n"); 937 966 return ret; 967 + } 968 + 969 + if (of_find_property(dev_of_node(dev), "xlnx,tcm-mode", NULL) || 970 + device_is_compatible(dev, "xlnx,zynqmp-r5fss")) { 971 + ret = zynqmp_pm_set_tcm_config(r5_core->pm_domain_id, 972 + tcm_mode); 973 + if (ret < 0) { 974 + dev_err(r5_core->dev, "failed to configure TCM\n"); 975 + return ret; 976 + } 938 977 } 939 978 } 940 979 ··· 1001 1022 ret = of_property_read_u32(dev_node, "xlnx,tcm-mode", (u32 *)&tcm_mode); 1002 1023 if (ret) 1003 1024 return ret; 1004 - } else { 1025 + } else if (device_is_compatible(dev, "xlnx,zynqmp-r5fss")) { 1005 1026 if (cluster_mode == LOCKSTEP_MODE) 1006 1027 tcm_mode = PM_RPU_TCM_COMB; 1007 1028 else ··· 1191 1212 1192 1213 /* Match table for OF platform binding */ 1193 1214 static const struct of_device_id zynqmp_r5_remoteproc_match[] = { 1215 + { .compatible = "xlnx,versal-net-r52fss", }, 1216 + { .compatible = "xlnx,versal-r5fss", }, 1194 1217 { .compatible = "xlnx,zynqmp-r5fss", }, 1195 1218 { /* end of list */ }, 1196 1219 };