Skip to content

Commit c761f92

Browse files
committed
dts: edtlib: test pin and clock controller, partitions, special nodes
Tests for edtlib features: - enable bindings for special nodes without compatibles - allow binding override by binding file name - allow extraction of gpio-ranges properties - extract pinctrl state and pin configuration nodes - extract clock inputs and clock outputs - extract partitions nodes - extract gpio led nodes Signed-off-by: Bobby Noelte <[email protected]>
1 parent d65e943 commit c761f92

17 files changed

+722
-9
lines changed

scripts/dts/test-bindings-2/multidir.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
description: Binding in test-bindings-2/
44

5-
compatible: "in-dir-2"
5+
compatible: "in-dir"
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Copyright (c) 2019..2020 Bobby Noelte
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: Chosen properties
5+
6+
compatible: "chosen"
7+
8+
properties:
9+
stdout-path:
10+
type: string
11+
required: false
12+
description: >
13+
Device to be used for boot console output
14+
If the character ":" is present in the value, this terminates the path.
15+
The meaning of any characters following the ":" is device-specific, and
16+
must be specified in the relevant binding documentation.
17+
For UART devices, the preferred binding is a string in the form:
18+
path:<baud>{<parity>{<bits>{<flow>}}}
19+
where
20+
path - path of uart device
21+
baud - baud rate in decimal
22+
parity - 'n' (none), 'o', (odd) or 'e' (even)
23+
bits - number of data bits
24+
flow - 'r' (rts)
25+
For example: 115200n8r
26+
27+
zephyr,flash:
28+
type: path
29+
required: false
30+
description: TBD
31+
32+
zephyr,sram:
33+
type: path
34+
required: false
35+
description: TBD
36+
37+
zephyr,ccm:
38+
type: path
39+
required: false
40+
description: TBD
41+
42+
zephyr,console:
43+
type: path
44+
required: false
45+
description: TBD
46+
47+
zephyr,shell-uart:
48+
type: path
49+
required: false
50+
description: TBD
51+
52+
zephyr,bt-uart:
53+
type: path
54+
required: false
55+
description: TBD
56+
57+
zephyr,uart-pipe:
58+
type: path
59+
required: false
60+
description: TBD
61+
62+
zephyr,bt-mon-uart:
63+
type: path
64+
required: false
65+
description: TBD
66+
67+
zephyr,uart-mcumgr:
68+
type: path
69+
required: false
70+
description: TBD
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Copyright (c) 2018..2020 Bobby Noelte
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# -- Assigned clock parents and rates --
5+
# Some platforms may require initial configuration of default parent clocks
6+
# and clock frequencies. Such a configuration can be specified in a device tree
7+
# node through assigned-clocks, assigned-clock-parents and assigned-clock-rates
8+
# properties.
9+
10+
description: Clock consumer
11+
12+
compatible: "clock-consumer"
13+
14+
properties:
15+
clocks:
16+
type: phandle-array
17+
required: true
18+
description: >
19+
List of phandle and clock specifier pairs, one pair for each clock
20+
input to the device. Note - if the clock provider specifies '0' for
21+
clock-cells, then only the phandle portion of the pair will appear.
22+
23+
clock-names:
24+
type: string-array
25+
required: false
26+
description: >
27+
List of clock input name strings sorted in the same order as the clocks
28+
property.
29+
30+
clock-ranges:
31+
type: boolean
32+
required: false
33+
description: >
34+
Empty property indicating that child nodes can inherit named clocks from
35+
this node. Useful for bus nodes to provide a clock to their children.
36+
37+
assigned-clocks:
38+
type: phandle-array
39+
required: false
40+
description: >
41+
List of phandle and clock specifier pairs, one pair for each assigned
42+
clock input. Note - if the clock provider specifies '0' for
43+
clock-cells, then only the phandle portion of the pair will appear.
44+
45+
assigned-clock-parents:
46+
type: phandle-array
47+
required: false
48+
description: >
49+
List of parent clocks in the form of a phandle and clock
50+
specifier pair. The list shall correspond to the clocks listed in the
51+
assigned-clocks directive.
52+
53+
assigned-clock-rates:
54+
type: array
55+
required: false
56+
description: >
57+
List of frequencies in Hz. The list shall correspond to the clocks
58+
listed in the assigned-clocks directive.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright (c) 2019, Linaro Limited
2+
# Copyright (c) 2019..2020 Bobby Noelte
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Common fields for clock controllers
6+
7+
description: Clock provider
8+
9+
compatible: "clock-provider"
10+
11+
properties:
12+
"#clock-cells":
13+
type: int
14+
required: true
15+
description: Number of items to expect in a Clock specifier
16+
17+
clock-output-names:
18+
type: string-array
19+
required: false
20+
description: >
21+
A list of strings of clock output signal names indexed by the first
22+
cell in the clock specifier.
23+
24+
clock-indices:
25+
type: array
26+
required: false
27+
description: >
28+
The identifying number for the clocks in the node. If it is not linear
29+
from zero, then this allows the mapping of identifiers into the
30+
clock-output-names array.
31+
32+
protected-clocks:
33+
type: phandles
34+
required: false
35+
description: >
36+
Clocks that are not fully exposed, such as in situations where those
37+
clocks are used by drivers running in ARM secure execution levels.
38+
39+
clock-cells:
40+
- clock-id
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2018..2020 Bobby Noelte
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: Fixed partition (one of the partions of a 'fixed-partitions' node).
5+
6+
compatible: "fixed-partition"
7+
8+
properties:
9+
label:
10+
type: string
11+
required: false
12+
description: The label / name for this partition. If omitted, the label is taken
13+
from the node name (excluding the unit address).
14+
15+
read-only:
16+
type: boolean
17+
required: false
18+
description: This parameter, if present, is a hint that this
19+
partition should/ can only be used read-only.
20+
21+
reg:
22+
type: array
23+
required: false
24+
description: partition offset (address) and size within flash
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
3+
description: GPIO controller with two cells
4+
5+
compatible: "gpio-two-cell"
6+
7+
properties:
8+
"#gpio-cells":
9+
type: int
10+
required: true
11+
12+
gpio-cells:
13+
- gpio_cell_one
14+
- gpio_cell_two
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Copyright (c) 2020 Bobby Noelte
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: GPIO LED
5+
6+
compatible: "gpio-led"
7+
8+
properties:
9+
gpios:
10+
type: phandle-array
11+
required: true
12+
function:
13+
required: false
14+
type: int
15+
description: Numerical LED functon identifier.
16+
color:
17+
required: false
18+
type: int
19+
description: Numerical LED color identifier
20+
default-state:
21+
required: false
22+
type: int
23+
default: 0
24+
description: >
25+
The initial state of the LED. Valid values are LED_STATE_OFF (0),
26+
LED_STATE_ON (1), and LED_STATE_KEEP (2). If the LED is already on or
27+
off and the default-state property is set the to same value, then no
28+
glitch should be produced where the LED momentarily turns off (or on).
29+
The LED_STATE_KEEP setting will keep the LED at whatever its current
30+
state is, without producing a glitch. The default is LED_STATE_OFF (0)
31+
if this property is not present.
32+
led-pattern:
33+
required: false
34+
type: array
35+
description: Array of integers with default pattern for certain triggers.
36+
retain-state-suspended:
37+
required: false
38+
type: boolean
39+
description: Retain the state of the LED in suspend state.
40+
retain-state-shutdown:
41+
required: false
42+
type: boolean
43+
description: Retain the state of the LED on shutdown.
44+
panic-indicator:
45+
required: false
46+
type: boolean
47+
description: The LED should be used as a panic indicator.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2020 Bobby Noelte
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: GPIO LEDs controller
5+
6+
compatible: "gpio-leds"

scripts/dts/test-bindings/multidir.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
description: Binding in test-bindings/
44

5-
compatible: "in-dir-1"
5+
compatible: "in-dir"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Copyright (c) 2018,2019 Bobby Noelte
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: Flash partition definition for fixed partitions
5+
6+
compatible: "fixed-partitions"
7+
8+
properties:
9+
"#address-cells":
10+
type: int
11+
required: true
12+
description: >
13+
<1>: for partitions that require a single 32-bit cell to represent their
14+
size/address (aka the value is below 4 GiB)
15+
<2>: for partitions that require two 32-bit cells to represent their
16+
size/address (aka the value is 4 GiB or greater).
17+
18+
"#size-cells":
19+
type: int
20+
required: false
21+
description: >
22+
<1>: for partitions that require a single 32-bit cell to represent their
23+
size/address (aka the value is below 4 GiB)
24+
<2>: for partitions that require two 32-bit cells to represent their
25+
size/address (aka the value is 4 GiB or greater).

0 commit comments

Comments
 (0)