Skip to content

Commit 546b0ad

Browse files
committed
Merge tag 'i3c/for-6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux
Pull i3c updates from Alexandre Belloni: "New driver: - Renesas I3C controller Subsystem: - use adapter timeout value for I2C transfers - don't fail if GETHDRCAP is unsupported - replace ENOTSUPP with SUSV4-compliant EOPNOTSUPP Drivers: - svc: Fix npcm845 FIFO_EMPTY quirk" * tag 'i3c/for-6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: (25 commits) i3c: add missing include to internal header i3c: dw: Remove redundant pm_runtime_mark_last_busy() calls i3c: master: svc: Remove redundant pm_runtime_mark_last_busy() calls i3c: master: svc: Fix npcm845 FIFO_EMPTY quirk i3c: master: Add basic driver for the Renesas I3C controller dt-bindings: i3c: Add Renesas I3C controller i3c: Add more parameters for controllers to the header i3c: Standardize defines for specification parameters i3c: fix module_i3c_i2c_driver() with I3C=n i3c: master: cdns: Simplify handling clocks in probe() i3c: Fix i3c_device_do_priv_xfers() kernel-doc indentation i3c: master: dw: Use i3c_writel_fifo() and i3c_readl_fifo() i3c: master: cdns: Use i3c_writel_fifo() and i3c_readl_fifo() i3c: master: Add inline i3c_readl_fifo() and i3c_writel_fifo() i3c: prefix hexadecimal entries in sysfs i3c: master: cdns: replace ENOTSUPP with SUSV4-compliant EOPNOTSUPP i3c: dw: replace ENOTSUPP with SUSV4-compliant EOPNOTSUPP i3c: master: replace ENOTSUPP with SUSV4-compliant EOPNOTSUPP i3c: don't fail if GETHDRCAP is unsupported i3c: add patchwork entry to MAINTAINERS ...
2 parents 352af6a + 3b661ca commit 546b0ad

File tree

14 files changed

+1728
-149
lines changed

14 files changed

+1728
-149
lines changed
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/i3c/renesas,i3c.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Renesas RZ/G3S and RZ/G3E I3C Bus Interface
8+
9+
maintainers:
10+
- Wolfram Sang <[email protected]>
11+
- Tommaso Merciai <[email protected]>
12+
13+
properties:
14+
compatible:
15+
items:
16+
- enum:
17+
- renesas,r9a08g045-i3c # RZ/G3S
18+
- renesas,r9a09g047-i3c # RZ/G3E
19+
20+
reg:
21+
maxItems: 1
22+
23+
interrupts:
24+
items:
25+
- description: Non-recoverable internal error interrupt
26+
- description: Normal transfer error interrupt
27+
- description: Normal transfer abort interrupt
28+
- description: Normal response status buffer full interrupt
29+
- description: Normal command buffer empty interrupt
30+
- description: Normal IBI status buffer full interrupt
31+
- description: Normal Rx data buffer full interrupt
32+
- description: Normal Tx data buffer empty interrupt
33+
- description: Normal receive status buffer full interrupt
34+
- description: START condition detection interrupt
35+
- description: STOP condition detection interrupt
36+
- description: Transmit end interrupt
37+
- description: NACK detection interrupt
38+
- description: Arbitration lost interrupt
39+
- description: Timeout detection interrupt
40+
- description: Wake-up condition detection interrupt
41+
- description: HDR Exit Pattern detection interrupt
42+
minItems: 16
43+
44+
interrupt-names:
45+
items:
46+
- const: ierr
47+
- const: terr
48+
- const: abort
49+
- const: resp
50+
- const: cmd
51+
- const: ibi
52+
- const: rx
53+
- const: tx
54+
- const: rcv
55+
- const: st
56+
- const: sp
57+
- const: tend
58+
- const: nack
59+
- const: al
60+
- const: tmo
61+
- const: wu
62+
- const: exit
63+
minItems: 16
64+
65+
clocks:
66+
items:
67+
- description: APB bus clock
68+
- description: transfer clock
69+
- description: SFRs clock
70+
minItems: 2
71+
72+
clock-names:
73+
items:
74+
- const: pclk
75+
- const: tclk
76+
- const: pclkrw
77+
minItems: 2
78+
79+
power-domains:
80+
maxItems: 1
81+
82+
resets:
83+
items:
84+
- description: Reset signal
85+
- description: APB interface reset signal/SCAN reset signal
86+
87+
reset-names:
88+
items:
89+
- const: presetn
90+
- const: tresetn
91+
92+
required:
93+
- compatible
94+
- reg
95+
- interrupts
96+
- interrupt-names
97+
- clock-names
98+
- clocks
99+
- power-domains
100+
- resets
101+
- reset-names
102+
103+
allOf:
104+
- $ref: i3c.yaml#
105+
106+
- if:
107+
properties:
108+
compatible:
109+
contains:
110+
const: renesas,r9a08g045-i3c
111+
then:
112+
properties:
113+
clocks:
114+
maxItems: 2
115+
clock-names:
116+
maxItems: 2
117+
interrupts:
118+
minItems: 17
119+
interrupt-names:
120+
minItems: 17
121+
122+
- if:
123+
properties:
124+
compatible:
125+
contains:
126+
const: renesas,r9a09g047-i3c
127+
then:
128+
properties:
129+
clocks:
130+
minItems: 3
131+
clock-names:
132+
minItems: 3
133+
interrupts:
134+
maxItems: 16
135+
interrupt-names:
136+
maxItems: 16
137+
138+
unevaluatedProperties: false
139+
140+
examples:
141+
- |
142+
#include <dt-bindings/clock/r9a08g045-cpg.h>
143+
#include <dt-bindings/interrupt-controller/arm-gic.h>
144+
145+
i3c@1005b000 {
146+
compatible = "renesas,r9a08g045-i3c";
147+
reg = <0x1005b000 0x1000>;
148+
clocks = <&cpg CPG_MOD R9A08G045_I3C_PCLK>,
149+
<&cpg CPG_MOD R9A08G045_I3C_TCLK>;
150+
clock-names = "pclk", "tclk";
151+
interrupts = <GIC_SPI 289 IRQ_TYPE_LEVEL_HIGH>,
152+
<GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>,
153+
<GIC_SPI 293 IRQ_TYPE_LEVEL_HIGH>,
154+
<GIC_SPI 294 IRQ_TYPE_EDGE_RISING>,
155+
<GIC_SPI 295 IRQ_TYPE_EDGE_RISING>,
156+
<GIC_SPI 296 IRQ_TYPE_EDGE_RISING>,
157+
<GIC_SPI 297 IRQ_TYPE_EDGE_RISING>,
158+
<GIC_SPI 298 IRQ_TYPE_EDGE_RISING>,
159+
<GIC_SPI 299 IRQ_TYPE_EDGE_RISING>,
160+
<GIC_SPI 304 IRQ_TYPE_LEVEL_HIGH>,
161+
<GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>,
162+
<GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>,
163+
<GIC_SPI 308 IRQ_TYPE_LEVEL_HIGH>,
164+
<GIC_SPI 309 IRQ_TYPE_LEVEL_HIGH>,
165+
<GIC_SPI 310 IRQ_TYPE_LEVEL_HIGH>,
166+
<GIC_SPI 311 IRQ_TYPE_LEVEL_HIGH>,
167+
<GIC_SPI 306 IRQ_TYPE_LEVEL_HIGH>;
168+
interrupt-names = "ierr", "terr", "abort", "resp",
169+
"cmd", "ibi", "rx", "tx", "rcv",
170+
"st", "sp", "tend", "nack",
171+
"al", "tmo", "wu", "exit";
172+
resets = <&cpg R9A08G045_I3C_PRESETN>,
173+
<&cpg R9A08G045_I3C_TRESETN>;
174+
reset-names = "presetn", "tresetn";
175+
power-domains = <&cpg>;
176+
#address-cells = <3>;
177+
#size-cells = <0>;
178+
};
179+
...

MAINTAINERS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11612,6 +11612,13 @@ S: Maintained
1161211612
F: Documentation/devicetree/bindings/i3c/cdns,i3c-master.yaml
1161311613
F: drivers/i3c/master/i3c-master-cdns.c
1161411614

11615+
I3C DRIVER FOR RENESAS
11616+
M: Wolfram Sang <[email protected]>
11617+
M: Tommaso Merciai <[email protected]>
11618+
S: Supported
11619+
F: Documentation/devicetree/bindings/i3c/renesas,i3c.yaml
11620+
F: drivers/i3c/master/renesas-i3c.c
11621+
1161511622
I3C DRIVER FOR SYNOPSYS DESIGNWARE
1161611623
S: Orphan
1161711624
F: Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.yaml
@@ -11622,6 +11629,7 @@ M: Alexandre Belloni <[email protected]>
1162211629
R: Frank Li <[email protected]>
1162311630
L: [email protected] (moderated for non-subscribers)
1162411631
S: Maintained
11632+
Q: https://patchwork.kernel.org/project/linux-i3c/list/
1162511633
C: irc://chat.freenode.net/linux-i3c
1162611634
T: git git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux.git
1162711635
F: Documentation/ABI/testing/sysfs-bus-i3c

drivers/i3c/device.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@
2626
*
2727
* This function can sleep and thus cannot be called in atomic context.
2828
*
29-
* Return: 0 in case of success, a negative error core otherwise.
30-
* -EAGAIN: controller lost address arbitration. Target
31-
* (IBI, HJ or controller role request) win the bus. Client
32-
* driver needs to resend the 'xfers' some time later.
33-
* See I3C spec ver 1.1.1 09-Jun-2021. Section: 5.1.2.2.3.
29+
* Return:
30+
* * 0 in case of success, a negative error core otherwise.
31+
* * -EAGAIN: controller lost address arbitration. Target (IBI, HJ or
32+
* controller role request) win the bus. Client driver needs to resend the
33+
* 'xfers' some time later. See I3C spec ver 1.1.1 09-Jun-2021. Section:
34+
* 5.1.2.2.3.
3435
*/
3536
int i3c_device_do_priv_xfers(struct i3c_device *dev,
3637
struct i3c_priv_xfer *xfers,

drivers/i3c/internals.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define I3C_INTERNALS_H
1010

1111
#include <linux/i3c/master.h>
12+
#include <linux/io.h>
1213

1314
void i3c_bus_normaluse_lock(struct i3c_bus *bus);
1415
void i3c_bus_normaluse_unlock(struct i3c_bus *bus);
@@ -22,4 +23,41 @@ int i3c_dev_enable_ibi_locked(struct i3c_dev_desc *dev);
2223
int i3c_dev_request_ibi_locked(struct i3c_dev_desc *dev,
2324
const struct i3c_ibi_setup *req);
2425
void i3c_dev_free_ibi_locked(struct i3c_dev_desc *dev);
26+
27+
/**
28+
* i3c_writel_fifo - Write data buffer to 32bit FIFO
29+
* @addr: FIFO Address to write to
30+
* @buf: Pointer to the data bytes to write
31+
* @nbytes: Number of bytes to write
32+
*/
33+
static inline void i3c_writel_fifo(void __iomem *addr, const void *buf,
34+
int nbytes)
35+
{
36+
writesl(addr, buf, nbytes / 4);
37+
if (nbytes & 3) {
38+
u32 tmp = 0;
39+
40+
memcpy(&tmp, buf + (nbytes & ~3), nbytes & 3);
41+
writel(tmp, addr);
42+
}
43+
}
44+
45+
/**
46+
* i3c_readl_fifo - Read data buffer from 32bit FIFO
47+
* @addr: FIFO Address to read from
48+
* @buf: Pointer to the buffer to store read bytes
49+
* @nbytes: Number of bytes to read
50+
*/
51+
static inline void i3c_readl_fifo(const void __iomem *addr, void *buf,
52+
int nbytes)
53+
{
54+
readsl(addr, buf, nbytes / 4);
55+
if (nbytes & 3) {
56+
u32 tmp;
57+
58+
tmp = readl(addr);
59+
memcpy(buf + (nbytes & ~3), &tmp, nbytes & 3);
60+
}
61+
}
62+
2563
#endif /* I3C_INTERNAL_H */

0 commit comments

Comments
 (0)