Add ipq6018 apcs mailbox driver
cover Add ipq6018 apcs mailbox driver
The ipq6018 devices has apcs block for ipc interrupts, this block also provides a clock controller which provides cpu clocks.
This series adds support for the apcs block found in ipq6018 devices.
This series was originally part of ipq6018 apss clock controller series
https://lkml.org/lkml/2020/5/27/637
The patch 4 has dtb dependency with apss pll driver which can be found in
https://lkml.org/lkml/2020/5/27/637
Sivaprakash Murugesan (4):
dt-bindings: mailbox: Add YAML schemas for QCOM APCS global block
dt-bindings: mailbox: Add dt-bindings for ipq6018 apcs global block
mailbox: qcom: Add ipq6018 apcs compatible
arm64: dts: ipq6018: Add support for apcs clk
.../bindings/mailbox/qcom,apcs-kpss-global.txt | 88 ------------------- .../bindings/mailbox/qcom,apcs-kpss-global.yaml | 99 ++++++++++++++++++++++ arch/arm64/boot/dts/qcom/ipq6018.dtsi | 8 +- drivers/mailbox/qcom-apcs-ipc-mailbox.c | 23 +++-- 4 files changed, 118 insertions(+), 100 deletions(-) delete mode 100644 Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt create mode 100644 Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
Signature · 1 line
2.7.4
PATCH 1/4 dt-bindings: mailbox: Add YAML schemas for QCOM APCS global block
Qualcomm APCS global block provides a bunch of generic properties which are required in a device tree. Add YAML schema for these properties.
--- .../bindings/mailbox/qcom,apcs-kpss-global.txt | 88 ---------------------- .../bindings/mailbox/qcom,apcs-kpss-global.yaml | 86 +++++++++++++++++++++ 2 files changed, 86 insertions(+), 88 deletions(-) delete mode 100644 Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt create mode 100644 Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.txt deleted +0 -88
@@ -1,88 +0,0 @@ -Binding for the Qualcomm APCS global block -========================================== - -This binding describes the APCS "global" block found in various Qualcomm -platforms. - -- compatible: - Usage: required - Value type: <string> - Definition: must be one of: - "qcom,msm8916-apcs-kpss-global", - "qcom,msm8996-apcs-hmss-global" - "qcom,msm8998-apcs-hmss-global" - "qcom,qcs404-apcs-apps-global" - "qcom,sc7180-apss-shared" - "qcom,sdm845-apss-shared" - "qcom,sm8150-apss-shared" - "qcom,ipq8074-apcs-apps-global" - -- reg: - Usage: required - Value type: <prop-encoded-array> - Definition: must specify the base address and size of the global block - -- clocks: - Usage: required if #clock-names property is present - Value type: <phandle array> - Definition: phandles to the two parent clocks of the clock driver. - -- #mbox-cells: - Usage: required - Value type: <u32> - Definition: as described in mailbox.txt, must be 1 - -- #clock-cells: - Usage: optional - Value type: <u32> - Definition: as described in clock.txt, must be 0 - -- clock-names: - Usage: required if the platform data based clock driver needs to - retrieve the parent clock names from device tree. - This will requires two mandatory clocks to be defined. - Value type: <string-array> - Definition: must be "pll" and "aux" - -= EXAMPLE -The following example describes the APCS HMSS found in MSM8996 and part of the -GLINK RPM referencing the "rpm_hlos" doorbell therein. - - apcs_glb: mailbox@9820000 { - compatible = "qcom,msm8996-apcs-hmss-global"; - reg = <0x9820000 0x1000>; - - #mbox-cells = <1>; - }; - - rpm-glink { - compatible = "qcom,glink-rpm"; - - interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>; - - qcom,rpm-msg-ram = <&rpm_msg_ram>; - - mboxes = <&apcs_glb 0>; - mbox-names = "rpm_hlos"; - }; - -Below is another example of the APCS binding on MSM8916 platforms: - - apcs: mailbox@b011000 { - compatible = "qcom,msm8916-apcs-kpss-global"; - reg = <0xb011000 0x1000>; - #mbox-cells = <1>; - clocks = <&a53pll>; - #clock-cells = <0>; - }; - -Below is another example of the APCS binding on QCS404 platforms: - - apcs_glb: mailbox@b011000 { - compatible = "qcom,qcs404-apcs-apps-global", "syscon"; - reg = <0x0b011000 0x1000>; - #mbox-cells = <1>; - clocks = <&apcs_hfpll>, <&gcc GCC_GPLL0_AO_OUT_MAIN>; - clock-names = "pll", "aux"; - #clock-cells = <0>; - };
Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml new file +86 -0
86 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 2/4 dt-bindings: mailbox: Add dt-bindings for ipq6018 apcs global block
In reply to Sivaprakash MurugesanAdd dt-bindings for ipq6018 mailbox driver
--- .../bindings/mailbox/qcom,apcs-kpss-global.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml +15 -2
@@ -16,6 +16,7 @@ maintainers: properties: compatible: enum: + - qcom,ipq6018-apcs-apps-global - qcom,ipq8074-apcs-apps-global - qcom,msm8916-apcs-kpss-global - qcom,msm8996-apcs-hmss-global
@@ -38,12 +39,12 @@ properties: const: 1 '#clock-cells': - const: 0 + enum: [ 0, 1 ] clock-names: items: - const: pll - - const: aux + - enum: [ aux, xo ] required: - compatible
@@ -84,3 +85,15 @@ examples: clock-names = "pll", "aux"; #clock-cells = <0>; }; + + # Example apcs with ipq6018 + - | + #include "dt-bindings/clock/qcom,apss-ipq.h" + apcs_ipq: mailbox@b111000 { + compatible = "qcom,ipq6018-apcs-apps-global"; + reg = <0x0b111000 0x1000>; + #clock-cells = <1>; + clocks = <&a53pll>, <&xo>; + clock-names = "pll", "xo"; + #mbox-cells = <1>; + };
Signature · 1 line
2.7.4
PATCH 3/4 mailbox: qcom: Add ipq6018 apcs compatible
In reply to Sivaprakash MurugesanThe Qualcomm ipq6018 has apcs block, add compatible for the same. Also, the apcs provides a clock controller functionality similar to msm8916 but the clock driver is different.
Create a child platform device based on the apcs compatible for the clock controller functionality.
--- drivers/mailbox/qcom-apcs-ipc-mailbox.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
drivers/mailbox/qcom-apcs-ipc-mailbox.c +14 -9
@@ -45,6 +45,13 @@ static const struct mbox_chan_ops qcom_apcs_ipc_ops = { .send_data = qcom_apcs_ipc_send_data, }; +static const struct of_device_id apcs_clk_match_table[] = { + { .compatible ="qcom,ipq6018-apcs-apps-global" , .data ="qcom,apss-ipq6018-clk" , }, + { .compatible ="qcom,msm8916-apcs-kpss-global" , .data ="qcom-apcs-msm8916-clk" , }, + { .compatible ="qcom,qcs404-apcs-apps-global" , .data ="qcom-apcs-msm8916-clk" , }, + {} +}; +static int qcom_apcs_ipc_probe (struct platform_device *pdev) {struct qcom_apcs_ipc *apcs;
@@ -54,11 +61,7 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)void __iomem *base;unsigned long i;int ret; -const struct of_device_id apcs_clk_match_table[] = { - { .compatible ="qcom,msm8916-apcs-kpss-global" , }, - { .compatible ="qcom,qcs404-apcs-apps-global" , }, - {} - }; +const struct of_device_id *clk_device; apcs =devm_kzalloc (&pdev->dev,sizeof (*apcs),GFP_KERNEL );if (!apcs)
@@ -93,11 +96,12 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)return ret; } -if (of_match_device (apcs_clk_match_table, &pdev->dev)) { + clk_device =of_match_device (apcs_clk_match_table, &pdev->dev); +if (clk_device) { apcs->clk =platform_device_register_data (&pdev->dev, -"qcom-apcs-msm8916-clk" , -PLATFORM_DEVID_NONE , -NULL ,0 ); + clk_device->data, +PLATFORM_DEVID_NONE , +NULL ,0 );if (IS_ERR (apcs->clk))dev_err (&pdev->dev,"failed to register APCS clk\n" ); }
@@ -126,6 +130,7 @@ static const struct of_device_id qcom_apcs_ipc_of_match[] = { { .compatible = "qcom,sc7180-apss-shared", .data = (void *)12 }, { .compatible = "qcom,sdm845-apss-shared", .data = (void *)12 }, { .compatible = "qcom,sm8150-apss-shared", .data = (void *)12 }, + { .compatible = "qcom,ipq6018-apcs-apps-global", .data = (void *)8 }, { .compatible = "qcom,ipq8074-apcs-apps-global", .data = (void *)8 }, {} };
Signature · 1 line
2.7.4
kbuild test robot
build botRe: [PATCH 3/4] mailbox: qcom: Add ipq6018 apcs compatible
Thank you for the patch! Perhaps something to improve:
Hi Sivaprakash,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v5.7-rc7 next-20200528] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Sivaprakash-Murugesan/Add-ipq6018-apcs-mailbox-driver/20200527-204025 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: x86_64-randconfig-a004-20200528 (attached as .config) compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 2d068e534f1671459e1b135852c1b3c10502e929)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/mailbox/qcom-apcs-ipc-mailbox.c:48:34: warning: unused variable 'apcs_clk_match_table' [-Wunused-const-variable]
static const struct of_device_id apcs_clk_match_table[] = { ^
1 warning generated.
vim +/apcs_clk_match_table +48 drivers/mailbox/qcom-apcs-ipc-mailbox.c
47
> 48 static const struct of_device_id apcs_clk_match_table[] = {
49 { .compatible = "qcom,ipq6018-apcs-apps-global", .data = "qcom,apss-ipq6018-clk", },
50 { .compatible = "qcom,msm8916-apcs-kpss-global", .data = "qcom-apcs-msm8916-clk", },
51 { .compatible = "qcom,qcs404-apcs-apps-global", .data = "qcom-apcs-msm8916-clk", },
52 {}
53 };
54 ---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
Re: [PATCH 3/4] mailbox: qcom: Add ipq6018 apcs compatible
In reply to Sivaprakash MurugesanQuoted 44 lines · Sivaprakash Murugesan
The Qualcomm ipq6018 has apcs block, add compatible for the same. Also, the apcs provides a clock controller functionality similar to msm8916 but the clock driver is different.
Create a child platform device based on the apcs compatible for the clock controller functionality.
Signed-off-by Sivaprakash Murugesan <[email protected]>--- drivers/mailbox/qcom-apcs-ipc-mailbox.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)drivers/mailbox/qcom-apcs-ipc-mailbox.c +8
-5@@ -45,6 +45,13 @@ static const struct mbox_chan_ops qcom_apcs_ipc_ops = { .send_data = qcom_apcs_ipc_send_data, }; +static const struct of_device_id apcs_clk_match_table[] = { + { .compatible ="qcom,ipq6018-apcs-apps-global" , .data ="qcom,apss-ipq6018-clk" , }, + { .compatible ="qcom,msm8916-apcs-kpss-global" , .data ="qcom-apcs-msm8916-clk" , }, + { .compatible ="qcom,qcs404-apcs-apps-global" , .data ="qcom-apcs-msm8916-clk" , }, + {} +}; +static int qcom_apcs_ipc_probe (struct platform_device *pdev) {struct qcom_apcs_ipc *apcs;@@ -54,11 +61,7 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)void __iomem *base;unsigned long i;int ret; -const struct of_device_id apcs_clk_match_table[] = { - { .compatible ="qcom,msm8916-apcs-kpss-global" , }, - { .compatible ="qcom,qcs404-apcs-apps-global" , }, - {} - }; +const struct of_device_id *clk_device; apcs =devm_kzalloc (&pdev->dev,sizeof (*apcs),GFP_KERNEL );if (!apcs)
drivers/mailbox/qcom-apcs-ipc-mailbox.c static int qcom_apcs_ipc_probe(struct platform_device *pdev) · line 99
Quoted 5 lines
drivers/mailbox/qcom-apcs-ipc-mailbox.c +1
-1@@ -93,11 +96,12 @@ static int qcom_apcs_ipc_probe(struct platform_device *pdev)return ret; } -if (of_match_device (apcs_clk_match_table, &pdev->dev)) { + clk_device =of_match_device (apcs_clk_match_table, &pdev->dev);
I think you should replace the direct integer in qcom_apcs_ipc_of_match with a small struct containing offset and the clock device's name - allowing the latter to be omitted.
That avoids the apcs_clk_match_table being unreferenced when this is compiled without CONFIG_OF and it removes the need for two of_device_id arrays.
Regards,
Bjorn
Quoted 22 lines
drivers/mailbox/qcom-apcs-ipc-mailbox.c +5
-3+if (clk_device) { apcs->clk =platform_device_register_data (&pdev->dev, -"qcom-apcs-msm8916-clk" , -PLATFORM_DEVID_NONE , -NULL ,0 ); + clk_device->data, +PLATFORM_DEVID_NONE , +NULL ,0 );if (IS_ERR (apcs->clk))dev_err (&pdev->dev,"failed to register APCS clk\n" ); }@@ -126,6 +130,7 @@ static const struct of_device_id qcom_apcs_ipc_of_match[] = { { .compatible = "qcom,sc7180-apss-shared", .data = (void *)12 }, { .compatible = "qcom,sdm845-apss-shared", .data = (void *)12 }, { .compatible = "qcom,sm8150-apss-shared", .data = (void *)12 }, + { .compatible = "qcom,ipq6018-apcs-apps-global", .data = (void *)8 }, { .compatible = "qcom,ipq8074-apcs-apps-global", .data = (void *)8 }, {} };Signature · 1 line
2.7.4
PATCH 4/4 arm64: dts: ipq6018: Add support for apcs clk
In reply to Sivaprakash MurugesanThe ipq6018 devices has a clock functionality in apcs blcok. Add support for the clock found in ipq6018 apcs block.
---
* This patch has compilation dependency with apss pll
https://lkml.org/lkml/2020/5/27/642 arch/arm64/boot/dts/qcom/ipq6018.dtsi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/ipq6018.dtsi +5 -3
@@ -294,9 +294,11 @@ }; apcs_glb: mailbox@b111000 { - compatible = "qcom,ipq8074-apcs-apps-global"; - reg = <0x0b111000 0xc>; - + compatible = "qcom,ipq6018-apcs-apps-global"; + reg = <0x0b111000 0x1000>; + #clock-cells = <1>; + clocks = <&apsspll>, <&xo>; + clock-names = "pll", "xo"; #mbox-cells = <1>; };
Signature · 1 line
2.7.4
kernel test robot
build botRe: [PATCH 4/4] arm64: dts: ipq6018: Add support for apcs clk
Thank you for the patch! Yet something to improve:
Hi Sivaprakash,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on robh/for-next]
[also build test ERROR on linus/master v5.7]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Sivaprakash-Murugesan/Add-ipq6018-apcs-mailbox-driver/20200527-204025 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: arm64-randconfig-r016-20200603 (attached as .config) compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 16437992cac249f6fe1efd392d20e3469b47e39e)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
All errors (new ones prefixed by >>, old ones prefixed by <<):
>> ERROR: Input tree has errors, aborting (use -f to force output)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org