Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Memshare service for GPS #158

Merged
merged 15 commits into from Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
109 changes: 109 additions & 0 deletions Documentation/devicetree/bindings/soc/qcom/qcom,memshare.yaml
@@ -0,0 +1,109 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: "http://devicetree.org/schemas/soc/qcom/qcom,memshare.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: Qualcomm QMI Shared Memory Service

description: |
This driver provides a QMI service that allows remote processors (like modem)
to request additional memory. It is used for applications like GPS in modem.

maintainers:
- Nikita Travkin <nikitos.tr@gmail.com>

properties:
compatible:
const: qcom,memshare

qcom,legacy-client:
$ref: /schemas/types.yaml#/definitions/phandle
description: Phandle to a memshare client node used for legacy requests.

"#address-cells":
const: 1

"#size-cells":
const: 0

patternProperties:
"^.*@[0-9]+$":
type: object

properties:
reg:
description: Proc-ID for clients in this node.

qcom,qrtr-node:
$ref: /schemas/types.yaml#/definitions/uint32
description: Node from which the requests are expected.

"#address-cells":
const: 1

"#size-cells":
const: 0

patternProperties:
"^.*@[0-9]+$":
type: object

properties:
reg:
description: ID of this client.

memory-region:
$ref: /schemas/types.yaml#/definitions/phandle
description: |
Reserved memory region that should be used for allocation.

required:
- reg

required:
- reg
- qcom,qrtr-node

required:
- compatible

additionalProperties: false

examples:
- |
#include <dt-bindings/soc/qcom,memshare.h>

reserved-memory {

#address-cells = <2>;
#size-cells = <2>;

gps_mem: gps@93c00000 {
reg = <0x0 0x93c00000 0x0 0x200000>;
no-map;
};
};

memshare {
compatible = "qcom,memshare";
qcom,legacy-client = <&memshare_gps>;

#address-cells = <1>;
#size-cells = <0>;

mpss@0 {
reg = <MEMSHARE_PROC_MPSS_V01>;
qcom,qrtr-node = <0>;

#address-cells = <1>;
#size-cells = <0>;

memshare_gps: gps@0 {
reg = <0>;
memory-region = <&gps_mem>;
};
};
};

...
stephan-gh marked this conversation as resolved.
Show resolved Hide resolved
14 changes: 10 additions & 4 deletions arch/arm/boot/dts/qcom-msm8916-samsung-serranovelte.dts
Expand Up @@ -37,13 +37,19 @@
no-map;
};

wcnss_mem: wcnss@8c200000 {
reg = <0x0 0x8c200000 0x0 0x600000>;
gps_mem: gps@8c200000 {
status = "disabled";
reg = <0x0 0x8c200000 0x0 0x200000>;
no-map;
};

wcnss_mem: wcnss@8c400000 {
reg = <0x0 0x8c400000 0x0 0x600000>;
no-map;
};

venus_mem: venus@8c800000 {
reg = <0x0 0x8c800000 0x0 0x600000>;
venus_mem: venus@8ca00000 {
reg = <0x0 0x8ca00000 0x0 0x600000>;
no-map;
};
};
Expand Down
14 changes: 10 additions & 4 deletions arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts
Expand Up @@ -69,13 +69,19 @@
no-map;
};

wcnss_mem: wcnss@8bd00000 {
reg = <0x0 0x8bd00000 0x0 0x600000>;
gps_mem: gps@8bd00000 {
status = "disabled";
reg = <0x0 0x8bd00000 0x0 0x200000>;
no-map;
};

wcnss_mem: wcnss@8bf00000 {
reg = <0x0 0x8bf00000 0x0 0x600000>;
no-map;
};

venus_mem: venus@8c300000 {
reg = <0x0 0x8c300000 0x0 0x600000>;
venus_mem: venus@8c500000 {
reg = <0x0 0x8c500000 0x0 0x600000>;
no-map;
};
};
Expand Down
14 changes: 10 additions & 4 deletions arch/arm64/boot/dts/qcom/msm8916-asus-z010d.dts
Expand Up @@ -64,13 +64,19 @@
no-map;
};

wcnss_mem: wcnss@8bd00000 {
reg = <0x0 0x8bd00000 0x0 0x600000>;
gps_mem: gps@8bd00000 {
status = "disabled";
reg = <0x0 0x8bd00000 0x0 0x200000>;
no-map;
};

wcnss_mem: wcnss@8bf00000 {
reg = <0x0 0x8bf00000 0x0 0x600000>;
no-map;
};

venus_mem: venus@8c300000 {
reg = <0x0 0x8c300000 0x0 0x600000>;
venus_mem: venus@8c500000 {
reg = <0x0 0x8c500000 0x0 0x600000>;
no-map;
};
};
Expand Down
14 changes: 10 additions & 4 deletions arch/arm64/boot/dts/qcom/msm8916-lg-m216.dts
Expand Up @@ -29,13 +29,19 @@
no-map;
};

wcnss_mem: wcnss@8b200000 {
reg = <0x0 0x8b200000 0x0 0x600000>;
gps_mem: gps@8b200000 {
status = "disabled";
reg = <0x0 0x8b200000 0x0 0x200000>;
no-map;
};

wcnss_mem: wcnss@8b400000 {
reg = <0x0 0x8b400000 0x0 0x600000>;
no-map;
};

venus_mem: venus@8b800000 {
reg = <0x0 0x8b800000 0x0 0x600000>;
venus_mem: venus@8ba00000 {
reg = <0x0 0x8ba00000 0x0 0x600000>;
no-map;
};
};
Expand Down
6 changes: 6 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
Expand Up @@ -55,6 +55,12 @@
reg = <0x0 0x8ec00000 0x0 0x5000000>;
no-map;
};

gps_mem: gps@93c00000 {
status = "disabled";
reg = <0x0 0x93c00000 0x0 0x200000>;
no-map;
};
};

backlight: backlight {
Expand Down
14 changes: 10 additions & 4 deletions arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts
Expand Up @@ -32,13 +32,19 @@
no-map;
};

wcnss_mem: wcnss@8b800000 {
reg = <0x0 0x8b800000 0x0 0x600000>;
gps_mem: gps@8b800000 {
status = "disabled";
reg = <0x0 0x8b800000 0x0 0x200000>;
no-map;
};

wcnss_mem: wcnss@8ba00000 {
reg = <0x0 0x8ba00000 0x0 0x600000>;
no-map;
};

venus_mem: venus@8be00000 {
reg = <0x0 0x8be00000 0x0 0x600000>;
venus_mem: venus@8c000000 {
reg = <0x0 0x8c000000 0x0 0x600000>;
no-map;
};
};
Expand Down
12 changes: 12 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8916-modem.dtsi
Expand Up @@ -15,10 +15,22 @@
status = "okay";
};

&gps_mem {
status = "okay";
};

&lpass {
status = "disabled";
};

&memshare {
status = "okay";
};

&memshare_gps {
memory-region = <&gps_mem>;
};

&mpss {
status = "okay";
};
Expand Down
14 changes: 10 additions & 4 deletions arch/arm64/boot/dts/qcom/msm8916-motorola-harpia.dts
Expand Up @@ -31,13 +31,19 @@
no-map;
};

wcnss_mem: wcnss@8bd00000 {
reg = <0x0 0x8bd00000 0x0 0x600000>;
gps_mem: gps@8bd00000 {
status = "disabled";
reg = <0x0 0x8bd00000 0x0 0x200000>;
no-map;
};

wcnss_mem: wcnss@8bf00000 {
reg = <0x0 0x8bf00000 0x0 0x600000>;
no-map;
};

venus_mem: venus@8c300000 {
reg = <0x0 0x8c300000 0x0 0x600000>;
venus_mem: venus@8c500000 {
reg = <0x0 0x8c500000 0x0 0x600000>;
no-map;
};
};
Expand Down
14 changes: 10 additions & 4 deletions arch/arm64/boot/dts/qcom/msm8916-motorola-osprey.dts
Expand Up @@ -32,13 +32,19 @@
no-map;
};

wcnss_mem: wcnss@8bd00000 {
reg = <0x0 0x8bd00000 0x0 0x600000>;
gps_mem: gps@8bd00000 {
status = "disabled";
reg = <0x0 0x8bd00000 0x0 0x200000>;
no-map;
};

wcnss_mem: wcnss@8bf00000 {
reg = <0x0 0x8bf00000 0x0 0x600000>;
no-map;
};

venus_mem: venus@8c300000 {
reg = <0x0 0x8c300000 0x0 0x600000>;
venus_mem: venus@8c500000 {
reg = <0x0 0x8c500000 0x0 0x600000>;
no-map;
};
};
Expand Down
14 changes: 10 additions & 4 deletions arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
Expand Up @@ -32,13 +32,19 @@
no-map;
};

wcnss_mem: wcnss@8bc00000 {
reg = <0x0 0x8bc00000 0x0 0x600000>;
gps_mem: gps@8bc00000 {
status = "disabled";
reg = <0x0 0x8bc00000 0x0 0x200000>;
stephan-gh marked this conversation as resolved.
Show resolved Hide resolved
no-map;
};

wcnss_mem: wcnss@8be00000 {
reg = <0x0 0x8be00000 0x0 0x600000>;
no-map;
};

venus_mem: venus@8c200000 {
reg = <0x0 0x8c200000 0x0 0x600000>;
venus_mem: venus@8c400000 {
reg = <0x0 0x8c400000 0x0 0x600000>;
no-map;
};
};
Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8916-wingtech-wt86518-modem.dts
@@ -1,3 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "msm8916-wingtech-wt86518.dts"
#include "msm8916-wingtech-wt865x8-modem.dtsi"

&memshare { status = "disabled"; };
&gps_mem { status = "disabled"; };
14 changes: 10 additions & 4 deletions arch/arm64/boot/dts/qcom/msm8916-wingtech-wt865x8.dtsi
Expand Up @@ -25,13 +25,19 @@
no-map;
};

wcnss_mem: wcnss@8bd00000 {
reg = <0x0 0x8bd00000 0x0 0x600000>;
gps_mem: gps@8bd00000 {
status = "disabled";
reg = <0x0 0x8bd00000 0x0 0x200000>;
no-map;
};

wcnss_mem: wcnss@8bf00000 {
reg = <0x0 0x8bf00000 0x0 0x600000>;
no-map;
};

venus_mem: venus@8c300000 {
reg = <0x0 0x8c300000 0x0 0x600000>;
venus_mem: venus@8c500000 {
reg = <0x0 0x8c500000 0x0 0x600000>;
no-map;
};
};
Expand Down
11 changes: 11 additions & 0 deletions arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047-modem.dts
Expand Up @@ -2,6 +2,17 @@
#include "msm8916-wingtech-wt88047.dts"
#include "msm8916-modem.dtsi"

/*
* The modem firmware sends a "query_size" memshare request for client ID 1,
* but basically does not do anything with it. GPS works only if:
* - Memshare is not present or
* - Memshare replies to the request with an error
* Overall it seems pointless to enable memshare for this device.
*/
&memshare {
status = "disabled";
};

&sound {
/delete-node/ dai-link-primary;
/delete-node/ dai-link-tertiary;
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts
Expand Up @@ -26,7 +26,7 @@
/delete-node/ wcnss@89300000;
/delete-node/ venus@89900000;

mpss_mem: mpss@86800000 {
mpss_mem: gps_mem: mpss@86800000 {
status = "disabled";
reg = <0x0 0x86800000 0x0 0x5100000>;
no-map;
Expand Down