Skip to content

Commit 60c6119

Browse files
committed
Merge tag 'rproc-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux
Pull remoteproc updates from Bjorn Andersson: - The maximum amount of DDR memory used by the Mediatek MT8188/MT8195 SCP is increased to handle new use cases. Handling of optional L1TCM memory is made actually optional. - An optimization is introduced to only clear the unused portion of IPI shared buffers, rather than the entire buffer before writing the message. - Detection for IPC-only mode in the TI K3 DSP remoteproc driver is corrected. The loglevel of a debug print in the same is lowered from error. - Support for attaching to an running remote processor is added to the Xilinx R5F. - An in-kernel implementation of the Qualcomm "protected domain mapper" (aka service registry) service is introduced, to remove the dependency on a userspace implementation to detect when the battery monitor and USB Type-C port manager becomes available. This is then integrated with the Qualcomm remoteproc driver. - The Qualcomm PAS remoteproc driver gains support for attempting to bust hwspinlocks held by the remote processor when it crashed/stopped. - The TI OMAP remoteproc driver is transitioned to use devres helpers for various forms of allocations. - Parsing of memory-regions in the i.MX remoteproc driver is improved to avoid a NULL pointer dereference if the phandle reference is empty. of_node reference counting is corrected in the same. * tag 'rproc-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: remoteproc: mediatek: Increase MT8188/MT8195 SCP core0 DRAM size remoteproc: k3-dsp: Fix log levels where appropriate remoteproc: xlnx: Add attach detach support remoteproc: qcom: select AUXILIARY_BUS remoteproc: k3-r5: Fix IPC-only mode detection remoteproc: mediatek: Don't attempt to remap l1tcm memory if missing remoteproc: qcom: enable in-kernel PD mapper dt-bindings: remoteproc: imx_rproc: Add minItems for power-domain remoteproc: imx_rproc: Fix refcount mistake in imx_rproc_addr_init remoteproc: omap: Use devm_rproc_add() helper remoteproc: omap: Use devm action to release reserved memory remoteproc: omap: Use devm_rproc_alloc() helper remoteproc: imx_rproc: Skip over memory region when node value is NULL dt-bindings: remoteproc: k3-dsp: Correct optional sram properties for AM62A SoCs remoteproc: qcom_q6v5_pas: Add hwspinlock bust on stop soc: qcom: smem: Add qcom_smem_bust_hwspin_lock_by_host() remoteproc: mediatek: Zero out only remaining bytes of IPI buffer
2 parents 58bffba + 19cb605 commit 60c6119

File tree

17 files changed

+414
-84
lines changed

17 files changed

+414
-84
lines changed

Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ properties:
5959
maxItems: 32
6060

6161
power-domains:
62+
minItems: 2
6263
maxItems: 8
6364

6465
fsl,auto-boot:
@@ -99,6 +100,20 @@ allOf:
99100
properties:
100101
fsl,iomuxc-gpr: false
101102

103+
- if:
104+
properties:
105+
compatible:
106+
contains:
107+
enum:
108+
- fsl,imx8qxp-cm4
109+
- fsl,imx8qm-cm4
110+
then:
111+
required:
112+
- power-domains
113+
else:
114+
properties:
115+
power-domains: false
116+
102117
additionalProperties: false
103118

104119
examples:

Documentation/devicetree/bindings/remoteproc/ti,k3-dsp-rproc.yaml

Lines changed: 51 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ description: |
2525
host processor (Arm CorePac) to perform the device management of the remote
2626
processor and to communicate with the remote processor.
2727
28-
allOf:
29-
- $ref: /schemas/arm/keystone/ti,k3-sci-common.yaml#
30-
3128
properties:
3229
compatible:
3330
enum:
@@ -89,41 +86,57 @@ properties:
8986
should be defined as per the generic bindings in,
9087
Documentation/devicetree/bindings/sram/sram.yaml
9188
92-
if:
93-
properties:
94-
compatible:
95-
enum:
96-
- ti,j721e-c66-dsp
97-
then:
98-
properties:
99-
reg:
100-
items:
101-
- description: Address and Size of the L2 SRAM internal memory region
102-
- description: Address and Size of the L1 PRAM internal memory region
103-
- description: Address and Size of the L1 DRAM internal memory region
104-
reg-names:
105-
items:
106-
- const: l2sram
107-
- const: l1pram
108-
- const: l1dram
109-
else:
110-
if:
111-
properties:
112-
compatible:
113-
enum:
114-
- ti,am62a-c7xv-dsp
115-
- ti,j721e-c71-dsp
116-
- ti,j721s2-c71-dsp
117-
then:
118-
properties:
119-
reg:
120-
items:
121-
- description: Address and Size of the L2 SRAM internal memory region
122-
- description: Address and Size of the L1 DRAM internal memory region
123-
reg-names:
124-
items:
125-
- const: l2sram
126-
- const: l1dram
89+
allOf:
90+
- if:
91+
properties:
92+
compatible:
93+
enum:
94+
- ti,j721e-c66-dsp
95+
then:
96+
properties:
97+
reg:
98+
items:
99+
- description: Address and Size of the L2 SRAM internal memory region
100+
- description: Address and Size of the L1 PRAM internal memory region
101+
- description: Address and Size of the L1 DRAM internal memory region
102+
reg-names:
103+
items:
104+
- const: l2sram
105+
- const: l1pram
106+
- const: l1dram
107+
108+
- if:
109+
properties:
110+
compatible:
111+
enum:
112+
- ti,j721e-c71-dsp
113+
- ti,j721s2-c71-dsp
114+
then:
115+
properties:
116+
reg:
117+
items:
118+
- description: Address and Size of the L2 SRAM internal memory region
119+
- description: Address and Size of the L1 DRAM internal memory region
120+
reg-names:
121+
items:
122+
- const: l2sram
123+
- const: l1dram
124+
125+
- if:
126+
properties:
127+
compatible:
128+
enum:
129+
- ti,am62a-c7xv-dsp
130+
then:
131+
properties:
132+
reg:
133+
items:
134+
- description: Address and Size of the L2 SRAM internal memory region
135+
reg-names:
136+
items:
137+
- const: l2sram
138+
139+
- $ref: /schemas/arm/keystone/ti,k3-sci-common.yaml#
127140

128141
required:
129142
- compatible

drivers/remoteproc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ config QCOM_PIL_INFO
166166

167167
config QCOM_RPROC_COMMON
168168
tristate
169+
select AUXILIARY_BUS
169170

170171
config QCOM_Q6V5_COMMON
171172
tristate

drivers/remoteproc/imx_rproc.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,31 +726,37 @@ static int imx_rproc_addr_init(struct imx_rproc *priv,
726726
struct resource res;
727727

728728
node = of_parse_phandle(np, "memory-region", a);
729+
if (!node)
730+
continue;
729731
/* Not map vdevbuffer, vdevring region */
730732
if (!strncmp(node->name, "vdev", strlen("vdev"))) {
731733
of_node_put(node);
732734
continue;
733735
}
734736
err = of_address_to_resource(node, 0, &res);
735-
of_node_put(node);
736737
if (err) {
737738
dev_err(dev, "unable to resolve memory region\n");
739+
of_node_put(node);
738740
return err;
739741
}
740742

741-
if (b >= IMX_RPROC_MEM_MAX)
743+
if (b >= IMX_RPROC_MEM_MAX) {
744+
of_node_put(node);
742745
break;
746+
}
743747

744748
/* Not use resource version, because we might share region */
745749
priv->mem[b].cpu_addr = devm_ioremap_wc(&pdev->dev, res.start, resource_size(&res));
746750
if (!priv->mem[b].cpu_addr) {
747751
dev_err(dev, "failed to remap %pr\n", &res);
752+
of_node_put(node);
748753
return -ENOMEM;
749754
}
750755
priv->mem[b].sys_addr = res.start;
751756
priv->mem[b].size = resource_size(&res);
752757
if (!strcmp(node->name, "rsc-table"))
753758
priv->rsc_table = priv->mem[b].cpu_addr;
759+
of_node_put(node);
754760
b++;
755761
}
756762

drivers/remoteproc/mtk_scp.c

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ static void scp_ipi_handler(struct mtk_scp *scp)
117117
return;
118118
}
119119

120-
memset(scp->share_buf, 0, scp_sizes->ipi_share_buffer_size);
121120
memcpy_fromio(scp->share_buf, &rcv_obj->share_buf, len);
121+
memset(&scp->share_buf[len], 0, scp_sizes->ipi_share_buffer_size - len);
122122
handler(scp->share_buf, len, ipi_desc[id].priv);
123123
scp_ipi_unlock(scp, id);
124124

@@ -1344,14 +1344,12 @@ static int scp_probe(struct platform_device *pdev)
13441344

13451345
/* l1tcm is an optional memory region */
13461346
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "l1tcm");
1347-
scp_cluster->l1tcm_base = devm_ioremap_resource(dev, res);
1348-
if (IS_ERR(scp_cluster->l1tcm_base)) {
1349-
ret = PTR_ERR(scp_cluster->l1tcm_base);
1350-
if (ret != -EINVAL)
1351-
return dev_err_probe(dev, ret, "Failed to map l1tcm memory\n");
1347+
if (res) {
1348+
scp_cluster->l1tcm_base = devm_ioremap_resource(dev, res);
1349+
if (IS_ERR(scp_cluster->l1tcm_base))
1350+
return dev_err_probe(dev, PTR_ERR(scp_cluster->l1tcm_base),
1351+
"Failed to map l1tcm memory\n");
13521352

1353-
scp_cluster->l1tcm_base = NULL;
1354-
} else {
13551353
scp_cluster->l1tcm_size = resource_size(res);
13561354
scp_cluster->l1tcm_phys = res->start;
13571355
}
@@ -1390,7 +1388,7 @@ static const struct mtk_scp_sizes_data default_scp_sizes = {
13901388
};
13911389

13921390
static const struct mtk_scp_sizes_data mt8188_scp_sizes = {
1393-
.max_dram_size = 0x500000,
1391+
.max_dram_size = 0x800000,
13941392
.ipi_share_buffer_size = 600,
13951393
};
13961394

@@ -1399,6 +1397,11 @@ static const struct mtk_scp_sizes_data mt8188_scp_c1_sizes = {
13991397
.ipi_share_buffer_size = 600,
14001398
};
14011399

1400+
static const struct mtk_scp_sizes_data mt8195_scp_sizes = {
1401+
.max_dram_size = 0x800000,
1402+
.ipi_share_buffer_size = 288,
1403+
};
1404+
14021405
static const struct mtk_scp_of_data mt8183_of_data = {
14031406
.scp_clk_get = mt8183_scp_clk_get,
14041407
.scp_before_load = mt8183_scp_before_load,
@@ -1476,7 +1479,7 @@ static const struct mtk_scp_of_data mt8195_of_data = {
14761479
.scp_da_to_va = mt8192_scp_da_to_va,
14771480
.host_to_scp_reg = MT8192_GIPC_IN_SET,
14781481
.host_to_scp_int_bit = MT8192_HOST_IPC_INT_BIT,
1479-
.scp_sizes = &default_scp_sizes,
1482+
.scp_sizes = &mt8195_scp_sizes,
14801483
};
14811484

14821485
static const struct mtk_scp_of_data mt8195_of_data_c1 = {

drivers/remoteproc/omap_remoteproc.c

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,6 +1277,13 @@ static int omap_rproc_of_get_timers(struct platform_device *pdev,
12771277
return 0;
12781278
}
12791279

1280+
static void omap_rproc_mem_release(void *data)
1281+
{
1282+
struct device *dev = data;
1283+
1284+
of_reserved_mem_device_release(dev);
1285+
}
1286+
12801287
static int omap_rproc_probe(struct platform_device *pdev)
12811288
{
12821289
struct device_node *np = pdev->dev.of_node;
@@ -1305,8 +1312,8 @@ static int omap_rproc_probe(struct platform_device *pdev)
13051312
return ret;
13061313
}
13071314

1308-
rproc = rproc_alloc(&pdev->dev, dev_name(&pdev->dev), &omap_rproc_ops,
1309-
firmware, sizeof(*oproc));
1315+
rproc = devm_rproc_alloc(&pdev->dev, dev_name(&pdev->dev), &omap_rproc_ops,
1316+
firmware, sizeof(*oproc));
13101317
if (!rproc)
13111318
return -ENOMEM;
13121319

@@ -1318,15 +1325,15 @@ static int omap_rproc_probe(struct platform_device *pdev)
13181325

13191326
ret = omap_rproc_of_get_internal_memories(pdev, rproc);
13201327
if (ret)
1321-
goto free_rproc;
1328+
return ret;
13221329

13231330
ret = omap_rproc_get_boot_data(pdev, rproc);
13241331
if (ret)
1325-
goto free_rproc;
1332+
return ret;
13261333

13271334
ret = omap_rproc_of_get_timers(pdev, rproc);
13281335
if (ret)
1329-
goto free_rproc;
1336+
return ret;
13301337

13311338
init_completion(&oproc->pm_comp);
13321339
oproc->autosuspend_delay = DEFAULT_AUTOSUSPEND_DELAY;
@@ -1337,40 +1344,26 @@ static int omap_rproc_probe(struct platform_device *pdev)
13371344
pm_runtime_set_autosuspend_delay(&pdev->dev, oproc->autosuspend_delay);
13381345

13391346
oproc->fck = devm_clk_get(&pdev->dev, 0);
1340-
if (IS_ERR(oproc->fck)) {
1341-
ret = PTR_ERR(oproc->fck);
1342-
goto free_rproc;
1343-
}
1347+
if (IS_ERR(oproc->fck))
1348+
return PTR_ERR(oproc->fck);
13441349

13451350
ret = of_reserved_mem_device_init(&pdev->dev);
13461351
if (ret) {
13471352
dev_warn(&pdev->dev, "device does not have specific CMA pool.\n");
13481353
dev_warn(&pdev->dev, "Typically this should be provided,\n");
13491354
dev_warn(&pdev->dev, "only omit if you know what you are doing.\n");
13501355
}
1356+
ret = devm_add_action_or_reset(&pdev->dev, omap_rproc_mem_release, &pdev->dev);
1357+
if (ret)
1358+
return ret;
13511359

13521360
platform_set_drvdata(pdev, rproc);
13531361

1354-
ret = rproc_add(rproc);
1362+
ret = devm_rproc_add(&pdev->dev, rproc);
13551363
if (ret)
1356-
goto release_mem;
1364+
return ret;
13571365

13581366
return 0;
1359-
1360-
release_mem:
1361-
of_reserved_mem_device_release(&pdev->dev);
1362-
free_rproc:
1363-
rproc_free(rproc);
1364-
return ret;
1365-
}
1366-
1367-
static void omap_rproc_remove(struct platform_device *pdev)
1368-
{
1369-
struct rproc *rproc = platform_get_drvdata(pdev);
1370-
1371-
rproc_del(rproc);
1372-
rproc_free(rproc);
1373-
of_reserved_mem_device_release(&pdev->dev);
13741367
}
13751368

13761369
static const struct dev_pm_ops omap_rproc_pm_ops = {
@@ -1381,7 +1374,6 @@ static const struct dev_pm_ops omap_rproc_pm_ops = {
13811374

13821375
static struct platform_driver omap_rproc_driver = {
13831376
.probe = omap_rproc_probe,
1384-
.remove_new = omap_rproc_remove,
13851377
.driver = {
13861378
.name = "omap-rproc",
13871379
.pm = &omap_rproc_pm_ops,

0 commit comments

Comments
 (0)