Skip to content

Commit 53a012e

Browse files
wypccDC-DeepComputing
authored andcommitted
dt-bindings: bus: add SpacemiT K3 eSPI and ChromeOS EC
The FML13V05 embedded controller uses the K3 eSPI peripheral shared-memory window, which is not described by the existing ChromeOS EC bindings. Describe the K3 controller, its register and shared-memory resources, clocks, reset, pinctrl and EC child. Add google,cros-ec-espi to the EC binding, with the interrupt supplied by the board's GPIO controller. Validate both schemas and the FML13V05 DTB against these bindings. Binding adaptation and validation were performed with Codex assistance. Signed-off-by: Wang Yang <yang.wang@deepcomputing.io>
1 parent 38ca848 commit 53a012e

2 files changed

Lines changed: 131 additions & 0 deletions

File tree

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/bus/spacemit,k3-espi.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: SpacemiT K3 eSPI controller
8+
9+
maintainers:
10+
- Yixun Lan <dlan@kernel.org>
11+
12+
description: |
13+
The K3 eSPI controller connects the application processor to an embedded
14+
controller. Child registers are accessed through a peripheral shared-memory
15+
window, translated by ranges. The controller manages clocks, resets and
16+
channel negotiation, including link recovery after an EC reboot.
17+
18+
properties:
19+
compatible:
20+
const: spacemit,k3-espi
21+
22+
reg:
23+
maxItems: 1
24+
25+
'#address-cells':
26+
const: 1
27+
28+
'#size-cells':
29+
const: 1
30+
31+
ranges:
32+
maxItems: 1
33+
34+
clocks:
35+
items:
36+
- description: Serial clock source
37+
- description: Serial clock
38+
- description: Bus clock
39+
40+
clock-names:
41+
items:
42+
- const: sclk_src
43+
- const: sclk
44+
- const: mclk
45+
46+
resets:
47+
items:
48+
- description: Bus reset
49+
- description: Serial clock reset
50+
51+
pr-mem-base0:
52+
$ref: /schemas/types.yaml#/definitions/uint32
53+
description: First peripheral memory translation base.
54+
55+
pr-mem-base1:
56+
$ref: /schemas/types.yaml#/definitions/uint32
57+
description: Second peripheral memory translation base.
58+
59+
operating-frequency:
60+
$ref: /schemas/types.yaml#/definitions/uint32
61+
description: Requested link clock frequency in MHz.
62+
enum: [20, 25, 33, 50, 66]
63+
default: 20
64+
65+
io-mode:
66+
$ref: /schemas/types.yaml#/definitions/string
67+
description: Requested number of eSPI data lines.
68+
enum: [single, dual, quad]
69+
default: single
70+
71+
alert-mode:
72+
$ref: /schemas/types.yaml#/definitions/string
73+
description: Use the shared IO1 line or the dedicated alert pin.
74+
enum: [io1, pin]
75+
default: io1
76+
77+
alert-type:
78+
$ref: /schemas/types.yaml#/definitions/string
79+
description: Electrical mode of the dedicated alert pin.
80+
enum: [open-drain, push-pull]
81+
default: open-drain
82+
83+
watchdog-timeout:
84+
$ref: /schemas/types.yaml#/definitions/uint32
85+
description: Controller watchdog counter value.
86+
maximum: 65535
87+
default: 65535
88+
89+
crc-enable:
90+
type: boolean
91+
description: Enable link CRC checking.
92+
93+
auto-gating-enable:
94+
type: boolean
95+
description: Enable automatic controller clock gating.
96+
97+
peripheral-channel-enable:
98+
type: boolean
99+
description: Enable the peripheral channel.
100+
101+
vwire-channel-enable:
102+
type: boolean
103+
description: Enable the virtual-wire channel.
104+
105+
oob-channel-enable:
106+
type: boolean
107+
description: Enable the out-of-band channel.
108+
109+
flash-channel-enable:
110+
type: boolean
111+
description: Enable the flash access channel.
112+
113+
patternProperties:
114+
'^ec@[0-9a-f]+$':
115+
$ref: /schemas/embedded-controller/google,cros-ec.yaml#
116+
117+
required:
118+
- compatible
119+
- reg
120+
- '#address-cells'
121+
- '#size-cells'
122+
- ranges
123+
- clocks
124+
- clock-names
125+
- resets
126+
127+
additionalProperties: false

‎Documentation/devicetree/bindings/embedded-controller/google,cros-ec.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ properties:
3636
- description:
3737
For implementations of the EC connected through UART.
3838
const: google,cros-ec-uart
39+
- description:
40+
For implementations of the EC connected through an eSPI
41+
peripheral shared-memory window.
42+
const: google,cros-ec-espi
3943

4044
controller-data: true
4145

0 commit comments

Comments
 (0)