mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 16:50:36 +08:00
WIP: device tree MVP
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Bar bus controller
|
||||
|
||||
compatible: "bar-bus"
|
||||
|
||||
bus: "bar"
|
||||
@@ -0,0 +1,20 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: child-binding with separate compatible than the parent
|
||||
|
||||
compatible: "top-binding-with-compat"
|
||||
|
||||
child-binding:
|
||||
compatible: child-compat
|
||||
description: child node
|
||||
properties:
|
||||
child-prop:
|
||||
type: int
|
||||
required: true
|
||||
|
||||
child-binding:
|
||||
description: grandchild node
|
||||
properties:
|
||||
grandchild-prop:
|
||||
type: int
|
||||
required: true
|
||||
@@ -0,0 +1,19 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: child-binding test
|
||||
|
||||
compatible: "top-binding"
|
||||
|
||||
child-binding:
|
||||
description: child node
|
||||
properties:
|
||||
child-prop:
|
||||
type: int
|
||||
required: true
|
||||
|
||||
child-binding:
|
||||
description: grandchild node
|
||||
properties:
|
||||
grandchild-prop:
|
||||
type: int
|
||||
required: true
|
||||
@@ -0,0 +1,8 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
include: [grandchild-1.yaml, grandchild-2.yaml, grandchild-3.yaml]
|
||||
|
||||
properties:
|
||||
bar:
|
||||
required: true
|
||||
type: int
|
||||
@@ -0,0 +1,36 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Property default value test
|
||||
|
||||
compatible: "defaults"
|
||||
|
||||
properties:
|
||||
int:
|
||||
type: int
|
||||
required: false
|
||||
default: 123
|
||||
|
||||
array:
|
||||
type: array
|
||||
required: false
|
||||
default: [1, 2, 3]
|
||||
|
||||
uint8-array:
|
||||
type: uint8-array
|
||||
required: false
|
||||
default: [0x89, 0xAB, 0xCD]
|
||||
|
||||
string:
|
||||
type: string
|
||||
required: false
|
||||
default: "hello"
|
||||
|
||||
string-array:
|
||||
type: string-array
|
||||
required: false
|
||||
default: ["hello", "there"]
|
||||
|
||||
default-not-used:
|
||||
type: int
|
||||
required: false
|
||||
default: 123
|
||||
@@ -0,0 +1,15 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Property deprecated value test
|
||||
|
||||
compatible: "test-deprecated"
|
||||
|
||||
properties:
|
||||
oldprop:
|
||||
type: int
|
||||
deprecated: true
|
||||
required: false
|
||||
|
||||
curprop:
|
||||
type: int
|
||||
required: false
|
||||
@@ -0,0 +1,5 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Device on any bus
|
||||
|
||||
compatible: "on-any-bus"
|
||||
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Device on bar bus
|
||||
|
||||
compatible: "on-bus"
|
||||
|
||||
on-bus: "bar"
|
||||
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Device on foo bus
|
||||
|
||||
compatible: "on-bus"
|
||||
|
||||
on-bus: "foo"
|
||||
@@ -0,0 +1,36 @@
|
||||
# Copyright (c) 2020 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Property enum test
|
||||
|
||||
compatible: "enums"
|
||||
|
||||
properties:
|
||||
int-enum:
|
||||
type: int
|
||||
enum:
|
||||
- 1
|
||||
- 2
|
||||
- 3
|
||||
|
||||
string-enum: # not tokenizable
|
||||
type: string
|
||||
enum:
|
||||
- foo bar
|
||||
- foo_bar
|
||||
|
||||
tokenizable-lower-enum: # tokenizable in lowercase only
|
||||
type: string
|
||||
enum:
|
||||
- bar
|
||||
- BAR
|
||||
|
||||
tokenizable-enum: # tokenizable in lower and uppercase
|
||||
type: string
|
||||
enum:
|
||||
- bar
|
||||
- whitespace is ok
|
||||
- 123 is ok
|
||||
|
||||
no-enum:
|
||||
type: string
|
||||
@@ -0,0 +1,4 @@
|
||||
# A file that mentions a 'compatible' string without actually implementing it.
|
||||
# Used to check for issues with how we optimize binding loading.
|
||||
|
||||
# props
|
||||
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Foo bus controller
|
||||
|
||||
compatible: "foo-bus"
|
||||
|
||||
bus: "foo"
|
||||
@@ -0,0 +1,4 @@
|
||||
properties:
|
||||
foo:
|
||||
type: int
|
||||
required: false
|
||||
@@ -0,0 +1,4 @@
|
||||
properties:
|
||||
foo:
|
||||
type: int
|
||||
required: true
|
||||
@@ -0,0 +1,8 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: GPIO destination for mapping test
|
||||
|
||||
compatible: "gpio-dst"
|
||||
|
||||
gpio-cells:
|
||||
- val
|
||||
@@ -0,0 +1,9 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: GPIO source for mapping test
|
||||
|
||||
compatible: "gpio-src"
|
||||
|
||||
properties:
|
||||
foo-gpios:
|
||||
type: phandle-array
|
||||
@@ -0,0 +1,10 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
properties:
|
||||
foo:
|
||||
required: false
|
||||
type: int
|
||||
|
||||
baz:
|
||||
required: true
|
||||
type: int
|
||||
@@ -0,0 +1,6 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
properties:
|
||||
baz:
|
||||
required: true
|
||||
type: int
|
||||
@@ -0,0 +1,6 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
properties:
|
||||
qaz:
|
||||
required: true
|
||||
type: int
|
||||
@@ -0,0 +1,8 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Interrupt controller with one cell
|
||||
|
||||
compatible: "interrupt-one-cell"
|
||||
|
||||
interrupt-cells:
|
||||
- one
|
||||
@@ -0,0 +1,9 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Interrupt controller with two cells
|
||||
|
||||
compatible: "interrupt-two-cell"
|
||||
|
||||
interrupt-cells:
|
||||
- one
|
||||
- two
|
||||
@@ -0,0 +1,10 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Interrupt controller with three cells
|
||||
|
||||
compatible: "interrupt-three-cell"
|
||||
|
||||
interrupt-cells:
|
||||
- one
|
||||
- two
|
||||
- three
|
||||
@@ -0,0 +1,5 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Binding in test-bindings/
|
||||
|
||||
compatible: "in-dir-1"
|
||||
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Include ordering test
|
||||
|
||||
compatible: "order-1"
|
||||
|
||||
include: ["foo-required.yaml", "foo-optional.yaml"]
|
||||
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Include ordering test
|
||||
|
||||
compatible: "order-2"
|
||||
|
||||
include: ["foo-optional.yaml", "foo-required.yaml"]
|
||||
@@ -0,0 +1,13 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Parent binding
|
||||
|
||||
compatible: "binding-include-test"
|
||||
|
||||
include: child.yaml
|
||||
|
||||
properties:
|
||||
foo:
|
||||
# Changed from not being required in grandchild-1.yaml
|
||||
required: true
|
||||
# Type set in grandchild
|
||||
@@ -0,0 +1,7 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Controller with zero data values
|
||||
|
||||
compatible: "phandle-array-controller-0"
|
||||
|
||||
phandle-array-foo-cells: []
|
||||
@@ -0,0 +1,11 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Controller with one data value
|
||||
|
||||
compatible: "phandle-array-controller-1"
|
||||
|
||||
phandle-array-foo-cells:
|
||||
- one
|
||||
|
||||
gpio-cells:
|
||||
- gpio-one
|
||||
@@ -0,0 +1,9 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Controller with two data values
|
||||
|
||||
compatible: "phandle-array-controller-2"
|
||||
|
||||
phandle-array-foo-cells:
|
||||
- one
|
||||
- two
|
||||
@@ -0,0 +1,50 @@
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
description: Device.props test
|
||||
|
||||
compatible: "props"
|
||||
|
||||
properties:
|
||||
nonexistent-boolean:
|
||||
type: boolean
|
||||
|
||||
existent-boolean:
|
||||
type: boolean
|
||||
|
||||
int:
|
||||
type: int
|
||||
const: 1
|
||||
|
||||
array:
|
||||
type: array
|
||||
|
||||
uint8-array:
|
||||
type: uint8-array
|
||||
|
||||
string:
|
||||
type: string
|
||||
const: "foo"
|
||||
|
||||
string-array:
|
||||
type: string-array
|
||||
|
||||
phandle-ref:
|
||||
type: phandle
|
||||
|
||||
phandle-refs:
|
||||
type: phandles
|
||||
|
||||
phandle-array-foos:
|
||||
type: phandle-array
|
||||
|
||||
phandle-array-foo-names:
|
||||
type: string-array
|
||||
|
||||
# There's some slight special-casing for GPIOs in that 'foo-gpios = ...'
|
||||
# gets resolved to #gpio-cells rather than #foo-gpio-cells, so test that
|
||||
# too
|
||||
foo-gpios:
|
||||
type: phandle-array
|
||||
|
||||
path:
|
||||
type: path
|
||||
Reference in New Issue
Block a user