Loading Documentation/devicetree/bindings/qdsp/msm-mdsprpc-mem.txt 0 → 100644 +15 −0 Original line number Diff line number Diff line Qualcomm Technologies, Inc. FastRPC MDSP CMA Heap The MSM MDSPRPC memory device allocates CMA memory, for sharing memory of FastRPC buffers to remote processor(MDSP). Required properties: -compatible: Must be "qcom,msm-mdsprpc-mem-region" -memory-region: A phandle that points to a memory heap where the heap memory is allocated Example: qcom,mdsprpc-mem { compatible = "qcom,msm-mdsprpc-mem-region"; memory-region = <&mdsp_mem>; }; arch/arm/boot/dts/qcom/msm8953-ion.dtsi +7 −1 Original line number Diff line number Diff line /* Copyright (c) 2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -37,5 +37,11 @@ memory-region = <&qseecom_mem>; qcom,ion-heap-type = "DMA"; }; qcom,ion-heap@22 { /* MODEM HEAP */ reg = <22>; memory-region = <&mdsp_mem>; qcom,ion-heap-type = "DMA"; }; }; }; arch/arm/boot/dts/qcom/msm8953.dtsi +11 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,12 @@ size = <0 0x400000>; }; mdsp_mem: mdsp_region@0 { compatible = "shared-dma-pool"; reusable; size = <0 0x6400000>; }; dfps_data_mem: dfps_data_mem@90000000 { reg = <0 0x90000000 0 0x1000>; label = "dfps_data_mem"; Loading Loading @@ -1656,6 +1662,11 @@ memory-region = <&adsp_mem>; }; qcom,mdsprpc-mem { compatible = "qcom,msm-mdsprpc-mem-region"; memory-region = <&mdsp_mem>; }; qcom,adsprpc_domains { compatible = "qcom,msm-fastrpc-legacy-compute-cb"; qcom,msm_fastrpc_compute_cb { Loading drivers/char/adsprpc.c +19 −2 Original line number Diff line number Diff line Loading @@ -212,6 +212,7 @@ struct fastrpc_apps { spinlock_t hlock; struct ion_client *client; struct device *dev; struct device *modem_cma_dev; bool glink; }; Loading Loading @@ -1723,17 +1724,26 @@ static int fastrpc_session_alloc(struct fastrpc_channel_ctx *chan, int *session) struct fastrpc_apps *me = &gfa; int idx = 0, err = 0; if (chan->sesscount) { switch (chan->channel) { case SMD_APPS_QDSP: idx = ffz(chan->bitmap); VERIFY(err, idx < chan->sesscount); if (err) goto bail; set_bit(idx, &chan->bitmap); } else { break; case SMD_APPS_DSPS: VERIFY(err, me->dev != NULL); if (err) goto bail; chan->session[0].dev = me->dev; break; case SMD_APPS_MODEM: VERIFY(err, me->dev != NULL); if (err) goto bail; chan->session[0].dev = me->modem_cma_dev; break; } chan->session[idx].smmu.faults = 0; Loading Loading @@ -2149,6 +2159,7 @@ static struct of_device_id fastrpc_match_table[] = { { .compatible = "qcom,msm-fastrpc-compute-cb", }, { .compatible = "qcom,msm-fastrpc-legacy-compute-cb", }, { .compatible = "qcom,msm-adsprpc-mem-region", }, { .compatible = "qcom,msm-mdsprpc-mem-region", }, {} }; Loading Loading @@ -2321,6 +2332,12 @@ static int fastrpc_probe(struct platform_device *pdev) return 0; } if (of_device_is_compatible(dev->of_node, "qcom,msm-mdsprpc-mem-region")) { me->modem_cma_dev = dev; return 0; } me->glink = of_property_read_bool(dev->of_node, "qcom,fastrpc-glink"); pr_info("adsprpc: channel link type: %d\n", me->glink); Loading Loading
Documentation/devicetree/bindings/qdsp/msm-mdsprpc-mem.txt 0 → 100644 +15 −0 Original line number Diff line number Diff line Qualcomm Technologies, Inc. FastRPC MDSP CMA Heap The MSM MDSPRPC memory device allocates CMA memory, for sharing memory of FastRPC buffers to remote processor(MDSP). Required properties: -compatible: Must be "qcom,msm-mdsprpc-mem-region" -memory-region: A phandle that points to a memory heap where the heap memory is allocated Example: qcom,mdsprpc-mem { compatible = "qcom,msm-mdsprpc-mem-region"; memory-region = <&mdsp_mem>; };
arch/arm/boot/dts/qcom/msm8953-ion.dtsi +7 −1 Original line number Diff line number Diff line /* Copyright (c) 2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -37,5 +37,11 @@ memory-region = <&qseecom_mem>; qcom,ion-heap-type = "DMA"; }; qcom,ion-heap@22 { /* MODEM HEAP */ reg = <22>; memory-region = <&mdsp_mem>; qcom,ion-heap-type = "DMA"; }; }; };
arch/arm/boot/dts/qcom/msm8953.dtsi +11 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,12 @@ size = <0 0x400000>; }; mdsp_mem: mdsp_region@0 { compatible = "shared-dma-pool"; reusable; size = <0 0x6400000>; }; dfps_data_mem: dfps_data_mem@90000000 { reg = <0 0x90000000 0 0x1000>; label = "dfps_data_mem"; Loading Loading @@ -1656,6 +1662,11 @@ memory-region = <&adsp_mem>; }; qcom,mdsprpc-mem { compatible = "qcom,msm-mdsprpc-mem-region"; memory-region = <&mdsp_mem>; }; qcom,adsprpc_domains { compatible = "qcom,msm-fastrpc-legacy-compute-cb"; qcom,msm_fastrpc_compute_cb { Loading
drivers/char/adsprpc.c +19 −2 Original line number Diff line number Diff line Loading @@ -212,6 +212,7 @@ struct fastrpc_apps { spinlock_t hlock; struct ion_client *client; struct device *dev; struct device *modem_cma_dev; bool glink; }; Loading Loading @@ -1723,17 +1724,26 @@ static int fastrpc_session_alloc(struct fastrpc_channel_ctx *chan, int *session) struct fastrpc_apps *me = &gfa; int idx = 0, err = 0; if (chan->sesscount) { switch (chan->channel) { case SMD_APPS_QDSP: idx = ffz(chan->bitmap); VERIFY(err, idx < chan->sesscount); if (err) goto bail; set_bit(idx, &chan->bitmap); } else { break; case SMD_APPS_DSPS: VERIFY(err, me->dev != NULL); if (err) goto bail; chan->session[0].dev = me->dev; break; case SMD_APPS_MODEM: VERIFY(err, me->dev != NULL); if (err) goto bail; chan->session[0].dev = me->modem_cma_dev; break; } chan->session[idx].smmu.faults = 0; Loading Loading @@ -2149,6 +2159,7 @@ static struct of_device_id fastrpc_match_table[] = { { .compatible = "qcom,msm-fastrpc-compute-cb", }, { .compatible = "qcom,msm-fastrpc-legacy-compute-cb", }, { .compatible = "qcom,msm-adsprpc-mem-region", }, { .compatible = "qcom,msm-mdsprpc-mem-region", }, {} }; Loading Loading @@ -2321,6 +2332,12 @@ static int fastrpc_probe(struct platform_device *pdev) return 0; } if (of_device_is_compatible(dev->of_node, "qcom,msm-mdsprpc-mem-region")) { me->modem_cma_dev = dev; return 0; } me->glink = of_property_read_bool(dev->of_node, "qcom,fastrpc-glink"); pr_info("adsprpc: channel link type: %d\n", me->glink); Loading