-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathdt-rust.yaml
71 lines (66 loc) · 2.09 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
# 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:
- !HasProp gpio-controller
actions:
- !Instance
raw: !Myself
device: crate::device::gpio::Gpio
static_type: crate::device::gpio::GpioStatic
# 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:
- !Compatible
names: [gpio-leds]
level: 1
actions:
- !Instance
raw: !Phandle 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:
- !Compatible
names:
- "nordic,nrf52-flash-controller"
- "nordic,nrf51-flash-controller"
- "raspberrypi,pico-flash-controller"
- "zephyr,sim-flash"
level: 0
actions:
- !Instance
raw: !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:
- !Compatible
names:
- "fixed-partitions"
level: 1
- !Compatible
names:
- "soc-nv-flash"
level: 2
actions:
- !Instance
raw: !Parent
level: 3
args:
- !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: !Root
actions:
- !Labels