Michael Pratt | fa28d14 | 2018-06-11 13:07:09 -0600 | [diff] [blame^] | 1 | * Memory binding |
| 2 | |
| 3 | The memory binding for U-Boot is as in the ePAPR with the following additions: |
| 4 | |
| 5 | Optional subnodes can be used defining the memory layout for different board |
| 6 | ID masks. To match a set of board ids, a board-id node may define match-mask |
| 7 | and match-value ints to define a mask to apply to the board id, and the value |
| 8 | that the result should have for the match to be considered valid. The mask |
| 9 | defaults to -1, meaning that the value must fully match the board id. |
| 10 | |
| 11 | If subnodes are present, then the /memory node must define these properties: |
| 12 | |
| 13 | - #address-cells: should be 1. |
| 14 | - #size-cells: should be 0. |
| 15 | |
| 16 | Each subnode must define |
| 17 | |
| 18 | reg - board ID or mask for this subnode |
| 19 | memory-banks - list of memory banks in the same format as normal |
| 20 | |
| 21 | Each subnode may optionally define: |
| 22 | |
| 23 | match-mask - A mask to apply to the board id. This must be accompanied by |
| 24 | match-value. |
| 25 | match-value - The required resulting value of the board id mask for the given |
| 26 | node to be considered a match. |
| 27 | auto-size - Indicates that the value given for a bank is the maximum size, |
| 28 | each bank is probed to determine its actual size, which may be |
| 29 | smaller |
| 30 | |
| 31 | |
| 32 | The board id determination is up to the vendor and is not defined by this |
| 33 | binding. |
| 34 | |
| 35 | Example: |
| 36 | |
| 37 | memory { |
| 38 | #address-cells = <1>; |
| 39 | #size-cells = <1>; |
| 40 | reg = <0x20000000 0x20000000 |
| 41 | 0x40000000 0x20000000 |
| 42 | 0x60000000 0x20000000 |
| 43 | 0x80000000 0x20000000>; |
| 44 | auto-size; |
| 45 | board-id@0 { |
| 46 | match-value = <17>; |
| 47 | reg = <0x20000000 0x20000000 |
| 48 | 0x40000000 0x20000000>; |
| 49 | }; |
| 50 | board-id@1 { |
| 51 | match-mask = <2>; |
| 52 | match-value = <2>; |
| 53 | reg = <0x20000000 0x20000000 |
| 54 | 0x40000000 0x20000000 |
| 55 | 0x60000000 0x20000000 |
| 56 | 0x80000000 0x20000000 |
| 57 | 0xa0000000 0x20000000 |
| 58 | 0xc0000000 0x20000000 |
| 59 | 0xe0000000 0x20000000>; |
| 60 | }; |
| 61 | }; |
| 62 | |
| 63 | |
| 64 | This shows a system with the following properties: |
| 65 | * Default of 2GB of memory, auto-sized, so could be smaller |
| 66 | * 3.5GB of memory (with no auto-size) if (board id & 2) is 2 |
| 67 | * 1GB of memory (with no auto-size) if board id is 17. |