Skip to content

Commit a2604f8

Browse files
committed
Merge tag 'i3c/for-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux
Pull i3c updates from Alexandre Belloni: "There is not much this this, mostly fixes around interrupt and IBI handling: - mipi-i3c-hci: interrupt handling fixes - svc: i.MX94 and i.MX95 support, IBI handling fixes" * tag 'i3c/for-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c: controllers do not need to depend on I3C i3c: master: svc: switch to bulk clk API for flexible clock support dt-bindings: i3c: silvaco,i3c-master: add i.MX94 and i.MX95 I3C i3c: master: svc: skip address resend on repeat START i3c: master: svc: Emit STOP asap in the IBI transaction i3c: master: svc: Receive IBI requests in interrupt context i3c: mipi-i3c-hci: Move unexpected INTR_STATUS print before IO handler i3c: mipi-i3c-hci: Change name of INTR_STATUS bit 11 i3c: mipi-i3c-hci: Clear INTR_STATUS unconditionally i3c: mipi-i3c-hci: Fix handling status of i3c_hci_irq_handler() i3c: mipi-i3c-hci: Allow only relevant INTR_STATUS bit updates
2 parents 9bebf9f + 00286d7 commit a2604f8

File tree

4 files changed

+98
-92
lines changed

4 files changed

+98
-92
lines changed

Documentation/devicetree/bindings/i3c/silvaco,i3c-master.yaml

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ title: Silvaco I3C master
99
maintainers:
1010
- Conor Culhane <[email protected]>
1111

12-
allOf:
13-
- $ref: i3c.yaml#
14-
1512
properties:
1613
compatible:
17-
enum:
18-
- nuvoton,npcm845-i3c
19-
- silvaco,i3c-master-v1
14+
oneOf:
15+
- enum:
16+
- nuvoton,npcm845-i3c
17+
- silvaco,i3c-master-v1
18+
- items:
19+
- enum:
20+
- nxp,imx94-i3c
21+
- nxp,imx95-i3c
22+
- const: silvaco,i3c-master-v1
2023

2124
reg:
2225
maxItems: 1
@@ -25,12 +28,14 @@ properties:
2528
maxItems: 1
2629

2730
clocks:
31+
minItems: 2
2832
items:
2933
- description: system clock
3034
- description: bus clock
3135
- description: other (slower) events clock
3236

3337
clock-names:
38+
minItems: 2
3439
items:
3540
- const: pclk
3641
- const: fast_clk
@@ -46,6 +51,34 @@ required:
4651
- clock-names
4752
- clocks
4853

54+
allOf:
55+
- $ref: i3c.yaml#
56+
- if:
57+
properties:
58+
compatible:
59+
enum:
60+
- nuvoton,npcm845-i3c
61+
- silvaco,i3c-master-v1
62+
then:
63+
properties:
64+
clocks:
65+
minItems: 3
66+
clock-names:
67+
minItems: 3
68+
- if:
69+
properties:
70+
compatible:
71+
contains:
72+
enum:
73+
- nxp,imx94-i3c
74+
- nxp,imx95-i3c
75+
then:
76+
properties:
77+
clocks:
78+
maxItems: 2
79+
clock-names:
80+
maxItems: 2
81+
4982
unevaluatedProperties: false
5083

5184
examples:

drivers/i3c/master/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
config CDNS_I3C_MASTER
33
tristate "Cadence I3C master driver"
4-
depends on I3C
54
depends on HAS_IOMEM
65
depends on !(ALPHA || PARISC)
76
help
87
Enable this driver if you want to support Cadence I3C master block.
98

109
config DW_I3C_MASTER
1110
tristate "Synospsys DesignWare I3C master driver"
12-
depends on I3C
1311
depends on HAS_IOMEM
1412
depends on !(ALPHA || PARISC)
1513
# ALPHA and PARISC needs {read,write}sl()
@@ -38,15 +36,13 @@ config AST2600_I3C_MASTER
3836

3937
config SVC_I3C_MASTER
4038
tristate "Silvaco I3C Dual-Role Master driver"
41-
depends on I3C
4239
depends on HAS_IOMEM
4340
depends on !(ALPHA || PARISC)
4441
help
4542
Support for Silvaco I3C Dual-Role Master Controller.
4643

4744
config MIPI_I3C_HCI
4845
tristate "MIPI I3C Host Controller Interface driver (EXPERIMENTAL)"
49-
depends on I3C
5046
depends on HAS_IOMEM
5147
help
5248
Support for hardware following the MIPI Aliance's I3C Host Controller

drivers/i3c/master/mipi-i3c-hci/core.c

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
#define INTR_SIGNAL_ENABLE 0x28
7979
#define INTR_FORCE 0x2c
8080
#define INTR_HC_CMD_SEQ_UFLOW_STAT BIT(12) /* Cmd Sequence Underflow */
81-
#define INTR_HC_RESET_CANCEL BIT(11) /* HC Cancelled Reset */
81+
#define INTR_HC_SEQ_CANCEL BIT(11) /* HC Cancelled Transaction Sequence */
8282
#define INTR_HC_INTERNAL_ERR BIT(10) /* HC Internal Error */
8383

8484
#define DAT_SECTION 0x30 /* Device Address Table */
@@ -590,26 +590,27 @@ static irqreturn_t i3c_hci_irq_handler(int irq, void *dev_id)
590590
u32 val;
591591

592592
val = reg_read(INTR_STATUS);
593+
reg_write(INTR_STATUS, val);
593594
DBG("INTR_STATUS = %#x", val);
594595

595-
if (val) {
596-
reg_write(INTR_STATUS, val);
597-
}
596+
if (val)
597+
result = IRQ_HANDLED;
598598

599-
if (val & INTR_HC_RESET_CANCEL) {
600-
DBG("cancelled reset");
601-
val &= ~INTR_HC_RESET_CANCEL;
599+
if (val & INTR_HC_SEQ_CANCEL) {
600+
dev_dbg(&hci->master.dev,
601+
"Host Controller Cancelled Transaction Sequence\n");
602+
val &= ~INTR_HC_SEQ_CANCEL;
602603
}
603604
if (val & INTR_HC_INTERNAL_ERR) {
604605
dev_err(&hci->master.dev, "Host Controller Internal Error\n");
605606
val &= ~INTR_HC_INTERNAL_ERR;
606607
}
607608

608-
hci->io->irq_handler(hci);
609-
610609
if (val)
611-
dev_err(&hci->master.dev, "unexpected INTR_STATUS %#x\n", val);
612-
else
610+
dev_warn_once(&hci->master.dev,
611+
"unexpected INTR_STATUS %#x\n", val);
612+
613+
if (hci->io->irq_handler(hci))
613614
result = IRQ_HANDLED;
614615

615616
return result;
@@ -699,9 +700,14 @@ static int i3c_hci_init(struct i3c_hci *hci)
699700
if (ret)
700701
return -ENXIO;
701702

702-
/* Disable all interrupts and allow all signal updates */
703+
/* Disable all interrupts */
703704
reg_write(INTR_SIGNAL_ENABLE, 0x0);
704-
reg_write(INTR_STATUS_ENABLE, 0xffffffff);
705+
/*
706+
* Only allow bit 31:10 signal updates because
707+
* Bit 0:9 are reserved in IP version >= 0.8
708+
* Bit 0:5 are defined in IP version < 0.8 but not handled by PIO code
709+
*/
710+
reg_write(INTR_STATUS_ENABLE, GENMASK(31, 10));
705711

706712
/* Make sure our data ordering fits the host's */
707713
regval = reg_read(HC_CONTROL);

0 commit comments

Comments
 (0)