Message ID | 20230526192210.3146896-1-bhupesh.sharma@linaro.org |
---|---|
Headers | show |
Series | arm64: qcom: Enable Crypto Engine for a few Qualcomm SoCs | expand |
On 26.05.2023 21:22, Bhupesh Sharma wrote: > Add crypto engine (CE) and CE BAM related nodes and definitions to > 'sm6115.dtsi'. > > Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> > Tested-by: Konrad Dybcio <konrad.dybcio@linaro.org> > Tested-by: Anders Roxell <anders.roxell@linaro.org> > Tested-by: Linux Kernel Functional Testing <lkft@linaro.org> > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> > --- > arch/arm64/boot/dts/qcom/sm6115.dtsi | 31 ++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/sm6115.dtsi b/arch/arm64/boot/dts/qcom/sm6115.dtsi > index 43f31c1b9d5a..2aa148340277 100644 > --- a/arch/arm64/boot/dts/qcom/sm6115.dtsi > +++ b/arch/arm64/boot/dts/qcom/sm6115.dtsi > @@ -663,6 +663,37 @@ usb_hsphy: phy@1613000 { > status = "disabled"; > }; > > + cryptobam: dma-controller@1b04000 { > + compatible = "qcom,bam-v1.7.4", "qcom,bam-v1.7.0"; > + reg = <0x0 0x01b04000 0x0 0x24000>; > + interrupts = <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&rpmcc RPM_SMD_CE1_CLK>; > + clock-names = "bam_clk"; > + #dma-cells = <1>; > + qcom,ee = <0>; > + qcom,controlled-remotely; > + iommus = <&apps_smmu 0x92 0>, > + <&apps_smmu 0x94 0x11>, > + <&apps_smmu 0x96 0x11>, > + <&apps_smmu 0x98 0x1>, > + <&apps_smmu 0x9F 0>; > + }; > + > + crypto: crypto@1b3a000 { > + compatible = "qcom,sm6115-qce", "qcom,ipq4019-qce", "qcom,qce"; > + reg = <0x0 0x01b3a000 0x0 0x6000>; > + clocks = <&rpmcc RPM_SMD_CE1_CLK>; > + clock-names = "core"; > + > + dmas = <&cryptobam 6>, <&cryptobam 7>; > + dma-names = "rx", "tx"; > + iommus = <&apps_smmu 0x92 0>, > + <&apps_smmu 0x94 0x11>, > + <&apps_smmu 0x96 0x11>, > + <&apps_smmu 0x98 0x1>, > + <&apps_smmu 0x9F 0>; Nit: masks should be hex (0 -> 0x0) and the 0x9F could be lowercase Konrad > + }; > + > qfprom@1b40000 { > compatible = "qcom,sm6115-qfprom", "qcom,qfprom"; > reg = <0x0 0x01b40000 0x0 0x7000>;
On 26.05.2023 21:22, Bhupesh Sharma wrote: > From: Neil Armstrong <neil.armstrong@linaro.org> > > Add crypto engine (CE) and CE BAM related nodes and definitions > for the SM8450 SoC. > > Tested-by: Anders Roxell <anders.roxell@linaro.org> > Tested-by: Linux Kernel Functional Testing <lkft@linaro.org> > Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org> > [Bhupesh: Corrected the compatible list] > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> > --- > arch/arm64/boot/dts/qcom/sm8450.dtsi | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi > index 7f193802a7c4..1642daea9624 100644 > --- a/arch/arm64/boot/dts/qcom/sm8450.dtsi > +++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi > @@ -4173,6 +4173,34 @@ ufs_mem_phy_lanes: phy@1d87400 { > }; > }; > > + cryptobam: dma-controller@1dc4000 { > + compatible = "qcom,bam-v1.7.4", "qcom,bam-v1.7.0"; > + reg = <0 0x01dc4000 0 0x28000>; > + interrupts = <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>; > + #dma-cells = <1>; > + qcom,ee = <0>; > + qcom,controlled-remotely; > + iommus = <&apps_smmu 0x584 0x11>, > + <&apps_smmu 0x588 0x0>, > + <&apps_smmu 0x598 0x5>, Does mapping 0x598 with and without the SMR mask make sense? (this is a genuine question, I have no idea but would be leaning on the side of no) Konrad > + <&apps_smmu 0x59a 0x0>, > + <&apps_smmu 0x59f 0x0>; > + }; > + > + crypto: crypto@1de0000 { > + compatible = "qcom,sm8450-qce", "qcom,sm8150-qce", "qcom,qce"; > + reg = <0 0x01dfa000 0 0x6000>; > + dmas = <&cryptobam 4>, <&cryptobam 5>; > + dma-names = "rx", "tx"; > + iommus = <&apps_smmu 0x584 0x11>, > + <&apps_smmu 0x588 0x0>, > + <&apps_smmu 0x598 0x5>, > + <&apps_smmu 0x59a 0x0>, > + <&apps_smmu 0x59f 0x0>; > + interconnects = <&aggre2_noc MASTER_CRYPTO 0 &mc_virt SLAVE_EBI1 0>; > + interconnect-names = "memory"; > + }; > + > sdhc_2: mmc@8804000 { > compatible = "qcom,sm8450-sdhci", "qcom,sdhci-msm-v5"; > reg = <0 0x08804000 0 0x1000>;
On Sat, 27 May 2023 00:51:59 +0530, Bhupesh Sharma wrote: > Changes since v7: > ----------------- > - v7 can be viewed here: https://lore.kernel.org/linux-arm-msm/20230519214813.2593271-1-bhupesh.sharma@linaro.org/ > - Addressed Stephan's comment about RPM clocks for sm6115 crypto block in dtsi. > - Also fixed the iommu context ids for sm6115 crypto block in dtsi. > > Changes since v6: > ----------------- > - v6 can be viewed here: https://lore.kernel.org/linux-arm-msm/20230405072836.1690248-1-bhupesh.sharma@linaro.org/ > - Collected Acks, R-Bs and Tested-by for various patches. > - Addressed Konrad's comment about iommu sids for sm8150 and sm8250 > crypto node entries. > - Addressed Konrad's and Stephan's comments about adding RPM clock for > crypto blocks on qcm2290 and sm6115. > > [...] Applied, thanks! [03/11] arm64: dts: qcom: sdm8550: Fix the BAM DMA engine compatible string commit: 31dfb8014f6bbebf06ca5084a072f755d8dd9797 [04/11] arm64: dts: qcom: sdm845: Fix the slimbam DMA engine compatible string commit: 20bf3ac438fd2f6f9a98bc5cbddb5024cd31560f [07/11] arm64: dts: qcom: sm6115: Add Crypto Engine support commit: 61baef687d81ffda97ac26db8f100b5b27069477 [08/11] arm64: dts: qcom: sm8150: Add Crypto Engine support commit: f7f485f3dc09d21c58f46756a7e6463c29a0f85b [09/11] arm64: dts: qcom: sm8250: Add Crypto Engine support commit: c58be6c87f482b6bdba804ee0a2d7b588e6a2d6a [10/11] arm64: dts: qcom: sm8350: Add Crypto Engine support commit: f1040a7fe8f069d2259ab3dab9190210005ceb33 [11/11] arm64: dts: qcom: sm8450: add crypto nodes commit: b92b0d2f75820540182e4edf9b57ead7ef344d45 Best regards,
On 26/05/2023 21:22, Bhupesh Sharma wrote: > Add crypto engine (CE) and CE BAM related nodes and definitions to > 'sm8350.dtsi'. > > Tested-by: Anders Roxell <anders.roxell@linaro.org> > Tested-by: Linux Kernel Functional Testing <lkft@linaro.org> > Co-developed-by and Signed-off-by: Robert Foss <rfoss@kernel.org> > [Bhupesh: Switch to '#interconnect-cells = <2>', available since commit 4f287e31ff5f] > Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> > --- #regzbot introduced: f1040a7fe8f069d2259ab3dab9190210005ceb33 #regzbot title: HDK8350 silently crashes early on boot Hi, this landed in the next but unfortunately it causes silent crash (and reboot) of HDK8350. Reverting this commit helps. Log is more or less like: [ 1.359340] Bluetooth: HCI UART driver ver 2.3 [ 1.363929] Bluetooth: HCI UART protocol H4 registered [ 1.369243] Bluetooth: HCI UART protocol LL registered [ 1.374639] Bluetooth: HCI UART protocol Broadcom registered [ 1.380476] Bluetooth: HCI UART protocol QCA registered [ 1.385868] Bluetooth: HCI UART protocol Marvell registered [ 1.391623] usbcore: registered new interface driver btusb [ 1.397273] ghes_edac: GHES probing device list is empty [ 1.400305] sdhci: Secure Digital Host Controller Interface driver [ 1.412124] sdhci: Copyright(c) Pierre Ossman [ 1.417494] Synopsys Designware Multimedia Card Interface Driver [ 1.424823] sdhci-pltfm: SDHCI platform and OF driver helper [ 1.433783] ledtrig-cpu: registered to indicate activity on CPUs [ 1.442236] usbcore: registered new interface driver usbhid [ 1.447982] usbhid: USB HID core driver [ 1.457065] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 counters available [ 1.473760] NET: Registered PF_PACKET protocol family [ 1.479044] 9pnet: Installing 9P2000 support [ 1.483491] Key type dns_resolver registered [ 1.496583] registered taskstats version 1 [ 1.500951] Loading compiled-in X.509 certificates [ 1.519456] platform 18200000.rsc:regulators-0: Fixed dependency cycle(s) with /soc@0/rsc@18200000/regulators-0/smps11 [ 1.530916] platform 18200000.rsc:regulators-1: Fixed dependency cycle(s) with /soc@0/rsc@18200000/regulators-0/smps12 [ 1.541906] platform 18200000.rsc:regulators-1: Fixed dependency cycle(s) with /soc@0/rsc@18200000/regulators-1/bob [ 1.552625] platform 18200000.rsc:regulators-1: Fixed dependency cycle(s) with /soc@0/rsc@18200000/regulators-1/smps1 [ 1.563730] vreg_s10b_1p8: Setting 1800000-1800000uV [ 1.564861] vreg_s1c_1p86: Setting 1856000-1880000uV [ 1.569411] vreg_s11b_0p95: Setting 952000-952000uV [ 1.574304] vreg_bob: Setting 3008000-3960000uV [ 1.576918] bam-dFormat: Log Type - Time(microsec) - Message - Optional Info Log Type: B - Since Boot(Power On Reset), D - Delta, S - Statistic S - QC_IMAGE_VERSION_STRING=BOOT.MXF.1.0-00637.1-LAHAINA-1 S - IMAGE_VARIANT_STRING=SocLahainaLAA S - OEM_IMAGE_VERSION_STRING=crm-ubuntu77 S - Boot Interface: UFS S - Secure Boot: Off defconfig with builtin INTERCONNECT_QCOM_SM8350 and several other options. Can it be that some dependency is missing in linux-next or Bjorn's tree? Shall we revert it? Best regards, Krzysztof
On 16.06.2023 19:36, Krzysztof Kozlowski wrote: > On 26/05/2023 21:22, Bhupesh Sharma wrote: >> Add crypto engine (CE) and CE BAM related nodes and definitions to >> 'sm8350.dtsi'. >> >> Tested-by: Anders Roxell <anders.roxell@linaro.org> >> Tested-by: Linux Kernel Functional Testing <lkft@linaro.org> >> Co-developed-by and Signed-off-by: Robert Foss <rfoss@kernel.org> >> [Bhupesh: Switch to '#interconnect-cells = <2>', available since commit 4f287e31ff5f] >> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> >> --- > > #regzbot introduced: f1040a7fe8f069d2259ab3dab9190210005ceb33 > #regzbot title: HDK8350 silently crashes early on boot > > Hi, this landed in the next but unfortunately it causes silent crash > (and reboot) of HDK8350. Reverting this commit helps. Downstream also references the following SIDs: iommus = <&apps_smmu 0x592 0>, <&apps_smmu 0x598 0>, <&apps_smmu 0x599 0>, <&apps_smmu 0x59F 0>; that might be the culprit Konrad > > Log is more or less like: > > [ 1.359340] Bluetooth: HCI UART driver ver 2.3 > [ 1.363929] Bluetooth: HCI UART protocol H4 registered > [ 1.369243] Bluetooth: HCI UART protocol LL registered > [ 1.374639] Bluetooth: HCI UART protocol Broadcom registered > [ 1.380476] Bluetooth: HCI UART protocol QCA registered > [ 1.385868] Bluetooth: HCI UART protocol Marvell registered > [ 1.391623] usbcore: registered new interface driver btusb > [ 1.397273] ghes_edac: GHES probing device list is empty > [ 1.400305] sdhci: Secure Digital Host Controller Interface driver > [ 1.412124] sdhci: Copyright(c) Pierre Ossman > [ 1.417494] Synopsys Designware Multimedia Card Interface Driver > [ 1.424823] sdhci-pltfm: SDHCI platform and OF driver helper > [ 1.433783] ledtrig-cpu: registered to indicate activity on CPUs > [ 1.442236] usbcore: registered new interface driver usbhid > [ 1.447982] usbhid: USB HID core driver > [ 1.457065] hw perfevents: enabled with armv8_pmuv3 PMU driver, 7 > counters available > [ 1.473760] NET: Registered PF_PACKET protocol family > [ 1.479044] 9pnet: Installing 9P2000 support > [ 1.483491] Key type dns_resolver registered > [ 1.496583] registered taskstats version 1 > [ 1.500951] Loading compiled-in X.509 certificates > [ 1.519456] platform 18200000.rsc:regulators-0: Fixed dependency > cycle(s) with /soc@0/rsc@18200000/regulators-0/smps11 > [ 1.530916] platform 18200000.rsc:regulators-1: Fixed dependency > cycle(s) with /soc@0/rsc@18200000/regulators-0/smps12 > [ 1.541906] platform 18200000.rsc:regulators-1: Fixed dependency > cycle(s) with /soc@0/rsc@18200000/regulators-1/bob > [ 1.552625] platform 18200000.rsc:regulators-1: Fixed dependency > cycle(s) with /soc@0/rsc@18200000/regulators-1/smps1 > [ 1.563730] vreg_s10b_1p8: Setting 1800000-1800000uV > [ 1.564861] vreg_s1c_1p86: Setting 1856000-1880000uV > [ 1.569411] vreg_s11b_0p95: Setting 952000-952000uV > [ 1.574304] vreg_bob: Setting 3008000-3960000uV > [ 1.576918] bam-dFormat: Log Type - Time(microsec) - Message - > Optional Info > Log Type: B - Since Boot(Power On Reset), D - Delta, S - Statistic > S - QC_IMAGE_VERSION_STRING=BOOT.MXF.1.0-00637.1-LAHAINA-1 > S - IMAGE_VARIANT_STRING=SocLahainaLAA > S - OEM_IMAGE_VERSION_STRING=crm-ubuntu77 > S - Boot Interface: UFS > S - Secure Boot: Off > > defconfig with builtin INTERCONNECT_QCOM_SM8350 and several other options. > > Can it be that some dependency is missing in linux-next or Bjorn's tree? > Shall we revert it? > > Best regards, > Krzysztof >
On 17/06/2023 01:33, Konrad Dybcio wrote: > On 16.06.2023 19:36, Krzysztof Kozlowski wrote: >> On 26/05/2023 21:22, Bhupesh Sharma wrote: >>> Add crypto engine (CE) and CE BAM related nodes and definitions to >>> 'sm8350.dtsi'. >>> >>> Tested-by: Anders Roxell <anders.roxell@linaro.org> >>> Tested-by: Linux Kernel Functional Testing <lkft@linaro.org> >>> Co-developed-by and Signed-off-by: Robert Foss <rfoss@kernel.org> >>> [Bhupesh: Switch to '#interconnect-cells = <2>', available since commit 4f287e31ff5f] >>> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> >>> --- >> >> #regzbot introduced: f1040a7fe8f069d2259ab3dab9190210005ceb33 >> #regzbot title: HDK8350 silently crashes early on boot >> >> Hi, this landed in the next but unfortunately it causes silent crash >> (and reboot) of HDK8350. Reverting this commit helps. > Downstream also references the following SIDs: > > iommus = <&apps_smmu 0x592 0>, > <&apps_smmu 0x598 0>, > <&apps_smmu 0x599 0>, > <&apps_smmu 0x59F 0>; I already tried iommus from downstream from: 1. qcrypto node (0x584, 0x594) 2. qcedev (0x586, 0x596) 3. qcom_cedev_ns_cb (0x592, 0x598, 0x599, 0x59F), although with 0x0011 last argument. Same results, but indeed iommu would be nice reason here. I also double checked the version of block (BAM DMA is v1.7.4) and other properties. When I disabled crypto but left BAM DMA, the result was the same, thus it is maybe the BAM who causes abort. Best regards, Krzysztof
On Sat, 17 Jun 2023 at 12:58, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 17/06/2023 01:33, Konrad Dybcio wrote: > > On 16.06.2023 19:36, Krzysztof Kozlowski wrote: > >> On 26/05/2023 21:22, Bhupesh Sharma wrote: > >>> Add crypto engine (CE) and CE BAM related nodes and definitions to > >>> 'sm8350.dtsi'. > >>> > >>> Tested-by: Anders Roxell <anders.roxell@linaro.org> > >>> Tested-by: Linux Kernel Functional Testing <lkft@linaro.org> > >>> Co-developed-by and Signed-off-by: Robert Foss <rfoss@kernel.org> > >>> [Bhupesh: Switch to '#interconnect-cells = <2>', available since commit 4f287e31ff5f] > >>> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> > >>> --- > >> > >> #regzbot introduced: f1040a7fe8f069d2259ab3dab9190210005ceb33 > >> #regzbot title: HDK8350 silently crashes early on boot > >> > >> Hi, this landed in the next but unfortunately it causes silent crash > >> (and reboot) of HDK8350. Reverting this commit helps. > > Downstream also references the following SIDs: > > > > iommus = <&apps_smmu 0x592 0>, > > <&apps_smmu 0x598 0>, > > <&apps_smmu 0x599 0>, > > <&apps_smmu 0x59F 0>; > > I already tried iommus from downstream from: > 1. qcrypto node (0x584, 0x594) > 2. qcedev (0x586, 0x596) > 3. qcom_cedev_ns_cb (0x592, 0x598, 0x599, 0x59F), although with 0x0011 > last argument. > > Same results, but indeed iommu would be nice reason here. > > I also double checked the version of block (BAM DMA is v1.7.4) and other > properties. When I disabled crypto but left BAM DMA, the result was the > same, thus it is maybe the BAM who causes abort. I remember testing it on the sm8350-mtp and found no issues. Infact Robert (the original author of the patch) had also done some testing in the past. I am sure - mtp v/s hdk board variation would not cause this, so let me have a stab at it tomorrow. Thanks, Bhupesh
[TLDR: This mail in primarily relevant for Linux kernel regression tracking. See link in footer if these mails annoy you.] On 16.06.23 19:36, Krzysztof Kozlowski wrote: > On 26/05/2023 21:22, Bhupesh Sharma wrote: >> Add crypto engine (CE) and CE BAM related nodes and definitions to >> 'sm8350.dtsi'. >> >> Tested-by: Anders Roxell <anders.roxell@linaro.org> >> Tested-by: Linux Kernel Functional Testing <lkft@linaro.org> >> Co-developed-by and Signed-off-by: Robert Foss <rfoss@kernel.org> >> [Bhupesh: Switch to '#interconnect-cells = <2>', available since commit 4f287e31ff5f] >> Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org> >> --- > > #regzbot introduced: f1040a7fe8f069d2259ab3dab9190210005ceb33 > #regzbot title: HDK8350 silently crashes early on boot > > Hi, this landed in the next but unfortunately it causes silent crash > (and reboot) of HDK8350. Reverting this commit helps. #regzbot fix: arm64: dts: qcom: sm8350: fix BAM DMA crash and reboot #regzbot monitor: https://lore.kernel.org/all/20230621143627.189134-1-krzysztof.kozlowski@linaro.org/ #regzbot ignore-activity Ciao, Thorsten (wearing his 'the Linux kernel's regression tracker' hat) -- Everything you wanna know about Linux kernel regression tracking: https://linux-regtracking.leemhuis.info/about/#tldr That page also explains what to do if mails like this annoy you.