summaryrefslogtreecommitdiffstats
path: root/drivers/hwspinlock/qcom_hwspinlock.c
Commit message (Collapse)AuthorAgeFilesLines
* hwspinlock: qcom: Remove IPQ6018 SOC specific compatibleVignesh Viswanathan2023-12-071-1/+0
| | | | | | | | | | | | | | | | IPQ6018 has 32 tcsr_mutex hwlock registers with stride 0x1000. The compatible string qcom,ipq6018-tcsr-mutex is mapped to of_msm8226_tcsr_mutex which has 32 locks configured with stride of 0x80 and doesn't match the HW present in IPQ6018. Remove IPQ6018 specific compatible string so that it fallsback to of_tcsr_mutex data which maps to the correct configuration for IPQ6018. Fixes: 5d4753f741d8 ("hwspinlock: qcom: add support for MMIO on older SoCs") Signed-off-by: Vignesh Viswanathan <quic_viswanat@quicinc.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230905095535.1263113-3-quic_viswanat@quicinc.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
* hwspinlock: qcom: add missing regmap config for SFPB MMIO implementationChristian Marangi2023-07-171-0/+9
| | | | | | | | | | | | | | | | | | | | | Commit 5d4753f741d8 ("hwspinlock: qcom: add support for MMIO on older SoCs") introduced and made regmap_config mandatory in the of_data struct but didn't add the regmap_config for sfpb based devices. SFPB based devices can both use the legacy syscon way to probe or the new MMIO way and currently device that use the MMIO way are broken as they lack the definition of the now required regmap_config and always return -EINVAL (and indirectly makes fail probing everything that depends on it, smem, nandc with smem-parser...) Fix this by correctly adding the missing regmap_config and restore function of hwspinlock on SFPB based devices with MMIO implementation. Cc: stable@vger.kernel.org Fixes: 5d4753f741d8 ("hwspinlock: qcom: add support for MMIO on older SoCs") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://lore.kernel.org/r/20230716022804.21239-1-ansuelsmth@gmail.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
* hwspinlock: add a check of devm_regmap_field_alloc in qcom_hwspinlock_probeKang Chen2023-07-151-0/+2
| | | | | | | | | devm_regmap_field_alloc may fails, priv field might be error pointer and cause illegal address access later. Signed-off-by: Kang Chen <void0red@gmail.com> Link: https://lore.kernel.org/r/20230227004116.1273988-1-void0red@gmail.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
* hwspinlock: qcom: add support for MMIO on older SoCsKrzysztof Kozlowski2022-09-131-10/+32
| | | | | | | | | Older Qualcomm SoCs have TCSR mutex registers with 0x80 stride, instead of 0x1000. Add dedicated compatibles and regmap for such case. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20220909092035.223915-5-krzysztof.kozlowski@linaro.org
* hwspinlock: qcom: correct MMIO max register for newer SoCsKrzysztof Kozlowski2022-09-131-1/+1
| | | | | | | | | | | Newer ARMv8 Qualcomm SoCs using 0x1000 register stride have maximum register 0x20000 (32 mutexes * 0x1000). Fixes: 7a1e6fb1c606 ("hwspinlock: qcom: Allow mmio usage in addition to syscon") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20220909092035.223915-4-krzysztof.kozlowski@linaro.org
* hwspinlock: qcom: Add support for mmio usage to sfpb-mutexChristian Marangi2022-07-161-5/+23
| | | | | | | | | Allow sfpb-mutex to use mmio in addition to syscon. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20220707102040.1859-1-ansuelsmth@gmail.com
* hwspinlock: qcom: Allow mmio usage in addition to sysconBjorn Andersson2020-07-131-16/+54
| | | | | | | | | | | | | | | | In modern Qualcomm platforms the mutex region of the TCSR is forked off into its own block, all with a offset of 0 and stride of 4096, and in some of these platforms no other registers in this region is accessed from Linux. So add support for directly memory mapping this register space, to avoid the need to represent this block using a syscon. Reviewed-by: Baolin Wang <baolin.wang7@gmail.com> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20200622075956.171058-4-bjorn.andersson@linaro.org Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* hwspinlock: qcom: Use devm_hwspin_lock_register() to register hwlock controllerBaolin Wang2020-01-211-17/+2
| | | | | | | | | Use devm_hwspin_lock_register() to register the hwlock controller instead of unregistering the hwlock controller explicitly when removing the device. Signed-off-by: Baolin Wang <baolin.wang7@gmail.com> Link: https://lore.kernel.org/r/d69ad8611a68b0cac3c927d19901f3c113c5435c.1578452735.git.baolin.wang7@gmail.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* hwspinlock: qcom: Remove redundant PM runtime functionsBaolin Wang2020-01-211-11/+2
| | | | | | | | | | Since the hwspinlock core has changed the PM runtime to be optional, and the Qualcomm hardware spinlock has no pm runtime requirement, thus remove these redundant PM runtime functions. Signed-off-by: Baolin Wang <baolin.wang7@gmail.com> Link: https://lore.kernel.org/r/e0bb751feb7af709f92e52a07d0e8ebcf1ee44ff.1578452735.git.baolin.wang7@gmail.com Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* hwspinlock: qcom: Switch to SPDX license identifierSuman Anna2018-05-241-9/+1
| | | | | | | | Use the appropriate SPDX license identifier in the Qualcomm Hwspinlock driver source file and drop the previous boilerplate license text. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* hwspinlock: qcom_hwspinlock: add missing of_node_put after calling ↵Peter Chen2016-07-061-0/+1
| | | | | | | | | | | | of_parse_phandle of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. Cc: linux-arm-kernel@lists.infradead.org Cc: linux-arm-msm@vger.kernel.org Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
* hwspinlock: qcom: Correct msb in regmap_fieldBjorn Andersson2015-07-011-1/+1
| | | | | | | | | msb of the regmap_field was mistakenly given the value 32, to set all bits in the regmap update mask; although incorrect this worked until 921cc294, where the mask calculation was corrected. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
* hwspinlock: qcom: Add support for Qualcomm HW Mutex blockBjorn Andersson2015-05-021-0/+181
Add driver for Qualcomm Hardware Mutex block found in many Qualcomm SoCs. Based on initial effort by Kumar Gala <galak@codeaurora.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Reviewed-by: Andy Gross <agross@codeaurora.org> Reviewed-by: Jeffrey Hugo <jhugo@codeaurora.org> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>