Path: blob/master/Documentation/devicetree/bindings/common-properties.txt
26301 views
Common properties1=================23Endianness4----------56The Devicetree Specification does not define any properties related to hardware7byte swapping, but endianness issues show up frequently in porting drivers to8different machine types. This document attempts to provide a consistent9way of handling byte swapping across drivers.1011Optional properties:12- big-endian: Boolean; force big endian register accesses13unconditionally (e.g. ioread32be/iowrite32be). Use this if you14know the peripheral always needs to be accessed in big endian (BE) mode.15- little-endian: Boolean; force little endian register accesses16unconditionally (e.g. readl/writel). Use this if you know the17peripheral always needs to be accessed in little endian (LE) mode.18- native-endian: Boolean; always use register accesses matched to the19endianness of the kernel binary (e.g. LE vmlinux -> readl/writel,20BE vmlinux -> ioread32be/iowrite32be). In this case no byte swaps21will ever be performed. Use this if the hardware "self-adjusts"22register endianness based on the CPU's configured endianness.2324If a binding supports these properties, then the binding should also25specify the default behavior if none of these properties are present.26In such cases, little-endian is the preferred default, but it is not27a requirement. Some implementations assume that little-endian is28the default, because most existing (PCI-based) drivers implicitly29default to LE for their MMIO accesses.3031Examples:32Scenario 1 : CPU in LE mode & device in LE mode.33dev: dev@40031000 {34compatible = "name";35reg = <0x40031000 0x1000>;36...37native-endian;38};3940Scenario 2 : CPU in LE mode & device in BE mode.41dev: dev@40031000 {42compatible = "name";43reg = <0x40031000 0x1000>;44...45big-endian;46};4748Scenario 3 : CPU in BE mode & device in BE mode.49dev: dev@40031000 {50compatible = "name";51reg = <0x40031000 0x1000>;52...53native-endian;54};5556Scenario 4 : CPU in BE mode & device in LE mode.57dev: dev@40031000 {58compatible = "name";59reg = <0x40031000 0x1000>;60...61little-endian;62};6364Daisy-chained devices65---------------------6667Many serially-attached GPIO and IIO devices are daisy-chainable. To the68host controller, a daisy-chain appears as a single device, but the number69of inputs and outputs it provides is the sum of inputs and outputs provided70by all of its devices. The driver needs to know how many devices the71daisy-chain comprises to determine the amount of data exchanged, how many72inputs and outputs to register and so on.7374Optional properties:75- #daisy-chained-devices: Number of devices in the daisy-chain (default is 1).7677Example:78gpio@0 {79compatible = "name";80reg = <0>;81gpio-controller;82#gpio-cells = <2>;83#daisy-chained-devices = <3>;84};858687