-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdt-rust.yaml
87 lines (81 loc) · 2.24 KB
/
dt-rust.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Description of how to augment the devicetree for Rust.
#
# Each entry describes an augmentation that will be added to matching nodes in the device tree.
# The full syntax is described (indirectly) in `zephyr-build/src/devicetree/config.rs`.
# Gpio controllers match for every node that has a `gpio-controller` property. This is one of the
# few instances were we can actually just match on a property.
- name: gpio-controller
rules:
- type: has_prop
value: gpio-controller
actions:
- type: instance
value:
raw:
type: myself
device: crate::device::gpio::Gpio
# The gpio-leds node will have #children nodes describing each led. We'll match on the parent
# having this compatible property. The nodes themselves are built out of the properties associated
# with each gpio.
- name: gpio-leds
rules:
- type: compatible
value:
names:
- gpio-leds
level: 1
actions:
- type: instance
value:
raw:
type: phandle
value: gpios
device: crate::device::gpio::GpioPin
# Flash controllers don't have any particular property to identify them, so we need a list of
# compatible values that should match.
- name: flash-controller
rules:
- type: compatible
value:
names:
- "nordic,nrf52-flash-controller"
- "nordic,nrf51-flash-controller"
- "raspberrypi,pico-flash-controller"
level: 0
actions:
- type: instance
value:
raw:
type: myself
device: crate::device::flash::FlashController
# Flash partitions exist as children of a node compatible with "soc-nv-flash" that itself is a child
# of the controller itself.
# TODO: Get the write and erase property from the DT if present.
- name: flash-partition
rules:
- type: compatible
value:
names:
- "fixed-partitions"
level: 1
- type: compatible
value:
names:
- "soc-nv-flash"
level: 2
actions:
- type: instance
value:
raw:
type: parent
value:
level: 3
args:
- type: reg
device: "crate::device::flash::FlashPartition"
# Generate a pseudo node that matches all of the labels across the tree with their nodes.
- name: labels
rules:
- type: root
actions:
- type: labels