Skip to content

Commit 851013e

Browse files
Merge patch series "Add support for RZ/G3E CANFD"
Biju Das <[email protected]> says: The CAN-FD module on RZ/G3E is very similar to the one on both R-Car V4H and RZ/G2L, but differs in some hardware parameters: * No external clock, but instead has ram clock. * Support up to 6 channels. * 20 interrupts. v8->v9: * Collected tags. * Added missing header bitfield.h. * Fixed logical error ch->BIT(ch) in rcar_canfd_global_error(). * Removed unneeded double space in rcar_canfd_setrnc(). * Updated commit description in patch#15. v7->v8: * Collected tags. * Updated commit description for patch#{5,9,15,16,17}. * Replaced the macro RCANFD_GERFL_EEF0_7->RCANFD_GERFL_EEF. * Dropped the redundant macro RCANFD_GERFL_EEF(ch). * Added patch for dropping the mask operation in RCANFD_GAFLCFG_SETRNC macro. * Converted RCANFD_GAFLCFG_SETRNC->rcar_canfd_setrnc(). * Updated RCANFD_GAFLCFG macro by replacing the parameter ch->w, where w is the GAFLCFG index used in the hardware manual. * Renamed the parameter x->page_num in RCANFD_GAFLECTR_AFLPN macro to make it clear. * Renamed the parameter x->cftml in RCANFD_CFCC_CFTML macro to make it clear. * Updated {rzg2l,car_gen3_hw_info} with ch_interface_mode = 0. * Updated {rzg2l,rcar_gen3}_hw_info with shared_can_regs = 0. * Started using struct rcanfd_regs instead of LUT for reg offsets. * Started using struct rcar_canfd_shift_data instead of LUT for shift data. * Renamed only_internal_clks->external_clk to avoid negation. * Updated rcar_canfd_hw_info tables with external_clk entries. * Replaced 10->sizeof(name) in scnprintf(). v6->v7: * Collected tags * Replaced 'aswell'->'as well' in patch#11 commit description. v5->v6: * Replaced RCANFD_RNC_PER_REG macro with rnc_stride variable. * Updated commit description for patch#7 and kernel-patches#8 * Dropped mask_table: AFLPN_MASK is replaced by max_aflpn variable. CFTML_MASK is replaced by max_cftml variable. BITTIMING MASK's are replaced by {nom,data}_bittiming variables. * Collected tag from Geert. v4->v5: * Collected tag from Geert. * The rules for R-Car Gen3/4 could be kept together, reducing the number of lines. Similar change for rzg2l-canfd aswell. * Keeping interrupts and resets together allows to keep a clear separation between RZ/G2L and RZ/G3E, at the expense of only a single line. * Retained the tags for binding patches as it is trivial changes. * Dropped the unused macro RCANFD_GAFLCFG_GETRNC. * Updated macro RCANFD_GERFL_ERR by using gpriv->channels_mask and dropped unused macro RCANFD_GERFL_EEF0_7. * Replaced RNC mask in RCANFD_GAFLCFG_SETRNC macro by using info->num_supported_rules variable. * Updated the macro RCANFD_GAFLCFG by using info->rnc_field_width variable. * Updated shift value in RCANFD_GAFLCFG_SETRNC macro by using a formula (32 - (n % rnc_per_reg + 1) * field_width). * Replaced the variable name shared_can_reg->shared_can_regs. * Improved commit description for patch{kernel-patches#11,kernel-patches#12}by replacing has->have. * Dropped RCANFD_EEF_MASK and RCANFD_RNC_MASK as it is taken care by gpriv->channels_mask and info->num_supported_rules. * Dropped RCANFD_FIRST_RNC_SH and RCANFD_SECOND_RNC_SH by using a formula (32 - (n % rnc_per_reg + 1) * rnc_field_width. * Improved commit description by "All SoCs supports extenal clock"-> "All existing SoCs support an external clock". * Updated error description in probe as "cannot get enabled ram clock" * Updated r9a09g047_hw_info table. v3->v4: * Added Rb tag from Rob for patch#2. * Added prefix RCANFD_* to enum rcar_canfd_reg_offset_id. * Added prefix RCANFD_* to enum rcar_canfd_mask_id. * Added prefix RCANFD_* to enum rcar_canfd_shift_id. v2->v3: * Collected tags. * Dropped reg_gen4() and is_gen4() by adding mask_table, shift_table, regs, ch_interface_mode and shared_can_reg variables to struct rcar_canfd_hw_info. v1->v2: * Split the series with fixes patch separately. * Added patch for Simplify rcar_canfd_probe() using of_get_available_child_by_name() as dependency patch hit on can-next. * Added Rb tag from Vincent Mailhol. * Dropped redundant comment from commit description for patch#3. Link: https://patch.msgid.link/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2 parents 9ab0ac0 + be53aa0 commit 851013e

File tree

2 files changed

+340
-109
lines changed

2 files changed

+340
-109
lines changed

Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml

Lines changed: 128 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,80 @@ properties:
4242
- renesas,r9a07g054-canfd # RZ/V2L
4343
- const: renesas,rzg2l-canfd # RZ/G2L family
4444

45+
- const: renesas,r9a09g047-canfd # RZ/G3E
46+
4547
reg:
4648
maxItems: 1
4749

48-
interrupts: true
50+
interrupts:
51+
oneOf:
52+
- items:
53+
- description: Channel interrupt
54+
- description: Global interrupt
55+
- items:
56+
- description: CAN global error interrupt
57+
- description: CAN receive FIFO interrupt
58+
- description: CAN0 error interrupt
59+
- description: CAN0 transmit interrupt
60+
- description: CAN0 transmit/receive FIFO receive completion interrupt
61+
- description: CAN1 error interrupt
62+
- description: CAN1 transmit interrupt
63+
- description: CAN1 transmit/receive FIFO receive completion interrupt
64+
- description: CAN2 error interrupt
65+
- description: CAN2 transmit interrupt
66+
- description: CAN2 transmit/receive FIFO receive completion interrupt
67+
- description: CAN3 error interrupt
68+
- description: CAN3 transmit interrupt
69+
- description: CAN3 transmit/receive FIFO receive completion interrupt
70+
- description: CAN4 error interrupt
71+
- description: CAN4 transmit interrupt
72+
- description: CAN4 transmit/receive FIFO receive completion interrupt
73+
- description: CAN5 error interrupt
74+
- description: CAN5 transmit interrupt
75+
- description: CAN5 transmit/receive FIFO receive completion interrupt
76+
minItems: 8
77+
78+
interrupt-names:
79+
oneOf:
80+
- items:
81+
- const: ch_int
82+
- const: g_int
83+
- items:
84+
- const: g_err
85+
- const: g_recc
86+
- const: ch0_err
87+
- const: ch0_rec
88+
- const: ch0_trx
89+
- const: ch1_err
90+
- const: ch1_rec
91+
- const: ch1_trx
92+
- const: ch2_err
93+
- const: ch2_rec
94+
- const: ch2_trx
95+
- const: ch3_err
96+
- const: ch3_rec
97+
- const: ch3_trx
98+
- const: ch4_err
99+
- const: ch4_rec
100+
- const: ch4_trx
101+
- const: ch5_err
102+
- const: ch5_rec
103+
- const: ch5_trx
104+
minItems: 8
49105

50106
clocks:
51107
maxItems: 3
52108

53109
clock-names:
54-
items:
55-
- const: fck
56-
- const: canfd
57-
- const: can_clk
110+
oneOf:
111+
- items:
112+
- const: fck
113+
- const: canfd
114+
- const: can_clk
115+
- items:
116+
- const: fck
117+
- const: ram_clk
118+
- const: can_clk
58119

59120
power-domains:
60121
maxItems: 1
@@ -117,52 +178,77 @@ allOf:
117178
then:
118179
properties:
119180
interrupts:
120-
items:
121-
- description: CAN global error interrupt
122-
- description: CAN receive FIFO interrupt
123-
- description: CAN0 error interrupt
124-
- description: CAN0 transmit interrupt
125-
- description: CAN0 transmit/receive FIFO receive completion interrupt
126-
- description: CAN1 error interrupt
127-
- description: CAN1 transmit interrupt
128-
- description: CAN1 transmit/receive FIFO receive completion interrupt
181+
maxItems: 8
129182

130183
interrupt-names:
131-
items:
132-
- const: g_err
133-
- const: g_recc
134-
- const: ch0_err
135-
- const: ch0_rec
136-
- const: ch0_trx
137-
- const: ch1_err
138-
- const: ch1_rec
139-
- const: ch1_trx
184+
maxItems: 8
140185

141186
resets:
187+
minItems: 2
142188
maxItems: 2
143189

144190
reset-names:
145-
items:
146-
- const: rstp_n
147-
- const: rstc_n
191+
minItems: 2
192+
maxItems: 2
148193

149194
required:
150195
- reset-names
151-
else:
196+
197+
- if:
198+
properties:
199+
compatible:
200+
contains:
201+
enum:
202+
- renesas,rcar-gen3-canfd
203+
- renesas,rcar-gen4-canfd
204+
then:
152205
properties:
153206
interrupts:
154-
items:
155-
- description: Channel interrupt
156-
- description: Global interrupt
207+
minItems: 2
208+
maxItems: 2
157209

158210
interrupt-names:
159-
items:
160-
- const: ch_int
161-
- const: g_int
211+
minItems: 2
212+
maxItems: 2
162213

163214
resets:
164215
maxItems: 1
165216

217+
- if:
218+
properties:
219+
compatible:
220+
contains:
221+
const: renesas,r9a09g047-canfd
222+
then:
223+
properties:
224+
interrupts:
225+
minItems: 20
226+
227+
interrupt-names:
228+
minItems: 20
229+
230+
resets:
231+
minItems: 2
232+
maxItems: 2
233+
234+
reset-names:
235+
minItems: 2
236+
maxItems: 2
237+
238+
required:
239+
- reset-names
240+
241+
- if:
242+
properties:
243+
compatible:
244+
contains:
245+
enum:
246+
- renesas,rcar-gen3-canfd
247+
- renesas,rzg2l-canfd
248+
then:
249+
patternProperties:
250+
"^channel[2-7]$": false
251+
166252
- if:
167253
properties:
168254
compatible:
@@ -171,16 +257,15 @@ allOf:
171257
then:
172258
patternProperties:
173259
"^channel[4-7]$": false
174-
else:
175-
if:
176-
not:
177-
properties:
178-
compatible:
179-
contains:
180-
const: renesas,rcar-gen4-canfd
181-
then:
182-
patternProperties:
183-
"^channel[2-7]$": false
260+
261+
- if:
262+
properties:
263+
compatible:
264+
contains:
265+
const: renesas,r9a09g047-canfd
266+
then:
267+
patternProperties:
268+
"^channel[6-7]$": false
184269

185270
unevaluatedProperties: false
186271

0 commit comments

Comments
 (0)