Enable BAM-DMUX/WWAN on Qualcomm MSM8916
Subsystems (4)
v2 cover Enable BAM-DMUX/WWAN on Qualcomm MSM8916
This series enables using mobile Internet/WWAN on devices based on Qualcomm MSM8916. The network driver for that has already landed in Linux 5.17.
The device tree node of BAM-DMUX does not have any own memory resources. It just bundles resources from other hardware blocks. It could be added to the device tree root node, but it logically belongs below the modem remote processor.
To allow adding it there, the qcom_q6v5_mss driver is modified slightly to create a platform device for it.
Changes in v2:
- Avoid using of_platform_populate() and create platform device specifically only for "qcom,bam-dmux".
Stephan Gerhold (2):
remoteproc: qcom_q6v5_mss: Create platform device for BAM-DMUX
arm64: dts: qcom: msm8916: Add BAM-DMUX for WWAN network interfaces
arch/arm64/boot/dts/qcom/msm8916.dtsi | 30 +++++++++++++++++++++++++++ drivers/remoteproc/qcom_q6v5_mss.c | 8 +++++++ 2 files changed, 38 insertions(+)
Signature · 1 line
2.35.1
PATCH v2 1/2 remoteproc: qcom_q6v5_mss: Create platform device for BAM-DMUX
The modem remoteproc on older Qualcomm SoCs (e.g. MSM8916 and MSM8974) implements the BAM-DMUX protocol to allow access to the network data channels of the modem. The hardware/firmware resources required to implement the BAM-DMUX driver are described in an extra node in the device tree (with the compatible "qcom,bam-dmux").
This node logically belongs below the modem remoteproc, so that both control interfaces (rpmsg_wwan_ctrl) and network interfaces (bam_dmux) have a common parent.
Unlike other child devices of the modem remoteproc, the bam-dmux device currently does not follow the state of the remoteproc (i.e. it is not added/removed when the remoteproc is started/stopped). However, this is an implementation detail of the bam_dmux driver in Linux that might change in the future.
To be flexible for future changes, create a standard platform device specifically only for "qcom,bam-dmux", rather than populating all child nodes. This is also more consistent with the way the other child nodes are handled in the driver.
Note: of_platform_device_create() and of_node_put() have NULL-checks internally, so there is no need to check if the "qcom,bam-dmux" node actually exists in the device tree.
---
Changes in v2:
- Avoid using of_platform_populate() and create platform device specifically only for "qcom,bam-dmux".
--- drivers/remoteproc/qcom_q6v5_mss.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/remoteproc/qcom_q6v5_mss.c +8 -0
@@ -218,6 +218,7 @@ struct q6v5 {struct qcom_rproc_subdev smd_subdev;struct qcom_rproc_ssr ssr_subdev;struct qcom_sysmon *sysmon; +struct platform_device *bam_dmux;bool need_mem_protection;bool has_alt_reset;bool has_mba_logs;
@@ -1847,6 +1848,7 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc)static int q6v5_probe (struct platform_device *pdev) {const struct rproc_hexagon_res *desc; +struct device_node *node;struct q6v5 *qproc;struct rproc *rproc;const char *mba_image;
@@ -1990,6 +1992,10 @@ static int q6v5_probe(struct platform_device *pdev)if (ret) goto remove_sysmon_subdev; + node =of_get_compatible_child (pdev->dev.of_node,"qcom,bam-dmux" ); + qproc->bam_dmux =of_platform_device_create (node,NULL , &pdev->dev); +of_node_put (node); +return 0 ; remove_sysmon_subdev:
@@ -2011,6 +2017,8 @@ static int q6v5_remove(struct platform_device *pdev)struct q6v5 *qproc =platform_get_drvdata (pdev);struct rproc *rproc = qproc->rproc; +if (qproc->bam_dmux) +of_platform_device_destroy (&qproc->bam_dmux->dev,NULL );rproc_del (rproc);qcom_q6v5_deinit (&qproc->q6v5);
Signature · 1 line
2.35.1
PATCH v2 2/2 arm64: dts: qcom: msm8916: Add BAM-DMUX for WWAN network interfaces
In reply to Stephan GerholdThe BAM Data Multiplexer provides access to the network data channels of modems integrated into many older Qualcomm SoCs, including MSM8916.
Add the nodes for the BAM DMA engine and BAM-DMUX to enable using WWAN on smartphones/tablets based on MSM8916. This should work out of the box with open-source WWAN userspace such as ModemManager.
The nodes are disabled by default to avoid loading unnecessary drivers on devices that cannot use BAM-DMUX (e.g. DragonBoard 410c). However, strictly speaking the nodes could be enabled by default since both the bam_dma and bam_dmux driver will simply do nothing if the modem does not announce any BAM-DMUX channels.
---
Changes in v2: None.
--- arch/arm64/boot/dts/qcom/msm8916.dtsi | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
arch/arm64/boot/dts/qcom/msm8916.dtsi +30 -0
@@ -1314,6 +1314,20 @@ spmi_bus: spmi@200f000 { #interrupt-cells = <4>; }; + bam_dmux_dma: dma-controller@4044000 { + compatible = "qcom,bam-v1.7.0"; + reg = <0x04044000 0x19000>; + interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; + #dma-cells = <1>; + qcom,ee = <0>; + + num-channels = <6>; + qcom,num-ees = <1>; + qcom,powered-remotely; + + status = "disabled"; + }; + mpss: remoteproc@4080000 { compatible = "qcom,msm8916-mss-pil", "qcom,q6v5-pil"; reg = <0x04080000 0x100>,
@@ -1357,6 +1371,22 @@ mpss { memory-region = <&mpss_mem>; }; + bam_dmux: bam-dmux { + compatible = "qcom,bam-dmux"; + + interrupt-parent = <&hexagon_smsm>; + interrupts = <1 IRQ_TYPE_EDGE_BOTH>, <11 IRQ_TYPE_EDGE_BOTH>; + interrupt-names = "pc", "pc-ack"; + + qcom,smem-states = <&apps_smsm 1>, <&apps_smsm 11>; + qcom,smem-state-names = "pc", "pc-ack"; + + dmas = <&bam_dmux_dma 4>, <&bam_dmux_dma 5>; + dma-names = "tx", "rx"; + + status = "disabled"; + }; + smd-edge { interrupts = <GIC_SPI 25 IRQ_TYPE_EDGE_RISING>;
Signature · 1 line
2.35.1