~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to roms/skiboot/doc/device-tree.txt

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Sapphire device-tree requirements
 
3
 *
 
4
 * Version: 0.2.1
 
5
 *
 
6
 * This documents the generated device-tree requirements, this is based on
 
7
 * a commented device-tree dump obtained from a DT generated by Sapphire
 
8
 * itself from an HDAT.
 
9
 */
 
10
 
 
11
/*
 
12
 * General comments:
 
13
 *
 
14
 *  - skiboot does not require nodes to have phandle properties, but
 
15
 *    if you have them then *all* nodes must have them including the
 
16
 *    root of the device-tree (currently a HB bug !). It is recommended
 
17
 *    to have them since they are needed to represent the cache levels.
 
18
 *
 
19
 *    NOTE: The example tree below only has phandle properties for
 
20
 *    nodes that are referenced by other nodes. This is *not* correct
 
21
 *    and is purely done for keeping this document smaller, make sure
 
22
 *    to follow the rule above.
 
23
 *
 
24
 *  - Only the "phandle" property is required. Sapphire also generates
 
25
 *    a "linux,phandle" for backward compatibility but doesn't require
 
26
 *    it as an input
 
27
 *
 
28
 *  - Any property not specifically documented must be put in "as is"
 
29
 *
 
30
 *  - All ibm,chip-id properties contain a HW chip ID which correspond
 
31
 *    on P8 to the PIR value shifted right by 7 bits, ie. it's a 6-bit
 
32
 *    value made of a 3-bit node number and a 3-bit chip number.
 
33
 *
 
34
 *  - Unit addresses (@xxxx part of node names) should if possible use
 
35
 *    lower case hexadecimal to be consistent with what skiboot does
 
36
 *    and to help some stupid parsers out there...
 
37
 */
 
38
 
 
39
/*
 
40
 * Version history
 
41
 *
 
42
 * 2013/10/08 : Version 0.1
 
43
 *
 
44
 * 2013/10/09 : Version 0.2
 
45
 *
 
46
 *    - Add comment about case of unit addresses
 
47
 *    - Add missing lpc node definition
 
48
 *    - Add example UART node on LPC
 
49
 *    - Remove "status" property from PSI xsco nodes
 
50
 *
 
51
 * 2014/03/26 : Version 0.2.1
 
52
 *
 
53
 *    - Fix cpus/xxx/ibm,pa-features to be a byte array
 
54
 */
 
55
 
 
56
/dts-v1/;
 
57
 
 
58
 
 
59
/*
 
60
 * Here are the reserve map entries. They should exactly match the
 
61
 * reserved-ranges property of the root node (see documentation
 
62
 * of that property)
 
63
 */
 
64
 
 
65
/memreserve/    0x00000007fe600000 0x0000000000100000;
 
66
/memreserve/    0x00000007fe200000 0x0000000000100000;
 
67
/memreserve/    0x0000000031e00000 0x00000000003e0000;
 
68
/memreserve/    0x0000000031000000 0x0000000000e00000;
 
69
/memreserve/    0x0000000030400000 0x0000000000c00000;
 
70
/memreserve/    0x0000000030000000 0x0000000000400000;
 
71
/memreserve/    0x0000000400000000 0x0000000000600450;
 
72
 
 
73
/* Root node */
 
74
/ {
 
75
        /*
 
76
         * "compatible" properties are string lists (ASCII strings separated by
 
77
         * \0 characters) indicating the overall compatibility from the more
 
78
         * specific to the least specific.
 
79
         *
 
80
         * The root node compatible property *must* contain "ibm,powernv" for
 
81
         * Linux to have the powernv platform match the machine. It is recommended
 
82
         * to add a slightly more precise property (first in order) indicating more
 
83
         * precisely the board type. We don't currently do that in HDAT based
 
84
         * setups but will.
 
85
         *
 
86
         * The standard naming is "vendor,name" so in your case, something like
 
87
         *
 
88
         * compatible = "goog,rhesus","ibm,powernv";
 
89
         *
 
90
         * would work. Or even better:
 
91
         *
 
92
         * compatible = "goog,rhesus-v1","goog,rhesus","ibm,powernv";
 
93
         */
 
94
        compatible = "ibm,powernv";
 
95
 
 
96
        /* mandatory */
 
97
        #address-cells = <0x2>;
 
98
        #size-cells = <0x2>;
 
99
 
 
100
        /* User visible board name (will be shown in /proc/cpuinfo) */
 
101
        model = "Machine Name";
 
102
 
 
103
        /*
 
104
         * The reserved-names and reserve-names properties work hand in hand. The first one
 
105
         * is a list of strings providing a "name" for each entry in the second one using
 
106
         * the traditional "vendor,name" format.
 
107
         *
 
108
         * The reserved-ranges property contains a list of ranges, each in the form of 2 cells
 
109
         * of address and 2 cells of size (64-bit x2 so each entry is 4 cells) indicating
 
110
         * regions of memory that are reserved and must not be overwritten by skiboot or
 
111
         * subsequently by the Linux Kernel.
 
112
         *
 
113
         * Corresponding entries must also be created in the "reserved map" part of the flat
 
114
         * device-tree (which is a binary list in the header of the fdt).
 
115
         *
 
116
         * Unless a component (skiboot or Linux) specifically knows about a region (usually
 
117
         * based on its name) and decides to change or remove it, all these regions are
 
118
         * passed as-is to Linux and to subsequent kernels across kexec and are kept
 
119
         * preserved.
 
120
         *
 
121
         * NOTE: Do *NOT* copy the entries below, they are just an example and are actually
 
122
         * created by skiboot itself. They represent the SLW image as "detected" by reading
 
123
         * the PBA BARs and skiboot own memory allocations.
 
124
         *
 
125
         * I would recommend that you put in there the SLW and OCC (or HOMER as one block
 
126
         * if that's how you use it) and any additional memory you want to preserve such
 
127
         * as FW log buffers etc...
 
128
         */
 
129
         
 
130
        reserved-names = "ibm,slw-image", "ibm,slw-image", "ibm,firmware-stacks", "ibm,firmware-data", "ibm,firmware-heap", "ibm,firmware-code", "memory@400000000";
 
131
        reserved-ranges = <0x7 0xfe600000 0x0 0x100000 0x7 0xfe200000 0x0 0x100000 0x0 0x31e00000 0x0 0x3e0000 0x0 0x31000000 0x0 0xe00000 0x0 0x30400000 0x0 0xc00000 0x0 0x30000000 0x0 0x400000 0x4 0x0 0x0 0x600450>;
 
132
 
 
133
        /* Mandatory */
 
134
        cpus {
 
135
                #address-cells = <0x1>;
 
136
                #size-cells = <0x0>;
 
137
 
 
138
                /*
 
139
                 * The following node must exist for each *core* in the system. The unit
 
140
                 * address (number after the @) is the hexadecimal HW CPU number (PIR value)
 
141
                 * of thread 0 of that core.
 
142
                 */
 
143
                PowerPC,POWER8@20 {
 
144
                        /* mandatory/standard properties */
 
145
                        device_type = "cpu";
 
146
                        64-bit;
 
147
                        32-64-bridge;
 
148
                        graphics;
 
149
                        general-purpose;
 
150
 
 
151
                        /*
 
152
                         * The "status" property indicate whether the core is functional. It's
 
153
                         * a string containing "okay" for a good core or "bad" for a non-functional
 
154
                         * one. You can also just ommit the non-functional ones from the DT
 
155
                         */
 
156
                        status = "okay";
 
157
 
 
158
                        /*
 
159
                         * This is the same value as the PIR of thread 0 of that core
 
160
                         * (ie same as the @xx part of the node name)
 
161
                         */
 
162
                        reg = <0x20>;
 
163
 
 
164
                        /* same as above */
 
165
                        ibm,pir = <0x20>;
 
166
 
 
167
                        /* chip ID of this core */
 
168
                        ibm,chip-id = <0x0>;
 
169
 
 
170
                        /*
 
171
                         * interrupt server numbers (aka HW processor numbers) of all threads
 
172
                         * on that core. This should have 8 numbers and the first one should
 
173
                         * have the same value as the above ibm,pir and reg properties
 
174
                         */
 
175
                        ibm,ppc-interrupt-server#s = <0x20 0x21 0x22 0x23 0x24 0x25 0x26 0x27>;
 
176
 
 
177
                        /*
 
178
                         * This is the "architected processor version" as defined in PAPR. Just
 
179
                         * stick to 0x0f000004 for P8 and things will be fine
 
180
                         */
 
181
                        cpu-version = <0x0f000004>;
 
182
 
 
183
                        /*
 
184
                         * These are various definitions of the page sizes and segment sizes
 
185
                         * supported by the MMU, those values are fine for P8 for now
 
186
                         */
 
187
                        ibm,processor-segment-sizes = <0x1c 0x28 0xffffffff 0xffffffff>;
 
188
                        ibm,processor-page-sizes = <0xc 0x10 0x18 0x22>;
 
189
                        ibm,segment-page-sizes = <0xc 0x0 0x3 0xc 0x0 0x10 0x7 0x18 0x38 0x10 0x110 0x2 0x10 0x1 0x18 0x8 0x18 0x100 0x1 0x18 0x0 0x22 0x120 0x1 0x22 0x3>;
 
190
 
 
191
                        /*
 
192
                         * Similarly that might need to be reviewed later but will do for now...
 
193
                         */                     
 
194
                        ibm,pa-features = [0x6 0x0 0xf6 0x3f 0xc7 0x0 0x80 0xc0];
 
195
 
 
196
                        /* SLB size, use as-is */
 
197
                        ibm,slb-size = <0x20>;
 
198
 
 
199
                        /* VSX support, use as-is */
 
200
                        ibm,vmx = <0x2>;
 
201
 
 
202
                        /* DFP support, use as-is */
 
203
                        ibm,dfp = <0x2>;
 
204
 
 
205
                        /* PURR/SPURR support, use as-is */
 
206
                        ibm,purr = <0x1>;
 
207
                        ibm,spurr = <0x1>;
 
208
 
 
209
                        /*
 
210
                         * Old-style core clock frequency. Only create this property if the frequency fits
 
211
                         * in a 32-bit number. Do not create it if it doesn't
 
212
                         */
 
213
                        clock-frequency = <0xf5552d00>;
 
214
 
 
215
                        /*
 
216
                         * mandatory: 64-bit version of the core clock frequency, always create this
 
217
                         * property.
 
218
                         */
 
219
                        ibm,extended-clock-frequency = <0x0 0xf5552d00>;
 
220
 
 
221
                        /* Timebase freq has a fixed value, always use that */
 
222
                        timebase-frequency = <0x1e848000>;
 
223
 
 
224
                        /* Same */
 
225
                        ibm,extended-timebase-frequency = <0x0 0x1e848000>;
 
226
 
 
227
                        /* Use as-is, values might need to be adjusted but that will do for now */
 
228
                        reservation-granule-size = <0x80>;
 
229
                        d-tlb-size = <0x800>;
 
230
                        i-tlb-size = <0x0>;
 
231
                        tlb-size = <0x800>;
 
232
                        d-tlb-sets = <0x4>;
 
233
                        i-tlb-sets = <0x0>;
 
234
                        tlb-sets = <0x4>;
 
235
                        d-cache-block-size = <0x80>;
 
236
                        i-cache-block-size = <0x80>;
 
237
                        d-cache-size = <0x10000>;
 
238
                        i-cache-size = <0x8000>;
 
239
                        i-cache-sets = <0x4>;
 
240
                        d-cache-sets = <0x8>;
 
241
                        performance-monitor = <0x0 0x1>;
 
242
 
 
243
                        /*
 
244
                         * optional: phandle of the node representing the L2 cache for this core,
 
245
                         * note: it can also be named "next-level-cache", Linux will support both
 
246
                         * and Sapphire doesn't currently use those properties, just passes them
 
247
                         * along to Linux
 
248
                         */
 
249
                        l2-cache = < 0x4 >;
 
250
                };
 
251
 
 
252
                /*
 
253
                 * Cache nodes. Those are siblings of the processor nodes under /cpus and
 
254
                 * represent the various level of caches.
 
255
                 *
 
256
                 * The unit address (and reg property) is mostly free-for-all as long as
 
257
                 * there is no collisions. On HDAT machines we use the following encoding
 
258
                 * which I encourage you to also follow to limit surprises:
 
259
                 *
 
260
                 * L2   :  (0x20 << 24) | PIR (PIR is PIR value of thread 0 of core)
 
261
                 * L3   :  (0x30 << 24) | PIR
 
262
                 * L3.5 :  (0x35 << 24) | PIR
 
263
                 *
 
264
                 * In addition, each cache points to the next level cache via its
 
265
                 * own "l2-cache" (or "next-level-cache") property, so the core node
 
266
                 * points to the L2, the L2 points to the L3 etc...
 
267
                 */
 
268
 
 
269
                l2-cache@20000020 {
 
270
                        phandle = <0x4>;
 
271
                        device_type = "cache";
 
272
                        reg = <0x20000020>;
 
273
                        status = "okay";
 
274
                        cache-unified;
 
275
                        d-cache-sets = <0x8>;
 
276
                        i-cache-sets = <0x8>;
 
277
                        d-cache-size = <0x80000>;
 
278
                        i-cache-size = <0x80000>;
 
279
                        l2-cache = <0x5>;
 
280
                };
 
281
 
 
282
                l3-cache@30000020 {
 
283
                        phandle = <0x5>;
 
284
                        device_type = "cache";
 
285
                        reg = <0x30000020>;
 
286
                        status = "bad";
 
287
                        cache-unified;
 
288
                        d-cache-sets = <0x8>;
 
289
                        i-cache-sets = <0x8>;
 
290
                        d-cache-size = <0x800000>;
 
291
                        i-cache-size = <0x800000>;
 
292
                };
 
293
 
 
294
        };
 
295
 
 
296
        /*
 
297
         * Interrupt presentation controller (ICP) nodes
 
298
         *
 
299
         * There is some flexibility as to how many of these are presents since
 
300
         * a given node can represent multiple ICPs. When generating from HDAT we
 
301
         * chose to create one per core
 
302
         */
 
303
        interrupt-controller@3ffff80020000 {
 
304
                /* Mandatory */
 
305
                compatible = "IBM,ppc-xicp", "IBM,power8-icp";
 
306
                interrupt-controller;
 
307
                #address-cells = <0x0>;
 
308
                device_type = "PowerPC-External-Interrupt-Presentation";
 
309
 
 
310
                /*
 
311
                 * Range of HW CPU IDs represented by that node. In this example
 
312
                 * the core starting at PIR 0x20 and 8 threads, which corresponds
 
313
                 * to the CPU node of the example above. The property in theory
 
314
                 * supports multiple ranges but Linux doesn't.
 
315
                 */
 
316
                ibm,interrupt-server-ranges = <0x20 0x8>;
 
317
 
 
318
                /*
 
319
                 * For each server in the above range, the physical address of the
 
320
                 * ICP register block and its size. Since the root node #address-cells
 
321
                 * and #size-cells properties are both "2", each entry is thus
 
322
                 * 2 cells address and 2 cells size (64-bit each).
 
323
                 */
 
324
                reg = <0x3ffff 0x80020000 0x0 0x1000 0x3ffff 0x80021000 0x0 0x1000 0x3ffff 0x80022000 0x0 0x1000 0x3ffff 0x80023000 0x0 0x1000 0x3ffff 0x80024000 0x0 0x1000 0x3ffff 0x80025000 0x0 0x1000 0x3ffff 0x80026000 0x0 0x1000 0x3ffff 0x80027000 0x0 0x1000>;
 
325
        };
 
326
 
 
327
        /*
 
328
         * The "memory" nodes represent physical memory in the system. They
 
329
         * do not represent DIMMs, memory controllers or Centaurs, thus will
 
330
         * be expressed separately.
 
331
         *
 
332
         * In order to be able to handle affinity properly, we require that
 
333
         * a memory node is created for each range of memory that has a different
 
334
         * "affinity", which in practice means for each chip since we don't
 
335
         * support memory interleaved across multiple chips on P8.
 
336
         *
 
337
         * Additionally, it is *not* required that one chip = one memory node,
 
338
         * it is perfectly acceptable to break down the memory of one chip into
 
339
         * multiple memory nodes (typically skiboot does that if the two MCs
 
340
         * are not interlaved).
 
341
         */
 
342
        memory@0 {
 
343
                device_type = "memory";
 
344
 
 
345
                /*
 
346
                 * We support multiple entries in the ibm,chip-id property for
 
347
                 * memory nodes in case the memory is interleaved across multiple
 
348
                 * chips but that shouldn't happen on P8
 
349
                 */
 
350
                ibm,chip-id = <0x0>;
 
351
 
 
352
                /* The "reg" property is 4 cells, as usual for a child of
 
353
                 * the root node, 2 cells of address and 2 cells of size
 
354
                 */
 
355
                reg = <0x0 0x0 0x4 0x0>;
 
356
        };
 
357
 
 
358
        /*
 
359
         * The XSCOM node. This is the closest thing to a "chip" node we have.
 
360
         * there must be one per chip in the system (thus a DCM has two) and
 
361
         * while it represents the "parent" of various devices on the PIB/PCB
 
362
         * that we want to expose, it is also used to store all sort of
 
363
         * miscellaneous per-chip information on HDAT based systems (such
 
364
         * as VPDs).
 
365
         */
 
366
        xscom@3fc0000000000 {
 
367
                /* standard & mandatory */
 
368
                #address-cells = <0x1>;
 
369
                #size-cells = <0x1>;
 
370
                scom-controller;
 
371
                compatible = "ibm,xscom", "ibm,power8-xscom";
 
372
 
 
373
                /* The chip ID as usual ... */
 
374
                ibm,chip-id = <0x0>;
 
375
 
 
376
                /* The base address of xscom for that chip */
 
377
                reg = <0x3fc00 0x0 0x8 0x0>;
 
378
 
 
379
                /*
 
380
                 * This comes from HDAT and I *think* is the raw content of the 
 
381
                 * module VPD eeprom (and thus doesn't have a standard ASCII keyword
 
382
                 * VPD format). We don't currently use it though ...
 
383
                 */
 
384
                ibm,module-vpd = < ... big pile of binary data ... >;
 
385
 
 
386
                /* PSI host bridge XSCOM register set */
 
387
                psihb@2010900 {
 
388
                        reg = <0x2010900 0x20>;
 
389
                        compatible = "ibm,power8-psihb-x", "ibm,psihb-x";
 
390
                };
 
391
 
 
392
                /* Chip TOD XSCOM register set */
 
393
                chiptod@40000 {
 
394
                        reg = <0x40000 0x34>;
 
395
                        compatible = "ibm,power-chiptod", "ibm,power8-chiptod";
 
396
 
 
397
                        /*
 
398
                         * Create that property with no value if this chip has
 
399
                         * the Primary TOD in the topology. If it has the secondary
 
400
                         * one (backup master ?) use "secondary".
 
401
                         */
 
402
                        primary;
 
403
                };
 
404
 
 
405
                /* NX XSCOM register set */
 
406
                nx@2010000 {
 
407
                        reg = <0x2010000 0x4000>;
 
408
                        compatible = "ibm,power-nx", "ibm,power8-nx";
 
409
                };
 
410
 
 
411
                /*
 
412
                 * PCI "PE Master" XSCOM register set for each active PHB
 
413
                 *
 
414
                 * For now, do *not* create these if the PHB isn't connected,
 
415
                 * clocked, or the PHY/HSS not configured.
 
416
                 */
 
417
                pbcq@2012000 {
 
418
                        reg = <0x2012000 0x20 0x9012000 0x5 0x9013c00 0x15>;
 
419
                        compatible = "ibm,power8-pbcq";
 
420
 
 
421
                        /* Indicate the PHB index on the chip, ie, 0,1 or 2 */
 
422
                        ibm,phb-index = <0x0>;
 
423
 
 
424
                        /* Create that property to use the IBM-style "A/B" dual input
 
425
                         * slot presence detect mechanism.
 
426
                         */
 
427
                        ibm,use-ab-detect;
 
428
 
 
429
                        /*
 
430
                         * TBD: Lane equalization values. Not currently used by
 
431
                         * skiboot but will have to be sorted out
 
432
                         */
 
433
                        ibm,lane_eq = <0x0>;
 
434
                };
 
435
 
 
436
                pbcq@2012400 {
 
437
                        reg = <0x2012400 0x20 0x9012400 0x5 0x9013c40 0x15>;
 
438
                        compatible = "ibm,power8-pbcq";
 
439
                        ibm,phb-index = <0x1>;
 
440
                        ibm,use-ab-detect;
 
441
                        ibm,lane_eq = <0x0>;
 
442
                };
 
443
 
 
444
                /*
 
445
                 * Here's the LPC bus. Ideally each chip has one but in
 
446
                 * practice it's ok to only populate the ones actually
 
447
                 * used for something. This is not an exact representation
 
448
                 * of HW, in that case we would have eccb -> opb -> lpc,
 
449
                 * but instead we just have an lpc node and the address is
 
450
                 * the base of the ECCB register set for it
 
451
                 *
 
452
                 * Devices on the LPC are represented as children nodes,
 
453
                 * see example below for a standard UART.
 
454
                 */
 
455
                lpc@b0020 {
 
456
                        /*
 
457
                         * Empty property indicating this is the primary
 
458
                         * LPC bus. It will be used for the default UART
 
459
                         * if any and this is the bus that will be used
 
460
                         * by Linux as the virtual 64k of IO ports
 
461
                         */
 
462
                        primary;
 
463
 
 
464
                        /*
 
465
                         * 2 cells of address, the first one indicates the
 
466
                         * address type, see below
 
467
                         */
 
468
                        #address-cells = <0x2>;
 
469
                        #size-cells = <0x1>;
 
470
                        reg = <0xb0020 0x4>;
 
471
                        compatible = "ibm,power8-lpc";
 
472
 
 
473
                        /*
 
474
                         * Example device: a UART on IO ports.
 
475
                         *
 
476
                         * LPC address have 2 cells. The first cell is the
 
477
                         * address type as follow:
 
478
                         *
 
479
                         *   0 : LPC memory space
 
480
                         *   1 : LPC IO space
 
481
                         *   2:  LPC FW space
 
482
                         *
 
483
                         * (This corresponds to the OPAL_LPC_* arguments
 
484
                         * passed to the opal_lpc_read/write functions)
 
485
                         *
 
486
                         * The unit address follows the old ISA convention
 
487
                         * for open firmware which prefixes IO ports with "i".
 
488
                         *
 
489
                         * (This is not critical and can be 1,3f8 if that's
 
490
                         * problematic to generate)
 
491
                         */
 
492
                        serial@i3f8 {
 
493
                                reg = <0x1 0x3f8 8>;
 
494
                                compatible = "ns16550", "pnpPNP,501";
 
495
 
 
496
                                /* Baud rate generator base frequency */
 
497
                                clock-frequency = < 1843200 >;
 
498
 
 
499
                                /* Default speed to use */
 
500
                                current-speed = < 115200 >;
 
501
 
 
502
                                /* Historical, helps Linux */
 
503
                                device_type = "serial";
 
504
 
 
505
                                /*
 
506
                                 * Indicate which chip ID the interrupt
 
507
                                 * is routed to (we assume it will always
 
508
                                 * be the "host error interrupt" (aka
 
509
                                 * "TPM interrupt" of that chip).
 
510
                                 */
 
511
                                 ibm,irq-chip-id = <0x0>;
 
512
                        }
 
513
                };
 
514
        };
 
515
};