1 .. SPDX-License-Identifier: GPL-2.0 2 3 ============================================== 4 DOs and DON'Ts for designing and writing Devic 5 ============================================== 6 7 This is a list of common review feedback items 8 every rule, there are exceptions and bindings 9 10 For guidelines related to patches, see 11 Documentation/devicetree/bindings/submitting-p 12 13 14 Overall design 15 ============== 16 17 - DO attempt to make bindings complete even if 18 features. For example, if a device has an in 19 'interrupts' property even if the driver is 20 21 - DON'T refer to Linux or "device driver" in b 22 based on what the hardware has, not what an 23 24 - DO use node names matching the class of the 25 defined in the DT Spec. If there isn't one, 26 27 - DO check that the example matches the docume 28 review changes. 29 30 - DON'T create nodes just for the sake of inst 31 devices only need child nodes when the child 32 resources. A single node can be multiple pro 33 34 - DON'T use 'syscon' alone without a specific 35 hardware block should have a compatible stri 36 register layout of the entire block (at a mi 37 38 39 Properties 40 ========== 41 42 - DO make 'compatible' properties specific. DO 43 strings. DO use fallback compatibles when de 44 of prior implementations. DO add new compati 45 features or bugs. 46 47 - DO use a vendor prefix on device-specific pr 48 properties could be common among devices of 49 existing bindings for similar devices. 50 51 - DON'T redefine common properties. Just refer 52 constraints specific to the device. 53 54 - DO use common property unit suffixes for pro 55 Recommended suffixes are listed at 56 https://github.com/devicetree-org/dt-schema/ 57 58 - DO define properties in terms of constraints 59 possible values? What is the order? 60 61 Typical cases and caveats 62 ========================= 63 64 - Phandle entries, like clocks/dmas/interrupts 65 explicitly ordered. Include the {clock,dma,i 66 more than one phandle. When used, both of th 67 constraints (e.g. list of items). 68 69 - For names used in {clock,dma,interrupt,reset 70 e.g.: "tx" instead of "txirq" (for interrupt 71 72 - Properties without schema types (e.g. withou 73 by schema) need the type, even if this is an 74 75 - If schema includes other schema (e.g. /schem 76 "unevaluatedProperties:false". In other case 77 "additionalProperties:false". 78 79 - For sub-blocks/components of bigger device ( 80 device-based compatible (e.g. SoC-based comp 81 versioning of that component. 82 For example use "vendor,soc1234-i2c" instead 83 84 - "syscon" is not a generic property. Use vend 85 "vendor,power-manager-syscon". 86 87 Board/SoC .dts Files 88 ==================== 89 90 - DO put all MMIO devices under a bus node and 91 92 - DO use non-empty 'ranges' to limit the size 93 platforms don't need all devices to have 64-
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.