mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-12 18:01:35 +08:00
WIP: device tree MVP
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# Copyright (c) 2018, Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test ADC-based temperature sensor
|
||||
|
||||
compatible: "vnd,adc-temp-sensor"
|
||||
|
||||
include: base.yaml
|
||||
|
||||
properties:
|
||||
label:
|
||||
required: true
|
||||
|
||||
io-channels:
|
||||
required: true
|
||||
description: ADC conversion channels
|
||||
|
||||
io-channel-names:
|
||||
required: true
|
||||
description: conversion channel names
|
||||
|
||||
clocks:
|
||||
required: true
|
||||
|
||||
pinctrl-0:
|
||||
type: phandles
|
||||
|
||||
pinctrl-1:
|
||||
type: phandles
|
||||
|
||||
pinctrl-2:
|
||||
type: phandles
|
||||
@@ -0,0 +1,15 @@
|
||||
# Copyright (c) 2020, Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test ADC
|
||||
|
||||
compatible: "vnd,adc"
|
||||
|
||||
include: adc-controller.yaml
|
||||
|
||||
properties:
|
||||
"#io-channel-cells":
|
||||
const: 1
|
||||
|
||||
io-channel-cells:
|
||||
- input
|
||||
@@ -0,0 +1,17 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test array container
|
||||
|
||||
compatible: "vnd,array-holder"
|
||||
|
||||
include: [base.yaml]
|
||||
|
||||
properties:
|
||||
a: {type: "array"}
|
||||
b: {type: "uint8-array"}
|
||||
c: {type: "string-array"}
|
||||
|
||||
gpio-cells:
|
||||
- pin
|
||||
- flags
|
||||
@@ -0,0 +1,20 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: |
|
||||
CPU load simulator
|
||||
|
||||
compatible: "vnd,busy-sim"
|
||||
|
||||
properties:
|
||||
counter:
|
||||
type: phandle
|
||||
required: true
|
||||
description: |
|
||||
Counter device used for generating intervals.
|
||||
|
||||
active-gpios:
|
||||
type: phandle-array
|
||||
required: false
|
||||
description: |
|
||||
Debug pin is set to active state when cpu load is active.
|
||||
@@ -0,0 +1,15 @@
|
||||
# Copyright (c) 2020, Teslabs Engineering S.L.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test child bindings
|
||||
|
||||
compatible: "vnd,child-bindings"
|
||||
|
||||
include: [base.yaml]
|
||||
|
||||
child-binding:
|
||||
description: Test child binding
|
||||
properties:
|
||||
val:
|
||||
type: int
|
||||
required: true
|
||||
@@ -0,0 +1,16 @@
|
||||
# Copyright (c) 2020 Linaro Ltd.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test Clock Controller
|
||||
|
||||
compatible: "vnd,clock"
|
||||
|
||||
include: [clock-controller.yaml, base.yaml]
|
||||
|
||||
properties:
|
||||
"#clock-cells":
|
||||
const: 2
|
||||
|
||||
clock-cells:
|
||||
- bus
|
||||
- bits
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test disabled compatible
|
||||
|
||||
compatible: "vnd,disabled-compat"
|
||||
|
||||
include: base.yaml
|
||||
@@ -0,0 +1,22 @@
|
||||
# Copyright (c) 2020, Linaro Limited
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: VND DMA controller
|
||||
|
||||
compatible: "vnd,dma"
|
||||
|
||||
include: dma-controller.yaml
|
||||
|
||||
properties:
|
||||
reg:
|
||||
required: true
|
||||
|
||||
interrupts:
|
||||
required: true
|
||||
|
||||
"#dma-cells":
|
||||
const: 2
|
||||
|
||||
dma-cells:
|
||||
- channel
|
||||
- slot
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test enum property container (instance based)
|
||||
|
||||
compatible: "vnd,enum-holder-inst"
|
||||
|
||||
include: [base.yaml, "vnd,enum-holder.yaml"]
|
||||
@@ -0,0 +1,17 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test enum property container
|
||||
|
||||
compatible: "vnd,enum-holder"
|
||||
|
||||
include: [base.yaml]
|
||||
|
||||
properties:
|
||||
val:
|
||||
type: string
|
||||
required: true
|
||||
enum:
|
||||
- "zero"
|
||||
- "one"
|
||||
- "two"
|
||||
@@ -0,0 +1,18 @@
|
||||
# Copyright (c) 2020 Linaro Limited
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test enum property container
|
||||
|
||||
compatible: "vnd,enum-int-required-false-holder"
|
||||
|
||||
include: [base.yaml]
|
||||
|
||||
properties:
|
||||
val:
|
||||
type: int
|
||||
required: false
|
||||
enum:
|
||||
- 5
|
||||
- 6
|
||||
- 7
|
||||
- 8
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test enum property container (instance based)
|
||||
|
||||
compatible: "vnd,enum-required-false-holder-inst"
|
||||
|
||||
include: [base.yaml, "vnd,enum-required-false-holder.yaml"]
|
||||
@@ -0,0 +1,17 @@
|
||||
# Copyright (c) 2020 Linaro Limited
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test enum property container
|
||||
|
||||
compatible: "vnd,enum-required-false-holder"
|
||||
|
||||
include: [base.yaml]
|
||||
|
||||
properties:
|
||||
val:
|
||||
type: string
|
||||
required: false
|
||||
enum:
|
||||
- "zero"
|
||||
- "one"
|
||||
- "two"
|
||||
@@ -0,0 +1,20 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test GPIO node
|
||||
|
||||
include: [gpio-controller.yaml, base.yaml]
|
||||
|
||||
properties:
|
||||
reg:
|
||||
required: true
|
||||
|
||||
label:
|
||||
required: true
|
||||
|
||||
"#gpio-cells":
|
||||
const: 2
|
||||
|
||||
gpio-cells:
|
||||
- pin
|
||||
- flags
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: GPIO expander via I2C
|
||||
|
||||
compatible: "vnd,gpio-expander"
|
||||
|
||||
include: ["vnd,gpio-expander-common.yaml", i2c-device.yaml]
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: GPIO expander via SPI
|
||||
|
||||
compatible: "vnd,gpio-expander"
|
||||
|
||||
include: ["vnd,gpio-expander-common.yaml", spi-device.yaml]
|
||||
@@ -0,0 +1,21 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test GPIO node with one cell
|
||||
|
||||
compatible: "vnd,gpio-one-cell"
|
||||
|
||||
include: [gpio-controller.yaml, base.yaml]
|
||||
|
||||
properties:
|
||||
reg:
|
||||
required: true
|
||||
|
||||
label:
|
||||
required: true
|
||||
|
||||
"#gpio-cells":
|
||||
const: 1
|
||||
|
||||
gpio-cells:
|
||||
- pin
|
||||
@@ -0,0 +1,28 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test GPIO node
|
||||
|
||||
compatible: "vnd,gpio"
|
||||
|
||||
include: [gpio-controller.yaml, base.yaml]
|
||||
|
||||
properties:
|
||||
reg:
|
||||
required: true
|
||||
|
||||
label:
|
||||
required: true
|
||||
|
||||
"#gpio-cells":
|
||||
const: 2
|
||||
|
||||
gpio-cells:
|
||||
- pin
|
||||
- flags
|
||||
|
||||
foo-cells:
|
||||
- foocell
|
||||
|
||||
baz-cells:
|
||||
- bazcell
|
||||
@@ -0,0 +1,27 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: |
|
||||
Test binding for 3 levels of "child-binding".
|
||||
|
||||
Previous versions of Zephyr only allowed up to two levels of
|
||||
"child-binding:" in a YAML file. This file is used to test that the
|
||||
restriction no longer holds.
|
||||
|
||||
compatible: "vnd,great-grandchild-bindings"
|
||||
|
||||
include: [base.yaml]
|
||||
|
||||
child-binding:
|
||||
description: child node, no properties
|
||||
|
||||
child-binding:
|
||||
description: grandchild node, no properties
|
||||
|
||||
child-binding:
|
||||
description: great-grandchild node, ggc-prop property
|
||||
|
||||
properties:
|
||||
ggc-prop:
|
||||
type: int
|
||||
required: true
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test I2C device
|
||||
|
||||
compatible: "vnd,i2c-device"
|
||||
|
||||
include: i2c-device.yaml
|
||||
@@ -0,0 +1,18 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: |
|
||||
I2C mux
|
||||
|
||||
This is an I2C device that is also (multiple) I2C controllers. We
|
||||
model this as a node which is an I2C device, whose children are I2C
|
||||
controllers, and whose grandchildren are therefore I2C devices.
|
||||
|
||||
compatible: "vnd,i2c-mux"
|
||||
|
||||
include: "i2c-device.yaml"
|
||||
|
||||
child-binding:
|
||||
description: I2C mux controller
|
||||
compatible: "vnd,i2c-mux-controller"
|
||||
include: "i2c-controller.yaml"
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test I2C node
|
||||
|
||||
compatible: "vnd,i2c"
|
||||
|
||||
include: [i2c-controller.yaml, base.yaml]
|
||||
@@ -0,0 +1,19 @@
|
||||
# Copyright (c) 2020 Linaro Ltd.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test Interrupt Controller
|
||||
|
||||
compatible: "vnd,intc"
|
||||
|
||||
include: [interrupt-controller.yaml, base.yaml]
|
||||
|
||||
properties:
|
||||
reg:
|
||||
required: true
|
||||
|
||||
"#interrupt-cells":
|
||||
const: 2
|
||||
|
||||
interrupt-cells:
|
||||
- irq
|
||||
- priority
|
||||
@@ -0,0 +1,15 @@
|
||||
# Copyright (c) 2020 Linaro Ltd.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test Interrupt Controller
|
||||
|
||||
compatible: "vnd,interrupt-holder"
|
||||
|
||||
include: [base.yaml]
|
||||
|
||||
properties:
|
||||
interrupts:
|
||||
required: true
|
||||
|
||||
interrupt-names:
|
||||
required: true
|
||||
@@ -0,0 +1,11 @@
|
||||
# Copyright (c) 2021, Carlo Caione <ccaione@baylibre.com>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: VND MBOX controller (0 cell)
|
||||
|
||||
compatible: "vnd,mbox-zero-cell"
|
||||
|
||||
properties:
|
||||
label:
|
||||
type: string
|
||||
required: true
|
||||
@@ -0,0 +1,16 @@
|
||||
# Copyright (c) 2021, Carlo Caione <ccaione@baylibre.com>
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: VND MBOX controller
|
||||
|
||||
compatible: "vnd,mbox"
|
||||
|
||||
include: mailbox-controller.yaml
|
||||
|
||||
properties:
|
||||
label:
|
||||
type: string
|
||||
required: true
|
||||
|
||||
mbox-cells:
|
||||
- channel
|
||||
@@ -0,0 +1,10 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test PCIe bus controller
|
||||
|
||||
compatible: vnd,pcie
|
||||
|
||||
include: base.yaml
|
||||
|
||||
bus: pcie
|
||||
@@ -0,0 +1,23 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test phandle property container
|
||||
|
||||
compatible: "vnd,phandle-holder"
|
||||
|
||||
include: [base.yaml]
|
||||
|
||||
properties:
|
||||
ph: {type: "phandle"}
|
||||
phs: {type: "phandles"}
|
||||
phs-or: {type: "phandles"}
|
||||
pha-gpios: {type: "phandle-array"}
|
||||
gpios: {type: "phandle-array"}
|
||||
foos: {type: "phandle-array"}
|
||||
foo-names: {type: "string-array"}
|
||||
pwms: {type: "phandle-array"}
|
||||
pwm-names: {type: "string-array"}
|
||||
bar:
|
||||
type: "phandle-array"
|
||||
specifier-space: baz
|
||||
baz-names: {type: "string-array"}
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test device for pin controller.
|
||||
|
||||
compatible: "vnd,pinctrl-device"
|
||||
|
||||
include: [base.yaml, pinctrl-device.yaml]
|
||||
@@ -0,0 +1,59 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: |
|
||||
Test pin controller.
|
||||
|
||||
compatible: "vnd,pinctrl-test"
|
||||
|
||||
include:
|
||||
- name: base.yaml
|
||||
- name: pincfg-node-group.yaml
|
||||
child-binding:
|
||||
child-binding:
|
||||
property-allowlist:
|
||||
- bias-pull-down
|
||||
- bias-pull-up
|
||||
|
||||
child-binding:
|
||||
description: |
|
||||
Test pin controller pin configuration nodes. Each node is composed by one or
|
||||
more groups, each defining the configuration for a set of pins.
|
||||
|
||||
child-binding:
|
||||
description: |
|
||||
Test pin controller pin configuration group. Each group contains a list of
|
||||
pins sharing the same set of properties. Example:
|
||||
|
||||
/* node representing default state for test_device0 */
|
||||
test_device0_default: test_device0_default {
|
||||
/* group 1 (name is arbitrary) */
|
||||
pins1 {
|
||||
/* configure pins 0 and 1 */
|
||||
pins = <0>, <1>;
|
||||
/* both pins 0 and 1 have pull-up enabled */
|
||||
bias-pull-up;
|
||||
};
|
||||
...
|
||||
/* group N (name is arbitrary) */
|
||||
pinsN {
|
||||
/* configure pin M */
|
||||
pins = <M>;
|
||||
/* pin M has pull-down enabled */
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
The list of supported standard properties:
|
||||
|
||||
- bias-pull-up: Enable pull-up resistor.
|
||||
- bias-pull-down: Enable pull-down resistor.
|
||||
|
||||
properties:
|
||||
pins:
|
||||
required: true
|
||||
type: array
|
||||
description: |
|
||||
An array of pins sharing the same group properties. Each entry is a
|
||||
32-bit integer that is just used to identify the entry for testing
|
||||
purposes.
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test pin controller node
|
||||
|
||||
compatible: "vnd,pinctrl"
|
||||
|
||||
include: pincfg-node.yaml
|
||||
@@ -0,0 +1,20 @@
|
||||
# Copyright (c) 2020, Linaro Limited
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: VND PWM controller
|
||||
|
||||
compatible: "vnd,pwm"
|
||||
|
||||
include: [pwm-controller.yaml, base.yaml]
|
||||
|
||||
properties:
|
||||
reg:
|
||||
required: true
|
||||
|
||||
"#pwm-cells":
|
||||
const: 3
|
||||
|
||||
pwm-cells:
|
||||
- channel
|
||||
- period
|
||||
- flags
|
||||
@@ -0,0 +1,18 @@
|
||||
# Copyright (c) 2020 Linaro Ltd.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test register property container
|
||||
|
||||
compatible: "vnd,reg-holder"
|
||||
|
||||
include: [base.yaml]
|
||||
|
||||
properties:
|
||||
reg:
|
||||
required: true
|
||||
|
||||
reg-names:
|
||||
required: true
|
||||
|
||||
misc-prop:
|
||||
type: int
|
||||
@@ -0,0 +1,13 @@
|
||||
description: Test serial port
|
||||
|
||||
compatible: "vnd,serial"
|
||||
|
||||
include: uart-controller.yaml
|
||||
|
||||
properties:
|
||||
reg:
|
||||
required: true
|
||||
|
||||
baud-rate:
|
||||
type: int
|
||||
required: false
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test SPI device 2
|
||||
|
||||
compatible: "vnd,spi-device-2"
|
||||
|
||||
include: spi-device.yaml
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test SPI device
|
||||
|
||||
compatible: "vnd,spi-device"
|
||||
|
||||
include: spi-device.yaml
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: Test SPI node
|
||||
|
||||
compatible: "vnd,spi"
|
||||
|
||||
include: [spi-controller.yaml, base.yaml]
|
||||
Reference in New Issue
Block a user