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.

Merge tag 'rproc-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux

Pull remoteproc updates from Bjorn Andersson:
"The bulk of these patches relates to the moving to a void-returning
remove callback.

The i.MX HiFi remoteproc driver gets its pm_ops helpers updated to
resolve build warnings about 'defined but not used' variables in
certain configurations.

The ST STM32 remoteproc driver is extended to allow using a SCMI reset
controller to hold boot, and has an error message corrected.

The Qualcomm Q6V5 PAS driver gains a missing 'static' qualifier on
adsp_segment_dump()"

* tag 'rproc-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: (23 commits)
remoteproc: qcom_q6v5_pas: staticize adsp_segment_dump()
remoteproc: stm32: Fix error code in stm32_rproc_parse_dt()
remoteproc: stm32: Allow hold boot management by the SCMI reset controller
dt-bindings: remoteproc: st,stm32-rproc: Rework reset declarations
remoteproc: imx_dsp_rproc: use modern pm_ops
remoteproc: wkup_m3: Convert to platform remove callback returning void
remoteproc: stm32: Convert to platform remove callback returning void
remoteproc: st: Convert to platform remove callback returning void
remoteproc: virtio: Convert to platform remove callback returning void
remoteproc: rcar: Convert to platform remove callback returning void
remoteproc: qcom_wcnss: Convert to platform remove callback returning void
remoteproc: qcom_q6v5_wcss: Convert to platform remove callback returning void
remoteproc: qcom_q6v5_pas: Convert to platform remove callback returning void
remoteproc: qcom_q6v5_mss: Convert to platform remove callback returning void
remoteproc: qcom_q6v5_adsp: Convert to platform remove callback returning void
remoteproc: pru: Convert to platform remove callback returning void
remoteproc: omap: Convert to platform remove callback returning void
remoteproc: mtk_scp: Convert to platform remove callback returning void
remoteproc: meson_mx_ao_arc: Convert to platform remove callback returning void
remoteproc: keystone: Convert to platform remove callback returning void
...

+137 -106
+39 -5
Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml
··· 25 25 maxItems: 3 26 26 27 27 resets: 28 - maxItems: 1 28 + minItems: 1 29 + maxItems: 2 30 + 31 + reset-names: 32 + items: 33 + - const: mcu_rst 34 + - const: hold_boot 35 + minItems: 1 29 36 30 37 st,syscfg-holdboot: 31 38 description: remote processor reset hold boot ··· 44 37 - description: The field mask of the hold boot 45 38 46 39 st,syscfg-tz: 40 + deprecated: true 47 41 description: 48 42 Reference to the system configuration which holds the RCC trust zone mode 49 43 $ref: /schemas/types.yaml#/definitions/phandle-array ··· 143 135 - compatible 144 136 - reg 145 137 - resets 146 - - st,syscfg-holdboot 147 - - st,syscfg-tz 138 + 139 + allOf: 140 + - if: 141 + properties: 142 + reset-names: 143 + not: 144 + contains: 145 + const: hold_boot 146 + then: 147 + required: 148 + - st,syscfg-holdboot 149 + else: 150 + properties: 151 + st,syscfg-holdboot: false 148 152 149 153 additionalProperties: false 150 154 151 155 examples: 152 156 - | 153 157 #include <dt-bindings/reset/stm32mp1-resets.h> 154 - m4_rproc: m4@10000000 { 158 + m4@10000000 { 155 159 compatible = "st,stm32mp1-m4"; 156 160 reg = <0x10000000 0x40000>, 157 161 <0x30000000 0x40000>, 158 162 <0x38000000 0x10000>; 159 163 resets = <&rcc MCU_R>; 164 + reset-names = "mcu_rst"; 165 + /* Hold boot managed using system config*/ 160 166 st,syscfg-holdboot = <&rcc 0x10C 0x1>; 161 - st,syscfg-tz = <&rcc 0x000 0x1>; 167 + st,syscfg-rsc-tbl = <&tamp 0x144 0xFFFFFFFF>; 168 + st,syscfg-m4-state = <&tamp 0x148 0xFFFFFFFF>; 169 + }; 170 + - | 171 + #include <dt-bindings/reset/stm32mp1-resets.h> 172 + m4@10000000 { 173 + compatible = "st,stm32mp1-m4"; 174 + reg = <0x10000000 0x40000>, 175 + <0x30000000 0x40000>, 176 + <0x38000000 0x10000>; 177 + /* Hold boot managed using SCMI reset controller */ 178 + resets = <&scmi MCU_R>, <&scmi MCU_HOLD_BOOT_R>; 179 + reset-names = "mcu_rst", "hold_boot"; 162 180 st,syscfg-rsc-tbl = <&tamp 0x144 0xFFFFFFFF>; 163 181 st,syscfg-m4-state = <&tamp 0x148 0xFFFFFFFF>; 164 182 };
+2 -4
drivers/remoteproc/da8xx_remoteproc.c
··· 357 357 return ret; 358 358 } 359 359 360 - static int da8xx_rproc_remove(struct platform_device *pdev) 360 + static void da8xx_rproc_remove(struct platform_device *pdev) 361 361 { 362 362 struct rproc *rproc = platform_get_drvdata(pdev); 363 363 struct da8xx_rproc *drproc = rproc->priv; ··· 374 374 rproc_free(rproc); 375 375 if (dev->of_node) 376 376 of_reserved_mem_device_release(dev); 377 - 378 - return 0; 379 377 } 380 378 381 379 static const struct of_device_id davinci_rproc_of_match[] __maybe_unused = { ··· 384 386 385 387 static struct platform_driver da8xx_rproc_driver = { 386 388 .probe = da8xx_rproc_probe, 387 - .remove = da8xx_rproc_remove, 389 + .remove_new = da8xx_rproc_remove, 388 390 .driver = { 389 391 .name = "davinci-rproc", 390 392 .of_match_table = of_match_ptr(davinci_rproc_of_match),
+7 -10
drivers/remoteproc/imx_dsp_rproc.c
··· 1161 1161 return ret; 1162 1162 } 1163 1163 1164 - static int imx_dsp_rproc_remove(struct platform_device *pdev) 1164 + static void imx_dsp_rproc_remove(struct platform_device *pdev) 1165 1165 { 1166 1166 struct rproc *rproc = platform_get_drvdata(pdev); 1167 1167 struct imx_dsp_rproc *priv = rproc->priv; ··· 1170 1170 rproc_del(rproc); 1171 1171 imx_dsp_detach_pm_domains(priv); 1172 1172 rproc_free(rproc); 1173 - 1174 - return 0; 1175 1173 } 1176 1174 1177 1175 /* pm runtime functions */ ··· 1241 1243 release_firmware(fw); 1242 1244 } 1243 1245 1244 - static __maybe_unused int imx_dsp_suspend(struct device *dev) 1246 + static int imx_dsp_suspend(struct device *dev) 1245 1247 { 1246 1248 struct rproc *rproc = dev_get_drvdata(dev); 1247 1249 struct imx_dsp_rproc *priv = rproc->priv; ··· 1276 1278 return pm_runtime_force_suspend(dev); 1277 1279 } 1278 1280 1279 - static __maybe_unused int imx_dsp_resume(struct device *dev) 1281 + static int imx_dsp_resume(struct device *dev) 1280 1282 { 1281 1283 struct rproc *rproc = dev_get_drvdata(dev); 1282 1284 int ret = 0; ··· 1310 1312 } 1311 1313 1312 1314 static const struct dev_pm_ops imx_dsp_rproc_pm_ops = { 1313 - SET_SYSTEM_SLEEP_PM_OPS(imx_dsp_suspend, imx_dsp_resume) 1314 - SET_RUNTIME_PM_OPS(imx_dsp_runtime_suspend, 1315 - imx_dsp_runtime_resume, NULL) 1315 + SYSTEM_SLEEP_PM_OPS(imx_dsp_suspend, imx_dsp_resume) 1316 + RUNTIME_PM_OPS(imx_dsp_runtime_suspend, imx_dsp_runtime_resume, NULL) 1316 1317 }; 1317 1318 1318 1319 static const struct of_device_id imx_dsp_rproc_of_match[] = { ··· 1325 1328 1326 1329 static struct platform_driver imx_dsp_rproc_driver = { 1327 1330 .probe = imx_dsp_rproc_probe, 1328 - .remove = imx_dsp_rproc_remove, 1331 + .remove_new = imx_dsp_rproc_remove, 1329 1332 .driver = { 1330 1333 .name = "imx-dsp-rproc", 1331 1334 .of_match_table = imx_dsp_rproc_of_match, 1332 - .pm = &imx_dsp_rproc_pm_ops, 1335 + .pm = pm_ptr(&imx_dsp_rproc_pm_ops), 1333 1336 }, 1334 1337 }; 1335 1338 module_platform_driver(imx_dsp_rproc_driver);
+2 -4
drivers/remoteproc/imx_rproc.c
··· 1112 1112 return ret; 1113 1113 } 1114 1114 1115 - static int imx_rproc_remove(struct platform_device *pdev) 1115 + static void imx_rproc_remove(struct platform_device *pdev) 1116 1116 { 1117 1117 struct rproc *rproc = platform_get_drvdata(pdev); 1118 1118 struct imx_rproc *priv = rproc->priv; ··· 1123 1123 imx_rproc_free_mbox(rproc); 1124 1124 destroy_workqueue(priv->workqueue); 1125 1125 rproc_free(rproc); 1126 - 1127 - return 0; 1128 1126 } 1129 1127 1130 1128 static const struct of_device_id imx_rproc_of_match[] = { ··· 1143 1145 1144 1146 static struct platform_driver imx_rproc_driver = { 1145 1147 .probe = imx_rproc_probe, 1146 - .remove = imx_rproc_remove, 1148 + .remove_new = imx_rproc_remove, 1147 1149 .driver = { 1148 1150 .name = "imx-rproc", 1149 1151 .of_match_table = imx_rproc_of_match,
+2 -4
drivers/remoteproc/keystone_remoteproc.c
··· 476 476 return ret; 477 477 } 478 478 479 - static int keystone_rproc_remove(struct platform_device *pdev) 479 + static void keystone_rproc_remove(struct platform_device *pdev) 480 480 { 481 481 struct keystone_rproc *ksproc = platform_get_drvdata(pdev); 482 482 ··· 486 486 pm_runtime_disable(&pdev->dev); 487 487 rproc_free(ksproc->rproc); 488 488 of_reserved_mem_device_release(&pdev->dev); 489 - 490 - return 0; 491 489 } 492 490 493 491 static const struct of_device_id keystone_rproc_of_match[] = { ··· 499 501 500 502 static struct platform_driver keystone_rproc_driver = { 501 503 .probe = keystone_rproc_probe, 502 - .remove = keystone_rproc_remove, 504 + .remove_new = keystone_rproc_remove, 503 505 .driver = { 504 506 .name = "keystone-rproc", 505 507 .of_match_table = keystone_rproc_of_match,
+2 -4
drivers/remoteproc/meson_mx_ao_arc.c
··· 228 228 return ret; 229 229 } 230 230 231 - static int meson_mx_ao_arc_rproc_remove(struct platform_device *pdev) 231 + static void meson_mx_ao_arc_rproc_remove(struct platform_device *pdev) 232 232 { 233 233 struct rproc *rproc = platform_get_drvdata(pdev); 234 234 struct meson_mx_ao_arc_rproc_priv *priv = rproc->priv; 235 235 236 236 rproc_del(rproc); 237 237 gen_pool_free(priv->sram_pool, priv->sram_va, priv->sram_size); 238 - 239 - return 0; 240 238 } 241 239 242 240 static const struct of_device_id meson_mx_ao_arc_rproc_match[] = { ··· 246 248 247 249 static struct platform_driver meson_mx_ao_arc_rproc_driver = { 248 250 .probe = meson_mx_ao_arc_rproc_probe, 249 - .remove = meson_mx_ao_arc_rproc_remove, 251 + .remove_new = meson_mx_ao_arc_rproc_remove, 250 252 .driver = { 251 253 .name = "meson-mx-ao-arc-rproc", 252 254 .of_match_table = meson_mx_ao_arc_rproc_match,
+2 -4
drivers/remoteproc/mtk_scp.c
··· 913 913 return ret; 914 914 } 915 915 916 - static int scp_remove(struct platform_device *pdev) 916 + static void scp_remove(struct platform_device *pdev) 917 917 { 918 918 struct mtk_scp *scp = platform_get_drvdata(pdev); 919 919 int i; ··· 925 925 for (i = 0; i < SCP_IPI_MAX; i++) 926 926 mutex_destroy(&scp->ipi_desc[i].lock); 927 927 mutex_destroy(&scp->send_lock); 928 - 929 - return 0; 930 928 } 931 929 932 930 static const struct mtk_scp_of_data mt8183_of_data = { ··· 1001 1003 1002 1004 static struct platform_driver mtk_scp_driver = { 1003 1005 .probe = scp_probe, 1004 - .remove = scp_remove, 1006 + .remove_new = scp_remove, 1005 1007 .driver = { 1006 1008 .name = "mtk-scp", 1007 1009 .of_match_table = mtk_scp_of_match,
+2 -4
drivers/remoteproc/omap_remoteproc.c
··· 1363 1363 return ret; 1364 1364 } 1365 1365 1366 - static int omap_rproc_remove(struct platform_device *pdev) 1366 + static void omap_rproc_remove(struct platform_device *pdev) 1367 1367 { 1368 1368 struct rproc *rproc = platform_get_drvdata(pdev); 1369 1369 1370 1370 rproc_del(rproc); 1371 1371 rproc_free(rproc); 1372 1372 of_reserved_mem_device_release(&pdev->dev); 1373 - 1374 - return 0; 1375 1373 } 1376 1374 1377 1375 static const struct dev_pm_ops omap_rproc_pm_ops = { ··· 1380 1382 1381 1383 static struct platform_driver omap_rproc_driver = { 1382 1384 .probe = omap_rproc_probe, 1383 - .remove = omap_rproc_remove, 1385 + .remove_new = omap_rproc_remove, 1384 1386 .driver = { 1385 1387 .name = "omap-rproc", 1386 1388 .pm = &omap_rproc_pm_ops,
+2 -4
drivers/remoteproc/pru_rproc.c
··· 1056 1056 return 0; 1057 1057 } 1058 1058 1059 - static int pru_rproc_remove(struct platform_device *pdev) 1059 + static void pru_rproc_remove(struct platform_device *pdev) 1060 1060 { 1061 1061 struct device *dev = &pdev->dev; 1062 1062 struct rproc *rproc = platform_get_drvdata(pdev); 1063 1063 1064 1064 dev_dbg(dev, "%s: removing rproc %s\n", __func__, rproc->name); 1065 - 1066 - return 0; 1067 1065 } 1068 1066 1069 1067 static const struct pru_private_data pru_data = { ··· 1109 1111 .suppress_bind_attrs = true, 1110 1112 }, 1111 1113 .probe = pru_rproc_probe, 1112 - .remove = pru_rproc_remove, 1114 + .remove_new = pru_rproc_remove, 1113 1115 }; 1114 1116 module_platform_driver(pru_rproc_driver); 1115 1117
+2 -4
drivers/remoteproc/qcom_q6v5_adsp.c
··· 763 763 return ret; 764 764 } 765 765 766 - static int adsp_remove(struct platform_device *pdev) 766 + static void adsp_remove(struct platform_device *pdev) 767 767 { 768 768 struct qcom_adsp *adsp = platform_get_drvdata(pdev); 769 769 ··· 775 775 qcom_remove_ssr_subdev(adsp->rproc, &adsp->ssr_subdev); 776 776 qcom_rproc_pds_detach(adsp, adsp->proxy_pds, adsp->proxy_pd_count); 777 777 rproc_free(adsp->rproc); 778 - 779 - return 0; 780 778 } 781 779 782 780 static const struct adsp_pil_data adsp_resource_init = { ··· 857 859 858 860 static struct platform_driver adsp_pil_driver = { 859 861 .probe = adsp_probe, 860 - .remove = adsp_remove, 862 + .remove_new = adsp_remove, 861 863 .driver = { 862 864 .name = "qcom_q6v5_adsp", 863 865 .of_match_table = adsp_of_match,
+2 -4
drivers/remoteproc/qcom_q6v5_mss.c
··· 2110 2110 return ret; 2111 2111 } 2112 2112 2113 - static int q6v5_remove(struct platform_device *pdev) 2113 + static void q6v5_remove(struct platform_device *pdev) 2114 2114 { 2115 2115 struct q6v5 *qproc = platform_get_drvdata(pdev); 2116 2116 struct rproc *rproc = qproc->rproc; ··· 2128 2128 q6v5_pds_detach(qproc, qproc->proxy_pds, qproc->proxy_pd_count); 2129 2129 2130 2130 rproc_free(rproc); 2131 - 2132 - return 0; 2133 2131 } 2134 2132 2135 2133 static const struct rproc_hexagon_res sc7180_mss = { ··· 2480 2482 2481 2483 static struct platform_driver q6v5_driver = { 2482 2484 .probe = q6v5_probe, 2483 - .remove = q6v5_remove, 2485 + .remove_new = q6v5_remove, 2484 2486 .driver = { 2485 2487 .name = "qcom-q6v5-mss", 2486 2488 .of_match_table = q6v5_of_match,
+3 -5
drivers/remoteproc/qcom_q6v5_pas.c
··· 105 105 struct qcom_scm_pas_metadata dtb_pas_metadata; 106 106 }; 107 107 108 - void adsp_segment_dump(struct rproc *rproc, struct rproc_dump_segment *segment, 108 + static void adsp_segment_dump(struct rproc *rproc, struct rproc_dump_segment *segment, 109 109 void *dest, size_t offset, size_t size) 110 110 { 111 111 struct qcom_adsp *adsp = rproc->priv; ··· 754 754 return ret; 755 755 } 756 756 757 - static int adsp_remove(struct platform_device *pdev) 757 + static void adsp_remove(struct platform_device *pdev) 758 758 { 759 759 struct qcom_adsp *adsp = platform_get_drvdata(pdev); 760 760 ··· 769 769 adsp_pds_detach(adsp, adsp->proxy_pds, adsp->proxy_pd_count); 770 770 device_init_wakeup(adsp->dev, false); 771 771 rproc_free(adsp->rproc); 772 - 773 - return 0; 774 772 } 775 773 776 774 static const struct adsp_data adsp_resource_init = { ··· 1230 1232 1231 1233 static struct platform_driver adsp_driver = { 1232 1234 .probe = adsp_probe, 1233 - .remove = adsp_remove, 1235 + .remove_new = adsp_remove, 1234 1236 .driver = { 1235 1237 .name = "qcom_q6v5_pas", 1236 1238 .of_match_table = adsp_of_match,
+2 -4
drivers/remoteproc/qcom_q6v5_wcss.c
··· 1074 1074 return ret; 1075 1075 } 1076 1076 1077 - static int q6v5_wcss_remove(struct platform_device *pdev) 1077 + static void q6v5_wcss_remove(struct platform_device *pdev) 1078 1078 { 1079 1079 struct rproc *rproc = platform_get_drvdata(pdev); 1080 1080 struct q6v5_wcss *wcss = rproc->priv; ··· 1082 1082 qcom_q6v5_deinit(&wcss->q6v5); 1083 1083 rproc_del(rproc); 1084 1084 rproc_free(rproc); 1085 - 1086 - return 0; 1087 1085 } 1088 1086 1089 1087 static const struct wcss_data wcss_ipq8074_res_init = { ··· 1115 1117 1116 1118 static struct platform_driver q6v5_wcss_driver = { 1117 1119 .probe = q6v5_wcss_probe, 1118 - .remove = q6v5_wcss_remove, 1120 + .remove_new = q6v5_wcss_remove, 1119 1121 .driver = { 1120 1122 .name = "qcom-q6v5-wcss-pil", 1121 1123 .of_match_table = q6v5_wcss_of_match,
+2 -4
drivers/remoteproc/qcom_wcnss.c
··· 666 666 return ret; 667 667 } 668 668 669 - static int wcnss_remove(struct platform_device *pdev) 669 + static void wcnss_remove(struct platform_device *pdev) 670 670 { 671 671 struct qcom_wcnss *wcnss = platform_get_drvdata(pdev); 672 672 ··· 678 678 qcom_remove_smd_subdev(wcnss->rproc, &wcnss->smd_subdev); 679 679 wcnss_release_pds(wcnss); 680 680 rproc_free(wcnss->rproc); 681 - 682 - return 0; 683 681 } 684 682 685 683 static const struct of_device_id wcnss_of_match[] = { ··· 691 693 692 694 static struct platform_driver wcnss_driver = { 693 695 .probe = wcnss_probe, 694 - .remove = wcnss_remove, 696 + .remove_new = wcnss_remove, 695 697 .driver = { 696 698 .name = "qcom-wcnss-pil", 697 699 .of_match_table = wcnss_of_match,
+2 -4
drivers/remoteproc/rcar_rproc.c
··· 197 197 return ret; 198 198 } 199 199 200 - static int rcar_rproc_remove(struct platform_device *pdev) 200 + static void rcar_rproc_remove(struct platform_device *pdev) 201 201 { 202 202 struct device *dev = &pdev->dev; 203 203 204 204 pm_runtime_disable(dev); 205 - 206 - return 0; 207 205 } 208 206 209 207 static const struct of_device_id rcar_rproc_of_match[] = { ··· 213 215 214 216 static struct platform_driver rcar_rproc_driver = { 215 217 .probe = rcar_rproc_probe, 216 - .remove = rcar_rproc_remove, 218 + .remove_new = rcar_rproc_remove, 217 219 .driver = { 218 220 .name = "rcar-rproc", 219 221 .of_match_table = rcar_rproc_of_match,
+2 -4
drivers/remoteproc/remoteproc_virtio.c
··· 569 569 return ret; 570 570 } 571 571 572 - static int rproc_virtio_remove(struct platform_device *pdev) 572 + static void rproc_virtio_remove(struct platform_device *pdev) 573 573 { 574 574 struct rproc_vdev *rvdev = dev_get_drvdata(&pdev->dev); 575 575 struct rproc *rproc = rvdev->rproc; ··· 588 588 dma_release_coherent_memory(&pdev->dev); 589 589 590 590 put_device(&rproc->dev); 591 - 592 - return 0; 593 591 } 594 592 595 593 /* Platform driver */ 596 594 static struct platform_driver rproc_virtio_driver = { 597 595 .probe = rproc_virtio_probe, 598 - .remove = rproc_virtio_remove, 596 + .remove_new = rproc_virtio_remove, 599 597 .driver = { 600 598 .name = "rproc-virtio", 601 599 },
+2 -4
drivers/remoteproc/st_remoteproc.c
··· 448 448 return ret; 449 449 } 450 450 451 - static int st_rproc_remove(struct platform_device *pdev) 451 + static void st_rproc_remove(struct platform_device *pdev) 452 452 { 453 453 struct rproc *rproc = platform_get_drvdata(pdev); 454 454 struct st_rproc *ddata = rproc->priv; ··· 462 462 mbox_free_channel(ddata->mbox_chan[i]); 463 463 464 464 rproc_free(rproc); 465 - 466 - return 0; 467 465 } 468 466 469 467 static struct platform_driver st_rproc_driver = { 470 468 .probe = st_rproc_probe, 471 - .remove = st_rproc_remove, 469 + .remove_new = st_rproc_remove, 472 470 .driver = { 473 471 .name = "st-rproc", 474 472 .of_match_table = of_match_ptr(st_rproc_match),
+58 -26
drivers/remoteproc/stm32_rproc.c
··· 79 79 80 80 struct stm32_rproc { 81 81 struct reset_control *rst; 82 + struct reset_control *hold_boot_rst; 82 83 struct stm32_syscon hold_boot; 83 84 struct stm32_syscon pdds; 84 85 struct stm32_syscon m4_state; ··· 89 88 struct stm32_rproc_mem *rmems; 90 89 struct stm32_mbox mb[MBOX_NB_MBX]; 91 90 struct workqueue_struct *workqueue; 92 - bool secured_soc; 91 + bool hold_boot_smc; 93 92 void __iomem *rsc_va; 94 93 }; 95 94 ··· 414 413 struct arm_smccc_res smc_res; 415 414 int val, err; 416 415 416 + /* 417 + * Three ways to manage the hold boot 418 + * - using SCMI: the hold boot is managed as a reset, 419 + * - using Linux(no SCMI): the hold boot is managed as a syscon register 420 + * - using SMC call (deprecated): use SMC reset interface 421 + */ 422 + 417 423 val = hold ? HOLD_BOOT : RELEASE_BOOT; 418 424 419 - if (IS_ENABLED(CONFIG_HAVE_ARM_SMCCC) && ddata->secured_soc) { 425 + if (ddata->hold_boot_rst) { 426 + /* Use the SCMI reset controller */ 427 + if (!hold) 428 + err = reset_control_deassert(ddata->hold_boot_rst); 429 + else 430 + err = reset_control_assert(ddata->hold_boot_rst); 431 + } else if (IS_ENABLED(CONFIG_HAVE_ARM_SMCCC) && ddata->hold_boot_smc) { 432 + /* Use the SMC call */ 420 433 arm_smccc_smc(STM32_SMC_RCC, STM32_SMC_REG_WRITE, 421 434 hold_boot.reg, val, 0, 0, 0, 0, &smc_res); 422 435 err = smc_res.a0; 423 436 } else { 437 + /* Use syscon */ 424 438 err = regmap_update_bits(hold_boot.map, hold_boot.reg, 425 439 hold_boot.mask, val); 426 440 } ··· 733 717 dev_info(dev, "wdg irq registered\n"); 734 718 } 735 719 736 - ddata->rst = devm_reset_control_get_by_index(dev, 0); 720 + ddata->rst = devm_reset_control_get_optional(dev, "mcu_rst"); 721 + if (!ddata->rst) { 722 + /* Try legacy fallback method: get it by index */ 723 + ddata->rst = devm_reset_control_get_by_index(dev, 0); 724 + } 737 725 if (IS_ERR(ddata->rst)) 738 726 return dev_err_probe(dev, PTR_ERR(ddata->rst), 739 727 "failed to get mcu_reset\n"); 740 728 741 729 /* 742 - * if platform is secured the hold boot bit must be written by 743 - * smc call and read normally. 744 - * if not secure the hold boot bit could be read/write normally 730 + * Three ways to manage the hold boot 731 + * - using SCMI: the hold boot is managed as a reset 732 + * The DT "reset-mames" property should be defined with 2 items: 733 + * reset-names = "mcu_rst", "hold_boot"; 734 + * - using SMC call (deprecated): use SMC reset interface 735 + * The DT "reset-mames" property is optional, "st,syscfg-tz" is required 736 + * - default(no SCMI, no SMC): the hold boot is managed as a syscon register 737 + * The DT "reset-mames" property is optional, "st,syscfg-holdboot" is required 745 738 */ 746 - err = stm32_rproc_get_syscon(np, "st,syscfg-tz", &tz); 747 - if (err) { 748 - dev_err(dev, "failed to get tz syscfg\n"); 749 - return err; 739 + 740 + ddata->hold_boot_rst = devm_reset_control_get_optional(dev, "hold_boot"); 741 + if (IS_ERR(ddata->hold_boot_rst)) 742 + return dev_err_probe(dev, PTR_ERR(ddata->hold_boot_rst), 743 + "failed to get hold_boot reset\n"); 744 + 745 + if (!ddata->hold_boot_rst && IS_ENABLED(CONFIG_HAVE_ARM_SMCCC)) { 746 + /* Manage the MCU_BOOT using SMC call */ 747 + err = stm32_rproc_get_syscon(np, "st,syscfg-tz", &tz); 748 + if (!err) { 749 + err = regmap_read(tz.map, tz.reg, &tzen); 750 + if (err) { 751 + dev_err(dev, "failed to read tzen\n"); 752 + return err; 753 + } 754 + ddata->hold_boot_smc = tzen & tz.mask; 755 + } 750 756 } 751 757 752 - err = regmap_read(tz.map, tz.reg, &tzen); 753 - if (err) { 754 - dev_err(dev, "failed to read tzen\n"); 755 - return err; 756 - } 757 - ddata->secured_soc = tzen & tz.mask; 758 - 759 - err = stm32_rproc_get_syscon(np, "st,syscfg-holdboot", 760 - &ddata->hold_boot); 761 - if (err) { 762 - dev_err(dev, "failed to get hold boot\n"); 763 - return err; 758 + if (!ddata->hold_boot_rst && !ddata->hold_boot_smc) { 759 + /* Default: hold boot manage it through the syscon controller */ 760 + err = stm32_rproc_get_syscon(np, "st,syscfg-holdboot", 761 + &ddata->hold_boot); 762 + if (err) { 763 + dev_err(dev, "failed to get hold boot\n"); 764 + return err; 765 + } 764 766 } 765 767 766 768 err = stm32_rproc_get_syscon(np, "st,syscfg-pdds", &ddata->pdds); ··· 901 867 return ret; 902 868 } 903 869 904 - static int stm32_rproc_remove(struct platform_device *pdev) 870 + static void stm32_rproc_remove(struct platform_device *pdev) 905 871 { 906 872 struct rproc *rproc = platform_get_drvdata(pdev); 907 873 struct stm32_rproc *ddata = rproc->priv; ··· 919 885 device_init_wakeup(dev, false); 920 886 } 921 887 rproc_free(rproc); 922 - 923 - return 0; 924 888 } 925 889 926 890 static int __maybe_unused stm32_rproc_suspend(struct device *dev) ··· 948 916 949 917 static struct platform_driver stm32_rproc_driver = { 950 918 .probe = stm32_rproc_probe, 951 - .remove = stm32_rproc_remove, 919 + .remove_new = stm32_rproc_remove, 952 920 .driver = { 953 921 .name = "stm32-rproc", 954 922 .pm = &stm32_rproc_pm_ops,
+2 -4
drivers/remoteproc/wkup_m3_rproc.c
··· 223 223 return ret; 224 224 } 225 225 226 - static int wkup_m3_rproc_remove(struct platform_device *pdev) 226 + static void wkup_m3_rproc_remove(struct platform_device *pdev) 227 227 { 228 228 struct rproc *rproc = platform_get_drvdata(pdev); 229 229 ··· 231 231 rproc_free(rproc); 232 232 pm_runtime_put_sync(&pdev->dev); 233 233 pm_runtime_disable(&pdev->dev); 234 - 235 - return 0; 236 234 } 237 235 238 236 #ifdef CONFIG_PM ··· 251 253 252 254 static struct platform_driver wkup_m3_rproc_driver = { 253 255 .probe = wkup_m3_rproc_probe, 254 - .remove = wkup_m3_rproc_remove, 256 + .remove_new = wkup_m3_rproc_remove, 255 257 .driver = { 256 258 .name = "wkup_m3_rproc", 257 259 .of_match_table = wkup_m3_rproc_of_match,