* [PATCH v3 0/2] spmi: pmic-arb: Add spmi-pmic-arb support for Qualcomm Hawi SoC
@ 2026-04-20 2:25 Fenglin Wu
2026-04-20 2:25 ` [PATCH v3 1/2] dt-bindings: spmi: glymur-spmi-pmic-arb: Add compatible " Fenglin Wu
2026-04-20 2:25 ` [PATCH v3 2/2] spmi: spmi-pmic-arb: add support for PMIC arbiter v8.5 Fenglin Wu
0 siblings, 2 replies; 5+ messages in thread
From: Fenglin Wu @ 2026-04-20 2:25 UTC (permalink / raw)
To: Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Konrad Dybcio, Dmitry Baryshkov
Cc: Subbaraman Narayanamurthy, David Collins, linux-arm-msm,
linux-kernel, devicetree, kernel, Fenglin Wu
Add compatible for Hawi SoC and add pmic-arb v8.5 support.
Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
---
Changes in v3:
- Updated the driver to include a "*check_chnl_status" hook function in
"pmic_arb_ver_ops," with separate implementations for each version,
as per Dmitry's feedback.
- Remove the Reviewed-by tag.
- Link to v2: https://patch.msgid.link/20260402-hawi-spmi-v2-0-0bbe811fe3f4@oss.qualcomm.com
Changes in v2:
- Revise patch 1 commit text to highlight the new features of the
PMIC arbiter in the Hawi SoC, and clarify how it is compatible
within the Glymur SoC.
- Link to v1: https://patch.msgid.link/20260401-hawi-spmi-v1-0-c40963041078@oss.qualcomm.com
---
Fenglin Wu (2):
dt-bindings: spmi: glymur-spmi-pmic-arb: Add compatible for Qualcomm Hawi SoC
spmi: spmi-pmic-arb: add support for PMIC arbiter v8.5
.../bindings/spmi/qcom,glymur-spmi-pmic-arb.yaml | 1 +
drivers/spmi/spmi-pmic-arb.c | 142 ++++++++++++++++-----
2 files changed, 113 insertions(+), 30 deletions(-)
---
base-commit: 840b0dd6b8c169e963f74265f508c54f1fe3c968
change-id: 20260323-hawi-spmi-a29ef97409a4
Best regards,
--
Fenglin Wu <fenglin.wu@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3 1/2] dt-bindings: spmi: glymur-spmi-pmic-arb: Add compatible for Qualcomm Hawi SoC
2026-04-20 2:25 [PATCH v3 0/2] spmi: pmic-arb: Add spmi-pmic-arb support for Qualcomm Hawi SoC Fenglin Wu
@ 2026-04-20 2:25 ` Fenglin Wu
2026-04-20 14:14 ` Krzysztof Kozlowski
2026-04-20 2:25 ` [PATCH v3 2/2] spmi: spmi-pmic-arb: add support for PMIC arbiter v8.5 Fenglin Wu
1 sibling, 1 reply; 5+ messages in thread
From: Fenglin Wu @ 2026-04-20 2:25 UTC (permalink / raw)
To: Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Konrad Dybcio, Dmitry Baryshkov
Cc: Subbaraman Narayanamurthy, David Collins, linux-arm-msm,
linux-kernel, devicetree, kernel, Fenglin Wu
The PMIC arbiter in the Qualcomm Hawi SoC is version v8.5, which
introduces parity and CRC checks for data received from the PMIC,
as well as NACK checks for command sequences except for read.
All other features in PMIC arbiter remain the same as the one in
the Qualcomm Glymur SoC, with the only differences being some
additional error status checks.
Therefore, add a string for "qcom,hawi-spmi-pmic-arb" as a compatible
entry for "qcom,glymur-spmi-pmic-arb".
Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
---
Documentation/devicetree/bindings/spmi/qcom,glymur-spmi-pmic-arb.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/spmi/qcom,glymur-spmi-pmic-arb.yaml b/Documentation/devicetree/bindings/spmi/qcom,glymur-spmi-pmic-arb.yaml
index 3b5005b96c6d..1593a1183a36 100644
--- a/Documentation/devicetree/bindings/spmi/qcom,glymur-spmi-pmic-arb.yaml
+++ b/Documentation/devicetree/bindings/spmi/qcom,glymur-spmi-pmic-arb.yaml
@@ -25,6 +25,7 @@ properties:
oneOf:
- items:
- enum:
+ - qcom,hawi-spmi-pmic-arb
- qcom,kaanapali-spmi-pmic-arb
- const: qcom,glymur-spmi-pmic-arb
- enum:
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3 2/2] spmi: spmi-pmic-arb: add support for PMIC arbiter v8.5
2026-04-20 2:25 [PATCH v3 0/2] spmi: pmic-arb: Add spmi-pmic-arb support for Qualcomm Hawi SoC Fenglin Wu
2026-04-20 2:25 ` [PATCH v3 1/2] dt-bindings: spmi: glymur-spmi-pmic-arb: Add compatible " Fenglin Wu
@ 2026-04-20 2:25 ` Fenglin Wu
2026-04-20 20:51 ` Dmitry Baryshkov
1 sibling, 1 reply; 5+ messages in thread
From: Fenglin Wu @ 2026-04-20 2:25 UTC (permalink / raw)
To: Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Konrad Dybcio, Dmitry Baryshkov
Cc: Subbaraman Narayanamurthy, David Collins, linux-arm-msm,
linux-kernel, devicetree, kernel, Fenglin Wu
PMIC arbiter v8.5 is an extension of PMIC arbiter v8 that updated
the definition of the channel status register bit fields. Add support
to handle this difference.
Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
---
drivers/spmi/spmi-pmic-arb.c | 142 ++++++++++++++++++++++++++++++++++---------
1 file changed, 112 insertions(+), 30 deletions(-)
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
index 69f8d456324a..2e2cb4774103 100644
--- a/drivers/spmi/spmi-pmic-arb.c
+++ b/drivers/spmi/spmi-pmic-arb.c
@@ -28,6 +28,7 @@
#define PMIC_ARB_VERSION_V5_MIN 0x50000000
#define PMIC_ARB_VERSION_V7_MIN 0x70000000
#define PMIC_ARB_VERSION_V8_MIN 0x80000000
+#define PMIC_ARB_VERSION_V8P5_MIN 0x80050000
#define PMIC_ARB_INT_EN 0x0004
#define PMIC_ARB_FEATURES 0x0004
@@ -62,14 +63,6 @@
/* Ownership Table */
#define SPMI_OWNERSHIP_PERIPH2OWNER(X) ((X) & 0x7)
-/* Channel Status fields */
-enum pmic_arb_chnl_status {
- PMIC_ARB_STATUS_DONE = BIT(0),
- PMIC_ARB_STATUS_FAILURE = BIT(1),
- PMIC_ARB_STATUS_DENIED = BIT(2),
- PMIC_ARB_STATUS_DROPPED = BIT(3),
-};
-
/* Command register fields */
#define PMIC_ARB_CMD_MAX_BYTE_COUNT 8
@@ -239,6 +232,7 @@ struct spmi_pmic_arb {
* on v2 address of SPMI_PIC_IRQ_CLEARn.
* @apid_map_offset: offset of PMIC_ARB_REG_CHNLn
* @apid_owner: on v2 and later address of SPMI_PERIPHn_2OWNER_TABLE_REG
+ * @check_chnl_status: checks channel status and returns error code if any
*/
struct pmic_arb_ver_ops {
const char *ver_str;
@@ -261,6 +255,8 @@ struct pmic_arb_ver_ops {
void __iomem *(*irq_clear)(struct spmi_pmic_arb_bus *bus, u16 n);
u32 (*apid_map_offset)(u16 n);
void __iomem *(*apid_owner)(struct spmi_pmic_arb_bus *bus, u16 n);
+ int (*check_chnl_status)(struct spmi_controller *ctrl, u32 status,
+ u8 sid, u16 addr, u32 offset);
};
static inline void pmic_arb_base_write(struct spmi_pmic_arb *pmic_arb,
@@ -306,6 +302,84 @@ static void pmic_arb_write_data(struct spmi_pmic_arb *pmic_arb, const u8 *buf,
__raw_writel(data, pmic_arb->wr_base + reg);
}
+static int pmic_arb_check_chnl_status_v1(struct spmi_controller *ctrl,
+ u32 status, u8 sid, u16 addr,
+ u32 offset)
+{
+ /* Check if DONE bit is set */
+ if (!(status & BIT(0)))
+ return -EAGAIN;
+
+ if (status & BIT(1)) {
+ dev_err(&ctrl->dev, "%s: %#x %#x: transaction failed (%#x) reg: 0x%x\n",
+ __func__, sid, addr, status, offset);
+ WARN_ON(1);
+ return -EIO;
+ }
+
+ if (status & BIT(2)) {
+ dev_err(&ctrl->dev, "%s: %#x %#x: transaction denied (%#x)\n",
+ __func__, sid, addr, status);
+ return -EPERM;
+ }
+
+ if (status & BIT(3)) {
+ dev_err(&ctrl->dev, "%s: %#x %#x: transaction dropped (%#x)\n",
+ __func__, sid, addr, status);
+ return -EIO;
+ }
+
+ return 0;
+}
+
+static int pmic_arb_check_chnl_status_v8p5(struct spmi_controller *ctrl,
+ u32 status, u8 sid, u16 addr,
+ u32 offset)
+{
+ /* Check if DONE bit is set */
+ if (!(status & BIT(0)))
+ return -EAGAIN;
+
+ if (status & BIT(1)) {
+ dev_err(&ctrl->dev, "%s: %#x %#x: transaction failed (%#x) reg: 0x%x\n",
+ __func__, sid, addr, status, offset);
+ WARN_ON(1);
+ return -EIO;
+ }
+
+ if (status & BIT(2)) {
+ dev_err(&ctrl->dev, "%s: %#x %#x: CRC error (%#x)\n",
+ __func__, sid, addr, status);
+ return -EIO;
+ }
+
+ if (status & BIT(3)) {
+ dev_err(&ctrl->dev, "%s: %#x %#x: parity error (%#x)\n",
+ __func__, sid, addr, status);
+ return -EIO;
+ }
+
+ if (status & BIT(4)) {
+ dev_err(&ctrl->dev, "%s: %#x %#x: NACK error (%#x)\n",
+ __func__, sid, addr, status);
+ return -EIO;
+ }
+
+ if (status & BIT(5)) {
+ dev_err(&ctrl->dev, "%s: %#x %#x: transaction denied (%#x)\n",
+ __func__, sid, addr, status);
+ return -EPERM;
+ }
+
+ if (status & BIT(6)) {
+ dev_err(&ctrl->dev, "%s: %#x %#x: transaction dropped (%#x)\n",
+ __func__, sid, addr, status);
+ return -EIO;
+ }
+
+ return 0;
+}
+
static int pmic_arb_wait_for_done(struct spmi_controller *ctrl,
void __iomem *base, u8 sid, u16 addr,
enum pmic_arb_channel ch_type)
@@ -327,28 +401,10 @@ static int pmic_arb_wait_for_done(struct spmi_controller *ctrl,
while (timeout--) {
status = readl_relaxed(base + offset);
- if (status & PMIC_ARB_STATUS_DONE) {
- if (status & PMIC_ARB_STATUS_DENIED) {
- dev_err(&ctrl->dev, "%s: %#x %#x: transaction denied (%#x)\n",
- __func__, sid, addr, status);
- return -EPERM;
- }
+ rc = pmic_arb->ver_ops->check_chnl_status(ctrl, status, sid, addr, offset);
+ if (rc != -EAGAIN)
+ return rc;
- if (status & PMIC_ARB_STATUS_FAILURE) {
- dev_err(&ctrl->dev, "%s: %#x %#x: transaction failed (%#x) reg: 0x%x\n",
- __func__, sid, addr, status, offset);
- WARN_ON(1);
- return -EIO;
- }
-
- if (status & PMIC_ARB_STATUS_DROPPED) {
- dev_err(&ctrl->dev, "%s: %#x %#x: transaction dropped (%#x)\n",
- __func__, sid, addr, status);
- return -EIO;
- }
-
- return 0;
- }
udelay(1);
}
@@ -1768,6 +1824,7 @@ static const struct pmic_arb_ver_ops pmic_arb_v1 = {
.irq_clear = pmic_arb_irq_clear_v1,
.apid_map_offset = pmic_arb_apid_map_offset_v2,
.apid_owner = pmic_arb_apid_owner_v2,
+ .check_chnl_status = pmic_arb_check_chnl_status_v1,
};
static const struct pmic_arb_ver_ops pmic_arb_v2 = {
@@ -1784,6 +1841,7 @@ static const struct pmic_arb_ver_ops pmic_arb_v2 = {
.irq_clear = pmic_arb_irq_clear_v2,
.apid_map_offset = pmic_arb_apid_map_offset_v2,
.apid_owner = pmic_arb_apid_owner_v2,
+ .check_chnl_status = pmic_arb_check_chnl_status_v1,
};
static const struct pmic_arb_ver_ops pmic_arb_v3 = {
@@ -1800,6 +1858,7 @@ static const struct pmic_arb_ver_ops pmic_arb_v3 = {
.irq_clear = pmic_arb_irq_clear_v2,
.apid_map_offset = pmic_arb_apid_map_offset_v2,
.apid_owner = pmic_arb_apid_owner_v2,
+ .check_chnl_status = pmic_arb_check_chnl_status_v1,
};
static const struct pmic_arb_ver_ops pmic_arb_v5 = {
@@ -1816,6 +1875,7 @@ static const struct pmic_arb_ver_ops pmic_arb_v5 = {
.irq_clear = pmic_arb_irq_clear_v5,
.apid_map_offset = pmic_arb_apid_map_offset_v5,
.apid_owner = pmic_arb_apid_owner_v2,
+ .check_chnl_status = pmic_arb_check_chnl_status_v1,
};
static const struct pmic_arb_ver_ops pmic_arb_v7 = {
@@ -1832,6 +1892,7 @@ static const struct pmic_arb_ver_ops pmic_arb_v7 = {
.irq_clear = pmic_arb_irq_clear_v7,
.apid_map_offset = pmic_arb_apid_map_offset_v7,
.apid_owner = pmic_arb_apid_owner_v7,
+ .check_chnl_status = pmic_arb_check_chnl_status_v1,
};
static const struct pmic_arb_ver_ops pmic_arb_v8 = {
@@ -1849,6 +1910,25 @@ static const struct pmic_arb_ver_ops pmic_arb_v8 = {
.irq_clear = pmic_arb_irq_clear_v8,
.apid_map_offset = pmic_arb_apid_map_offset_v8,
.apid_owner = pmic_arb_apid_owner_v8,
+ .check_chnl_status = pmic_arb_check_chnl_status_v1,
+};
+
+static const struct pmic_arb_ver_ops pmic_arb_v8p5 = {
+ .ver_str = "v8.5",
+ .get_core_resources = pmic_arb_get_core_resources_v8,
+ .get_bus_resources = pmic_arb_get_bus_resources_v8,
+ .init_apid = pmic_arb_init_apid_v8,
+ .ppid_to_apid = pmic_arb_ppid_to_apid_v5,
+ .non_data_cmd = pmic_arb_non_data_cmd_v2,
+ .offset = pmic_arb_offset_v8,
+ .fmt_cmd = pmic_arb_fmt_cmd_v2,
+ .owner_acc_status = pmic_arb_owner_acc_status_v7,
+ .acc_enable = pmic_arb_acc_enable_v8,
+ .irq_status = pmic_arb_irq_status_v8,
+ .irq_clear = pmic_arb_irq_clear_v8,
+ .apid_map_offset = pmic_arb_apid_map_offset_v8,
+ .apid_owner = pmic_arb_apid_owner_v8,
+ .check_chnl_status = pmic_arb_check_chnl_status_v8p5,
};
static const struct irq_domain_ops pmic_arb_irq_domain_ops = {
@@ -2030,8 +2110,10 @@ static int spmi_pmic_arb_probe(struct platform_device *pdev)
pmic_arb->ver_ops = &pmic_arb_v5;
else if (hw_ver < PMIC_ARB_VERSION_V8_MIN)
pmic_arb->ver_ops = &pmic_arb_v7;
- else
+ else if (hw_ver < PMIC_ARB_VERSION_V8P5_MIN)
pmic_arb->ver_ops = &pmic_arb_v8;
+ else
+ pmic_arb->ver_ops = &pmic_arb_v8p5;
err = pmic_arb->ver_ops->get_core_resources(pdev, core);
if (err)
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v3 1/2] dt-bindings: spmi: glymur-spmi-pmic-arb: Add compatible for Qualcomm Hawi SoC
2026-04-20 2:25 ` [PATCH v3 1/2] dt-bindings: spmi: glymur-spmi-pmic-arb: Add compatible " Fenglin Wu
@ 2026-04-20 14:14 ` Krzysztof Kozlowski
0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2026-04-20 14:14 UTC (permalink / raw)
To: Fenglin Wu
Cc: Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Konrad Dybcio, Dmitry Baryshkov, Subbaraman Narayanamurthy,
David Collins, linux-arm-msm, linux-kernel, devicetree, kernel
On Sun, Apr 19, 2026 at 07:25:52PM -0700, Fenglin Wu wrote:
> The PMIC arbiter in the Qualcomm Hawi SoC is version v8.5, which
> introduces parity and CRC checks for data received from the PMIC,
> as well as NACK checks for command sequences except for read.
> All other features in PMIC arbiter remain the same as the one in
> the Qualcomm Glymur SoC, with the only differences being some
> additional error status checks.
>
> Therefore, add a string for "qcom,hawi-spmi-pmic-arb" as a compatible
> entry for "qcom,glymur-spmi-pmic-arb".
>
> Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
> ---
> Documentation/devicetree/bindings/spmi/qcom,glymur-spmi-pmic-arb.yaml | 1 +
> 1 file changed, 1 insertion(+)
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 2/2] spmi: spmi-pmic-arb: add support for PMIC arbiter v8.5
2026-04-20 2:25 ` [PATCH v3 2/2] spmi: spmi-pmic-arb: add support for PMIC arbiter v8.5 Fenglin Wu
@ 2026-04-20 20:51 ` Dmitry Baryshkov
0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2026-04-20 20:51 UTC (permalink / raw)
To: Fenglin Wu
Cc: Stephen Boyd, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Konrad Dybcio, Subbaraman Narayanamurthy, David Collins,
linux-arm-msm, linux-kernel, devicetree, kernel
On Sun, Apr 19, 2026 at 07:25:53PM -0700, Fenglin Wu wrote:
> PMIC arbiter v8.5 is an extension of PMIC arbiter v8 that updated
> the definition of the channel status register bit fields. Add support
> to handle this difference.
>
> Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
> ---
> drivers/spmi/spmi-pmic-arb.c | 142 ++++++++++++++++++++++++++++++++++---------
> 1 file changed, 112 insertions(+), 30 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-04-20 20:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 2:25 [PATCH v3 0/2] spmi: pmic-arb: Add spmi-pmic-arb support for Qualcomm Hawi SoC Fenglin Wu
2026-04-20 2:25 ` [PATCH v3 1/2] dt-bindings: spmi: glymur-spmi-pmic-arb: Add compatible " Fenglin Wu
2026-04-20 14:14 ` Krzysztof Kozlowski
2026-04-20 2:25 ` [PATCH v3 2/2] spmi: spmi-pmic-arb: add support for PMIC arbiter v8.5 Fenglin Wu
2026-04-20 20:51 ` Dmitry Baryshkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox