aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2016-03-17 13:23:40 -0400
committerMark Brown <broonie@kernel.org>2016-03-17 14:42:25 -0400
commit2596e07a3ed5a5f4d8b89be316c2b704d6f5dc5f (patch)
tree175d089ec68e5f6609fcd1577dab63b6b64083bf
parentd25263d917caadba52275bf95c9b3400fe77edbe (diff)
regmap: fix documentation to match code
The regmap binding talks about one thing, which is register endianess, and it gets almost every aspect of it wrong. This replaces the current text of the file with a version that makes more sense and that matches what we implement now. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: a06c488da0b0 ("regmap: Add explict native endian flag to DT bindings") Fixes: 275876e208e2 ("regmap: Add the DT binding documentation for endianness") Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--Documentation/devicetree/bindings/regmap/regmap.txt59
1 files changed, 19 insertions, 40 deletions
diff --git a/Documentation/devicetree/bindings/regmap/regmap.txt b/Documentation/devicetree/bindings/regmap/regmap.txt
index e98a9652ccc8..0127be360fe8 100644
--- a/Documentation/devicetree/bindings/regmap/regmap.txt
+++ b/Documentation/devicetree/bindings/regmap/regmap.txt
@@ -1,50 +1,29 @@
1Device-Tree binding for regmap 1Devicetree binding for regmap
2
3The endianness mode of CPU & Device scenarios:
4Index Device Endianness properties
5---------------------------------------------------
61 BE 'big-endian'
72 LE 'little-endian'
83 Native 'native-endian'
9
10For one device driver, which will run in different scenarios above
11on different SoCs using the devicetree, we need one way to simplify
12this.
13 2
14Optional properties: 3Optional properties:
15- {big,little,native}-endian: these are boolean properties, if absent
16 then the implementation will choose a default based on the device
17 being controlled. These properties are for register values and all
18 the buffers only. Native endian means that the CPU and device have
19 the same endianness.
20 4
21Examples: 5 little-endian,
22Scenario 1 : CPU in LE mode & device in LE mode. 6 big-endian,
23dev: dev@40031000 { 7 native-endian: See common-properties.txt for a definition
24 compatible = "name";
25 reg = <0x40031000 0x1000>;
26 ...
27};
28 8
29Scenario 2 : CPU in LE mode & device in BE mode. 9Note:
30dev: dev@40031000 { 10Regmap defaults to little-endian register access on MMIO based
31 compatible = "name"; 11devices, this is by far the most common setting. On CPU
32 reg = <0x40031000 0x1000>; 12architectures that typically run big-endian operating systems
33 ... 13(e.g. PowerPC), registers can be defined as big-endian and must
34 big-endian; 14be marked that way in the devicetree.
35};
36 15
37Scenario 3 : CPU in BE mode & device in BE mode. 16On SoCs that can be operated in both big-endian and little-endian
38dev: dev@40031000 { 17modes, with a single hardware switch controlling both the endianess
39 compatible = "name"; 18of the CPU and a byteswap for MMIO registers (e.g. many Broadcom MIPS
40 reg = <0x40031000 0x1000>; 19chips), "native-endian" is used to allow using the same device tree
41 ... 20blob in both cases.
42};
43 21
44Scenario 4 : CPU in BE mode & device in LE mode. 22Examples:
23Scenario 1 : a register set in big-endian mode.
45dev: dev@40031000 { 24dev: dev@40031000 {
46 compatible = "name"; 25 compatible = "syscon";
47 reg = <0x40031000 0x1000>; 26 reg = <0x40031000 0x1000>;
27 big-endian;
48 ... 28 ...
49 little-endian;
50}; 29};