Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt/documentation: Fix value format description

Numeric values in dts files can be specified in decimal and hex (the latter
prefixed 0x). The current documentation is updated with this patch to prevent
confusion about what is meant with values without "0x" (previously hex, now
dec).

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Rob Landley <rob@landley.net>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

authored by

Roland Stigge and committed by
Grant Likely
36793623 99fc012b

+28 -27
+28 -27
Documentation/devicetree/booting-without-of.txt
··· 551 551 designates a node followed by the node unit name. Properties are 552 552 presented with their name followed by their content. "content" 553 553 represents an ASCII string (zero terminated) value, while <content> 554 - represents a 32-bit hexadecimal value. The various nodes in this 555 - example will be discussed in a later chapter. At this point, it is 556 - only meant to give you a idea of what a device-tree looks like. I have 557 - purposefully kept the "name" and "linux,phandle" properties which 558 - aren't necessary in order to give you a better idea of what the tree 559 - looks like in practice. 554 + represents a 32-bit value, specified in decimal or hexadecimal (the 555 + latter prefixed 0x). The various nodes in this example will be 556 + discussed in a later chapter. At this point, it is only meant to give 557 + you a idea of what a device-tree looks like. I have purposefully kept 558 + the "name" and "linux,phandle" properties which aren't necessary in 559 + order to give you a better idea of what the tree looks like in 560 + practice. 560 561 561 562 / o device-tree 562 563 |- name = "device-tree" ··· 577 576 | |- name = "PowerPC,970" 578 577 | |- device_type = "cpu" 579 578 | |- reg = <0> 580 - | |- clock-frequency = <5f5e1000> 579 + | |- clock-frequency = <0x5f5e1000> 581 580 | |- 64-bit 582 581 | |- linux,phandle = <2> 583 582 | 584 583 o memory@0 585 584 | |- name = "memory" 586 585 | |- device_type = "memory" 587 - | |- reg = <00000000 00000000 00000000 20000000> 586 + | |- reg = <0x00000000 0x00000000 0x00000000 0x20000000> 588 587 | |- linux,phandle = <3> 589 588 | 590 589 o chosen ··· 1011 1010 #size-cells = <1>; 1012 1011 #interrupt-cells = <2>; 1013 1012 device_type = "soc"; 1014 - ranges = <00000000 e0000000 00100000> 1015 - reg = <e0000000 00003000>; 1013 + ranges = <0x00000000 0xe0000000 0x00100000> 1014 + reg = <0xe0000000 0x00003000>; 1016 1015 bus-frequency = <0>; 1017 1016 } 1018 1017 ··· 1086 1085 * terminated string 1087 1086 */ 1088 1087 1089 - property2 = <1234abcd>; /* define a property containing a 1088 + property2 = <0x1234abcd>; /* define a property containing a 1090 1089 * numerical 32-bit value (hexadecimal) 1091 1090 */ 1092 1091 1093 - property3 = <12345678 12345678 deadbeef>; 1092 + property3 = <0x12345678 0x12345678 0xdeadbeef>; 1094 1093 /* define a property containing 3 1095 1094 * numerical 32-bit values (cells) in 1096 1095 * hexadecimal 1097 1096 */ 1098 - property4 = [0a 0b 0c 0d de ea ad be ef]; 1097 + property4 = [0x0a 0x0b 0x0c 0x0d 0xde 0xea 0xad 0xbe 0xef]; 1099 1098 /* define a property whose content is 1100 1099 * an arbitrary array of bytes 1101 1100 */ ··· 1351 1350 model = "TSEC"; 1352 1351 compatible = "gianfar", "simple-bus"; 1353 1352 reg = <0x24000 0x1000>; 1354 - local-mac-address = [ 00 E0 0C 00 73 00 ]; 1355 - interrupts = <29 2 30 2 34 2>; 1353 + local-mac-address = [ 0x00 0xE0 0x0C 0x00 0x73 0x00 ]; 1354 + interrupts = <0x29 2 0x30 2 0x34 2>; 1356 1355 phy-handle = <&phy0>; 1357 - sleep = <&pmc 00000080>; 1356 + sleep = <&pmc 0x00000080>; 1358 1357 ranges; 1359 1358 1360 1359 mdio@24520 { ··· 1386 1385 model = "TSEC"; 1387 1386 compatible = "gianfar"; 1388 1387 reg = <0x25000 0x1000>; 1389 - local-mac-address = [ 00 E0 0C 00 73 01 ]; 1390 - interrupts = <13 2 14 2 18 2>; 1388 + local-mac-address = [ 0x00 0xE0 0x0C 0x00 0x73 0x01 ]; 1389 + interrupts = <0x13 2 0x14 2 0x18 2>; 1391 1390 phy-handle = <&phy1>; 1392 - sleep = <&pmc 00000040>; 1391 + sleep = <&pmc 0x00000040>; 1393 1392 }; 1394 1393 1395 1394 ethernet@26000 { ··· 1397 1396 model = "FEC"; 1398 1397 compatible = "gianfar"; 1399 1398 reg = <0x26000 0x1000>; 1400 - local-mac-address = [ 00 E0 0C 00 73 02 ]; 1401 - interrupts = <41 2>; 1399 + local-mac-address = [ 0x00 0xE0 0x0C 0x00 0x73 0x02 ]; 1400 + interrupts = <0x41 2>; 1402 1401 phy-handle = <&phy3>; 1403 - sleep = <&pmc 00000020>; 1402 + sleep = <&pmc 0x00000020>; 1404 1403 }; 1405 1404 1406 1405 serial@4500 { 1407 1406 #address-cells = <1>; 1408 1407 #size-cells = <1>; 1409 1408 compatible = "fsl,mpc8540-duart", "simple-bus"; 1410 - sleep = <&pmc 00000002>; 1409 + sleep = <&pmc 0x00000002>; 1411 1410 ranges; 1412 1411 1413 1412 serial@4500 { ··· 1415 1414 compatible = "ns16550"; 1416 1415 reg = <0x4500 0x100>; 1417 1416 clock-frequency = <0>; 1418 - interrupts = <42 2>; 1417 + interrupts = <0x42 2>; 1419 1418 }; 1420 1419 1421 1420 serial@4600 { ··· 1423 1422 compatible = "ns16550"; 1424 1423 reg = <0x4600 0x100>; 1425 1424 clock-frequency = <0>; 1426 - interrupts = <42 2>; 1425 + interrupts = <0x42 2>; 1427 1426 }; 1428 1427 }; 1429 1428 ··· 1437 1436 }; 1438 1437 1439 1438 i2c@3000 { 1440 - interrupts = <43 2>; 1439 + interrupts = <0x43 2>; 1441 1440 reg = <0x3000 0x100>; 1442 1441 compatible = "fsl-i2c"; 1443 1442 dfsrr; 1444 - sleep = <&pmc 00000004>; 1443 + sleep = <&pmc 0x00000004>; 1445 1444 }; 1446 1445 1447 1446 pmc: power@e0070 {