e31b814977f408ce850e77c29411a364bfc7ad88
[openwrt.git] / 700-powerpc_git.patch
1 --- a/Documentation/kernel-parameters.txt
2 +++ b/Documentation/kernel-parameters.txt
3 @@ -686,6 +686,7 @@
4                         See Documentation/isdn/README.HiSax.
5  
6         hugepages=      [HW,X86-32,IA-64] Maximal number of HugeTLB pages.
7 +       hugepagesz=     [HW,IA-64,PPC] The size of the HugeTLB pages.
8  
9         i8042.direct    [HW] Put keyboard port into non-translated mode
10         i8042.dumbkbd   [HW] Pretend that controller can only read data from
11 --- a/Documentation/powerpc/00-INDEX
12 +++ b/Documentation/powerpc/00-INDEX
13 @@ -28,3 +28,6 @@
14         - info on sound support under Linux/PPC
15  zImage_layout.txt
16         - info on the kernel images for Linux/PPC
17 +qe_firmware.txt
18 +       - describes the layout of firmware binaries for the Freescale QUICC
19 +         Engine and the code that parses and uploads the microcode therein.
20 --- a/Documentation/powerpc/booting-without-of.txt
21 +++ b/Documentation/powerpc/booting-without-of.txt
22 @@ -52,7 +52,11 @@
23        i) Freescale QUICC Engine module (QE)
24        j) CFI or JEDEC memory-mapped NOR flash
25        k) Global Utilities Block
26 -      l) Xilinx IP cores
27 +      l) Freescale Communications Processor Module
28 +      m) Chipselect/Local Bus
29 +      n) 4xx/Axon EMAC ethernet nodes
30 +      o) Xilinx IP cores
31 +      p) Freescale Synchronous Serial Interface
32  
33    VII - Specifying interrupt information for devices
34      1) interrupts property
35 @@ -671,10 +675,10 @@
36  
37  In general, the format of an address for a device is defined by the
38  parent bus type, based on the #address-cells and #size-cells
39 -property. In the absence of such a property, the parent's parent
40 -values are used, etc... The kernel requires the root node to have
41 -those properties defining addresses format for devices directly mapped
42 -on the processor bus.
43 +properties.  Note that the parent's parent definitions of #address-cells
44 +and #size-cells are not inhereted so every node with children must specify
45 +them.  The kernel requires the root node to have those properties defining
46 +addresses format for devices directly mapped on the processor bus.
47  
48  Those 2 properties define 'cells' for representing an address and a
49  size. A "cell" is a 32-bit number. For example, if both contain 2
50 @@ -711,13 +715,14 @@
51  like address space bits, you'll have to add a bus translator to the
52  prom_parse.c file of the recent kernels for your bus type.
53  
54 -The "reg" property only defines addresses and sizes (if #size-cells
55 -is non-0) within a given bus. In order to translate addresses upward
56 +The "reg" property only defines addresses and sizes (if #size-cells is
57 +non-0) within a given bus. In order to translate addresses upward
58  (that is into parent bus addresses, and possibly into CPU physical
59  addresses), all busses must contain a "ranges" property. If the
60  "ranges" property is missing at a given level, it's assumed that
61 -translation isn't possible. The format of the "ranges" property for a
62 -bus is a list of:
63 +translation isn't possible, i.e., the registers are not visible on the
64 +parent bus.  The format of the "ranges" property for a bus is a list
65 +of:
66  
67         bus address, parent bus address, size
68  
69 @@ -735,6 +740,10 @@
70  1/1 format, unless the processor supports physical addresses greater
71  than 32-bits, in which case a 2/1 format is recommended.
72  
73 +Alternatively, the "ranges" property may be empty, indicating that the
74 +registers are visible on the parent bus using an identity mapping
75 +translation.  In other words, the parent bus address space is the same
76 +as the child bus address space.
77  
78  2) Note about "compatible" properties
79  -------------------------------------
80 @@ -1218,16 +1227,14 @@
81  
82    Required properties:
83      - reg : Offset and length of the register set for the device
84 -    - device_type : Should be "mdio"
85      - compatible : Should define the compatible device type for the
86 -      mdio.  Currently, this is most likely to be "gianfar"
87 +      mdio.  Currently, this is most likely to be "fsl,gianfar-mdio"
88  
89    Example:
90  
91         mdio@24520 {
92                 reg = <24520 20>;
93 -               device_type = "mdio"; 
94 -               compatible = "gianfar";
95 +               compatible = "fsl,gianfar-mdio";
96  
97                 ethernet-phy@0 {
98                         ......
99 @@ -1254,6 +1261,10 @@
100        services interrupts for this device.
101      - phy-handle : The phandle for the PHY connected to this ethernet
102        controller.
103 +    - fixed-link : <a b c d e> where a is emulated phy id - choose any,
104 +      but unique to the all specified fixed-links, b is duplex - 0 half,
105 +      1 full, c is link speed - d#10/d#100/d#1000, d is pause - 0 no
106 +      pause, 1 pause, e is asym_pause - 0 no asym_pause, 1 asym_pause.
107  
108    Recommended properties:
109  
110 @@ -1408,7 +1419,6 @@
111  
112     Example multi port host USB controller device node :
113         usb@22000 {
114 -               device_type = "usb";
115                 compatible = "fsl-usb2-mph";
116                 reg = <22000 1000>;
117                 #address-cells = <1>;
118 @@ -1422,7 +1432,6 @@
119  
120     Example dual role USB controller device node :
121         usb@23000 {
122 -               device_type = "usb";
123                 compatible = "fsl-usb2-dr";
124                 reg = <23000 1000>;
125                 #address-cells = <1>;
126 @@ -1586,7 +1595,6 @@
127     iii) USB (Universal Serial Bus Controller)
128  
129     Required properties:
130 -   - device_type : should be "usb".
131     - compatible : could be "qe_udc" or "fhci-hcd".
132     - mode : the could be "host" or "slave".
133     - reg : Offset and length of the register set for the device
134 @@ -1600,7 +1608,6 @@
135  
136     Example(slave):
137         usb@6c0 {
138 -               device_type = "usb";
139                 compatible = "qe_udc";
140                 reg = <6c0 40>;
141                 interrupts = <8b 0>;
142 @@ -1613,7 +1620,7 @@
143  
144     Required properties:
145     - device_type : should be "network", "hldc", "uart", "transparent"
146 -    "bisync" or "atm".
147 +     "bisync", "atm", or "serial".
148     - compatible : could be "ucc_geth" or "fsl_atm" and so on.
149     - model : should be "UCC".
150     - device-id : the ucc number(1-8), corresponding to UCCx in UM.
151 @@ -1626,6 +1633,26 @@
152     - interrupt-parent : the phandle for the interrupt controller that
153       services interrupts for this device.
154     - pio-handle : The phandle for the Parallel I/O port configuration.
155 +   - port-number : for UART drivers, the port number to use, between 0 and 3.
156 +     This usually corresponds to the /dev/ttyQE device, e.g. <0> = /dev/ttyQE0.
157 +     The port number is added to the minor number of the device.  Unlike the
158 +     CPM UART driver, the port-number is required for the QE UART driver.
159 +   - soft-uart : for UART drivers, if specified this means the QE UART device
160 +     driver should use "Soft-UART" mode, which is needed on some SOCs that have
161 +     broken UART hardware.  Soft-UART is provided via a microcode upload.
162 +   - rx-clock-name: the UCC receive clock source
163 +     "none": clock source is disabled
164 +     "brg1" through "brg16": clock source is BRG1-BRG16, respectively
165 +     "clk1" through "clk24": clock source is CLK1-CLK24, respectively
166 +   - tx-clock-name: the UCC transmit clock source
167 +     "none": clock source is disabled
168 +     "brg1" through "brg16": clock source is BRG1-BRG16, respectively
169 +     "clk1" through "clk24": clock source is CLK1-CLK24, respectively
170 +   The following two properties are deprecated.  rx-clock has been replaced
171 +   with rx-clock-name, and tx-clock has been replaced with tx-clock-name.
172 +   Drivers that currently use the deprecated properties should continue to
173 +   do so, in order to support older device trees, but they should be updated
174 +   to check for the new properties first.
175     - rx-clock : represents the UCC receive clock source.
176       0x00 : clock source is disabled;
177       0x1~0x10 : clock source is BRG1~BRG16 respectively;
178 @@ -1772,6 +1799,32 @@
179                 };
180         };
181  
182 +   viii) Uploaded QE firmware
183 +
184 +        If a new firwmare has been uploaded to the QE (usually by the
185 +        boot loader), then a 'firmware' child node should be added to the QE
186 +        node.  This node provides information on the uploaded firmware that
187 +        device drivers may need.
188 +
189 +        Required properties:
190 +        - id: The string name of the firmware.  This is taken from the 'id'
191 +              member of the qe_firmware structure of the uploaded firmware.
192 +              Device drivers can search this string to determine if the
193 +              firmware they want is already present.
194 +        - extended-modes: The Extended Modes bitfield, taken from the
195 +                          firmware binary.  It is a 64-bit number represented
196 +                          as an array of two 32-bit numbers.
197 +        - virtual-traps: The virtual traps, taken from the firmware binary.
198 +                         It is an array of 8 32-bit numbers.
199 +
200 +        Example:
201 +
202 +               firmware {
203 +                       id = "Soft-UART";
204 +                       extended-modes = <0 0>;
205 +                       virtual-traps = <0 0 0 0 0 0 0 0>;
206 +               }
207 +
208     j) CFI or JEDEC memory-mapped NOR flash
209  
210      Flash chips (Memory Technology Devices) are often used for solid state
211 @@ -2075,8 +2128,7 @@
212  
213     Example:
214         localbus@f0010100 {
215 -               compatible = "fsl,mpc8272ads-localbus",
216 -                            "fsl,mpc8272-localbus",
217 +               compatible = "fsl,mpc8272-localbus",
218                              "fsl,pq2-localbus";
219                 #address-cells = <2>;
220                 #size-cells = <1>;
221 @@ -2254,7 +2306,7 @@
222                            available.
223                            For Axon: 0x0000012a
224  
225 -   l) Xilinx IP cores
226 +   o) Xilinx IP cores
227  
228     The Xilinx EDK toolchain ships with a set of IP cores (devices) for use
229     in Xilinx Spartan and Virtex FPGAs.  The devices cover the whole range
230 @@ -2276,7 +2328,7 @@
231     properties of the device node.  In general, device nodes for IP-cores
232     will take the following form:
233  
234 -       (name)@(base-address) {
235 +       (name): (generic-name)@(base-address) {
236                 compatible = "xlnx,(ip-core-name)-(HW_VER)"
237                              [, (list of compatible devices), ...];
238                 reg = <(baseaddr) (size)>;
239 @@ -2286,6 +2338,9 @@
240                 xlnx,(parameter2) = <(int-value)>;
241         };
242  
243 +       (generic-name):   an open firmware-style name that describes the
244 +                       generic class of device.  Preferably, this is one word, such
245 +                       as 'serial' or 'ethernet'.
246         (ip-core-name): the name of the ip block (given after the BEGIN
247                         directive in system.mhs).  Should be in lowercase
248                         and all underscores '_' converted to dashes '-'.
249 @@ -2294,9 +2349,9 @@
250                         dropped from the parameter name, the name is converted
251                         to lowercase and all underscore '_' characters are
252                         converted to dashes '-'.
253 -       (baseaddr):     the C_BASEADDR parameter.
254 +       (baseaddr):     the baseaddr parameter value (often named C_BASEADDR).
255         (HW_VER):       from the HW_VER parameter.
256 -       (size):         equals C_HIGHADDR - C_BASEADDR + 1
257 +       (size):         the address range size (often C_HIGHADDR - C_BASEADDR + 1).
258  
259     Typically, the compatible list will include the exact IP core version
260     followed by an older IP core version which implements the same
261 @@ -2326,11 +2381,11 @@
262  
263     becomes the following device tree node:
264  
265 -       opb-uartlite-0@ec100000 {
266 +       opb_uartlite_0: serial@ec100000 {
267                 device_type = "serial";
268                 compatible = "xlnx,opb-uartlite-1.00.b";
269                 reg = <ec100000 10000>;
270 -               interrupt-parent = <&opb-intc>;
271 +               interrupt-parent = <&opb_intc_0>;
272                 interrupts = <1 0>; // got this from the opb_intc parameters
273                 current-speed = <d#115200>;     // standard serial device prop
274                 clock-frequency = <d#50000000>; // standard serial device prop
275 @@ -2339,16 +2394,19 @@
276                 xlnx,use-parity = <0>;
277         };
278  
279 -   Some IP cores actually implement 2 or more logical devices.  In this case,
280 -   the device should still describe the whole IP core with a single node
281 -   and add a child node for each logical device.  The ranges property can
282 -   be used to translate from parent IP-core to the registers of each device.
283 -   (Note: this makes the assumption that both logical devices have the same
284 -   bus binding.  If this is not true, then separate nodes should be used for
285 -   each logical device).  The 'cell-index' property can be used to enumerate
286 -   logical devices within an IP core.  For example, the following is the
287 -   system.mhs entry for the dual ps2 controller found on the ml403 reference
288 -   design.
289 +   Some IP cores actually implement 2 or more logical devices.  In
290 +   this case, the device should still describe the whole IP core with
291 +   a single node and add a child node for each logical device.  The
292 +   ranges property can be used to translate from parent IP-core to the
293 +   registers of each device.  In addition, the parent node should be
294 +   compatible with the bus type 'xlnx,compound', and should contain
295 +   #address-cells and #size-cells, as with any other bus.  (Note: this
296 +   makes the assumption that both logical devices have the same bus
297 +   binding.  If this is not true, then separate nodes should be used
298 +   for each logical device).  The 'cell-index' property can be used to
299 +   enumerate logical devices within an IP core.  For example, the
300 +   following is the system.mhs entry for the dual ps2 controller found
301 +   on the ml403 reference design.
302  
303         BEGIN opb_ps2_dual_ref
304                 PARAMETER INSTANCE = opb_ps2_dual_ref_0
305 @@ -2370,21 +2428,24 @@
306  
307     It would result in the following device tree nodes:
308  
309 -       opb_ps2_dual_ref_0@a9000000 {
310 +       opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 {
311 +               #address-cells = <1>;
312 +               #size-cells = <1>;
313 +               compatible = "xlnx,compound";
314                 ranges = <0 a9000000 2000>;
315                 // If this device had extra parameters, then they would
316                 // go here.
317                 ps2@0 {
318                         compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
319                         reg = <0 40>;
320 -                       interrupt-parent = <&opb-intc>;
321 +                       interrupt-parent = <&opb_intc_0>;
322                         interrupts = <3 0>;
323                         cell-index = <0>;
324                 };
325                 ps2@1000 {
326                         compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
327                         reg = <1000 40>;
328 -                       interrupt-parent = <&opb-intc>;
329 +                       interrupt-parent = <&opb_intc_0>;
330                         interrupts = <3 0>;
331                         cell-index = <0>;
332                 };
333 @@ -2447,17 +2508,18 @@
334  
335     Gives this device tree (some properties removed for clarity):
336  
337 -       plb-v34-0 {
338 +       plb@0 {
339                 #address-cells = <1>;
340                 #size-cells = <1>;
341 +               compatible = "xlnx,plb-v34-1.02.a";
342                 device_type = "ibm,plb";
343                 ranges; // 1:1 translation
344  
345 -               plb-bram-if-cntrl-0@ffff0000 {
346 +               plb_bram_if_cntrl_0: bram@ffff0000 {
347                         reg = <ffff0000 10000>;
348                 }
349  
350 -               opb-v20-0 {
351 +               opb@20000000 {
352                         #address-cells = <1>;
353                         #size-cells = <1>;
354                         ranges = <20000000 20000000 20000000
355 @@ -2465,11 +2527,11 @@
356                                   80000000 80000000 40000000
357                                   c0000000 c0000000 20000000>;
358  
359 -                       opb-uart16550-0@a0000000 {
360 +                       opb_uart16550_0: serial@a0000000 {
361                                 reg = <a00000000 2000>;
362                         };
363  
364 -                       opb-intc-0@d1000fc0 {
365 +                       opb_intc_0: interrupt-controller@d1000fc0 {
366                                 reg = <d1000fc0 20>;
367                         };
368                 };
369 @@ -2514,6 +2576,46 @@
370        Requred properties:
371         - current-speed : Baud rate of uartlite
372  
373 +    p) Freescale Synchronous Serial Interface
374 +
375 +       The SSI is a serial device that communicates with audio codecs.  It can
376 +       be programmed in AC97, I2S, left-justified, or right-justified modes.
377 +
378 +       Required properties:
379 +       - compatible      : compatible list, containing "fsl,ssi"
380 +       - cell-index      : the SSI, <0> = SSI1, <1> = SSI2, and so on
381 +       - reg             : offset and length of the register set for the device
382 +       - interrupts      : <a b> where a is the interrupt number and b is a
383 +                            field that represents an encoding of the sense and
384 +                           level information for the interrupt.  This should be
385 +                           encoded based on the information in section 2)
386 +                           depending on the type of interrupt controller you
387 +                           have.
388 +       - interrupt-parent : the phandle for the interrupt controller that
389 +                            services interrupts for this device.
390 +       - fsl,mode        : the operating mode for the SSI interface
391 +                           "i2s-slave" - I2S mode, SSI is clock slave
392 +                           "i2s-master" - I2S mode, SSI is clock master
393 +                           "lj-slave" - left-justified mode, SSI is clock slave
394 +                           "lj-master" - l.j. mode, SSI is clock master
395 +                           "rj-slave" - right-justified mode, SSI is clock slave
396 +                           "rj-master" - r.j., SSI is clock master
397 +                           "ac97-slave" - AC97 mode, SSI is clock slave
398 +                           "ac97-master" - AC97 mode, SSI is clock master
399 +
400 +       Optional properties:
401 +       - codec-handle    : phandle to a 'codec' node that defines an audio
402 +                           codec connected to this SSI.  This node is typically
403 +                           a child of an I2C or other control node.
404 +
405 +       Child 'codec' node required properties:
406 +       - compatible      : compatible list, contains the name of the codec
407 +
408 +       Child 'codec' node optional properties:
409 +       - clock-frequency  : The frequency of the input clock, which typically
410 +                            comes from an on-board dedicated oscillator.
411 +
412 +
413     More devices will be defined as this spec matures.
414  
415  VII - Specifying interrupt information for devices
416 --- /dev/null
417 +++ b/Documentation/powerpc/qe_firmware.txt
418 @@ -0,0 +1,295 @@
419 +          Freescale QUICC Engine Firmware Uploading
420 +          -----------------------------------------
421 +
422 +(c) 2007 Timur Tabi <timur at freescale.com>,
423 +    Freescale Semiconductor
424 +
425 +Table of Contents
426 +=================
427 +
428 +  I - Software License for Firmware
429 +
430 +  II - Microcode Availability
431 +
432 +  III - Description and Terminology
433 +
434 +  IV - Microcode Programming Details
435 +
436 +  V - Firmware Structure Layout
437 +
438 +  VI - Sample Code for Creating Firmware Files
439 +
440 +Revision Information
441 +====================
442 +
443 +November 30, 2007: Rev 1.0 - Initial version
444 +
445 +I - Software License for Firmware
446 +=================================
447 +
448 +Each firmware file comes with its own software license.  For information on
449 +the particular license, please see the license text that is distributed with
450 +the firmware.
451 +
452 +II - Microcode Availability
453 +===========================
454 +
455 +Firmware files are distributed through various channels.  Some are available on
456 +http://opensource.freescale.com.  For other firmware files, please contact
457 +your Freescale representative or your operating system vendor.
458 +
459 +III - Description and Terminology
460 +================================
461 +
462 +In this document, the term 'microcode' refers to the sequence of 32-bit
463 +integers that compose the actual QE microcode.
464 +
465 +The term 'firmware' refers to a binary blob that contains the microcode as
466 +well as other data that
467 +
468 +       1) describes the microcode's purpose
469 +       2) describes how and where to upload the microcode
470 +       3) specifies the values of various registers
471 +       4) includes additional data for use by specific device drivers
472 +
473 +Firmware files are binary files that contain only a firmware.
474 +
475 +IV - Microcode Programming Details
476 +===================================
477 +
478 +The QE architecture allows for only one microcode present in I-RAM for each
479 +RISC processor.  To replace any current microcode, a full QE reset (which
480 +disables the microcode) must be performed first.
481 +
482 +QE microcode is uploaded using the following procedure:
483 +
484 +1) The microcode is placed into I-RAM at a specific location, using the
485 +   IRAM.IADD and IRAM.IDATA registers.
486 +
487 +2) The CERCR.CIR bit is set to 0 or 1, depending on whether the firmware
488 +   needs split I-RAM.  Split I-RAM is only meaningful for SOCs that have
489 +   QEs with multiple RISC processors, such as the 8360.  Splitting the I-RAM
490 +   allows each processor to run a different microcode, effectively creating an
491 +   asymmetric multiprocessing (AMP) system.
492 +
493 +3) The TIBCR trap registers are loaded with the addresses of the trap handlers
494 +   in the microcode.
495 +
496 +4) The RSP.ECCR register is programmed with the value provided.
497 +
498 +5) If necessary, device drivers that need the virtual traps and extended mode
499 +   data will use them.
500 +
501 +Virtual Microcode Traps
502 +
503 +These virtual traps are conditional branches in the microcode.  These are
504 +"soft" provisional introduced in the ROMcode in order to enable higher
505 +flexibility and save h/w traps If new features are activated or an issue is
506 +being fixed in the RAM package utilizing they should be activated.  This data
507 +structure signals the microcode which of these virtual traps is active.
508 +
509 +This structure contains 6 words that the application should copy to some
510 +specific been defined.  This table describes the structure.
511 +
512 +       ---------------------------------------------------------------
513 +       | Offset in |                  | Destination Offset | Size of |
514 +       |   array   |     Protocol     |   within PRAM      | Operand |
515 +       --------------------------------------------------------------|
516 +       |     0     | Ethernet         |      0xF8          | 4 bytes |
517 +       |           | interworking     |                    |         |
518 +       ---------------------------------------------------------------
519 +       |     4     | ATM              |      0xF8          | 4 bytes |
520 +       |           | interworking     |                    |         |
521 +       ---------------------------------------------------------------
522 +       |     8     | PPP              |      0xF8          | 4 bytes |
523 +       |           | interworking     |                    |         |
524 +       ---------------------------------------------------------------
525 +       |     12    | Ethernet RX      |      0x22          | 1 byte  |
526 +       |           | Distributor Page |                    |         |
527 +       ---------------------------------------------------------------
528 +       |     16    | ATM Globtal      |      0x28          | 1 byte  |
529 +       |           | Params Table     |                    |         |
530 +       ---------------------------------------------------------------
531 +       |     20    | Insert Frame     |      0xF8          | 4 bytes |
532 +       ---------------------------------------------------------------
533 +
534 +
535 +Extended Modes
536 +
537 +This is a double word bit array (64 bits) that defines special functionality
538 +which has an impact on the softwarew drivers.  Each bit has its own impact
539 +and has special instructions for the s/w associated with it.  This structure is
540 +described in this table:
541 +
542 +       -----------------------------------------------------------------------
543 +       | Bit #  |     Name     |   Description                               |
544 +       -----------------------------------------------------------------------
545 +       |   0    | General      | Indicates that prior to each host command   |
546 +       |        | push command | given by the application, the software must |
547 +       |        |              | assert a special host command (push command)|
548 +       |        |              | CECDR = 0x00800000.                         |
549 +       |        |              | CECR = 0x01c1000f.                          |
550 +       -----------------------------------------------------------------------
551 +       |   1    | UCC ATM      | Indicates that after issuing ATM RX INIT    |
552 +       |        | RX INIT      | command, the host must issue another special|
553 +       |        | push command | command (push command) and immediately      |
554 +       |        |              | following that re-issue the ATM RX INIT     |
555 +       |        |              | command. (This makes the sequence of        |
556 +       |        |              | initializing the ATM receiver a sequence of |
557 +       |        |              | three host commands)                        |
558 +       |        |              | CECDR = 0x00800000.                         |
559 +       |        |              | CECR = 0x01c1000f.                          |
560 +       -----------------------------------------------------------------------
561 +       |   2    | Add/remove   | Indicates that following the specific host  |
562 +       |        | command      | command: "Add/Remove entry in Hash Lookup   |
563 +       |        | validation   | Table" used in Interworking setup, the user |
564 +       |        |              | must issue another command.                 |
565 +       |        |              | CECDR = 0xce000003.                         |
566 +       |        |              | CECR = 0x01c10f58.                          |
567 +       -----------------------------------------------------------------------
568 +       |   3    | General push | Indicates that the s/w has to initialize    |
569 +       |        | command      | some pointers in the Ethernet thread pages  |
570 +       |        |              | which are used when Header Compression is   |
571 +       |        |              | activated.  The full details of these       |
572 +       |        |              | pointers is located in the software drivers.|
573 +       -----------------------------------------------------------------------
574 +       |   4    | General push | Indicates that after issuing Ethernet TX    |
575 +       |        | command      | INIT command, user must issue this command  |
576 +       |        |              | for each SNUM of Ethernet TX thread.        |
577 +       |        |              | CECDR = 0x00800003.                         |
578 +       |        |              | CECR = 0x7'b{0}, 8'b{Enet TX thread SNUM},  |
579 +       |        |              |        1'b{1}, 12'b{0}, 4'b{1}              |
580 +       -----------------------------------------------------------------------
581 +       | 5 - 31 |     N/A      | Reserved, set to zero.                      |
582 +       -----------------------------------------------------------------------
583 +
584 +V - Firmware Structure Layout
585 +==============================
586 +
587 +QE microcode from Freescale is typically provided as a header file.  This
588 +header file contains macros that define the microcode binary itself as well as
589 +some other data used in uploading that microcode.  The format of these files
590 +do not lend themselves to simple inclusion into other code.  Hence,
591 +the need for a more portable format.  This section defines that format.
592 +
593 +Instead of distributing a header file, the microcode and related data are
594 +embedded into a binary blob.  This blob is passed to the qe_upload_firmware()
595 +function, which parses the blob and performs everything necessary to upload
596 +the microcode.
597 +
598 +All integers are big-endian.  See the comments for function
599 +qe_upload_firmware() for up-to-date implementation information.
600 +
601 +This structure supports versioning, where the version of the structure is
602 +embedded into the structure itself.  To ensure forward and backwards
603 +compatibility, all versions of the structure must use the same 'qe_header'
604 +structure at the beginning.
605 +
606 +'header' (type: struct qe_header):
607 +       The 'length' field is the size, in bytes, of the entire structure,
608 +       including all the microcode embedded in it, as well as the CRC (if
609 +       present).
610 +
611 +       The 'magic' field is an array of three bytes that contains the letters
612 +       'Q', 'E', and 'F'.  This is an identifier that indicates that this
613 +       structure is a QE Firmware structure.
614 +
615 +       The 'version' field is a single byte that indicates the version of this
616 +       structure.  If the layout of the structure should ever need to be
617 +       changed to add support for additional types of microcode, then the
618 +       version number should also be changed.
619 +
620 +The 'id' field is a null-terminated string(suitable for printing) that
621 +identifies the firmware.
622 +
623 +The 'count' field indicates the number of 'microcode' structures.  There
624 +must be one and only one 'microcode' structure for each RISC processor.
625 +Therefore, this field also represents the number of RISC processors for this
626 +SOC.
627 +
628 +The 'soc' structure contains the SOC numbers and revisions used to match
629 +the microcode to the SOC itself.  Normally, the microcode loader should
630 +check the data in this structure with the SOC number and revisions, and
631 +only upload the microcode if there's a match.  However, this check is not
632 +made on all platforms.
633 +
634 +Although it is not recommended, you can specify '0' in the soc.model
635 +field to skip matching SOCs altogether.
636 +
637 +The 'model' field is a 16-bit number that matches the actual SOC. The
638 +'major' and 'minor' fields are the major and minor revision numbrs,
639 +respectively, of the SOC.
640 +
641 +For example, to match the 8323, revision 1.0:
642 +     soc.model = 8323
643 +     soc.major = 1
644 +     soc.minor = 0
645 +
646 +'padding' is neccessary for structure alignment.  This field ensures that the
647 +'extended_modes' field is aligned on a 64-bit boundary.
648 +
649 +'extended_modes' is a bitfield that defines special functionality which has an
650 +impact on the device drivers.  Each bit has its own impact and has special
651 +instructions for the driver associated with it.  This field is stored in
652 +the QE library and available to any driver that calles qe_get_firmware_info().
653 +
654 +'vtraps' is an array of 8 words that contain virtual trap values for each
655 +virtual traps.  As with 'extended_modes', this field is stored in the QE
656 +library and available to any driver that calles qe_get_firmware_info().
657 +
658 +'microcode' (type: struct qe_microcode):
659 +       For each RISC processor there is one 'microcode' structure.  The first
660 +       'microcode' structure is for the first RISC, and so on.
661 +
662 +       The 'id' field is a null-terminated string suitable for printing that
663 +       identifies this particular microcode.
664 +
665 +       'traps' is an array of 16 words that contain hardware trap values
666 +       for each of the 16 traps.  If trap[i] is 0, then this particular
667 +       trap is to be ignored (i.e. not written to TIBCR[i]).  The entire value
668 +       is written as-is to the TIBCR[i] register, so be sure to set the EN
669 +       and T_IBP bits if necessary.
670 +
671 +       'eccr' is the value to program into the ECCR register.
672 +
673 +       'iram_offset' is the offset into IRAM to start writing the
674 +       microcode.
675 +
676 +       'count' is the number of 32-bit words in the microcode.
677 +
678 +       'code_offset' is the offset, in bytes, from the beginning of this
679 +       structure where the microcode itself can be found.  The first
680 +       microcode binary should be located immediately after the 'microcode'
681 +       array.
682 +
683 +       'major', 'minor', and 'revision' are the major, minor, and revision
684 +       version numbers, respectively, of the microcode.  If all values are 0,
685 +       then these fields are ignored.
686 +
687 +       'reserved' is necessary for structure alignment.  Since 'microcode'
688 +       is an array, the 64-bit 'extended_modes' field needs to be aligned
689 +       on a 64-bit boundary, and this can only happen if the size of
690 +       'microcode' is a multiple of 8 bytes.  To ensure that, we add
691 +       'reserved'.
692 +
693 +After the last microcode is a 32-bit CRC.  It can be calculated using
694 +this algorithm:
695 +
696 +u32 crc32(const u8 *p, unsigned int len)
697 +{
698 +       unsigned int i;
699 +       u32 crc = 0;
700 +
701 +       while (len--) {
702 +          crc ^= *p++;
703 +          for (i = 0; i < 8; i++)
704 +                  crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0);
705 +       }
706 +       return crc;
707 +}
708 +
709 +VI - Sample Code for Creating Firmware Files
710 +============================================
711 +
712 +A Python program that creates firmware binaries from the header files normally
713 +distributed by Freescale can be found on http://opensource.freescale.com.
714 --- a/arch/powerpc/Kconfig
715 +++ b/arch/powerpc/Kconfig
716 @@ -140,6 +140,9 @@
717           Used to allow a board to specify it wants a uImage built by default
718         default n
719  
720 +config REDBOOT
721 +       bool
722 +
723  config PPC64_SWSUSP
724         bool
725         depends on PPC64 && (BROKEN || (PPC_PMAC64 && EXPERIMENTAL))
726 @@ -160,11 +163,13 @@
727  
728  config PPC_OF_PLATFORM_PCI
729         bool
730 +       depends on PCI
731         depends on PPC64 # not supported on 32 bits yet
732         default n
733  
734  source "init/Kconfig"
735  
736 +source "arch/powerpc/sysdev/Kconfig"
737  source "arch/powerpc/platforms/Kconfig"
738  
739  menu "Kernel options"
740 @@ -417,7 +422,7 @@
741  
742  config ISA_DMA_API
743         bool
744 -       default y
745 +       default !PPC_ISERIES || PCI
746  
747  menu "Bus options"
748  
749 @@ -467,7 +472,7 @@
750  config PCI
751         bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \
752                 || PPC_MPC52xx || (EMBEDDED && (PPC_PSERIES || PPC_ISERIES)) \
753 -               || PPC_PS3
754 +               || PPC_PS3 || 44x
755         default y if !40x && !CPM2 && !8xx && !PPC_83xx \
756                 && !PPC_85xx && !PPC_86xx
757         default PCI_PERMEDIA if !4xx && !CPM2 && !8xx
758 --- a/arch/powerpc/Kconfig.debug
759 +++ b/arch/powerpc/Kconfig.debug
760 @@ -151,6 +151,13 @@
761  
762  config PPC_EARLY_DEBUG
763         bool "Early debugging (dangerous)"
764 +       help
765 +         Say Y to enable some early debugging facilities that may be available
766 +         for your processor/board combination. Those facilities are hacks
767 +         intended to debug problems early during boot, this should not be
768 +         enabled in a production kernel.
769 +         Note that enabling this will also cause the kernel default log level
770 +         to be pushed to max automatically very early during boot
771  
772  choice
773         prompt "Early debugging console"
774 @@ -218,7 +225,16 @@
775         depends on 44x
776         help
777           Select this to enable early debugging for IBM 44x chips via the
778 -         inbuilt serial port.
779 +         inbuilt serial port.  If you enable this, ensure you set
780 +          PPC_EARLY_DEBUG_44x_PHYSLOW below to suit your target board.
781 +
782 +config PPC_EARLY_DEBUG_40x
783 +       bool "Early serial debugging for IBM/AMCC 40x CPUs"
784 +       depends on 40x
785 +       help
786 +         Select this to enable early debugging for IBM 40x chips via the
787 +         inbuilt serial port. This works on chips with a 16550 compatible
788 +         UART. Xilinx chips with uartlite cannot use this option.
789  
790  config PPC_EARLY_DEBUG_CPM
791         bool "Early serial debugging for Freescale CPM-based serial ports"
792 @@ -235,12 +251,20 @@
793         hex "Low 32 bits of early debug UART physical address"
794         depends on PPC_EARLY_DEBUG_44x
795         default "0x40000200"
796 +       help
797 +         You probably want 0x40000200 for ebony boards and
798 +          0x40000300 for taishan
799  
800  config PPC_EARLY_DEBUG_44x_PHYSHIGH
801         hex "EPRN of early debug UART physical address"
802         depends on PPC_EARLY_DEBUG_44x
803         default "0x1"
804  
805 +config PPC_EARLY_DEBUG_40x_PHYSADDR
806 +       hex "Early debug UART physical address"
807 +       depends on PPC_EARLY_DEBUG_40x
808 +       default "0xef600300"
809 +
810  config PPC_EARLY_DEBUG_CPM_ADDR
811         hex "CPM UART early debug transmit descriptor address"
812         depends on PPC_EARLY_DEBUG_CPM
813 --- a/arch/powerpc/Makefile
814 +++ b/arch/powerpc/Makefile
815 @@ -167,6 +167,9 @@
816  $(BOOT_TARGETS): vmlinux
817         $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
818  
819 +bootwrapper_install:
820 +       $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
821 +
822  define archhelp
823    @echo '* zImage          - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)'
824    @echo '  install         - Install kernel using'
825 --- a/arch/powerpc/boot/4xx.c
826 +++ b/arch/powerpc/boot/4xx.c
827 @@ -22,16 +22,14 @@
828  #include "dcr.h"
829  
830  /* Read the 4xx SDRAM controller to get size of system memory. */
831 -void ibm4xx_fixup_memsize(void)
832 +void ibm4xx_sdram_fixup_memsize(void)
833  {
834         int i;
835         unsigned long memsize, bank_config;
836  
837         memsize = 0;
838         for (i = 0; i < ARRAY_SIZE(sdram_bxcr); i++) {
839 -               mtdcr(DCRN_SDRAM0_CFGADDR, sdram_bxcr[i]);
840 -               bank_config = mfdcr(DCRN_SDRAM0_CFGDATA);
841 -
842 +               bank_config = SDRAM0_READ(sdram_bxcr[i]);
843                 if (bank_config & SDRAM_CONFIG_BANK_ENABLE)
844                         memsize += SDRAM_CONFIG_BANK_SIZE(bank_config);
845         }
846 @@ -39,6 +37,69 @@
847         dt_fixup_memory(0, memsize);
848  }
849  
850 +/* Read the 440SPe MQ controller to get size of system memory. */
851 +#define DCRN_MQ0_B0BAS         0x40
852 +#define DCRN_MQ0_B1BAS         0x41
853 +#define DCRN_MQ0_B2BAS         0x42
854 +#define DCRN_MQ0_B3BAS         0x43
855 +
856 +static u64 ibm440spe_decode_bas(u32 bas)
857 +{
858 +       u64 base = ((u64)(bas & 0xFFE00000u)) << 2;
859 +
860 +       /* open coded because I'm paranoid about invalid values */
861 +       switch ((bas >> 4) & 0xFFF) {
862 +       case 0:
863 +               return 0;
864 +       case 0xffc:
865 +               return base + 0x000800000ull;
866 +       case 0xff8:
867 +               return base + 0x001000000ull;
868 +       case 0xff0:
869 +               return base + 0x002000000ull;
870 +       case 0xfe0:
871 +               return base + 0x004000000ull;
872 +       case 0xfc0:
873 +               return base + 0x008000000ull;
874 +       case 0xf80:
875 +               return base + 0x010000000ull;
876 +       case 0xf00:
877 +               return base + 0x020000000ull;
878 +       case 0xe00:
879 +               return base + 0x040000000ull;
880 +       case 0xc00:
881 +               return base + 0x080000000ull;
882 +       case 0x800:
883 +               return base + 0x100000000ull;
884 +       }
885 +       printf("Memory BAS value 0x%08x unsupported !\n", bas);
886 +       return 0;
887 +}
888 +
889 +void ibm440spe_fixup_memsize(void)
890 +{
891 +       u64 banktop, memsize = 0;
892 +
893 +       /* Ultimately, we should directly construct the memory node
894 +        * so we are able to handle holes in the memory address space
895 +        */
896 +       banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B0BAS));
897 +       if (banktop > memsize)
898 +               memsize = banktop;
899 +       banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B1BAS));
900 +       if (banktop > memsize)
901 +               memsize = banktop;
902 +       banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B2BAS));
903 +       if (banktop > memsize)
904 +               memsize = banktop;
905 +       banktop = ibm440spe_decode_bas(mfdcr(DCRN_MQ0_B3BAS));
906 +       if (banktop > memsize)
907 +               memsize = banktop;
908 +
909 +       dt_fixup_memory(0, memsize);
910 +}
911 +
912 +
913  /* 4xx DDR1/2 Denali memory controller support */
914  /* DDR0 registers */
915  #define DDR0_02                        2
916 @@ -77,19 +138,13 @@
917  
918  #define DDR_GET_VAL(val, mask, shift)  (((val) >> (shift)) & (mask))
919  
920 -static inline u32 mfdcr_sdram0(u32 reg)
921 -{
922 -        mtdcr(DCRN_SDRAM0_CFGADDR, reg);
923 -        return mfdcr(DCRN_SDRAM0_CFGDATA);
924 -}
925 -
926  void ibm4xx_denali_fixup_memsize(void)
927  {
928         u32 val, max_cs, max_col, max_row;
929         u32 cs, col, row, bank, dpath;
930         unsigned long memsize;
931  
932 -       val = mfdcr_sdram0(DDR0_02);
933 +       val = SDRAM0_READ(DDR0_02);
934         if (!DDR_GET_VAL(val, DDR_START, DDR_START_SHIFT))
935                 fatal("DDR controller is not initialized\n");
936  
937 @@ -99,12 +154,12 @@
938         max_row = DDR_GET_VAL(val, DDR_MAX_ROW_REG, DDR_MAX_ROW_REG_SHIFT);
939  
940         /* get CS value */
941 -       val = mfdcr_sdram0(DDR0_10);
942 +       val = SDRAM0_READ(DDR0_10);
943  
944         val = DDR_GET_VAL(val, DDR_CS_MAP, DDR_CS_MAP_SHIFT);
945         cs = 0;
946         while (val) {
947 -               if (val && 0x1)
948 +               if (val & 0x1)
949                         cs++;
950                 val = val >> 1;
951         }
952 @@ -115,15 +170,15 @@
953                 fatal("DDR wrong CS configuration\n");
954  
955         /* get data path bytes */
956 -       val = mfdcr_sdram0(DDR0_14);
957 +       val = SDRAM0_READ(DDR0_14);
958  
959         if (DDR_GET_VAL(val, DDR_REDUC, DDR_REDUC_SHIFT))
960                 dpath = 8; /* 64 bits */
961         else
962                 dpath = 4; /* 32 bits */
963  
964 -       /* get adress pins (rows) */
965 -       val = mfdcr_sdram0(DDR0_42);
966 +       /* get address pins (rows) */
967 +       val = SDRAM0_READ(DDR0_42);
968  
969         row = DDR_GET_VAL(val, DDR_APIN, DDR_APIN_SHIFT);
970         if (row > max_row)
971 @@ -131,7 +186,7 @@
972         row = max_row - row;
973  
974         /* get collomn size and banks */
975 -       val = mfdcr_sdram0(DDR0_43);
976 +       val = SDRAM0_READ(DDR0_43);
977  
978         col = DDR_GET_VAL(val, DDR_COL_SZ, DDR_COL_SZ_SHIFT);
979         if (col > max_col)
980 @@ -179,13 +234,17 @@
981  #define EMAC_RESET 0x20000000
982  void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1)
983  {
984 -       /* Quiesce the MAL and EMAC(s) since PIBS/OpenBIOS don't do this for us */
985 +       /* Quiesce the MAL and EMAC(s) since PIBS/OpenBIOS don't
986 +        * do this for us
987 +        */
988         if (emac0)
989                 *emac0 = EMAC_RESET;
990         if (emac1)
991                 *emac1 = EMAC_RESET;
992  
993         mtdcr(DCRN_MAL0_CFG, MAL_RESET);
994 +       while (mfdcr(DCRN_MAL0_CFG) & MAL_RESET)
995 +               ; /* loop until reset takes effect */
996  }
997  
998  /* Read 4xx EBC bus bridge registers to get mappings of the peripheral
999 @@ -217,84 +276,335 @@
1000         setprop(devp, "ranges", ranges, (p - ranges) * sizeof(u32));
1001  }
1002  
1003 -#define SPRN_CCR1 0x378
1004 -void ibm440ep_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
1005 +/* Calculate 440GP clocks */
1006 +void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk)
1007  {
1008 -       u32 cpu, plb, opb, ebc, tb, uart0, m, vco;
1009 -       u32 reg;
1010 -       u32 fwdva, fwdvb, fbdv, lfbdv, opbdv0, perdv0, spcid0, prbdv0, tmp;
1011 -
1012 -       mtdcr(DCRN_CPR0_ADDR, CPR0_PLLD0);
1013 -       reg = mfdcr(DCRN_CPR0_DATA);
1014 -       tmp = (reg & 0x000F0000) >> 16;
1015 -       fwdva = tmp ? tmp : 16;
1016 -       tmp = (reg & 0x00000700) >> 8;
1017 -       fwdvb = tmp ? tmp : 8;
1018 -       tmp = (reg & 0x1F000000) >> 24;
1019 -       fbdv = tmp ? tmp : 32;
1020 -       lfbdv = (reg & 0x0000007F);
1021 -
1022 -       mtdcr(DCRN_CPR0_ADDR, CPR0_OPBD0);
1023 -       reg = mfdcr(DCRN_CPR0_DATA);
1024 -       tmp = (reg & 0x03000000) >> 24;
1025 -       opbdv0 = tmp ? tmp : 4;
1026 -
1027 -       mtdcr(DCRN_CPR0_ADDR, CPR0_PERD0);
1028 -       reg = mfdcr(DCRN_CPR0_DATA);
1029 -       tmp = (reg & 0x07000000) >> 24;
1030 -       perdv0 = tmp ? tmp : 8;
1031 -
1032 -       mtdcr(DCRN_CPR0_ADDR, CPR0_PRIMBD0);
1033 -       reg = mfdcr(DCRN_CPR0_DATA);
1034 -       tmp = (reg & 0x07000000) >> 24;
1035 -       prbdv0 = tmp ? tmp : 8;
1036 -
1037 -       mtdcr(DCRN_CPR0_ADDR, CPR0_SCPID);
1038 -       reg = mfdcr(DCRN_CPR0_DATA);
1039 -       tmp = (reg & 0x03000000) >> 24;
1040 -       spcid0 = tmp ? tmp : 4;
1041 -
1042 -       /* Calculate M */
1043 -       mtdcr(DCRN_CPR0_ADDR, CPR0_PLLC0);
1044 -       reg = mfdcr(DCRN_CPR0_DATA);
1045 -       tmp = (reg & 0x03000000) >> 24;
1046 -       if (tmp == 0) { /* PLL output */
1047 -               tmp = (reg & 0x20000000) >> 29;
1048 -               if (!tmp) /* PLLOUTA */
1049 -                       m = fbdv * lfbdv * fwdva;
1050 +       u32 sys0 = mfdcr(DCRN_CPC0_SYS0);
1051 +       u32 cr0 = mfdcr(DCRN_CPC0_CR0);
1052 +       u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
1053 +       u32 opdv = CPC0_SYS0_OPDV(sys0);
1054 +       u32 epdv = CPC0_SYS0_EPDV(sys0);
1055 +
1056 +       if (sys0 & CPC0_SYS0_BYPASS) {
1057 +               /* Bypass system PLL */
1058 +               cpu = plb = sys_clk;
1059 +       } else {
1060 +               if (sys0 & CPC0_SYS0_EXTSL)
1061 +                       /* PerClk */
1062 +                       m = CPC0_SYS0_FWDVB(sys0) * opdv * epdv;
1063                 else
1064 -                       m = fbdv * lfbdv * fwdvb;
1065 +                       /* CPU clock */
1066 +                       m = CPC0_SYS0_FBDV(sys0) * CPC0_SYS0_FWDVA(sys0);
1067 +               cpu = sys_clk * m / CPC0_SYS0_FWDVA(sys0);
1068 +               plb = sys_clk * m / CPC0_SYS0_FWDVB(sys0);
1069         }
1070 -       else if (tmp == 1) /* CPU output */
1071 -               m = fbdv * fwdva;
1072 +
1073 +       opb = plb / opdv;
1074 +       ebc = opb / epdv;
1075 +
1076 +       /* FIXME: Check if this is for all 440GP, or just Ebony */
1077 +       if ((mfpvr() & 0xf0000fff) == 0x40000440)
1078 +               /* Rev. B 440GP, use external system clock */
1079 +               tb = sys_clk;
1080         else
1081 -               m = perdv0 * opbdv0 * fwdvb;
1082 +               /* Rev. C 440GP, errata force us to use internal clock */
1083 +               tb = cpu;
1084  
1085 -       vco = (m * sysclk) + (m >> 1);
1086 -       cpu = vco / fwdva;
1087 -       plb = vco / fwdvb / prbdv0;
1088 -       opb = plb / opbdv0;
1089 -       ebc = plb / perdv0;
1090 +       if (cr0 & CPC0_CR0_U0EC)
1091 +               /* External UART clock */
1092 +               uart0 = ser_clk;
1093 +       else
1094 +               /* Internal UART clock */
1095 +               uart0 = plb / CPC0_CR0_UDIV(cr0);
1096  
1097 -       /* FIXME */
1098 -       uart0 = ser_clk;
1099 +       if (cr0 & CPC0_CR0_U1EC)
1100 +               /* External UART clock */
1101 +               uart1 = ser_clk;
1102 +       else
1103 +               /* Internal UART clock */
1104 +               uart1 = plb / CPC0_CR0_UDIV(cr0);
1105 +
1106 +       printf("PPC440GP: SysClk = %dMHz (%x)\n\r",
1107 +              (sys_clk + 500000) / 1000000, sys_clk);
1108 +
1109 +       dt_fixup_cpu_clocks(cpu, tb, 0);
1110 +
1111 +       dt_fixup_clock("/plb", plb);
1112 +       dt_fixup_clock("/plb/opb", opb);
1113 +       dt_fixup_clock("/plb/opb/ebc", ebc);
1114 +       dt_fixup_clock("/plb/opb/serial@40000200", uart0);
1115 +       dt_fixup_clock("/plb/opb/serial@40000300", uart1);
1116 +}
1117 +
1118 +#define SPRN_CCR1 0x378
1119 +
1120 +static inline u32 __fix_zero(u32 v, u32 def)
1121 +{
1122 +       return v ? v : def;
1123 +}
1124 +
1125 +static unsigned int __ibm440eplike_fixup_clocks(unsigned int sys_clk,
1126 +                                               unsigned int tmr_clk,
1127 +                                               int per_clk_from_opb)
1128 +{
1129 +       /* PLL config */
1130 +       u32 pllc  = CPR0_READ(DCRN_CPR0_PLLC);
1131 +       u32 plld  = CPR0_READ(DCRN_CPR0_PLLD);
1132 +
1133 +       /* Dividers */
1134 +       u32 fbdv   = __fix_zero((plld >> 24) & 0x1f, 32);
1135 +       u32 fwdva  = __fix_zero((plld >> 16) & 0xf, 16);
1136 +       u32 fwdvb  = __fix_zero((plld >> 8) & 7, 8);
1137 +       u32 lfbdv  = __fix_zero(plld & 0x3f, 64);
1138 +       u32 pradv0 = __fix_zero((CPR0_READ(DCRN_CPR0_PRIMAD) >> 24) & 7, 8);
1139 +       u32 prbdv0 = __fix_zero((CPR0_READ(DCRN_CPR0_PRIMBD) >> 24) & 7, 8);
1140 +       u32 opbdv0 = __fix_zero((CPR0_READ(DCRN_CPR0_OPBD) >> 24) & 3, 4);
1141 +       u32 perdv0 = __fix_zero((CPR0_READ(DCRN_CPR0_PERD) >> 24) & 3, 4);
1142 +
1143 +       /* Input clocks for primary dividers */
1144 +       u32 clk_a, clk_b;
1145 +
1146 +       /* Resulting clocks */
1147 +       u32 cpu, plb, opb, ebc, vco;
1148 +
1149 +       /* Timebase */
1150 +       u32 ccr1, tb = tmr_clk;
1151 +
1152 +       if (pllc & 0x40000000) {
1153 +               u32 m;
1154 +
1155 +               /* Feedback path */
1156 +               switch ((pllc >> 24) & 7) {
1157 +               case 0:
1158 +                       /* PLLOUTx */
1159 +                       m = ((pllc & 0x20000000) ? fwdvb : fwdva) * lfbdv;
1160 +                       break;
1161 +               case 1:
1162 +                       /* CPU */
1163 +                       m = fwdva * pradv0;
1164 +                       break;
1165 +               case 5:
1166 +                       /* PERClk */
1167 +                       m = fwdvb * prbdv0 * opbdv0 * perdv0;
1168 +                       break;
1169 +               default:
1170 +                       printf("WARNING ! Invalid PLL feedback source !\n");
1171 +                       goto bypass;
1172 +               }
1173 +               m *= fbdv;
1174 +               vco = sys_clk * m;
1175 +               clk_a = vco / fwdva;
1176 +               clk_b = vco / fwdvb;
1177 +       } else {
1178 +bypass:
1179 +               /* Bypass system PLL */
1180 +               vco = 0;
1181 +               clk_a = clk_b = sys_clk;
1182 +       }
1183 +
1184 +       cpu = clk_a / pradv0;
1185 +       plb = clk_b / prbdv0;
1186 +       opb = plb / opbdv0;
1187 +       ebc = (per_clk_from_opb ? opb : plb) / perdv0;
1188  
1189         /* Figure out timebase.  Either CPU or default TmrClk */
1190 -       asm volatile (
1191 -                       "mfspr  %0,%1\n"
1192 -                       :
1193 -                       "=&r"(reg) : "i"(SPRN_CCR1));
1194 -       if (reg & 0x0080)
1195 -               tb = 25000000; /* TmrClk is 25MHz */
1196 -       else
1197 +       ccr1 = mfspr(SPRN_CCR1);
1198 +
1199 +       /* If passed a 0 tmr_clk, force CPU clock */
1200 +       if (tb == 0) {
1201 +               ccr1 &= ~0x80u;
1202 +               mtspr(SPRN_CCR1, ccr1);
1203 +       }
1204 +       if ((ccr1 & 0x0080) == 0)
1205                 tb = cpu;
1206  
1207         dt_fixup_cpu_clocks(cpu, tb, 0);
1208         dt_fixup_clock("/plb", plb);
1209         dt_fixup_clock("/plb/opb", opb);
1210         dt_fixup_clock("/plb/opb/ebc", ebc);
1211 +
1212 +       return plb;
1213 +}
1214 +
1215 +static void eplike_fixup_uart_clk(int index, const char *path,
1216 +                                 unsigned int ser_clk,
1217 +                                 unsigned int plb_clk)
1218 +{
1219 +       unsigned int sdr;
1220 +       unsigned int clock;
1221 +
1222 +       switch (index) {
1223 +       case 0:
1224 +               sdr = SDR0_READ(DCRN_SDR0_UART0);
1225 +               break;
1226 +       case 1:
1227 +               sdr = SDR0_READ(DCRN_SDR0_UART1);
1228 +               break;
1229 +       case 2:
1230 +               sdr = SDR0_READ(DCRN_SDR0_UART2);
1231 +               break;
1232 +       case 3:
1233 +               sdr = SDR0_READ(DCRN_SDR0_UART3);
1234 +               break;
1235 +       default:
1236 +               return;
1237 +       }
1238 +
1239 +       if (sdr & 0x00800000u)
1240 +               clock = ser_clk;
1241 +       else
1242 +               clock = plb_clk / __fix_zero(sdr & 0xff, 256);
1243 +
1244 +       dt_fixup_clock(path, clock);
1245 +}
1246 +
1247 +void ibm440ep_fixup_clocks(unsigned int sys_clk,
1248 +                          unsigned int ser_clk,
1249 +                          unsigned int tmr_clk)
1250 +{
1251 +       unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 0);
1252 +
1253 +       /* serial clocks beed fixup based on int/ext */
1254 +       eplike_fixup_uart_clk(0, "/plb/opb/serial@ef600300", ser_clk, plb_clk);
1255 +       eplike_fixup_uart_clk(1, "/plb/opb/serial@ef600400", ser_clk, plb_clk);
1256 +       eplike_fixup_uart_clk(2, "/plb/opb/serial@ef600500", ser_clk, plb_clk);
1257 +       eplike_fixup_uart_clk(3, "/plb/opb/serial@ef600600", ser_clk, plb_clk);
1258 +}
1259 +
1260 +void ibm440gx_fixup_clocks(unsigned int sys_clk,
1261 +                          unsigned int ser_clk,
1262 +                          unsigned int tmr_clk)
1263 +{
1264 +       unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 1);
1265 +
1266 +       /* serial clocks beed fixup based on int/ext */
1267 +       eplike_fixup_uart_clk(0, "/plb/opb/serial@40000200", ser_clk, plb_clk);
1268 +       eplike_fixup_uart_clk(1, "/plb/opb/serial@40000300", ser_clk, plb_clk);
1269 +}
1270 +
1271 +void ibm440spe_fixup_clocks(unsigned int sys_clk,
1272 +                           unsigned int ser_clk,
1273 +                           unsigned int tmr_clk)
1274 +{
1275 +       unsigned int plb_clk = __ibm440eplike_fixup_clocks(sys_clk, tmr_clk, 1);
1276 +
1277 +       /* serial clocks beed fixup based on int/ext */
1278 +       eplike_fixup_uart_clk(0, "/plb/opb/serial@10000200", ser_clk, plb_clk);
1279 +       eplike_fixup_uart_clk(1, "/plb/opb/serial@10000300", ser_clk, plb_clk);
1280 +       eplike_fixup_uart_clk(2, "/plb/opb/serial@10000600", ser_clk, plb_clk);
1281 +}
1282 +
1283 +void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk)
1284 +{
1285 +       u32 pllmr = mfdcr(DCRN_CPC0_PLLMR);
1286 +       u32 cpc0_cr0 = mfdcr(DCRN_405_CPC0_CR0);
1287 +       u32 cpc0_cr1 = mfdcr(DCRN_405_CPC0_CR1);
1288 +       u32 psr = mfdcr(DCRN_405_CPC0_PSR);
1289 +       u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
1290 +       u32 fwdv, fwdvb, fbdv, cbdv, opdv, epdv, ppdv, udiv;
1291 +
1292 +       fwdv = (8 - ((pllmr & 0xe0000000) >> 29));
1293 +       fbdv = (pllmr & 0x1e000000) >> 25;
1294 +       if (fbdv == 0)
1295 +               fbdv = 16;
1296 +       cbdv = ((pllmr & 0x00060000) >> 17) + 1; /* CPU:PLB */
1297 +       opdv = ((pllmr & 0x00018000) >> 15) + 1; /* PLB:OPB */
1298 +       ppdv = ((pllmr & 0x00001800) >> 13) + 1; /* PLB:PCI */
1299 +       epdv = ((pllmr & 0x00001800) >> 11) + 2; /* PLB:EBC */
1300 +       udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
1301 +
1302 +       /* check for 405GPr */
1303 +       if ((mfpvr() & 0xfffffff0) == (0x50910951 & 0xfffffff0)) {
1304 +               fwdvb = 8 - (pllmr & 0x00000007);
1305 +               if (!(psr & 0x00001000)) /* PCI async mode enable == 0 */
1306 +                       if (psr & 0x00000020) /* New mode enable */
1307 +                               m = fwdvb * 2 * ppdv;
1308 +                       else
1309 +                               m = fwdvb * cbdv * ppdv;
1310 +               else if (psr & 0x00000020) /* New mode enable */
1311 +                       if (psr & 0x00000800) /* PerClk synch mode */
1312 +                               m = fwdvb * 2 * epdv;
1313 +                       else
1314 +                               m = fbdv * fwdv;
1315 +               else if (epdv == fbdv)
1316 +                       m = fbdv * cbdv * epdv;
1317 +               else
1318 +                       m = fbdv * fwdvb * cbdv;
1319 +
1320 +               cpu = sys_clk * m / fwdv;
1321 +               plb = sys_clk * m / (fwdvb * cbdv);
1322 +       } else {
1323 +               m = fwdv * fbdv * cbdv;
1324 +               cpu = sys_clk * m / fwdv;
1325 +               plb = cpu / cbdv;
1326 +       }
1327 +       opb = plb / opdv;
1328 +       ebc = plb / epdv;
1329 +
1330 +       if (cpc0_cr0 & 0x80)
1331 +               /* uart0 uses the external clock */
1332 +               uart0 = ser_clk;
1333 +       else
1334 +               uart0 = cpu / udiv;
1335 +
1336 +       if (cpc0_cr0 & 0x40)
1337 +               /* uart1 uses the external clock */
1338 +               uart1 = ser_clk;
1339 +       else
1340 +               uart1 = cpu / udiv;
1341 +
1342 +       /* setup the timebase clock to tick at the cpu frequency */
1343 +       cpc0_cr1 = cpc0_cr1 & ~0x00800000;
1344 +       mtdcr(DCRN_405_CPC0_CR1, cpc0_cr1);
1345 +       tb = cpu;
1346 +
1347 +       dt_fixup_cpu_clocks(cpu, tb, 0);
1348 +       dt_fixup_clock("/plb", plb);
1349 +       dt_fixup_clock("/plb/opb", opb);
1350 +       dt_fixup_clock("/plb/ebc", ebc);
1351 +       dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
1352 +       dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
1353 +}
1354 +
1355 +
1356 +void ibm405ep_fixup_clocks(unsigned int sys_clk)
1357 +{
1358 +       u32 pllmr0 = mfdcr(DCRN_CPC0_PLLMR0);
1359 +       u32 pllmr1 = mfdcr(DCRN_CPC0_PLLMR1);
1360 +       u32 cpc0_ucr = mfdcr(DCRN_CPC0_UCR);
1361 +       u32 cpu, plb, opb, ebc, uart0, uart1;
1362 +       u32 fwdva, fwdvb, fbdv, cbdv, opdv, epdv;
1363 +       u32 pllmr0_ccdv, tb, m;
1364 +
1365 +       fwdva = 8 - ((pllmr1 & 0x00070000) >> 16);
1366 +       fwdvb = 8 - ((pllmr1 & 0x00007000) >> 12);
1367 +       fbdv = (pllmr1 & 0x00f00000) >> 20;
1368 +       if (fbdv == 0)
1369 +               fbdv = 16;
1370 +
1371 +       cbdv = ((pllmr0 & 0x00030000) >> 16) + 1; /* CPU:PLB */
1372 +       epdv = ((pllmr0 & 0x00000300) >> 8) + 2;  /* PLB:EBC */
1373 +       opdv = ((pllmr0 & 0x00003000) >> 12) + 1; /* PLB:OPB */
1374 +
1375 +       m = fbdv * fwdvb;
1376 +
1377 +       pllmr0_ccdv = ((pllmr0 & 0x00300000) >> 20) + 1;
1378 +       if (pllmr1 & 0x80000000)
1379 +               cpu = sys_clk * m / (fwdva * pllmr0_ccdv);
1380 +       else
1381 +               cpu = sys_clk / pllmr0_ccdv;
1382 +
1383 +       plb = cpu / cbdv;
1384 +       opb = plb / opdv;
1385 +       ebc = plb / epdv;
1386 +       tb = cpu;
1387 +       uart0 = cpu / (cpc0_ucr & 0x0000007f);
1388 +       uart1 = cpu / ((cpc0_ucr & 0x00007f00) >> 8);
1389 +
1390 +       dt_fixup_cpu_clocks(cpu, tb, 0);
1391 +       dt_fixup_clock("/plb", plb);
1392 +       dt_fixup_clock("/plb/opb", opb);
1393 +       dt_fixup_clock("/plb/ebc", ebc);
1394         dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
1395 -       dt_fixup_clock("/plb/opb/serial@ef600400", uart0);
1396 -       dt_fixup_clock("/plb/opb/serial@ef600500", uart0);
1397 -       dt_fixup_clock("/plb/opb/serial@ef600600", uart0);
1398 +       dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
1399  }
1400 --- a/arch/powerpc/boot/4xx.h
1401 +++ b/arch/powerpc/boot/4xx.h
1402 @@ -11,12 +11,22 @@
1403  #ifndef _POWERPC_BOOT_4XX_H_
1404  #define _POWERPC_BOOT_4XX_H_
1405  
1406 -void ibm4xx_fixup_memsize(void);
1407 +void ibm4xx_sdram_fixup_memsize(void);
1408 +void ibm440spe_fixup_memsize(void);
1409  void ibm4xx_denali_fixup_memsize(void);
1410  void ibm44x_dbcr_reset(void);
1411  void ibm40x_dbcr_reset(void);
1412  void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1);
1413  void ibm4xx_fixup_ebc_ranges(const char *ebc);
1414 -void ibm440ep_fixup_clocks(unsigned int sysclk, unsigned int ser_clk);
1415 +
1416 +void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
1417 +void ibm405ep_fixup_clocks(unsigned int sys_clk);
1418 +void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk);
1419 +void ibm440ep_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
1420 +                          unsigned int tmr_clk);
1421 +void ibm440gx_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
1422 +                          unsigned int tmr_clk);
1423 +void ibm440spe_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk,
1424 +                           unsigned int tmr_clk);
1425  
1426  #endif /* _POWERPC_BOOT_4XX_H_ */
1427 --- a/arch/powerpc/boot/Makefile
1428 +++ b/arch/powerpc/boot/Makefile
1429 @@ -33,12 +33,15 @@
1430  BOOTCFLAGS     += -fno-stack-protector
1431  endif
1432  
1433 -BOOTCFLAGS     += -I$(obj) -I$(srctree)/$(obj)
1434 +BOOTCFLAGS     += -I$(obj) -I$(srctree)/$(obj) -I$(srctree)/$(src)/libfdt
1435  
1436  $(obj)/4xx.o: BOOTCFLAGS += -mcpu=440
1437  $(obj)/ebony.o: BOOTCFLAGS += -mcpu=440
1438 +$(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=440
1439 +$(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=440
1440  $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405
1441  
1442 +
1443  zlib       := inffast.c inflate.c inftrees.c
1444  zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
1445  zliblinuxheader := zlib.h zconf.h zutil.h
1446 @@ -46,17 +49,21 @@
1447  $(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \
1448         $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader))
1449  
1450 -src-wlib := string.S crt0.S stdio.c main.c flatdevtree.c flatdevtree_misc.c \
1451 +src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
1452 +src-wlib := string.S crt0.S stdio.c main.c \
1453 +               $(addprefix libfdt/,$(src-libfdt)) libfdt-wrapper.c \
1454                 ns16550.c serial.c simple_alloc.c div64.S util.S \
1455                 gunzip_util.c elf_util.c $(zlib) devtree.c oflib.c ofconsole.c \
1456                 4xx.c ebony.c mv64x60.c mpsc.c mv64x60_i2c.c cuboot.c bamboo.c \
1457                 cpm-serial.c stdlib.c mpc52xx-psc.c planetcore.c uartlite.c \
1458                 fsl-soc.c mpc8xx.c pq2.c
1459 -src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \
1460 +src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c \
1461                 cuboot-ebony.c treeboot-ebony.c prpmc2800.c \
1462                 ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
1463                 cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \
1464 -               fixed-head.S ep88xc.c cuboot-hpc2.c
1465 +               fixed-head.S ep88xc.c cuboot-hpc2.c ep405.c cuboot-taishan.c \
1466 +               cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \
1467 +               cuboot-warp.c
1468  src-boot := $(src-wlib) $(src-plat) empty.c
1469  
1470  src-boot := $(addprefix $(obj)/, $(src-boot))
1471 @@ -101,24 +108,61 @@
1472        cmd_bootar = $(CROSS32AR) -cr $@.$$$$ $(filter-out FORCE,$^); mv $@.$$$$ $@
1473  
1474  $(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c FORCE
1475 +       $(Q)mkdir -p $(dir $@)
1476         $(call if_changed_dep,bootcc)
1477  $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE
1478 +       $(Q)mkdir -p $(dir $@)
1479         $(call if_changed_dep,bootas)
1480  
1481  $(obj)/wrapper.a: $(obj-wlib) FORCE
1482         $(call if_changed,bootar)
1483  
1484 -hostprogs-y    := addnote addRamDisk hack-coff mktree
1485 +hostprogs-y    := addnote addRamDisk hack-coff mktree dtc
1486  
1487  targets                += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
1488  extra-y                := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
1489                    $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds
1490  
1491  wrapper                :=$(srctree)/$(src)/wrapper
1492 -wrapperbits    := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \
1493 +wrapperbits    := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree dtc) \
1494                         $(wrapper) FORCE
1495  
1496  #############
1497 +# Bits for building dtc
1498 +# DTC_GENPARSER      := 1    # Uncomment to rebuild flex/bison output
1499 +
1500 +dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o srcpos.o checks.o
1501 +dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
1502 +dtc-objs := $(addprefix dtc-src/, $(dtc-objs))
1503 +
1504 +# prerequisites on generated files needs to be explicit
1505 +$(obj)/dtc-src/dtc-parser.tab.o: $(obj)/dtc-src/dtc-parser.tab.c $(obj)/dtc-src/dtc-parser.tab.h
1506 +$(obj)/dtc-src/dtc-lexer.lex.o:  $(obj)/dtc-src/dtc-lexer.lex.c $(obj)/dtc-src/dtc-parser.tab.h
1507 +
1508 +HOSTCFLAGS += -I$(src)/dtc-src/ -I$(src)/libfdt/
1509 +
1510 +targets += dtc-src/dtc-parser.tab.c
1511 +targets += dtc-src/dtc-lexer.lex.c
1512 +
1513 +ifdef DTC_GENPARSER
1514 +BISON = bison
1515 +FLEX = flex
1516 +
1517 +quiet_cmd_bison = BISON   $@
1518 +      cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
1519 +quiet_cmd_flex = FLEX    $@
1520 +      cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
1521 +
1522 +$(obj)/dtc-src/dtc-parser.tab.c: $(src)/dtc-src/dtc-parser.y FORCE
1523 +     $(call if_changed,bison)
1524 +
1525 +$(obj)/dtc-src/dtc-parser.tab.h: $(obj)/dtc-src/dtc-parser.tab.c
1526 +
1527 +$(obj)/dtc-src/dtc-lexer.lex.c: $(src)/dtc-src/dtc-lexer.l FORCE
1528 +     $(call if_changed,flex)
1529 +endif
1530 +
1531 +#############
1532  # Bits for building various flavours of zImage
1533  
1534  ifneq ($(CROSS32_COMPILE),)
1535 @@ -150,15 +194,26 @@
1536  ifneq ($(CONFIG_DEVICE_TREE),"")
1537  image-$(CONFIG_PPC_8xx)                        += cuImage.8xx
1538  image-$(CONFIG_PPC_EP88XC)             += zImage.ep88xc
1539 +image-$(CONFIG_EP405)                  += zImage.ep405
1540  image-$(CONFIG_8260)                   += cuImage.pq2
1541 +image-$(CONFIG_EP8248E)                        += zImage.ep8248e
1542  image-$(CONFIG_PPC_MPC52xx)            += cuImage.52xx
1543 +image-$(CONFIG_STORCENTER)             += cuImage.824x
1544  image-$(CONFIG_PPC_83xx)               += cuImage.83xx
1545  image-$(CONFIG_PPC_85xx)               += cuImage.85xx
1546  image-$(CONFIG_MPC7448HPC2)            += cuImage.hpc2
1547  image-$(CONFIG_EBONY)                  += treeImage.ebony cuImage.ebony
1548  image-$(CONFIG_BAMBOO)                 += treeImage.bamboo cuImage.bamboo
1549  image-$(CONFIG_SEQUOIA)                        += cuImage.sequoia
1550 +image-$(CONFIG_RAINIER)                        += cuImage.rainier
1551  image-$(CONFIG_WALNUT)                 += treeImage.walnut
1552 +image-$(CONFIG_TAISHAN)                        += cuImage.taishan
1553 +image-$(CONFIG_KATMAI)                 += cuImage.katmai
1554 +image-$(CONFIG_WARP)                   += cuImage.warp
1555 +endif
1556 +
1557 +ifneq ($(CONFIG_REDBOOT),"")
1558 +image-$(CONFIG_PPC_8xx)                        += zImage.redboot-8xx
1559  endif
1560  
1561  # For 32-bit powermacs, build the COFF and miboot images
1562 @@ -243,3 +298,51 @@
1563  clean-kernel += $(addsuffix .gz,$(clean-kernel))
1564  # If not absolute clean-files are relative to $(obj).
1565  clean-files += $(addprefix $(objtree)/, $(clean-kernel))
1566 +
1567 +WRAPPER_OBJDIR := /usr/lib/kernel-wrapper
1568 +WRAPPER_DTSDIR := /usr/lib/kernel-wrapper/dts
1569 +WRAPPER_BINDIR := /usr/sbin
1570 +INSTALL := install
1571 +
1572 +extra-installed                := $(patsubst $(obj)/%, $(DESTDIR)$(WRAPPER_OBJDIR)/%, $(extra-y))
1573 +hostprogs-installed    := $(patsubst %, $(DESTDIR)$(WRAPPER_BINDIR)/%, $(hostprogs-y))
1574 +wrapper-installed      := $(DESTDIR)$(WRAPPER_BINDIR)/wrapper
1575 +dts-installed          := $(patsubst $(obj)/dts/%, $(DESTDIR)$(WRAPPER_DTSDIR)/%, $(wildcard $(obj)/dts/*.dts))
1576 +
1577 +all-installed          := $(extra-installed) $(hostprogs-installed) $(wrapper-installed) $(dts-installed)
1578 +
1579 +quiet_cmd_mkdir           = MKDIR   $(patsubst $(INSTALL_HDR_PATH)/%,%,$@)
1580 +      cmd_mkdir           = mkdir -p $@
1581 +
1582 +quiet_cmd_install        = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,%,$@)
1583 +      cmd_install        = $(INSTALL)  -m0644 $(patsubst $(DESTDIR)$(WRAPPER_OBJDIR)/%,$(obj)/%,$@) $@
1584 +
1585 +quiet_cmd_install_dts    = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,dts/%,$@)
1586 +      cmd_install_dts    = $(INSTALL)  -m0644 $(patsubst $(DESTDIR)$(WRAPPER_DTSDIR)/%,$(srctree)/$(obj)/dts/%,$@) $@
1587 +
1588 +quiet_cmd_install_exe    = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
1589 +      cmd_install_exe    = $(INSTALL)  -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(obj)/%,$@) $@
1590 +
1591 +quiet_cmd_install_wrapper = INSTALL $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,%,$@)
1592 +      cmd_install_wrapper = $(INSTALL)  -m0755 $(patsubst $(DESTDIR)$(WRAPPER_BINDIR)/%,$(srctree)/$(obj)/%,$@) $@ ;\
1593 +                               sed -i $@ -e 's%^object=.*%object=$(WRAPPER_OBJDIR)%' \
1594 +                                         -e 's%^objbin=.*%objbin=$(WRAPPER_BINDIR)%' \
1595 +
1596 +
1597 +$(DESTDIR)$(WRAPPER_OBJDIR) $(DESTDIR)$(WRAPPER_DTSDIR) $(DESTDIR)$(WRAPPER_BINDIR):
1598 +       $(call cmd,mkdir)
1599 +
1600 +$(extra-installed)     : $(DESTDIR)$(WRAPPER_OBJDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_OBJDIR)
1601 +       $(call cmd,install)
1602 +
1603 +$(hostprogs-installed)  : $(DESTDIR)$(WRAPPER_BINDIR)/% : $(obj)/% | $(DESTDIR)$(WRAPPER_BINDIR)
1604 +       $(call cmd,install_exe)
1605 +
1606 +$(dts-installed)       : $(DESTDIR)$(WRAPPER_DTSDIR)/% : $(srctree)/$(obj)/dts/% | $(DESTDIR)$(WRAPPER_DTSDIR)
1607 +       $(call cmd,install_dts)
1608 +
1609 +$(wrapper-installed): $(DESTDIR)$(WRAPPER_BINDIR) $(srctree)/$(obj)/wrapper | $(DESTDIR)$(WRAPPER_BINDIR)
1610 +       $(call cmd,install_wrapper)
1611 +
1612 +$(obj)/bootwrapper_install: $(all-installed)
1613 +
1614 --- a/arch/powerpc/boot/bamboo.c
1615 +++ b/arch/powerpc/boot/bamboo.c
1616 @@ -30,8 +30,8 @@
1617  {
1618         unsigned long sysclk = 33333333;
1619  
1620 -       ibm440ep_fixup_clocks(sysclk, 11059200);
1621 -       ibm4xx_fixup_memsize();
1622 +       ibm440ep_fixup_clocks(sysclk, 11059200, 25000000);
1623 +       ibm4xx_sdram_fixup_memsize();
1624         ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
1625         dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
1626  }
1627 @@ -42,6 +42,6 @@
1628         platform_ops.exit = ibm44x_dbcr_reset;
1629         bamboo_mac0 = mac0;
1630         bamboo_mac1 = mac1;
1631 -       ft_init(_dtb_start, 0, 32);
1632 +       fdt_init(_dtb_start);
1633         serial_console_init();
1634  }
1635 --- a/arch/powerpc/boot/cuboot-52xx.c
1636 +++ b/arch/powerpc/boot/cuboot-52xx.c
1637 @@ -53,7 +53,7 @@
1638                     unsigned long r6, unsigned long r7)
1639  {
1640         CUBOOT_INIT();
1641 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1642 +       fdt_init(_dtb_start);
1643         serial_console_init();
1644         platform_ops.fixups = platform_fixups;
1645  }
1646 --- /dev/null
1647 +++ b/arch/powerpc/boot/cuboot-824x.c
1648 @@ -0,0 +1,53 @@
1649 +/*
1650 + * Old U-boot compatibility for 824x
1651 + *
1652 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
1653 + *
1654 + * This program is free software; you can redistribute it and/or modify it
1655 + * under the terms of the GNU General Public License version 2 as published
1656 + * by the Free Software Foundation.
1657 + */
1658 +
1659 +#include "ops.h"
1660 +#include "stdio.h"
1661 +#include "cuboot.h"
1662 +
1663 +#define TARGET_824x
1664 +#include "ppcboot.h"
1665 +
1666 +static bd_t bd;
1667 +
1668 +
1669 +static void platform_fixups(void)
1670 +{
1671 +       void *soc;
1672 +
1673 +       dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
1674 +       dt_fixup_mac_addresses(bd.bi_enetaddr);
1675 +       dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
1676 +
1677 +       soc = find_node_by_devtype(NULL, "soc");
1678 +       if (soc) {
1679 +               void *serial = NULL;
1680 +
1681 +               setprop(soc, "bus-frequency", &bd.bi_busfreq,
1682 +                       sizeof(bd.bi_busfreq));
1683 +
1684 +               while ((serial = find_node_by_devtype(serial, "serial"))) {
1685 +                       if (get_parent(serial) != soc)
1686 +                               continue;
1687 +
1688 +                       setprop(serial, "clock-frequency", &bd.bi_busfreq,
1689 +                               sizeof(bd.bi_busfreq));
1690 +               }
1691 +       }
1692 +}
1693 +
1694 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
1695 +                   unsigned long r6, unsigned long r7)
1696 +{
1697 +       CUBOOT_INIT();
1698 +       fdt_init(_dtb_start);
1699 +       serial_console_init();
1700 +       platform_ops.fixups = platform_fixups;
1701 +}
1702 --- a/arch/powerpc/boot/cuboot-83xx.c
1703 +++ b/arch/powerpc/boot/cuboot-83xx.c
1704 @@ -24,7 +24,8 @@
1705         void *soc;
1706  
1707         dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
1708 -       dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
1709 +       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
1710 +       dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
1711         dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
1712  
1713         /* Unfortunately, the specific model number is encoded in the
1714 @@ -52,7 +53,7 @@
1715                     unsigned long r6, unsigned long r7)
1716  {
1717         CUBOOT_INIT();
1718 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1719 +       fdt_init(_dtb_start);
1720         serial_console_init();
1721         platform_ops.fixups = platform_fixups;
1722  }
1723 --- a/arch/powerpc/boot/cuboot-85xx.c
1724 +++ b/arch/powerpc/boot/cuboot-85xx.c
1725 @@ -24,8 +24,9 @@
1726         void *soc;
1727  
1728         dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
1729 -       dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr,
1730 -                              bd.bi_enet2addr);
1731 +       dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr);
1732 +       dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr);
1733 +       dt_fixup_mac_address_by_alias("ethernet2", bd.bi_enet2addr);
1734         dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 8, bd.bi_busfreq);
1735  
1736         /* Unfortunately, the specific model number is encoded in the
1737 @@ -53,7 +54,7 @@
1738                     unsigned long r6, unsigned long r7)
1739  {
1740         CUBOOT_INIT();
1741 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1742 +       fdt_init(_dtb_start);
1743         serial_console_init();
1744         platform_ops.fixups = platform_fixups;
1745  }
1746 --- a/arch/powerpc/boot/cuboot-8xx.c
1747 +++ b/arch/powerpc/boot/cuboot-8xx.c
1748 @@ -41,7 +41,7 @@
1749                     unsigned long r6, unsigned long r7)
1750  {
1751         CUBOOT_INIT();
1752 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1753 +       fdt_init(_dtb_start);
1754         serial_console_init();
1755         platform_ops.fixups = platform_fixups;
1756  }
1757 --- a/arch/powerpc/boot/cuboot-hpc2.c
1758 +++ b/arch/powerpc/boot/cuboot-hpc2.c
1759 @@ -42,7 +42,7 @@
1760                 unsigned long r6, unsigned long r7)
1761  {
1762         CUBOOT_INIT();
1763 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1764 +       fdt_init(_dtb_start);
1765         serial_console_init();
1766         platform_ops.fixups = platform_fixups;
1767  }
1768 --- /dev/null
1769 +++ b/arch/powerpc/boot/cuboot-katmai.c
1770 @@ -0,0 +1,56 @@
1771 +/*
1772 + * Old U-boot compatibility for Katmai
1773 + *
1774 + * Author: Hugh Blemings <hugh@au.ibm.com>
1775 + *
1776 + * Copyright 2007 Hugh Blemings, IBM Corporation.
1777 + *   Based on cuboot-ebony.c which is:
1778 + * Copyright 2007 David Gibson, IBM Corporation.
1779 + *   Based on cuboot-83xx.c, which is:
1780 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
1781 + *
1782 + * This program is free software; you can redistribute it and/or modify it
1783 + * under the terms of the GNU General Public License version 2 as published
1784 + * by the Free Software Foundation.
1785 + */
1786 +
1787 +#include "ops.h"
1788 +#include "stdio.h"
1789 +#include "reg.h"
1790 +#include "dcr.h"
1791 +#include "4xx.h"
1792 +#include "44x.h"
1793 +#include "cuboot.h"
1794 +
1795 +#define TARGET_44x
1796 +#include "ppcboot.h"
1797 +
1798 +static bd_t bd;
1799 +
1800 +BSS_STACK(4096);
1801 +
1802 +static void katmai_fixups(void)
1803 +{
1804 +       unsigned long sysclk = 33333000;
1805 +
1806 +       /* 440SP Clock logic is all but identical to 440GX
1807 +        * so we just use that code for now at least
1808 +        */
1809 +       ibm440spe_fixup_clocks(sysclk, 6 * 1843200, 0);
1810 +
1811 +       ibm440spe_fixup_memsize();
1812 +
1813 +       dt_fixup_mac_address(0, bd.bi_enetaddr);
1814 +
1815 +       ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
1816 +}
1817 +
1818 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
1819 +                  unsigned long r6, unsigned long r7)
1820 +{
1821 +       CUBOOT_INIT();
1822 +
1823 +       platform_ops.fixups = katmai_fixups;
1824 +       fdt_init(_dtb_start);
1825 +       serial_console_init();
1826 +}
1827 --- a/arch/powerpc/boot/cuboot-pq2.c
1828 +++ b/arch/powerpc/boot/cuboot-pq2.c
1829 @@ -255,7 +255,7 @@
1830                     unsigned long r6, unsigned long r7)
1831  {
1832         CUBOOT_INIT();
1833 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
1834 +       fdt_init(_dtb_start);
1835         serial_console_init();
1836         platform_ops.fixups = pq2_platform_fixups;
1837  }
1838 --- /dev/null
1839 +++ b/arch/powerpc/boot/cuboot-rainier.c
1840 @@ -0,0 +1,56 @@
1841 +/*
1842 + * Old U-boot compatibility for Rainier
1843 + *
1844 + * Valentine Barshak <vbarshak@ru.mvista.com>
1845 + * Copyright 2007 MontaVista Software, Inc
1846 + *
1847 + * Based on Ebony code by David Gibson <david@gibson.dropbear.id.au>
1848 + * Copyright IBM Corporation, 2007
1849 + *
1850 + * Based on Bamboo code by Josh Boyer <jwboyer@linux.vnet.ibm.com>
1851 + * Copyright IBM Corporation, 2007
1852 + *
1853 + * This program is free software; you can redistribute it and/or
1854 + * modify it under the terms of the GNU General Public License
1855 + * as published by the Free Software Foundation; version 2 of the License
1856 + */
1857 +
1858 +#include <stdarg.h>
1859 +#include <stddef.h>
1860 +#include "types.h"
1861 +#include "elf.h"
1862 +#include "string.h"
1863 +#include "stdio.h"
1864 +#include "page.h"
1865 +#include "ops.h"
1866 +#include "dcr.h"
1867 +#include "4xx.h"
1868 +#include "44x.h"
1869 +#include "cuboot.h"
1870 +
1871 +#define TARGET_4xx
1872 +#define TARGET_44x
1873 +#include "ppcboot.h"
1874 +
1875 +static bd_t bd;
1876 +
1877 +
1878 +static void rainier_fixups(void)
1879 +{
1880 +       unsigned long sysclk = 33333333;
1881 +
1882 +       ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
1883 +       ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
1884 +       ibm4xx_denali_fixup_memsize();
1885 +       dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
1886 +}
1887 +
1888 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
1889 +                   unsigned long r6, unsigned long r7)
1890 +{
1891 +       CUBOOT_INIT();
1892 +       platform_ops.fixups = rainier_fixups;
1893 +       platform_ops.exit = ibm44x_dbcr_reset;
1894 +       fdt_init(_dtb_start);
1895 +       serial_console_init();
1896 +}
1897 --- a/arch/powerpc/boot/cuboot-sequoia.c
1898 +++ b/arch/powerpc/boot/cuboot-sequoia.c
1899 @@ -39,7 +39,7 @@
1900  {
1901         unsigned long sysclk = 33333333;
1902  
1903 -       ibm440ep_fixup_clocks(sysclk, 11059200);
1904 +       ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
1905         ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
1906         ibm4xx_denali_fixup_memsize();
1907         dt_fixup_mac_addresses(&bd.bi_enetaddr, &bd.bi_enet1addr);
1908 @@ -51,6 +51,6 @@
1909         CUBOOT_INIT();
1910         platform_ops.fixups = sequoia_fixups;
1911         platform_ops.exit = ibm44x_dbcr_reset;
1912 -       ft_init(_dtb_start, 0, 32);
1913 +       fdt_init(_dtb_start);
1914         serial_console_init();
1915  }
1916 --- /dev/null
1917 +++ b/arch/powerpc/boot/cuboot-taishan.c
1918 @@ -0,0 +1,54 @@
1919 +/*
1920 + * Old U-boot compatibility for Taishan
1921 + *
1922 + * Author: Hugh Blemings <hugh@au.ibm.com>
1923 + *
1924 + * Copyright 2007 Hugh Blemings, IBM Corporation.
1925 + *   Based on cuboot-ebony.c which is:
1926 + * Copyright 2007 David Gibson, IBM Corporation.
1927 + *   Based on cuboot-83xx.c, which is:
1928 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
1929 + *
1930 + * This program is free software; you can redistribute it and/or modify it
1931 + * under the terms of the GNU General Public License version 2 as published
1932 + * by the Free Software Foundation.
1933 + */
1934 +
1935 +#include "ops.h"
1936 +#include "stdio.h"
1937 +#include "cuboot.h"
1938 +#include "reg.h"
1939 +#include "dcr.h"
1940 +#include "4xx.h"
1941 +
1942 +#define TARGET_44x
1943 +#include "ppcboot.h"
1944 +
1945 +static bd_t bd;
1946 +
1947 +BSS_STACK(4096);
1948 +
1949 +static void taishan_fixups(void)
1950 +{
1951 +       /* FIXME: sysclk should be derived by reading the FPGA
1952 +          registers */
1953 +       unsigned long sysclk = 33000000;
1954 +
1955 +       ibm440gx_fixup_clocks(sysclk, 6 * 1843200, 25000000);
1956 +
1957 +       ibm4xx_sdram_fixup_memsize();
1958 +
1959 +       dt_fixup_mac_addresses(bd.bi_enetaddr, bd.bi_enet1addr);
1960 +
1961 +       ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
1962 +}
1963 +
1964 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
1965 +                  unsigned long r6, unsigned long r7)
1966 +{
1967 +       CUBOOT_INIT();
1968 +
1969 +       platform_ops.fixups = taishan_fixups;
1970 +       fdt_init(_dtb_start);
1971 +       serial_console_init();
1972 +}
1973 --- /dev/null
1974 +++ b/arch/powerpc/boot/cuboot-warp.c
1975 @@ -0,0 +1,39 @@
1976 +/*
1977 + * Copyright (c) 2008 PIKA Technologies
1978 + *   Sean MacLennan <smaclennan@pikatech.com>
1979 + *
1980 + * This program is free software; you can redistribute it and/or modify it
1981 + * under the terms of the GNU General Public License version 2 as published
1982 + * by the Free Software Foundation.
1983 + */
1984 +
1985 +#include "ops.h"
1986 +#include "4xx.h"
1987 +#include "cuboot.h"
1988 +
1989 +#define TARGET_44x
1990 +#include "ppcboot.h"
1991 +
1992 +static bd_t bd;
1993 +
1994 +static void warp_fixups(void)
1995 +{
1996 +       unsigned long sysclk = 66000000;
1997 +
1998 +       ibm440ep_fixup_clocks(sysclk, 11059200, 50000000);
1999 +       ibm4xx_sdram_fixup_memsize();
2000 +       ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
2001 +       dt_fixup_mac_addresses(&bd.bi_enetaddr);
2002 +}
2003 +
2004 +
2005 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
2006 +                  unsigned long r6, unsigned long r7)
2007 +{
2008 +       CUBOOT_INIT();
2009 +
2010 +       platform_ops.fixups = warp_fixups;
2011 +       platform_ops.exit = ibm44x_dbcr_reset;
2012 +       fdt_init(_dtb_start);
2013 +       serial_console_init();
2014 +}
2015 --- a/arch/powerpc/boot/dcr.h
2016 +++ b/arch/powerpc/boot/dcr.h
2017 @@ -14,12 +14,20 @@
2018  #define DCRN_SDRAM0_CFGADDR                            0x010
2019  #define DCRN_SDRAM0_CFGDATA                            0x011
2020  
2021 +#define SDRAM0_READ(offset) ({\
2022 +       mtdcr(DCRN_SDRAM0_CFGADDR, offset); \
2023 +       mfdcr(DCRN_SDRAM0_CFGDATA); })
2024 +#define SDRAM0_WRITE(offset, data) ({\
2025 +       mtdcr(DCRN_SDRAM0_CFGADDR, offset); \
2026 +       mtdcr(DCRN_SDRAM0_CFGDATA, data); })
2027 +
2028  #define        SDRAM0_B0CR                             0x40
2029  #define        SDRAM0_B1CR                             0x44
2030  #define        SDRAM0_B2CR                             0x48
2031  #define        SDRAM0_B3CR                             0x4c
2032  
2033 -static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR, SDRAM0_B2CR, SDRAM0_B3CR };
2034 +static const unsigned long sdram_bxcr[] = { SDRAM0_B0CR, SDRAM0_B1CR,
2035 +                                           SDRAM0_B2CR, SDRAM0_B3CR };
2036  
2037  #define                        SDRAM_CONFIG_BANK_ENABLE        0x00000001
2038  #define                        SDRAM_CONFIG_SIZE_MASK          0x000e0000
2039 @@ -138,5 +146,54 @@
2040  #define DCRN_CPC0_PLLMR 0xb0
2041  #define DCRN_405_CPC0_CR0 0xb1
2042  #define DCRN_405_CPC0_CR1 0xb2
2043 +#define DCRN_405_CPC0_PSR 0xb4
2044 +
2045 +/* 405EP Clocking/Power Management/Chip Control regs */
2046 +#define DCRN_CPC0_PLLMR0  0xf0
2047 +#define DCRN_CPC0_PLLMR1  0xf4
2048 +#define DCRN_CPC0_UCR     0xf5
2049 +
2050 +/* 440GX Clock control etc */
2051 +
2052 +
2053 +#define DCRN_CPR0_CLKUPD                               0x020
2054 +#define DCRN_CPR0_PLLC                                 0x040
2055 +#define DCRN_CPR0_PLLD                                 0x060
2056 +#define DCRN_CPR0_PRIMAD                               0x080
2057 +#define DCRN_CPR0_PRIMBD                               0x0a0
2058 +#define DCRN_CPR0_OPBD                                 0x0c0
2059 +#define DCRN_CPR0_PERD                                 0x0e0
2060 +#define DCRN_CPR0_MALD                                 0x100
2061 +
2062 +#define DCRN_SDR0_CONFIG_ADDR  0xe
2063 +#define DCRN_SDR0_CONFIG_DATA  0xf
2064 +
2065 +/* SDR read/write helper macros */
2066 +#define SDR0_READ(offset) ({\
2067 +       mtdcr(DCRN_SDR0_CONFIG_ADDR, offset); \
2068 +       mfdcr(DCRN_SDR0_CONFIG_DATA); })
2069 +#define SDR0_WRITE(offset, data) ({\
2070 +       mtdcr(DCRN_SDR0_CONFIG_ADDR, offset); \
2071 +       mtdcr(DCRN_SDR0_CONFIG_DATA, data); })
2072 +
2073 +#define DCRN_SDR0_UART0                0x0120
2074 +#define DCRN_SDR0_UART1                0x0121
2075 +#define DCRN_SDR0_UART2                0x0122
2076 +#define DCRN_SDR0_UART3                0x0123
2077 +
2078 +
2079 +/* CPRs read/write helper macros - based off include/asm-ppc/ibm44x.h */
2080 +
2081 +#define DCRN_CPR0_CFGADDR                              0xc
2082 +#define DCRN_CPR0_CFGDATA                              0xd
2083 +
2084 +#define CPR0_READ(offset) ({\
2085 +       mtdcr(DCRN_CPR0_CFGADDR, offset); \
2086 +       mfdcr(DCRN_CPR0_CFGDATA); })
2087 +#define CPR0_WRITE(offset, data) ({\
2088 +       mtdcr(DCRN_CPR0_CFGADDR, offset); \
2089 +       mtdcr(DCRN_CPR0_CFGDATA, data); })
2090 +
2091 +
2092  
2093  #endif /* _PPC_BOOT_DCR_H_ */
2094 --- a/arch/powerpc/boot/devtree.c
2095 +++ b/arch/powerpc/boot/devtree.c
2096 @@ -88,6 +88,20 @@
2097         }
2098  }
2099  
2100 +void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr)
2101 +{
2102 +       void *devp = find_node_by_alias(alias);
2103 +
2104 +       if (devp) {
2105 +               printf("%s: local-mac-address <-"
2106 +                      " %02x:%02x:%02x:%02x:%02x:%02x\n\r", alias,
2107 +                      addr[0], addr[1], addr[2],
2108 +                      addr[3], addr[4], addr[5]);
2109 +
2110 +               setprop(devp, "local-mac-address", addr, 6);
2111 +       }
2112 +}
2113 +
2114  void dt_fixup_mac_address(u32 index, const u8 *addr)
2115  {
2116         void *devp = find_node_by_prop_value(NULL, "linux,network-index",
2117 --- /dev/null
2118 +++ b/arch/powerpc/boot/dtc-src/Makefile.dtc
2119 @@ -0,0 +1,25 @@
2120 +# Makefile.dtc
2121 +#
2122 +# This is not a complete Makefile of itself.  Instead, it is designed to
2123 +# be easily embeddable into other systems of Makefiles.
2124 +#
2125 +DTC_SRCS = dtc.c flattree.c fstree.c data.c livetree.c treesource.c srcpos.c \
2126 +       checks.c
2127 +DTC_EXTRA = dtc.h srcpos.h
2128 +DTC_LEXFILES = dtc-lexer.l
2129 +DTC_BISONFILES = dtc-parser.y
2130 +
2131 +DTC_LEX_SRCS = $(DTC_LEXFILES:%.l=%.lex.c)
2132 +DTC_BISON_SRCS = $(DTC_BISONFILES:%.y=%.tab.c)
2133 +DTC_BISON_INCLUDES = $(DTC_BISONFILES:%.y=%.tab.h)
2134 +
2135 +DTC_GEN_SRCS = $(DTC_LEX_SRCS) $(DTC_BISON_SRCS)
2136 +DTC_GEN_ALL = $(DTC_GEN_SRCS) $(DTC_BISON_INCLUDES)
2137 +DTC_OBJS = $(DTC_SRCS:%.c=%.o) $(DTC_GEN_SRCS:%.c=%.o)
2138 +
2139 +DTC_CLEANFILES = $(DTC_GEN_ALL)
2140 +
2141 +# We assume the containing Makefile system can do auto-dependencies for most
2142 +# things, but we supply the dependencies on generated header files explicitly
2143 +
2144 +$(addprefix $(DTC_objdir)/,$(DTC_GEN_SRCS:%.c=%.o)): $(addprefix $(DTC_objdir)/,$(DTC_BISON_INCLUDES))
2145 --- /dev/null
2146 +++ b/arch/powerpc/boot/dtc-src/checks.c
2147 @@ -0,0 +1,750 @@
2148 +/*
2149 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2007.
2150 + *
2151 + *
2152 + * This program is free software; you can redistribute it and/or
2153 + * modify it under the terms of the GNU General Public License as
2154 + * published by the Free Software Foundation; either version 2 of the
2155 + * License, or (at your option) any later version.
2156 + *
2157 + *  This program is distributed in the hope that it will be useful,
2158 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
2159 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2160 + *  General Public License for more details.
2161 + *
2162 + *  You should have received a copy of the GNU General Public License
2163 + *  along with this program; if not, write to the Free Software
2164 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
2165 + *                                                                   USA
2166 + */
2167 +
2168 +#include "dtc.h"
2169 +
2170 +#ifdef TRACE_CHECKS
2171 +#define TRACE(c, ...) \
2172 +       do { \
2173 +               fprintf(stderr, "=== %s: ", (c)->name); \
2174 +               fprintf(stderr, __VA_ARGS__); \
2175 +               fprintf(stderr, "\n"); \
2176 +       } while (0)
2177 +#else
2178 +#define TRACE(c, fmt, ...)     do { } while (0)
2179 +#endif
2180 +
2181 +enum checklevel {
2182 +       IGNORE = 0,
2183 +       WARN = 1,
2184 +       ERROR = 2,
2185 +};
2186 +
2187 +enum checkstatus {
2188 +       UNCHECKED = 0,
2189 +       PREREQ,
2190 +       PASSED,
2191 +       FAILED,
2192 +};
2193 +
2194 +struct check;
2195 +
2196 +typedef void (*tree_check_fn)(struct check *c, struct node *dt);
2197 +typedef void (*node_check_fn)(struct check *c, struct node *dt, struct node *node);
2198 +typedef void (*prop_check_fn)(struct check *c, struct node *dt,
2199 +                             struct node *node, struct property *prop);
2200 +
2201 +struct check {
2202 +       const char *name;
2203 +       tree_check_fn tree_fn;
2204 +       node_check_fn node_fn;
2205 +       prop_check_fn prop_fn;
2206 +       void *data;
2207 +       enum checklevel level;
2208 +       enum checkstatus status;
2209 +       int inprogress;
2210 +       int num_prereqs;
2211 +       struct check **prereq;
2212 +};
2213 +
2214 +#define CHECK(nm, tfn, nfn, pfn, d, lvl, ...) \
2215 +       static struct check *nm##_prereqs[] = { __VA_ARGS__ }; \
2216 +       static struct check nm = { \
2217 +               .name = #nm, \
2218 +               .tree_fn = (tfn), \
2219 +               .node_fn = (nfn), \
2220 +               .prop_fn = (pfn), \
2221 +               .data = (d), \
2222 +               .level = (lvl), \
2223 +               .status = UNCHECKED, \
2224 +               .num_prereqs = ARRAY_SIZE(nm##_prereqs), \
2225 +               .prereq = nm##_prereqs, \
2226 +       };
2227 +
2228 +#define TREE_CHECK(nm, d, lvl, ...) \
2229 +       CHECK(nm, check_##nm, NULL, NULL, d, lvl, __VA_ARGS__)
2230 +#define NODE_CHECK(nm, d, lvl, ...) \
2231 +       CHECK(nm, NULL, check_##nm, NULL, d, lvl, __VA_ARGS__)
2232 +#define PROP_CHECK(nm, d, lvl, ...) \
2233 +       CHECK(nm, NULL, NULL, check_##nm, d, lvl, __VA_ARGS__)
2234 +#define BATCH_CHECK(nm, lvl, ...) \
2235 +       CHECK(nm, NULL, NULL, NULL, NULL, lvl, __VA_ARGS__)
2236 +
2237 +#ifdef __GNUC__
2238 +static inline void check_msg(struct check *c, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
2239 +#endif
2240 +static inline void check_msg(struct check *c, const char *fmt, ...)
2241 +{
2242 +       va_list ap;
2243 +       va_start(ap, fmt);
2244 +
2245 +       if ((c->level < WARN) || (c->level <= quiet))
2246 +               return; /* Suppress message */
2247 +
2248 +       fprintf(stderr, "%s (%s): ",
2249 +               (c->level == ERROR) ? "ERROR" : "Warning", c->name);
2250 +       vfprintf(stderr, fmt, ap);
2251 +       fprintf(stderr, "\n");
2252 +}
2253 +
2254 +#define FAIL(c, ...) \
2255 +       do { \
2256 +               TRACE((c), "\t\tFAILED at %s:%d", __FILE__, __LINE__); \
2257 +               (c)->status = FAILED; \
2258 +               check_msg((c), __VA_ARGS__); \
2259 +       } while (0)
2260 +
2261 +static void check_nodes_props(struct check *c, struct node *dt, struct node *node)
2262 +{
2263 +       struct node *child;
2264 +       struct property *prop;
2265 +
2266 +       TRACE(c, "%s", node->fullpath);
2267 +       if (c->node_fn)
2268 +               c->node_fn(c, dt, node);
2269 +
2270 +       if (c->prop_fn)
2271 +               for_each_property(node, prop) {
2272 +                       TRACE(c, "%s\t'%s'", node->fullpath, prop->name);
2273 +                       c->prop_fn(c, dt, node, prop);
2274 +               }
2275 +
2276 +       for_each_child(node, child)
2277 +               check_nodes_props(c, dt, child);
2278 +}
2279 +
2280 +static int run_check(struct check *c, struct node *dt)
2281 +{
2282 +       int error = 0;
2283 +       int i;
2284 +
2285 +       assert(!c->inprogress);
2286 +
2287 +       if (c->status != UNCHECKED)
2288 +               goto out;
2289 +
2290 +       c->inprogress = 1;
2291 +
2292 +       for (i = 0; i < c->num_prereqs; i++) {
2293 +               struct check *prq = c->prereq[i];
2294 +               error |= run_check(prq, dt);
2295 +               if (prq->status != PASSED) {
2296 +                       c->status = PREREQ;
2297 +                       check_msg(c, "Failed prerequisite '%s'",
2298 +                                 c->prereq[i]->name);
2299 +               }
2300 +       }
2301 +
2302 +       if (c->status != UNCHECKED)
2303 +               goto out;
2304 +
2305 +       if (c->node_fn || c->prop_fn)
2306 +               check_nodes_props(c, dt, dt);
2307 +
2308 +       if (c->tree_fn)
2309 +               c->tree_fn(c, dt);
2310 +       if (c->status == UNCHECKED)
2311 +               c->status = PASSED;
2312 +
2313 +       TRACE(c, "\tCompleted, status %d", c->status);
2314 +
2315 +out:
2316 +       c->inprogress = 0;
2317 +       if ((c->status != PASSED) && (c->level == ERROR))
2318 +               error = 1;
2319 +       return error;
2320 +}
2321 +
2322 +/*
2323 + * Utility check functions
2324 + */
2325 +
2326 +static void check_is_string(struct check *c, struct node *root,
2327 +                           struct node *node)
2328 +{
2329 +       struct property *prop;
2330 +       char *propname = c->data;
2331 +
2332 +       prop = get_property(node, propname);
2333 +       if (!prop)
2334 +               return; /* Not present, assumed ok */
2335 +
2336 +       if (!data_is_one_string(prop->val))
2337 +               FAIL(c, "\"%s\" property in %s is not a string",
2338 +                    propname, node->fullpath);
2339 +}
2340 +#define CHECK_IS_STRING(nm, propname, lvl) \
2341 +       CHECK(nm, NULL, check_is_string, NULL, (propname), (lvl))
2342 +
2343 +static void check_is_cell(struct check *c, struct node *root,
2344 +                         struct node *node)
2345 +{
2346 +       struct property *prop;
2347 +       char *propname = c->data;
2348 +
2349 +       prop = get_property(node, propname);
2350 +       if (!prop)
2351 +               return; /* Not present, assumed ok */
2352 +
2353 +       if (prop->val.len != sizeof(cell_t))
2354 +               FAIL(c, "\"%s\" property in %s is not a single cell",
2355 +                    propname, node->fullpath);
2356 +}
2357 +#define CHECK_IS_CELL(nm, propname, lvl) \
2358 +       CHECK(nm, NULL, check_is_cell, NULL, (propname), (lvl))
2359 +
2360 +/*
2361 + * Structural check functions
2362 + */
2363 +
2364 +static void check_duplicate_node_names(struct check *c, struct node *dt,
2365 +                                      struct node *node)
2366 +{
2367 +       struct node *child, *child2;
2368 +
2369 +       for_each_child(node, child)
2370 +               for (child2 = child->next_sibling;
2371 +                    child2;
2372 +                    child2 = child2->next_sibling)
2373 +                       if (streq(child->name, child2->name))
2374 +                               FAIL(c, "Duplicate node name %s",
2375 +                                    child->fullpath);
2376 +}
2377 +NODE_CHECK(duplicate_node_names, NULL, ERROR);
2378 +
2379 +static void check_duplicate_property_names(struct check *c, struct node *dt,
2380 +                                          struct node *node)
2381 +{
2382 +       struct property *prop, *prop2;
2383 +
2384 +       for_each_property(node, prop)
2385 +               for (prop2 = prop->next; prop2; prop2 = prop2->next)
2386 +                       if (streq(prop->name, prop2->name))
2387 +                               FAIL(c, "Duplicate property name %s in %s",
2388 +                                    prop->name, node->fullpath);
2389 +}
2390 +NODE_CHECK(duplicate_property_names, NULL, ERROR);
2391 +
2392 +static void check_explicit_phandles(struct check *c, struct node *root,
2393 +                                         struct node *node)
2394 +{
2395 +       struct property *prop;
2396 +       struct node *other;
2397 +       cell_t phandle;
2398 +
2399 +       prop = get_property(node, "linux,phandle");
2400 +       if (! prop)
2401 +               return; /* No phandle, that's fine */
2402 +
2403 +       if (prop->val.len != sizeof(cell_t)) {
2404 +               FAIL(c, "%s has bad length (%d) linux,phandle property",
2405 +                    node->fullpath, prop->val.len);
2406 +               return;
2407 +       }
2408 +
2409 +       phandle = propval_cell(prop);
2410 +       if ((phandle == 0) || (phandle == -1)) {
2411 +               FAIL(c, "%s has invalid linux,phandle value 0x%x",
2412 +                    node->fullpath, phandle);
2413 +               return;
2414 +       }
2415 +
2416 +       other = get_node_by_phandle(root, phandle);
2417 +       if (other) {
2418 +               FAIL(c, "%s has duplicated phandle 0x%x (seen before at %s)",
2419 +                    node->fullpath, phandle, other->fullpath);
2420 +               return;
2421 +       }
2422 +
2423 +       node->phandle = phandle;
2424 +}
2425 +NODE_CHECK(explicit_phandles, NULL, ERROR);
2426 +
2427 +static void check_name_properties(struct check *c, struct node *root,
2428 +                                 struct node *node)
2429 +{
2430 +       struct property *prop;
2431 +
2432 +       prop = get_property(node, "name");
2433 +       if (!prop)
2434 +               return; /* No name property, that's fine */
2435 +
2436 +       if ((prop->val.len != node->basenamelen+1)
2437 +           || (memcmp(prop->val.val, node->name, node->basenamelen) != 0))
2438 +               FAIL(c, "\"name\" property in %s is incorrect (\"%s\" instead"
2439 +                    " of base node name)", node->fullpath, prop->val.val);
2440 +}
2441 +CHECK_IS_STRING(name_is_string, "name", ERROR);
2442 +NODE_CHECK(name_properties, NULL, ERROR, &name_is_string);
2443 +
2444 +/*
2445 + * Reference fixup functions
2446 + */
2447 +
2448 +static void fixup_phandle_references(struct check *c, struct node *dt,
2449 +                                    struct node *node, struct property *prop)
2450 +{
2451 +      struct marker *m = prop->val.markers;
2452 +      struct node *refnode;
2453 +      cell_t phandle;
2454 +
2455 +      for_each_marker_of_type(m, REF_PHANDLE) {
2456 +             assert(m->offset + sizeof(cell_t) <= prop->val.len);
2457 +
2458 +             refnode = get_node_by_ref(dt, m->ref);
2459 +             if (! refnode) {
2460 +                     FAIL(c, "Reference to non-existent node or label \"%s\"\n",
2461 +                          m->ref);
2462 +                     continue;
2463 +             }
2464 +
2465 +             phandle = get_node_phandle(dt, refnode);
2466 +             *((cell_t *)(prop->val.val + m->offset)) = cpu_to_be32(phandle);
2467 +      }
2468 +}
2469 +CHECK(phandle_references, NULL, NULL, fixup_phandle_references, NULL, ERROR,
2470 +      &duplicate_node_names, &explicit_phandles);
2471 +
2472 +static void fixup_path_references(struct check *c, struct node *dt,
2473 +                                 struct node *node, struct property *prop)
2474 +{
2475 +       struct marker *m = prop->val.markers;
2476 +       struct node *refnode;
2477 +       char *path;
2478 +
2479 +       for_each_marker_of_type(m, REF_PATH) {
2480 +               assert(m->offset <= prop->val.len);
2481 +
2482 +               refnode = get_node_by_ref(dt, m->ref);
2483 +               if (!refnode) {
2484 +                       FAIL(c, "Reference to non-existent node or label \"%s\"\n",
2485 +                            m->ref);
2486 +                       continue;
2487 +               }
2488 +
2489 +               path = refnode->fullpath;
2490 +               prop->val = data_insert_at_marker(prop->val, m, path,
2491 +                                                 strlen(path) + 1);
2492 +       }
2493 +}
2494 +CHECK(path_references, NULL, NULL, fixup_path_references, NULL, ERROR,
2495 +      &duplicate_node_names);
2496 +
2497 +/*
2498 + * Semantic checks
2499 + */
2500 +CHECK_IS_CELL(address_cells_is_cell, "#address-cells", WARN);
2501 +CHECK_IS_CELL(size_cells_is_cell, "#size-cells", WARN);
2502 +CHECK_IS_CELL(interrupt_cells_is_cell, "#interrupt-cells", WARN);
2503 +
2504 +CHECK_IS_STRING(device_type_is_string, "device_type", WARN);
2505 +CHECK_IS_STRING(model_is_string, "model", WARN);
2506 +CHECK_IS_STRING(status_is_string, "status", WARN);
2507 +
2508 +static void fixup_addr_size_cells(struct check *c, struct node *dt,
2509 +                                 struct node *node)
2510 +{
2511 +       struct property *prop;
2512 +
2513 +       node->addr_cells = -1;
2514 +       node->size_cells = -1;
2515 +
2516 +       prop = get_property(node, "#address-cells");
2517 +       if (prop)
2518 +               node->addr_cells = propval_cell(prop);
2519 +
2520 +       prop = get_property(node, "#size-cells");
2521 +       if (prop)
2522 +               node->size_cells = propval_cell(prop);
2523 +}
2524 +CHECK(addr_size_cells, NULL, fixup_addr_size_cells, NULL, NULL, WARN,
2525 +      &address_cells_is_cell, &size_cells_is_cell);
2526 +
2527 +#define node_addr_cells(n) \
2528 +       (((n)->addr_cells == -1) ? 2 : (n)->addr_cells)
2529 +#define node_size_cells(n) \
2530 +       (((n)->size_cells == -1) ? 1 : (n)->size_cells)
2531 +
2532 +static void check_reg_format(struct check *c, struct node *dt,
2533 +                            struct node *node)
2534 +{
2535 +       struct property *prop;
2536 +       int addr_cells, size_cells, entrylen;
2537 +
2538 +       prop = get_property(node, "reg");
2539 +       if (!prop)
2540 +               return; /* No "reg", that's fine */
2541 +
2542 +       if (!node->parent) {
2543 +               FAIL(c, "Root node has a \"reg\" property");
2544 +               return;
2545 +       }
2546 +
2547 +       if (prop->val.len == 0)
2548 +               FAIL(c, "\"reg\" property in %s is empty", node->fullpath);
2549 +
2550 +       addr_cells = node_addr_cells(node->parent);
2551 +       size_cells = node_size_cells(node->parent);
2552 +       entrylen = (addr_cells + size_cells) * sizeof(cell_t);
2553 +
2554 +       if ((prop->val.len % entrylen) != 0)
2555 +               FAIL(c, "\"reg\" property in %s has invalid length (%d bytes) "
2556 +                    "(#address-cells == %d, #size-cells == %d)",
2557 +                    node->fullpath, prop->val.len, addr_cells, size_cells);
2558 +}
2559 +NODE_CHECK(reg_format, NULL, WARN, &addr_size_cells);
2560 +
2561 +static void check_ranges_format(struct check *c, struct node *dt,
2562 +                               struct node *node)
2563 +{
2564 +       struct property *prop;
2565 +       int c_addr_cells, p_addr_cells, c_size_cells, p_size_cells, entrylen;
2566 +
2567 +       prop = get_property(node, "ranges");
2568 +       if (!prop)
2569 +               return;
2570 +
2571 +       if (!node->parent) {
2572 +               FAIL(c, "Root node has a \"ranges\" property");
2573 +               return;
2574 +       }
2575 +
2576 +       p_addr_cells = node_addr_cells(node->parent);
2577 +       p_size_cells = node_size_cells(node->parent);
2578 +       c_addr_cells = node_addr_cells(node);
2579 +       c_size_cells = node_size_cells(node);
2580 +       entrylen = (p_addr_cells + c_addr_cells + c_size_cells) * sizeof(cell_t);
2581 +
2582 +       if (prop->val.len == 0) {
2583 +               if (p_addr_cells != c_addr_cells)
2584 +                       FAIL(c, "%s has empty \"ranges\" property but its "
2585 +                            "#address-cells (%d) differs from %s (%d)",
2586 +                            node->fullpath, c_addr_cells, node->parent->fullpath,
2587 +                            p_addr_cells);
2588 +               if (p_size_cells != c_size_cells)
2589 +                       FAIL(c, "%s has empty \"ranges\" property but its "
2590 +                            "#size-cells (%d) differs from %s (%d)",
2591 +                            node->fullpath, c_size_cells, node->parent->fullpath,
2592 +                            p_size_cells);
2593 +       } else if ((prop->val.len % entrylen) != 0) {
2594 +               FAIL(c, "\"ranges\" property in %s has invalid length (%d bytes) "
2595 +                    "(parent #address-cells == %d, child #address-cells == %d, "
2596 +                    "#size-cells == %d)", node->fullpath, prop->val.len,
2597 +                    p_addr_cells, c_addr_cells, c_size_cells);
2598 +       }
2599 +}
2600 +NODE_CHECK(ranges_format, NULL, WARN, &addr_size_cells);
2601 +
2602 +/*
2603 + * Style checks
2604 + */
2605 +static void check_avoid_default_addr_size(struct check *c, struct node *dt,
2606 +                                         struct node *node)
2607 +{
2608 +       struct property *reg, *ranges;
2609 +
2610 +       if (!node->parent)
2611 +               return; /* Ignore root node */
2612 +
2613 +       reg = get_property(node, "reg");
2614 +       ranges = get_property(node, "ranges");
2615 +
2616 +       if (!reg && !ranges)
2617 +               return;
2618 +
2619 +       if ((node->parent->addr_cells == -1))
2620 +               FAIL(c, "Relying on default #address-cells value for %s",
2621 +                    node->fullpath);
2622 +
2623 +       if ((node->parent->size_cells == -1))
2624 +               FAIL(c, "Relying on default #size-cells value for %s",
2625 +                    node->fullpath);
2626 +}
2627 +NODE_CHECK(avoid_default_addr_size, NULL, WARN, &addr_size_cells);
2628 +
2629 +static void check_obsolete_chosen_interrupt_controller(struct check *c,
2630 +                                                      struct node *dt)
2631 +{
2632 +       struct node *chosen;
2633 +       struct property *prop;
2634 +
2635 +       chosen = get_node_by_path(dt, "/chosen");
2636 +       if (!chosen)
2637 +               return;
2638 +
2639 +       prop = get_property(chosen, "interrupt-controller");
2640 +       if (prop)
2641 +               FAIL(c, "/chosen has obsolete \"interrupt-controller\" "
2642 +                    "property");
2643 +}
2644 +TREE_CHECK(obsolete_chosen_interrupt_controller, NULL, WARN);
2645 +
2646 +static struct check *check_table[] = {
2647 +       &duplicate_node_names, &duplicate_property_names,
2648 +       &name_is_string, &name_properties,
2649 +       &explicit_phandles,
2650 +       &phandle_references, &path_references,
2651 +
2652 +       &address_cells_is_cell, &size_cells_is_cell, &interrupt_cells_is_cell,
2653 +       &device_type_is_string, &model_is_string, &status_is_string,
2654 +
2655 +       &addr_size_cells, &reg_format, &ranges_format,
2656 +
2657 +       &avoid_default_addr_size,
2658 +       &obsolete_chosen_interrupt_controller,
2659 +};
2660 +
2661 +int check_semantics(struct node *dt, int outversion, int boot_cpuid_phys);
2662 +
2663 +void process_checks(int force, struct boot_info *bi,
2664 +                   int checkflag, int outversion, int boot_cpuid_phys)
2665 +{
2666 +       struct node *dt = bi->dt;
2667 +       int i;
2668 +       int error = 0;
2669 +
2670 +       for (i = 0; i < ARRAY_SIZE(check_table); i++) {
2671 +               struct check *c = check_table[i];
2672 +
2673 +               if (c->level != IGNORE)
2674 +                       error = error || run_check(c, dt);
2675 +       }
2676 +
2677 +       if (error) {
2678 +               if (!force) {
2679 +                       fprintf(stderr, "ERROR: Input tree has errors, aborting "
2680 +                               "(use -f to force output)\n");
2681 +                       exit(2);
2682 +               } else if (quiet < 3) {
2683 +                       fprintf(stderr, "Warning: Input tree has errors, "
2684 +                               "output forced\n");
2685 +               }
2686 +       }
2687 +
2688 +       if (checkflag) {
2689 +               if (error) {
2690 +                       fprintf(stderr, "Warning: Skipping semantic checks due to structural errors\n");
2691 +               } else {
2692 +                       if (!check_semantics(bi->dt, outversion,
2693 +                                            boot_cpuid_phys))
2694 +                               fprintf(stderr, "Warning: Input tree has semantic errors\n");
2695 +               }
2696 +       }
2697 +}
2698 +
2699 +/*
2700 + * Semantic check functions
2701 + */
2702 +
2703 +#define ERRMSG(...) if (quiet < 2) fprintf(stderr, "ERROR: " __VA_ARGS__)
2704 +#define WARNMSG(...) if (quiet < 1) fprintf(stderr, "Warning: " __VA_ARGS__)
2705 +
2706 +#define DO_ERR(...) do {ERRMSG(__VA_ARGS__); ok = 0; } while (0)
2707 +
2708 +#define CHECK_HAVE(node, propname) \
2709 +       do { \
2710 +               if (! (prop = get_property((node), (propname)))) \
2711 +                       DO_ERR("Missing \"%s\" property in %s\n", (propname), \
2712 +                               (node)->fullpath); \
2713 +       } while (0);
2714 +
2715 +#define CHECK_HAVE_WARN(node, propname) \
2716 +       do { \
2717 +               if (! (prop  = get_property((node), (propname)))) \
2718 +                       WARNMSG("%s has no \"%s\" property\n", \
2719 +                               (node)->fullpath, (propname)); \
2720 +       } while (0)
2721 +
2722 +#define CHECK_HAVE_STRING(node, propname) \
2723 +       do { \
2724 +               CHECK_HAVE((node), (propname)); \
2725 +               if (prop && !data_is_one_string(prop->val)) \
2726 +                       DO_ERR("\"%s\" property in %s is not a string\n", \
2727 +                               (propname), (node)->fullpath); \
2728 +       } while (0)
2729 +
2730 +#define CHECK_HAVE_STREQ(node, propname, value) \
2731 +       do { \
2732 +               CHECK_HAVE_STRING((node), (propname)); \
2733 +               if (prop && !streq(prop->val.val, (value))) \
2734 +                       DO_ERR("%s has wrong %s, %s (should be %s\n", \
2735 +                               (node)->fullpath, (propname), \
2736 +                               prop->val.val, (value)); \
2737 +       } while (0)
2738 +
2739 +#define CHECK_HAVE_ONECELL(node, propname) \
2740 +       do { \
2741 +               CHECK_HAVE((node), (propname)); \
2742 +               if (prop && (prop->val.len != sizeof(cell_t))) \
2743 +                       DO_ERR("\"%s\" property in %s has wrong size %d (should be 1 cell)\n", (propname), (node)->fullpath, prop->val.len); \
2744 +       } while (0)
2745 +
2746 +#define CHECK_HAVE_WARN_ONECELL(node, propname) \
2747 +       do { \
2748 +               CHECK_HAVE_WARN((node), (propname)); \
2749 +               if (prop && (prop->val.len != sizeof(cell_t))) \
2750 +                       DO_ERR("\"%s\" property in %s has wrong size %d (should be 1 cell)\n", (propname), (node)->fullpath, prop->val.len); \
2751 +       } while (0)
2752 +
2753 +#define CHECK_HAVE_WARN_PHANDLE(xnode, propname, root) \
2754 +       do { \
2755 +               struct node *ref; \
2756 +               CHECK_HAVE_WARN_ONECELL((xnode), (propname)); \
2757 +               if (prop) {\
2758 +                       cell_t phandle = propval_cell(prop); \
2759 +                       if ((phandle == 0) || (phandle == -1)) { \
2760 +                               DO_ERR("\"%s\" property in %s contains an invalid phandle %x\n", (propname), (xnode)->fullpath, phandle); \
2761 +                       } else { \
2762 +                               ref = get_node_by_phandle((root), propval_cell(prop)); \
2763 +                               if (! ref) \
2764 +                                       DO_ERR("\"%s\" property in %s refers to non-existant phandle %x\n", (propname), (xnode)->fullpath, propval_cell(prop)); \
2765 +                       } \
2766 +               } \
2767 +       } while (0)
2768 +
2769 +#define CHECK_HAVE_WARN_STRING(node, propname) \
2770 +       do { \
2771 +               CHECK_HAVE_WARN((node), (propname)); \
2772 +               if (prop && !data_is_one_string(prop->val)) \
2773 +                       DO_ERR("\"%s\" property in %s is not a string\n", \
2774 +                               (propname), (node)->fullpath); \
2775 +       } while (0)
2776 +
2777 +static int check_root(struct node *root)
2778 +{
2779 +       struct property *prop;
2780 +       int ok = 1;
2781 +
2782 +       CHECK_HAVE_STRING(root, "model");
2783 +       CHECK_HAVE_WARN(root, "compatible");
2784 +
2785 +       return ok;
2786 +}
2787 +
2788 +static int check_cpus(struct node *root, int outversion, int boot_cpuid_phys)
2789 +{
2790 +       struct node *cpus, *cpu;
2791 +       struct property *prop;
2792 +       struct node *bootcpu = NULL;
2793 +       int ok = 1;
2794 +
2795 +       cpus = get_subnode(root, "cpus");
2796 +       if (! cpus) {
2797 +               ERRMSG("Missing /cpus node\n");
2798 +               return 0;
2799 +       }
2800 +
2801 +       if (cpus->addr_cells != 1)
2802 +               DO_ERR("%s has bad #address-cells value %d (should be 1)\n",
2803 +                      cpus->fullpath, cpus->addr_cells);
2804 +       if (cpus->size_cells != 0)
2805 +               DO_ERR("%s has bad #size-cells value %d (should be 0)\n",
2806 +                      cpus->fullpath, cpus->size_cells);
2807 +
2808 +       for_each_child(cpus, cpu) {
2809 +               CHECK_HAVE_STREQ(cpu, "device_type", "cpu");
2810 +
2811 +               CHECK_HAVE_ONECELL(cpu, "reg");
2812 +               if (prop) {
2813 +                       cell_t unitnum;
2814 +                       char *eptr;
2815 +
2816 +                       unitnum = strtol(get_unitname(cpu), &eptr, 16);
2817 +                       if (*eptr) {
2818 +                               WARNMSG("%s has bad format unit name %s (should be CPU number\n",
2819 +                                       cpu->fullpath, get_unitname(cpu));
2820 +                       } else if (unitnum != propval_cell(prop)) {
2821 +                               WARNMSG("%s unit name \"%s\" does not match \"reg\" property <%x>\n",
2822 +                                      cpu->fullpath, get_unitname(cpu),
2823 +                                      propval_cell(prop));
2824 +                       }
2825 +               }
2826 +
2827 +/*             CHECK_HAVE_ONECELL(cpu, "d-cache-line-size"); */
2828 +/*             CHECK_HAVE_ONECELL(cpu, "i-cache-line-size"); */
2829 +               CHECK_HAVE_ONECELL(cpu, "d-cache-size");
2830 +               CHECK_HAVE_ONECELL(cpu, "i-cache-size");
2831 +
2832 +               CHECK_HAVE_WARN_ONECELL(cpu, "clock-frequency");
2833 +               CHECK_HAVE_WARN_ONECELL(cpu, "timebase-frequency");
2834 +
2835 +               prop = get_property(cpu, "linux,boot-cpu");
2836 +               if (prop) {
2837 +                       if (prop->val.len)
2838 +                               WARNMSG("\"linux,boot-cpu\" property in %s is non-empty\n",
2839 +                                       cpu->fullpath);
2840 +                       if (bootcpu)
2841 +                               DO_ERR("Multiple boot cpus (%s and %s)\n",
2842 +                                      bootcpu->fullpath, cpu->fullpath);
2843 +                       else
2844 +                               bootcpu = cpu;
2845 +               }
2846 +       }
2847 +
2848 +       if (outversion < 2) {
2849 +               if (! bootcpu)
2850 +                       WARNMSG("No cpu has \"linux,boot-cpu\" property\n");
2851 +       } else {
2852 +               if (bootcpu)
2853 +                       WARNMSG("\"linux,boot-cpu\" property is deprecated in blob version 2 or higher\n");
2854 +               if (boot_cpuid_phys == 0xfeedbeef)
2855 +                       WARNMSG("physical boot CPU not set.  Use -b option to set\n");
2856 +       }
2857 +
2858 +       return ok;
2859 +}
2860 +
2861 +static int check_memory(struct node *root)
2862 +{
2863 +       struct node *mem;
2864 +       struct property *prop;
2865 +       int nnodes = 0;
2866 +       int ok = 1;
2867 +
2868 +       for_each_child(root, mem) {
2869 +               if (! strneq(mem->name, "memory", mem->basenamelen))
2870 +                       continue;
2871 +
2872 +               nnodes++;
2873 +
2874 +               CHECK_HAVE_STREQ(mem, "device_type", "memory");
2875 +               CHECK_HAVE(mem, "reg");
2876 +       }
2877 +
2878 +       if (nnodes == 0) {
2879 +               ERRMSG("No memory nodes\n");
2880 +               return 0;
2881 +       }
2882 +
2883 +       return ok;
2884 +}
2885 +
2886 +int check_semantics(struct node *dt, int outversion, int boot_cpuid_phys)
2887 +{
2888 +       int ok = 1;
2889 +
2890 +       ok = ok && check_root(dt);
2891 +       ok = ok && check_cpus(dt, outversion, boot_cpuid_phys);
2892 +       ok = ok && check_memory(dt);
2893 +       if (! ok)
2894 +               return 0;
2895 +
2896 +       return 1;
2897 +}
2898 --- /dev/null
2899 +++ b/arch/powerpc/boot/dtc-src/data.c
2900 @@ -0,0 +1,321 @@
2901 +/*
2902 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
2903 + *
2904 + *
2905 + * This program is free software; you can redistribute it and/or
2906 + * modify it under the terms of the GNU General Public License as
2907 + * published by the Free Software Foundation; either version 2 of the
2908 + * License, or (at your option) any later version.
2909 + *
2910 + *  This program is distributed in the hope that it will be useful,
2911 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
2912 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2913 + *  General Public License for more details.
2914 + *
2915 + *  You should have received a copy of the GNU General Public License
2916 + *  along with this program; if not, write to the Free Software
2917 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
2918 + *                                                                   USA
2919 + */
2920 +
2921 +#include "dtc.h"
2922 +
2923 +void data_free(struct data d)
2924 +{
2925 +       struct marker *m, *nm;
2926 +
2927 +       m = d.markers;
2928 +       while (m) {
2929 +               nm = m->next;
2930 +               free(m->ref);
2931 +               free(m);
2932 +               m = nm;
2933 +       }
2934 +
2935 +       assert(!d.val || d.asize);
2936 +
2937 +       if (d.val)
2938 +               free(d.val);
2939 +}
2940 +
2941 +struct data data_grow_for(struct data d, int xlen)
2942 +{
2943 +       struct data nd;
2944 +       int newsize;
2945 +
2946 +       /* we must start with an allocated datum */
2947 +       assert(!d.val || d.asize);
2948 +
2949 +       if (xlen == 0)
2950 +               return d;
2951 +
2952 +       nd = d;
2953 +
2954 +       newsize = xlen;
2955 +
2956 +       while ((d.len + xlen) > newsize)
2957 +               newsize *= 2;
2958 +
2959 +       nd.asize = newsize;
2960 +       nd.val = xrealloc(d.val, newsize);
2961 +
2962 +       assert(nd.asize >= (d.len + xlen));
2963 +
2964 +       return nd;
2965 +}
2966 +
2967 +struct data data_copy_mem(const char *mem, int len)
2968 +{
2969 +       struct data d;
2970 +
2971 +       d = data_grow_for(empty_data, len);
2972 +
2973 +       d.len = len;
2974 +       memcpy(d.val, mem, len);
2975 +
2976 +       return d;
2977 +}
2978 +
2979 +static char get_oct_char(const char *s, int *i)
2980 +{
2981 +       char x[4];
2982 +       char *endx;
2983 +       long val;
2984 +
2985 +       x[3] = '\0';
2986 +       x[0] = s[(*i)];
2987 +       if (x[0]) {
2988 +               x[1] = s[(*i)+1];
2989 +               if (x[1])
2990 +                       x[2] = s[(*i)+2];
2991 +       }
2992 +
2993 +       val = strtol(x, &endx, 8);
2994 +       if ((endx - x) == 0)
2995 +               fprintf(stderr, "Empty \\nnn escape\n");
2996 +
2997 +       (*i) += endx - x;
2998 +       return val;
2999 +}
3000 +
3001 +static char get_hex_char(const char *s, int *i)
3002 +{
3003 +       char x[3];
3004 +       char *endx;
3005 +       long val;
3006 +
3007 +       x[2] = '\0';
3008 +       x[0] = s[(*i)];
3009 +       if (x[0])
3010 +               x[1] = s[(*i)+1];
3011 +
3012 +       val = strtol(x, &endx, 16);
3013 +       if ((endx - x) == 0)
3014 +               fprintf(stderr, "Empty \\x escape\n");
3015 +
3016 +       (*i) += endx - x;
3017 +       return val;
3018 +}
3019 +
3020 +struct data data_copy_escape_string(const char *s, int len)
3021 +{
3022 +       int i = 0;
3023 +       struct data d;
3024 +       char *q;
3025 +
3026 +       d = data_grow_for(empty_data, strlen(s)+1);
3027 +
3028 +       q = d.val;
3029 +       while (i < len) {
3030 +               char c = s[i++];
3031 +
3032 +               if (c != '\\') {
3033 +                       q[d.len++] = c;
3034 +                       continue;
3035 +               }
3036 +
3037 +               c = s[i++];
3038 +               assert(c);
3039 +               switch (c) {
3040 +               case 'a':
3041 +                       q[d.len++] = '\a';
3042 +                       break;
3043 +               case 'b':
3044 +                       q[d.len++] = '\b';
3045 +                       break;
3046 +               case 't':
3047 +                       q[d.len++] = '\t';
3048 +                       break;
3049 +               case 'n':
3050 +                       q[d.len++] = '\n';
3051 +                       break;
3052 +               case 'v':
3053 +                       q[d.len++] = '\v';
3054 +                       break;
3055 +               case 'f':
3056 +                       q[d.len++] = '\f';
3057 +                       break;
3058 +               case 'r':
3059 +                       q[d.len++] = '\r';
3060 +                       break;
3061 +               case '0':
3062 +               case '1':
3063 +               case '2':
3064 +               case '3':
3065 +               case '4':
3066 +               case '5':
3067 +               case '6':
3068 +               case '7':
3069 +                       i--; /* need to re-read the first digit as
3070 +                             * part of the octal value */
3071 +                       q[d.len++] = get_oct_char(s, &i);
3072 +                       break;
3073 +               case 'x':
3074 +                       q[d.len++] = get_hex_char(s, &i);
3075 +                       break;
3076 +               default:
3077 +                       q[d.len++] = c;
3078 +               }
3079 +       }
3080 +
3081 +       q[d.len++] = '\0';
3082 +       return d;
3083 +}
3084 +
3085 +struct data data_copy_file(FILE *f, size_t len)
3086 +{
3087 +       struct data d;
3088 +
3089 +       d = data_grow_for(empty_data, len);
3090 +
3091 +       d.len = len;
3092 +       fread(d.val, len, 1, f);
3093 +
3094 +       return d;
3095 +}
3096 +
3097 +struct data data_append_data(struct data d, const void *p, int len)
3098 +{
3099 +       d = data_grow_for(d, len);
3100 +       memcpy(d.val + d.len, p, len);
3101 +       d.len += len;
3102 +       return d;
3103 +}
3104 +
3105 +struct data data_insert_at_marker(struct data d, struct marker *m,
3106 +                                 const void *p, int len)
3107 +{
3108 +       d = data_grow_for(d, len);
3109 +       memmove(d.val + m->offset + len, d.val + m->offset, d.len - m->offset);
3110 +       memcpy(d.val + m->offset, p, len);
3111 +       d.len += len;
3112 +
3113 +       /* Adjust all markers after the one we're inserting at */
3114 +       m = m->next;
3115 +       for_each_marker(m)
3116 +               m->offset += len;
3117 +       return d;
3118 +}
3119 +
3120 +struct data data_append_markers(struct data d, struct marker *m)
3121 +{
3122 +       struct marker **mp = &d.markers;
3123 +
3124 +       /* Find the end of the markerlist */
3125 +       while (*mp)
3126 +               mp = &((*mp)->next);
3127 +       *mp = m;
3128 +       return d;
3129 +}
3130 +
3131 +struct data data_merge(struct data d1, struct data d2)
3132 +{
3133 +       struct data d;
3134 +       struct marker *m2 = d2.markers;
3135 +
3136 +       d = data_append_markers(data_append_data(d1, d2.val, d2.len), m2);
3137 +
3138 +       /* Adjust for the length of d1 */
3139 +       for_each_marker(m2)
3140 +               m2->offset += d1.len;
3141 +
3142 +       d2.markers = NULL; /* So data_free() doesn't clobber them */
3143 +       data_free(d2);
3144 +
3145 +       return d;
3146 +}
3147 +
3148 +struct data data_append_cell(struct data d, cell_t word)
3149 +{
3150 +       cell_t beword = cpu_to_be32(word);
3151 +
3152 +       return data_append_data(d, &beword, sizeof(beword));
3153 +}
3154 +
3155 +struct data data_append_re(struct data d, const struct fdt_reserve_entry *re)
3156 +{
3157 +       struct fdt_reserve_entry bere;
3158 +
3159 +       bere.address = cpu_to_be64(re->address);
3160 +       bere.size = cpu_to_be64(re->size);
3161 +
3162 +       return data_append_data(d, &bere, sizeof(bere));
3163 +}
3164 +
3165 +struct data data_append_addr(struct data d, u64 addr)
3166 +{
3167 +       u64 beaddr = cpu_to_be64(addr);
3168 +
3169 +       return data_append_data(d, &beaddr, sizeof(beaddr));
3170 +}
3171 +
3172 +struct data data_append_byte(struct data d, uint8_t byte)
3173 +{
3174 +       return data_append_data(d, &byte, 1);
3175 +}
3176 +
3177 +struct data data_append_zeroes(struct data d, int len)
3178 +{
3179 +       d = data_grow_for(d, len);
3180 +
3181 +       memset(d.val + d.len, 0, len);
3182 +       d.len += len;
3183 +       return d;
3184 +}
3185 +
3186 +struct data data_append_align(struct data d, int align)
3187 +{
3188 +       int newlen = ALIGN(d.len, align);
3189 +       return data_append_zeroes(d, newlen - d.len);
3190 +}
3191 +
3192 +struct data data_add_marker(struct data d, enum markertype type, char *ref)
3193 +{
3194 +       struct marker *m;
3195 +
3196 +       m = xmalloc(sizeof(*m));
3197 +       m->offset = d.len;
3198 +       m->type = type;
3199 +       m->ref = ref;
3200 +       m->next = NULL;
3201 +
3202 +       return data_append_markers(d, m);
3203 +}
3204 +
3205 +int data_is_one_string(struct data d)
3206 +{
3207 +       int i;
3208 +       int len = d.len;
3209 +
3210 +       if (len == 0)
3211 +               return 0;
3212 +
3213 +       for (i = 0; i < len-1; i++)
3214 +               if (d.val[i] == '\0')
3215 +                       return 0;
3216 +
3217 +       if (d.val[len-1] != '\0')
3218 +               return 0;
3219 +
3220 +       return 1;
3221 +}
3222 --- /dev/null
3223 +++ b/arch/powerpc/boot/dtc-src/dtc-lexer.l
3224 @@ -0,0 +1,328 @@
3225 +/*
3226 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
3227 + *
3228 + *
3229 + * This program is free software; you can redistribute it and/or
3230 + * modify it under the terms of the GNU General Public License as
3231 + * published by the Free Software Foundation; either version 2 of the
3232 + * License, or (at your option) any later version.
3233 + *
3234 + *  This program is distributed in the hope that it will be useful,
3235 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
3236 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3237 + *  General Public License for more details.
3238 + *
3239 + *  You should have received a copy of the GNU General Public License
3240 + *  along with this program; if not, write to the Free Software
3241 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
3242 + *                                                                   USA
3243 + */
3244 +
3245 +%option noyywrap nounput yylineno
3246 +
3247 +%x INCLUDE
3248 +%x BYTESTRING
3249 +%x PROPNODENAME
3250 +%s V1
3251 +
3252 +PROPNODECHAR   [a-zA-Z0-9,._+*#?@-]
3253 +PATHCHAR       ({PROPNODECHAR}|[/])
3254 +LABEL          [a-zA-Z_][a-zA-Z0-9_]*
3255 +
3256 +%{
3257 +#include "dtc.h"
3258 +#include "srcpos.h"
3259 +#include "dtc-parser.tab.h"
3260 +
3261 +
3262 +/*#define LEXDEBUG     1*/
3263 +
3264 +#ifdef LEXDEBUG
3265 +#define DPRINT(fmt, ...)       fprintf(stderr, fmt, ##__VA_ARGS__)
3266 +#else
3267 +#define DPRINT(fmt, ...)       do { } while (0)
3268 +#endif
3269 +
3270 +static int dts_version; /* = 0 */
3271 +
3272 +#define BEGIN_DEFAULT()        if (dts_version == 0) { \
3273 +                               DPRINT("<INITIAL>\n"); \
3274 +                               BEGIN(INITIAL); \
3275 +                       } else { \
3276 +                               DPRINT("<V1>\n"); \
3277 +                               BEGIN(V1); \
3278 +                       }
3279 +%}
3280 +
3281 +%%
3282 +<*>"/include/"         BEGIN(INCLUDE);
3283 +
3284 +<INCLUDE>\"[^"\n]*\"   {
3285 +                       yytext[strlen(yytext) - 1] = 0;
3286 +                       if (!push_input_file(yytext + 1)) {
3287 +                               /* Some unrecoverable error.*/
3288 +                               exit(1);
3289 +                       }
3290 +                       BEGIN_DEFAULT();
3291 +               }
3292 +
3293 +
3294 +<*><<EOF>>             {
3295 +                       if (!pop_input_file()) {
3296 +                               yyterminate();
3297 +                       }
3298 +               }
3299 +
3300 +<*>\"([^\\"]|\\.)*\"   {
3301 +                       yylloc.filenum = srcpos_filenum;
3302 +                       yylloc.first_line = yylineno;
3303 +                       DPRINT("String: %s\n", yytext);
3304 +                       yylval.data = data_copy_escape_string(yytext+1,
3305 +                                       yyleng-2);
3306 +                       yylloc.first_line = yylineno;
3307 +                       return DT_STRING;
3308 +               }
3309 +
3310 +<*>"/dts-v1/"  {
3311 +                       yylloc.filenum = srcpos_filenum;
3312 +                       yylloc.first_line = yylineno;
3313 +                       DPRINT("Keyword: /dts-v1/\n");
3314 +                       dts_version = 1;
3315 +                       BEGIN_DEFAULT();
3316 +                       return DT_V1;
3317 +               }
3318 +
3319 +<*>"/memreserve/"      {
3320 +                       yylloc.filenum = srcpos_filenum;
3321 +                       yylloc.first_line = yylineno;
3322 +                       DPRINT("Keyword: /memreserve/\n");
3323 +                       BEGIN_DEFAULT();
3324 +                       return DT_MEMRESERVE;
3325 +               }
3326 +
3327 +<*>{LABEL}:    {
3328 +                       yylloc.filenum = srcpos_filenum;
3329 +                       yylloc.first_line = yylineno;
3330 +                       DPRINT("Label: %s\n", yytext);
3331 +                       yylval.labelref = strdup(yytext);
3332 +                       yylval.labelref[yyleng-1] = '\0';
3333 +                       return DT_LABEL;
3334 +               }
3335 +
3336 +<INITIAL>[bodh]# {
3337 +                       yylloc.filenum = srcpos_filenum;
3338 +                       yylloc.first_line = yylineno;
3339 +                       if (*yytext == 'b')
3340 +                               yylval.cbase = 2;
3341 +                       else if (*yytext == 'o')
3342 +                               yylval.cbase = 8;
3343 +                       else if (*yytext == 'd')
3344 +                               yylval.cbase = 10;
3345 +                       else
3346 +                               yylval.cbase = 16;
3347 +                       DPRINT("Base: %d\n", yylval.cbase);
3348 +                       return DT_BASE;
3349 +               }
3350 +
3351 +<INITIAL>[0-9a-fA-F]+  {
3352 +                       yylloc.filenum = srcpos_filenum;
3353 +                       yylloc.first_line = yylineno;
3354 +                       yylval.literal = strdup(yytext);
3355 +                       DPRINT("Literal: '%s'\n", yylval.literal);
3356 +                       return DT_LEGACYLITERAL;
3357 +               }
3358 +
3359 +<V1>[0-9]+|0[xX][0-9a-fA-F]+      {
3360 +                       yylloc.filenum = srcpos_filenum;
3361 +                       yylloc.first_line = yylineno;
3362 +                       yylval.literal = strdup(yytext);
3363 +                       DPRINT("Literal: '%s'\n", yylval.literal);
3364 +                       return DT_LITERAL;
3365 +               }
3366 +
3367 +\&{LABEL}      {       /* label reference */
3368 +                       yylloc.filenum = srcpos_filenum;
3369 +                       yylloc.first_line = yylineno;
3370 +                       DPRINT("Ref: %s\n", yytext+1);
3371 +                       yylval.labelref = strdup(yytext+1);
3372 +                       return DT_REF;
3373 +               }
3374 +
3375 +"&{/"{PATHCHAR}+\}     {       /* new-style path reference */
3376 +                       yylloc.filenum = srcpos_filenum;
3377 +                       yylloc.first_line = yylineno;
3378 +                       yytext[yyleng-1] = '\0';
3379 +                       DPRINT("Ref: %s\n", yytext+2);
3380 +                       yylval.labelref = strdup(yytext+2);
3381 +                       return DT_REF;
3382 +               }
3383 +
3384 +<INITIAL>"&/"{PATHCHAR}+ {     /* old-style path reference */
3385 +                       yylloc.filenum = srcpos_filenum;
3386 +                       yylloc.first_line = yylineno;
3387 +                       DPRINT("Ref: %s\n", yytext+1);
3388 +                       yylval.labelref = strdup(yytext+1);
3389 +                       return DT_REF;
3390 +               }
3391 +
3392 +<BYTESTRING>[0-9a-fA-F]{2} {
3393 +                       yylloc.filenum = srcpos_filenum;
3394 +                       yylloc.first_line = yylineno;
3395 +                       yylval.byte = strtol(yytext, NULL, 16);
3396 +                       DPRINT("Byte: %02x\n", (int)yylval.byte);
3397 +                       return DT_BYTE;
3398 +               }
3399 +
3400 +<BYTESTRING>"]"        {
3401 +                       yylloc.filenum = srcpos_filenum;
3402 +                       yylloc.first_line = yylineno;
3403 +                       DPRINT("/BYTESTRING\n");
3404 +                       BEGIN_DEFAULT();
3405 +                       return ']';
3406 +               }
3407 +
3408 +<PROPNODENAME>{PROPNODECHAR}+ {
3409 +                       yylloc.filenum = srcpos_filenum;
3410 +                       yylloc.first_line = yylineno;
3411 +                       DPRINT("PropNodeName: %s\n", yytext);
3412 +                       yylval.propnodename = strdup(yytext);
3413 +                       BEGIN_DEFAULT();
3414 +                       return DT_PROPNODENAME;
3415 +               }
3416 +
3417 +
3418 +<*>[[:space:]]+        /* eat whitespace */
3419 +
3420 +<*>"/*"([^*]|\*+[^*/])*\*+"/"  {
3421 +                       yylloc.filenum = srcpos_filenum;
3422 +                       yylloc.first_line = yylineno;
3423 +                       DPRINT("Comment: %s\n", yytext);
3424 +                       /* eat comments */
3425 +               }
3426 +
3427 +<*>"//".*\n    /* eat line comments */
3428 +
3429 +<*>.           {
3430 +                       yylloc.filenum = srcpos_filenum;
3431 +                       yylloc.first_line = yylineno;
3432 +                       DPRINT("Char: %c (\\x%02x)\n", yytext[0],
3433 +                               (unsigned)yytext[0]);
3434 +                       if (yytext[0] == '[') {
3435 +                               DPRINT("<BYTESTRING>\n");
3436 +                               BEGIN(BYTESTRING);
3437 +                       }
3438 +                       if ((yytext[0] == '{')
3439 +                           || (yytext[0] == ';')) {
3440 +                               DPRINT("<PROPNODENAME>\n");
3441 +                               BEGIN(PROPNODENAME);
3442 +                       }
3443 +                       return yytext[0];
3444 +               }
3445 +
3446 +%%
3447 +
3448 +
3449 +/*
3450 + * Stack of nested include file contexts.
3451 + */
3452 +
3453 +struct incl_file {
3454 +       int filenum;
3455 +       FILE *file;
3456 +       YY_BUFFER_STATE yy_prev_buf;
3457 +       int yy_prev_lineno;
3458 +       struct incl_file *prev;
3459 +};
3460 +
3461 +struct incl_file *incl_file_stack;
3462 +
3463 +
3464 +/*
3465 + * Detect infinite include recursion.
3466 + */
3467 +#define MAX_INCLUDE_DEPTH      (100)
3468 +
3469 +static int incl_depth = 0;
3470 +
3471 +
3472 +int push_input_file(const char *filename)
3473 +{
3474 +       FILE *f;
3475 +       struct incl_file *incl_file;
3476 +
3477 +       if (!filename) {
3478 +               yyerror("No include file name given.");
3479 +               return 0;
3480 +       }
3481 +
3482 +       if (incl_depth++ >= MAX_INCLUDE_DEPTH) {
3483 +               yyerror("Includes nested too deeply");
3484 +               return 0;
3485 +       }
3486 +
3487 +       f = dtc_open_file(filename);
3488 +
3489 +       incl_file = malloc(sizeof(struct incl_file));
3490 +       if (!incl_file) {
3491 +               yyerror("Can not allocate include file space.");
3492 +               return 0;
3493 +       }
3494 +
3495 +       /*
3496 +        * Save current context.
3497 +        */
3498 +       incl_file->yy_prev_buf = YY_CURRENT_BUFFER;
3499 +       incl_file->yy_prev_lineno = yylineno;
3500 +       incl_file->filenum = srcpos_filenum;
3501 +       incl_file->file = yyin;
3502 +       incl_file->prev = incl_file_stack;
3503 +
3504 +       incl_file_stack = incl_file;
3505 +
3506 +       /*
3507 +        * Establish new context.
3508 +        */
3509 +       srcpos_filenum = lookup_file_name(filename, 0);
3510 +       yylineno = 1;
3511 +       yyin = f;
3512 +       yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
3513 +
3514 +       return 1;
3515 +}
3516 +
3517 +
3518 +int pop_input_file(void)
3519 +{
3520 +       struct incl_file *incl_file;
3521 +
3522 +       if (incl_file_stack == 0)
3523 +               return 0;
3524 +
3525 +       fclose(yyin);
3526 +
3527 +       /*
3528 +        * Pop.
3529 +        */
3530 +       --incl_depth;
3531 +       incl_file = incl_file_stack;
3532 +       incl_file_stack = incl_file->prev;
3533 +
3534 +       /*
3535 +        * Recover old context.
3536 +        */
3537 +       yy_delete_buffer(YY_CURRENT_BUFFER);
3538 +       yy_switch_to_buffer(incl_file->yy_prev_buf);
3539 +       yylineno = incl_file->yy_prev_lineno;
3540 +       srcpos_filenum = incl_file->filenum;
3541 +       yyin = incl_file->file;
3542 +
3543 +       /*
3544 +        * Free old state.
3545 +        */
3546 +       free(incl_file);
3547 +
3548 +       if (YY_CURRENT_BUFFER == 0)
3549 +               return 0;
3550 +
3551 +       return 1;
3552 +}
3553 --- /dev/null
3554 +++ b/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped
3555 @@ -0,0 +1,2174 @@
3556 +#line 2 "dtc-lexer.lex.c"
3557 +
3558 +#line 4 "dtc-lexer.lex.c"
3559 +
3560 +#define  YY_INT_ALIGNED short int
3561 +
3562 +/* A lexical scanner generated by flex */
3563 +
3564 +#define FLEX_SCANNER
3565 +#define YY_FLEX_MAJOR_VERSION 2
3566 +#define YY_FLEX_MINOR_VERSION 5
3567 +#define YY_FLEX_SUBMINOR_VERSION 33
3568 +#if YY_FLEX_SUBMINOR_VERSION > 0
3569 +#define FLEX_BETA
3570 +#endif
3571 +
3572 +/* First, we deal with  platform-specific or compiler-specific issues. */
3573 +
3574 +/* begin standard C headers. */
3575 +#include <stdio.h>
3576 +#include <string.h>
3577 +#include <errno.h>
3578 +#include <stdlib.h>
3579 +
3580 +/* end standard C headers. */
3581 +
3582 +/* flex integer type definitions */
3583 +
3584 +#ifndef FLEXINT_H
3585 +#define FLEXINT_H
3586 +
3587 +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
3588 +
3589 +#if __STDC_VERSION__ >= 199901L
3590 +
3591 +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
3592 + * if you want the limit (max/min) macros for int types. 
3593 + */
3594 +#ifndef __STDC_LIMIT_MACROS
3595 +#define __STDC_LIMIT_MACROS 1
3596 +#endif
3597 +
3598 +#include <inttypes.h>
3599 +typedef int8_t flex_int8_t;
3600 +typedef uint8_t flex_uint8_t;
3601 +typedef int16_t flex_int16_t;
3602 +typedef uint16_t flex_uint16_t;
3603 +typedef int32_t flex_int32_t;
3604 +typedef uint32_t flex_uint32_t;
3605 +#else
3606 +typedef signed char flex_int8_t;
3607 +typedef short int flex_int16_t;
3608 +typedef int flex_int32_t;
3609 +typedef unsigned char flex_uint8_t; 
3610 +typedef unsigned short int flex_uint16_t;
3611 +typedef unsigned int flex_uint32_t;
3612 +#endif /* ! C99 */
3613 +
3614 +/* Limits of integral types. */
3615 +#ifndef INT8_MIN
3616 +#define INT8_MIN               (-128)
3617 +#endif
3618 +#ifndef INT16_MIN
3619 +#define INT16_MIN              (-32767-1)
3620 +#endif
3621 +#ifndef INT32_MIN
3622 +#define INT32_MIN              (-2147483647-1)
3623 +#endif
3624 +#ifndef INT8_MAX
3625 +#define INT8_MAX               (127)
3626 +#endif
3627 +#ifndef INT16_MAX
3628 +#define INT16_MAX              (32767)
3629 +#endif
3630 +#ifndef INT32_MAX
3631 +#define INT32_MAX              (2147483647)
3632 +#endif
3633 +#ifndef UINT8_MAX
3634 +#define UINT8_MAX              (255U)
3635 +#endif
3636 +#ifndef UINT16_MAX
3637 +#define UINT16_MAX             (65535U)
3638 +#endif
3639 +#ifndef UINT32_MAX
3640 +#define UINT32_MAX             (4294967295U)
3641 +#endif
3642 +
3643 +#endif /* ! FLEXINT_H */
3644 +
3645 +#ifdef __cplusplus
3646 +
3647 +/* The "const" storage-class-modifier is valid. */
3648 +#define YY_USE_CONST
3649 +
3650 +#else  /* ! __cplusplus */
3651 +
3652 +#if __STDC__
3653 +
3654 +#define YY_USE_CONST
3655 +
3656 +#endif /* __STDC__ */
3657 +#endif /* ! __cplusplus */
3658 +
3659 +#ifdef YY_USE_CONST
3660 +#define yyconst const
3661 +#else
3662 +#define yyconst
3663 +#endif
3664 +
3665 +/* Returned upon end-of-file. */
3666 +#define YY_NULL 0
3667 +
3668 +/* Promotes a possibly negative, possibly signed char to an unsigned
3669 + * integer for use as an array index.  If the signed char is negative,
3670 + * we want to instead treat it as an 8-bit unsigned char, hence the
3671 + * double cast.
3672 + */
3673 +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
3674 +
3675 +/* Enter a start condition.  This macro really ought to take a parameter,
3676 + * but we do it the disgusting crufty way forced on us by the ()-less
3677 + * definition of BEGIN.
3678 + */
3679 +#define BEGIN (yy_start) = 1 + 2 *
3680 +
3681 +/* Translate the current start state into a value that can be later handed
3682 + * to BEGIN to return to the state.  The YYSTATE alias is for lex
3683 + * compatibility.
3684 + */
3685 +#define YY_START (((yy_start) - 1) / 2)
3686 +#define YYSTATE YY_START
3687 +
3688 +/* Action number for EOF rule of a given start state. */
3689 +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
3690 +
3691 +/* Special action meaning "start processing a new file". */
3692 +#define YY_NEW_FILE yyrestart(yyin  )
3693 +
3694 +#define YY_END_OF_BUFFER_CHAR 0
3695 +
3696 +/* Size of default input buffer. */
3697 +#ifndef YY_BUF_SIZE
3698 +#define YY_BUF_SIZE 16384
3699 +#endif
3700 +
3701 +/* The state buf must be large enough to hold one state per character in the main buffer.
3702 + */
3703 +#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
3704 +
3705 +#ifndef YY_TYPEDEF_YY_BUFFER_STATE
3706 +#define YY_TYPEDEF_YY_BUFFER_STATE
3707 +typedef struct yy_buffer_state *YY_BUFFER_STATE;
3708 +#endif
3709 +
3710 +extern int yyleng;
3711 +
3712 +extern FILE *yyin, *yyout;
3713 +
3714 +#define EOB_ACT_CONTINUE_SCAN 0
3715 +#define EOB_ACT_END_OF_FILE 1
3716 +#define EOB_ACT_LAST_MATCH 2
3717 +
3718 +    /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
3719 +     *       access to the local variable yy_act. Since yyless() is a macro, it would break
3720 +     *       existing scanners that call yyless() from OUTSIDE yylex. 
3721 +     *       One obvious solution it to make yy_act a global. I tried that, and saw
3722 +     *       a 5% performance hit in a non-yylineno scanner, because yy_act is
3723 +     *       normally declared as a register variable-- so it is not worth it.
3724 +     */
3725 +    #define  YY_LESS_LINENO(n) \
3726 +            do { \
3727 +                int yyl;\
3728 +                for ( yyl = n; yyl < yyleng; ++yyl )\
3729 +                    if ( yytext[yyl] == '\n' )\
3730 +                        --yylineno;\
3731 +            }while(0)
3732 +    
3733 +/* Return all but the first "n" matched characters back to the input stream. */
3734 +#define yyless(n) \
3735 +       do \
3736 +               { \
3737 +               /* Undo effects of setting up yytext. */ \
3738 +        int yyless_macro_arg = (n); \
3739 +        YY_LESS_LINENO(yyless_macro_arg);\
3740 +               *yy_cp = (yy_hold_char); \
3741 +               YY_RESTORE_YY_MORE_OFFSET \
3742 +               (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
3743 +               YY_DO_BEFORE_ACTION; /* set up yytext again */ \
3744 +               } \
3745 +       while ( 0 )
3746 +
3747 +#define unput(c) yyunput( c, (yytext_ptr)  )
3748 +
3749 +/* The following is because we cannot portably get our hands on size_t
3750 + * (without autoconf's help, which isn't available because we want
3751 + * flex-generated scanners to compile on their own).
3752 + */
3753 +
3754 +#ifndef YY_TYPEDEF_YY_SIZE_T
3755 +#define YY_TYPEDEF_YY_SIZE_T
3756 +typedef unsigned int yy_size_t;
3757 +#endif
3758 +
3759 +#ifndef YY_STRUCT_YY_BUFFER_STATE
3760 +#define YY_STRUCT_YY_BUFFER_STATE
3761 +struct yy_buffer_state
3762 +       {
3763 +       FILE *yy_input_file;
3764 +
3765 +       char *yy_ch_buf;                /* input buffer */
3766 +       char *yy_buf_pos;               /* current position in input buffer */
3767 +
3768 +       /* Size of input buffer in bytes, not including room for EOB
3769 +        * characters.
3770 +        */
3771 +       yy_size_t yy_buf_size;
3772 +
3773 +       /* Number of characters read into yy_ch_buf, not including EOB
3774 +        * characters.
3775 +        */
3776 +       int yy_n_chars;
3777 +
3778 +       /* Whether we "own" the buffer - i.e., we know we created it,
3779 +        * and can realloc() it to grow it, and should free() it to
3780 +        * delete it.
3781 +        */
3782 +       int yy_is_our_buffer;
3783 +
3784 +       /* Whether this is an "interactive" input source; if so, and
3785 +        * if we're using stdio for input, then we want to use getc()
3786 +        * instead of fread(), to make sure we stop fetching input after
3787 +        * each newline.
3788 +        */
3789 +       int yy_is_interactive;
3790 +
3791 +       /* Whether we're considered to be at the beginning of a line.
3792 +        * If so, '^' rules will be active on the next match, otherwise
3793 +        * not.
3794 +        */
3795 +       int yy_at_bol;
3796 +
3797 +    int yy_bs_lineno; /**< The line count. */
3798 +    int yy_bs_column; /**< The column count. */
3799 +    
3800 +       /* Whether to try to fill the input buffer when we reach the
3801 +        * end of it.
3802 +        */
3803 +       int yy_fill_buffer;
3804 +
3805 +       int yy_buffer_status;
3806 +
3807 +#define YY_BUFFER_NEW 0
3808 +#define YY_BUFFER_NORMAL 1
3809 +       /* When an EOF's been seen but there's still some text to process
3810 +        * then we mark the buffer as YY_EOF_PENDING, to indicate that we
3811 +        * shouldn't try reading from the input source any more.  We might
3812 +        * still have a bunch of tokens to match, though, because of
3813 +        * possible backing-up.
3814 +        *
3815 +        * When we actually see the EOF, we change the status to "new"
3816 +        * (via yyrestart()), so that the user can continue scanning by
3817 +        * just pointing yyin at a new input file.
3818 +        */
3819 +#define YY_BUFFER_EOF_PENDING 2
3820 +
3821 +       };
3822 +#endif /* !YY_STRUCT_YY_BUFFER_STATE */
3823 +
3824 +/* Stack of input buffers. */
3825 +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
3826 +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
3827 +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
3828 +
3829 +/* We provide macros for accessing buffer states in case in the
3830 + * future we want to put the buffer states in a more general
3831 + * "scanner state".
3832 + *
3833 + * Returns the top of the stack, or NULL.
3834 + */
3835 +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
3836 +                          ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
3837 +                          : NULL)
3838 +
3839 +/* Same as previous macro, but useful when we know that the buffer stack is not
3840 + * NULL or when we need an lvalue. For internal use only.
3841 + */
3842 +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
3843 +
3844 +/* yy_hold_char holds the character lost when yytext is formed. */
3845 +static char yy_hold_char;
3846 +static int yy_n_chars;         /* number of characters read into yy_ch_buf */
3847 +int yyleng;
3848 +
3849 +/* Points to current character in buffer. */
3850 +static char *yy_c_buf_p = (char *) 0;
3851 +static int yy_init = 0;                /* whether we need to initialize */
3852 +static int yy_start = 0;       /* start state number */
3853 +
3854 +/* Flag which is used to allow yywrap()'s to do buffer switches
3855 + * instead of setting up a fresh yyin.  A bit of a hack ...
3856 + */
3857 +static int yy_did_buffer_switch_on_eof;
3858 +
3859 +void yyrestart (FILE *input_file  );
3860 +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer  );
3861 +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size  );
3862 +void yy_delete_buffer (YY_BUFFER_STATE b  );
3863 +void yy_flush_buffer (YY_BUFFER_STATE b  );
3864 +void yypush_buffer_state (YY_BUFFER_STATE new_buffer  );
3865 +void yypop_buffer_state (void );
3866 +
3867 +static void yyensure_buffer_stack (void );
3868 +static void yy_load_buffer_state (void );
3869 +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file  );
3870 +
3871 +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
3872 +
3873 +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size  );
3874 +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str  );
3875 +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len  );
3876 +
3877 +void *yyalloc (yy_size_t  );
3878 +void *yyrealloc (void *,yy_size_t  );
3879 +void yyfree (void *  );
3880 +
3881 +#define yy_new_buffer yy_create_buffer
3882 +
3883 +#define yy_set_interactive(is_interactive) \
3884 +       { \
3885 +       if ( ! YY_CURRENT_BUFFER ){ \
3886 +        yyensure_buffer_stack (); \
3887 +               YY_CURRENT_BUFFER_LVALUE =    \
3888 +            yy_create_buffer(yyin,YY_BUF_SIZE ); \
3889 +       } \
3890 +       YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
3891 +       }
3892 +
3893 +#define yy_set_bol(at_bol) \
3894 +       { \
3895 +       if ( ! YY_CURRENT_BUFFER ){\
3896 +        yyensure_buffer_stack (); \
3897 +               YY_CURRENT_BUFFER_LVALUE =    \
3898 +            yy_create_buffer(yyin,YY_BUF_SIZE ); \
3899 +       } \
3900 +       YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
3901 +       }
3902 +
3903 +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
3904 +
3905 +/* Begin user sect3 */
3906 +
3907 +#define yywrap() 1
3908 +#define YY_SKIP_YYWRAP
3909 +
3910 +typedef unsigned char YY_CHAR;
3911 +
3912 +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
3913 +
3914 +typedef int yy_state_type;
3915 +
3916 +extern int yylineno;
3917 +
3918 +int yylineno = 1;
3919 +
3920 +extern char *yytext;
3921 +#define yytext_ptr yytext
3922 +
3923 +static yy_state_type yy_get_previous_state (void );
3924 +static yy_state_type yy_try_NUL_trans (yy_state_type current_state  );
3925 +static int yy_get_next_buffer (void );
3926 +static void yy_fatal_error (yyconst char msg[]  );
3927 +
3928 +/* Done after the current pattern has been matched and before the
3929 + * corresponding action - sets up yytext.
3930 + */
3931 +#define YY_DO_BEFORE_ACTION \
3932 +       (yytext_ptr) = yy_bp; \
3933 +       yyleng = (size_t) (yy_cp - yy_bp); \
3934 +       (yy_hold_char) = *yy_cp; \
3935 +       *yy_cp = '\0'; \
3936 +       (yy_c_buf_p) = yy_cp;
3937 +
3938 +#define YY_NUM_RULES 20
3939 +#define YY_END_OF_BUFFER 21
3940 +/* This struct is not used in this scanner,
3941 +   but its presence is necessary. */
3942 +struct yy_trans_info
3943 +       {
3944 +       flex_int32_t yy_verify;
3945 +       flex_int32_t yy_nxt;
3946 +       };
3947 +static yyconst flex_int16_t yy_accept[94] =
3948 +    {   0,
3949 +        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
3950 +       21,   19,   16,   16,   19,   19,   19,    8,    8,   19,
3951 +        8,   19,   19,   19,   19,   14,   15,   15,   19,    9,
3952 +        9,   16,    0,    3,    0,    0,   10,    0,    0,    0,
3953 +        0,    0,    0,    8,    8,    6,    0,    7,    0,    2,
3954 +        0,   13,   13,   15,   15,    9,    0,   12,   10,    0,
3955 +        0,    0,    0,   18,    0,    0,    0,    2,    9,    0,
3956 +       17,    0,    0,    0,   11,    0,    0,    0,    0,    0,
3957 +        0,    0,    0,    0,    4,    0,    0,    1,    0,    0,
3958 +        0,    5,    0
3959 +
3960 +    } ;
3961 +
3962 +static yyconst flex_int32_t yy_ec[256] =
3963 +    {   0,
3964 +        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
3965 +        2,    2,    2,    1,    1,    1,    1,    1,    1,    1,
3966 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3967 +        1,    2,    1,    4,    5,    1,    1,    6,    1,    1,
3968 +        1,    7,    8,    8,    9,    8,   10,   11,   12,   13,
3969 +       13,   13,   13,   13,   13,   13,   13,   14,    1,    1,
3970 +        1,    1,    8,    8,   15,   15,   15,   15,   15,   15,
3971 +       16,   16,   16,   16,   16,   16,   16,   16,   16,   16,
3972 +       16,   16,   16,   16,   16,   16,   16,   17,   16,   16,
3973 +        1,   18,   19,    1,   16,    1,   15,   20,   21,   22,
3974 +
3975 +       23,   15,   16,   24,   25,   16,   16,   26,   27,   28,
3976 +       24,   16,   16,   29,   30,   31,   32,   33,   16,   17,
3977 +       16,   16,   34,    1,   35,    1,    1,    1,    1,    1,
3978 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3979 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3980 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3981 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3982 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3983 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3984 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3985 +
3986 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3987 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3988 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3989 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3990 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
3991 +        1,    1,    1,    1,    1
3992 +    } ;
3993 +
3994 +static yyconst flex_int32_t yy_meta[36] =
3995 +    {   0,
3996 +        1,    1,    1,    1,    2,    1,    2,    2,    2,    3,
3997 +        4,    4,    4,    5,    6,    7,    7,    1,    1,    6,
3998 +        6,    6,    6,    7,    7,    7,    7,    7,    7,    7,
3999 +        7,    7,    7,    8,    1
4000 +    } ;
4001 +
4002 +static yyconst flex_int16_t yy_base[107] =
4003 +    {   0,
4004 +        0,    0,   32,    0,   53,    0,   76,    0,  108,  111,
4005 +      280,  288,   37,   39,   33,   36,  106,    0,  123,  146,
4006 +      255,  251,   45,    0,  159,  288,    0,   53,  108,  172,
4007 +      114,  127,  158,  288,  245,    0,    0,  234,  235,  236,
4008 +      197,  195,  199,    0,    0,  288,    0,  288,  160,  288,
4009 +      183,  288,    0,    0,  183,  182,    0,    0,    0,    0,
4010 +      204,  189,  207,  288,  179,  187,  180,  194,    0,  171,
4011 +      288,  196,  178,  174,  288,  169,  169,  177,  165,  153,
4012 +      143,  155,  137,  118,  288,  122,   42,  288,   36,   36,
4013 +       40,  288,  288,  212,  218,  223,  229,  234,  239,  245,
4014 +
4015 +      251,  255,  262,  270,  275,  280
4016 +    } ;
4017 +
4018 +static yyconst flex_int16_t yy_def[107] =
4019 +    {   0,
4020 +       93,    1,    1,    3,    3,    5,   93,    7,    3,    3,
4021 +       93,   93,   93,   93,   94,   95,   93,   96,   93,   19,
4022 +       19,   20,   97,   98,   20,   93,   99,  100,   95,   93,
4023 +       93,   93,   94,   93,   94,  101,  102,   93,  103,  104,
4024 +       93,   93,   93,   96,   19,   93,   20,   93,   97,   93,
4025 +       97,   93,   20,   99,  100,   93,  105,  101,  102,  106,
4026 +      103,  103,  104,   93,   93,   93,   93,   94,  105,  106,
4027 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4028 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4029 +       93,   93,    0,   93,   93,   93,   93,   93,   93,   93,
4030 +
4031 +       93,   93,   93,   93,   93,   93
4032 +    } ;
4033 +
4034 +static yyconst flex_int16_t yy_nxt[324] =
4035 +    {   0,
4036 +       12,   13,   14,   15,   12,   16,   12,   12,   12,   17,
4037 +       18,   18,   18,   12,   19,   20,   20,   12,   12,   21,
4038 +       19,   21,   19,   22,   20,   20,   20,   20,   20,   20,
4039 +       20,   20,   20,   12,   12,   23,   34,   12,   32,   32,
4040 +       32,   32,   12,   12,   12,   36,   20,   33,   50,   92,
4041 +       35,   20,   20,   20,   20,   20,   15,   54,   91,   54,
4042 +       54,   54,   51,   24,   24,   24,   46,   25,   90,   38,
4043 +       89,   26,   25,   25,   25,   25,   12,   13,   14,   15,
4044 +       27,   12,   27,   27,   27,   17,   27,   27,   27,   12,
4045 +       28,   28,   28,   12,   12,   28,   28,   28,   28,   28,
4046 +
4047 +       28,   28,   28,   28,   28,   28,   28,   28,   28,   12,
4048 +       12,   15,   39,   29,   15,   40,   29,   93,   30,   31,
4049 +       31,   30,   31,   31,   56,   56,   56,   41,   32,   32,
4050 +       42,   88,   43,   45,   45,   45,   46,   45,   47,   47,
4051 +       87,   38,   45,   45,   45,   45,   47,   47,   47,   47,
4052 +       47,   47,   47,   47,   47,   47,   47,   47,   47,   86,
4053 +       47,   34,   33,   50,   85,   47,   47,   47,   47,   53,
4054 +       53,   53,   84,   53,   83,   35,   82,   51,   53,   53,
4055 +       53,   53,   56,   56,   56,   93,   68,   54,   57,   54,
4056 +       54,   54,   56,   56,   56,   62,   46,   34,   71,   81,
4057 +
4058 +       80,   79,   78,   77,   76,   75,   74,   73,   72,   64,
4059 +       62,   35,   33,   33,   33,   33,   33,   33,   33,   33,
4060 +       37,   67,   66,   37,   37,   37,   44,   65,   44,   49,
4061 +       49,   49,   49,   49,   49,   49,   49,   52,   64,   52,
4062 +       54,   62,   54,   60,   54,   54,   55,   93,   55,   55,
4063 +       55,   55,   58,   58,   58,   48,   58,   58,   59,   48,
4064 +       59,   59,   61,   61,   61,   61,   61,   61,   61,   61,
4065 +       63,   63,   63,   63,   63,   63,   63,   63,   69,   93,
4066 +       69,   70,   70,   70,   93,   70,   70,   11,   93,   93,
4067 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4068 +
4069 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4070 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4071 +       93,   93,   93
4072 +    } ;
4073 +
4074 +static yyconst flex_int16_t yy_chk[324] =
4075 +    {   0,
4076 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4077 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4078 +        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
4079 +        1,    1,    1,    1,    1,    3,   15,    3,   13,   13,
4080 +       14,   14,    3,    3,    3,   16,    3,   23,   23,   91,
4081 +       15,    3,    3,    3,    3,    3,    5,   28,   90,   28,
4082 +       28,   28,   23,    5,    5,    5,   28,    5,   89,   16,
4083 +       87,    5,    5,    5,    5,    5,    7,    7,    7,    7,
4084 +        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
4085 +        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
4086 +
4087 +        7,    7,    7,    7,    7,    7,    7,    7,    7,    7,
4088 +        7,    9,   17,    9,   10,   17,   10,   29,    9,    9,
4089 +        9,   10,   10,   10,   31,   31,   31,   17,   32,   32,
4090 +       17,   86,   17,   19,   19,   19,   19,   19,   19,   19,
4091 +       84,   29,   19,   19,   19,   19,   19,   19,   19,   19,
4092 +       19,   19,   19,   19,   19,   19,   20,   20,   20,   83,
4093 +       20,   33,   49,   49,   82,   20,   20,   20,   20,   25,
4094 +       25,   25,   81,   25,   80,   33,   79,   49,   25,   25,
4095 +       25,   25,   30,   30,   30,   51,   51,   55,   30,   55,
4096 +       55,   55,   56,   56,   56,   62,   55,   68,   62,   78,
4097 +
4098 +       77,   76,   74,   73,   72,   70,   67,   66,   65,   63,
4099 +       61,   68,   94,   94,   94,   94,   94,   94,   94,   94,
4100 +       95,   43,   42,   95,   95,   95,   96,   41,   96,   97,
4101 +       97,   97,   97,   97,   97,   97,   97,   98,   40,   98,
4102 +       99,   39,   99,   38,   99,   99,  100,   35,  100,  100,
4103 +      100,  100,  101,  101,  101,   22,  101,  101,  102,   21,
4104 +      102,  102,  103,  103,  103,  103,  103,  103,  103,  103,
4105 +      104,  104,  104,  104,  104,  104,  104,  104,  105,   11,
4106 +      105,  106,  106,  106,    0,  106,  106,   93,   93,   93,
4107 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4108 +
4109 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4110 +       93,   93,   93,   93,   93,   93,   93,   93,   93,   93,
4111 +       93,   93,   93
4112 +    } ;
4113 +
4114 +/* Table of booleans, true if rule could match eol. */
4115 +static yyconst flex_int32_t yy_rule_can_match_eol[21] =
4116 +    {   0,
4117 +0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 
4118 +    0,     };
4119 +
4120 +static yy_state_type yy_last_accepting_state;
4121 +static char *yy_last_accepting_cpos;
4122 +
4123 +extern int yy_flex_debug;
4124 +int yy_flex_debug = 0;
4125 +
4126 +/* The intent behind this definition is that it'll catch
4127 + * any uses of REJECT which flex missed.
4128 + */
4129 +#define REJECT reject_used_but_not_detected
4130 +#define yymore() yymore_used_but_not_detected
4131 +#define YY_MORE_ADJ 0
4132 +#define YY_RESTORE_YY_MORE_OFFSET
4133 +char *yytext;
4134 +#line 1 "dtc-lexer.l"
4135 +/*
4136 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
4137 + *
4138 + *
4139 + * This program is free software; you can redistribute it and/or
4140 + * modify it under the terms of the GNU General Public License as
4141 + * published by the Free Software Foundation; either version 2 of the
4142 + * License, or (at your option) any later version.
4143 + *
4144 + *  This program is distributed in the hope that it will be useful,
4145 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
4146 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4147 + *  General Public License for more details.
4148 + *
4149 + *  You should have received a copy of the GNU General Public License
4150 + *  along with this program; if not, write to the Free Software
4151 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
4152 + *                                                                   USA
4153 + */
4154 +
4155 +
4156 +
4157 +
4158 +#line 33 "dtc-lexer.l"
4159 +#include "dtc.h"
4160 +#include "srcpos.h"
4161 +#include "dtc-parser.tab.h"
4162 +
4163 +
4164 +/*#define LEXDEBUG     1*/
4165 +
4166 +#ifdef LEXDEBUG
4167 +#define DPRINT(fmt, ...)       fprintf(stderr, fmt, ##__VA_ARGS__)
4168 +#else
4169 +#define DPRINT(fmt, ...)       do { } while (0)
4170 +#endif
4171 +
4172 +static int dts_version; /* = 0 */
4173 +
4174 +#define BEGIN_DEFAULT()        if (dts_version == 0) { \
4175 +                               DPRINT("<INITIAL>\n"); \
4176 +                               BEGIN(INITIAL); \
4177 +                       } else { \
4178 +                               DPRINT("<V1>\n"); \
4179 +                               BEGIN(V1); \
4180 +                       }
4181 +#line 627 "dtc-lexer.lex.c"
4182 +
4183 +#define INITIAL 0
4184 +#define INCLUDE 1
4185 +#define BYTESTRING 2
4186 +#define PROPNODENAME 3
4187 +#define V1 4
4188 +
4189 +#ifndef YY_NO_UNISTD_H
4190 +/* Special case for "unistd.h", since it is non-ANSI. We include it way
4191 + * down here because we want the user's section 1 to have been scanned first.
4192 + * The user has a chance to override it with an option.
4193 + */
4194 +#include <unistd.h>
4195 +#endif
4196 +
4197 +#ifndef YY_EXTRA_TYPE
4198 +#define YY_EXTRA_TYPE void *
4199 +#endif
4200 +
4201 +static int yy_init_globals (void );
4202 +
4203 +/* Macros after this point can all be overridden by user definitions in
4204 + * section 1.
4205 + */
4206 +
4207 +#ifndef YY_SKIP_YYWRAP
4208 +#ifdef __cplusplus
4209 +extern "C" int yywrap (void );
4210 +#else
4211 +extern int yywrap (void );
4212 +#endif
4213 +#endif
4214 +
4215 +#ifndef yytext_ptr
4216 +static void yy_flex_strncpy (char *,yyconst char *,int );
4217 +#endif
4218 +
4219 +#ifdef YY_NEED_STRLEN
4220 +static int yy_flex_strlen (yyconst char * );
4221 +#endif
4222 +
4223 +#ifndef YY_NO_INPUT
4224 +
4225 +#ifdef __cplusplus
4226 +static int yyinput (void );
4227 +#else
4228 +static int input (void );
4229 +#endif
4230 +
4231 +#endif
4232 +
4233 +/* Amount of stuff to slurp up with each read. */
4234 +#ifndef YY_READ_BUF_SIZE
4235 +#define YY_READ_BUF_SIZE 8192
4236 +#endif
4237 +
4238 +/* Copy whatever the last rule matched to the standard output. */
4239 +#ifndef ECHO
4240 +/* This used to be an fputs(), but since the string might contain NUL's,
4241 + * we now use fwrite().
4242 + */
4243 +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
4244 +#endif
4245 +
4246 +/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
4247 + * is returned in "result".
4248 + */
4249 +#ifndef YY_INPUT
4250 +#define YY_INPUT(buf,result,max_size) \
4251 +       if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
4252 +               { \
4253 +               int c = '*'; \
4254 +               size_t n; \
4255 +               for ( n = 0; n < max_size && \
4256 +                            (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
4257 +                       buf[n] = (char) c; \
4258 +               if ( c == '\n' ) \
4259 +                       buf[n++] = (char) c; \
4260 +               if ( c == EOF && ferror( yyin ) ) \
4261 +                       YY_FATAL_ERROR( "input in flex scanner failed" ); \
4262 +               result = n; \
4263 +               } \
4264 +       else \
4265 +               { \
4266 +               errno=0; \
4267 +               while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
4268 +                       { \
4269 +                       if( errno != EINTR) \
4270 +                               { \
4271 +                               YY_FATAL_ERROR( "input in flex scanner failed" ); \
4272 +                               break; \
4273 +                               } \
4274 +                       errno=0; \
4275 +                       clearerr(yyin); \
4276 +                       } \
4277 +               }\
4278 +\
4279 +
4280 +#endif
4281 +
4282 +/* No semi-colon after return; correct usage is to write "yyterminate();" -
4283 + * we don't want an extra ';' after the "return" because that will cause
4284 + * some compilers to complain about unreachable statements.
4285 + */
4286 +#ifndef yyterminate
4287 +#define yyterminate() return YY_NULL
4288 +#endif
4289 +
4290 +/* Number of entries by which start-condition stack grows. */
4291 +#ifndef YY_START_STACK_INCR
4292 +#define YY_START_STACK_INCR 25
4293 +#endif
4294 +
4295 +/* Report a fatal error. */
4296 +#ifndef YY_FATAL_ERROR
4297 +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
4298 +#endif
4299 +
4300 +/* end tables serialization structures and prototypes */
4301 +
4302 +/* Default declaration of generated scanner - a define so the user can
4303 + * easily add parameters.
4304 + */
4305 +#ifndef YY_DECL
4306 +#define YY_DECL_IS_OURS 1
4307 +
4308 +extern int yylex (void);
4309 +
4310 +#define YY_DECL int yylex (void)
4311 +#endif /* !YY_DECL */
4312 +
4313 +/* Code executed at the beginning of each rule, after yytext and yyleng
4314 + * have been set up.
4315 + */
4316 +#ifndef YY_USER_ACTION
4317 +#define YY_USER_ACTION
4318 +#endif
4319 +
4320 +/* Code executed at the end of each rule. */
4321 +#ifndef YY_BREAK
4322 +#define YY_BREAK break;
4323 +#endif
4324 +
4325 +#define YY_RULE_SETUP \
4326 +       YY_USER_ACTION
4327 +
4328 +/** The main scanner function which does all the work.
4329 + */
4330 +YY_DECL
4331 +{
4332 +       register yy_state_type yy_current_state;
4333 +       register char *yy_cp, *yy_bp;
4334 +       register int yy_act;
4335 +    
4336 +#line 57 "dtc-lexer.l"
4337 +
4338 +#line 784 "dtc-lexer.lex.c"
4339 +
4340 +       if ( !(yy_init) )
4341 +               {
4342 +               (yy_init) = 1;
4343 +
4344 +#ifdef YY_USER_INIT
4345 +               YY_USER_INIT;
4346 +#endif
4347 +
4348 +               if ( ! (yy_start) )
4349 +                       (yy_start) = 1; /* first start state */
4350 +
4351 +               if ( ! yyin )
4352 +                       yyin = stdin;
4353 +
4354 +               if ( ! yyout )
4355 +                       yyout = stdout;
4356 +
4357 +               if ( ! YY_CURRENT_BUFFER ) {
4358 +                       yyensure_buffer_stack ();
4359 +                       YY_CURRENT_BUFFER_LVALUE =
4360 +                               yy_create_buffer(yyin,YY_BUF_SIZE );
4361 +               }
4362 +
4363 +               yy_load_buffer_state( );
4364 +               }
4365 +
4366 +       while ( 1 )             /* loops until end-of-file is reached */
4367 +               {
4368 +               yy_cp = (yy_c_buf_p);
4369 +
4370 +               /* Support of yytext. */
4371 +               *yy_cp = (yy_hold_char);
4372 +
4373 +               /* yy_bp points to the position in yy_ch_buf of the start of
4374 +                * the current run.
4375 +                */
4376 +               yy_bp = yy_cp;
4377 +
4378 +               yy_current_state = (yy_start);
4379 +yy_match:
4380 +               do
4381 +                       {
4382 +                       register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
4383 +                       if ( yy_accept[yy_current_state] )
4384 +                               {
4385 +                               (yy_last_accepting_state) = yy_current_state;
4386 +                               (yy_last_accepting_cpos) = yy_cp;
4387 +                               }
4388 +                       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
4389 +                               {
4390 +                               yy_current_state = (int) yy_def[yy_current_state];
4391 +                               if ( yy_current_state >= 94 )
4392 +                                       yy_c = yy_meta[(unsigned int) yy_c];
4393 +                               }
4394 +                       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
4395 +                       ++yy_cp;
4396 +                       }
4397 +               while ( yy_base[yy_current_state] != 288 );
4398 +
4399 +yy_find_action:
4400 +               yy_act = yy_accept[yy_current_state];
4401 +               if ( yy_act == 0 )
4402 +                       { /* have to back up */
4403 +                       yy_cp = (yy_last_accepting_cpos);
4404 +                       yy_current_state = (yy_last_accepting_state);
4405 +                       yy_act = yy_accept[yy_current_state];
4406 +                       }
4407 +
4408 +               YY_DO_BEFORE_ACTION;
4409 +
4410 +               if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
4411 +                       {
4412 +                       int yyl;
4413 +                       for ( yyl = 0; yyl < yyleng; ++yyl )
4414 +                               if ( yytext[yyl] == '\n' )
4415 +                                          
4416 +    yylineno++;
4417 +;
4418 +                       }
4419 +
4420 +do_action:     /* This label is used only to access EOF actions. */
4421 +
4422 +               switch ( yy_act )
4423 +       { /* beginning of action switch */
4424 +                       case 0: /* must back up */
4425 +                       /* undo the effects of YY_DO_BEFORE_ACTION */
4426 +                       *yy_cp = (yy_hold_char);
4427 +                       yy_cp = (yy_last_accepting_cpos);
4428 +                       yy_current_state = (yy_last_accepting_state);
4429 +                       goto yy_find_action;
4430 +
4431 +case 1:
4432 +YY_RULE_SETUP
4433 +#line 58 "dtc-lexer.l"
4434 +BEGIN(INCLUDE);
4435 +       YY_BREAK
4436 +case 2:
4437 +YY_RULE_SETUP
4438 +#line 60 "dtc-lexer.l"
4439 +{
4440 +                       yytext[strlen(yytext) - 1] = 0;
4441 +                       if (!push_input_file(yytext + 1)) {
4442 +                               /* Some unrecoverable error.*/
4443 +                               exit(1);
4444 +                       }
4445 +                       BEGIN_DEFAULT();
4446 +               }
4447 +       YY_BREAK
4448 +case YY_STATE_EOF(INITIAL):
4449 +case YY_STATE_EOF(INCLUDE):
4450 +case YY_STATE_EOF(BYTESTRING):
4451 +case YY_STATE_EOF(PROPNODENAME):
4452 +case YY_STATE_EOF(V1):
4453 +#line 70 "dtc-lexer.l"
4454 +{
4455 +                       if (!pop_input_file()) {
4456 +                               yyterminate();
4457 +                       }
4458 +               }
4459 +       YY_BREAK
4460 +case 3:
4461 +/* rule 3 can match eol */
4462 +YY_RULE_SETUP
4463 +#line 76 "dtc-lexer.l"
4464 +{
4465 +                       yylloc.filenum = srcpos_filenum;
4466 +                       yylloc.first_line = yylineno;
4467 +                       DPRINT("String: %s\n", yytext);
4468 +                       yylval.data = data_copy_escape_string(yytext+1,
4469 +                                       yyleng-2);
4470 +                       yylloc.first_line = yylineno;
4471 +                       return DT_STRING;
4472 +               }
4473 +       YY_BREAK
4474 +case 4:
4475 +YY_RULE_SETUP
4476 +#line 86 "dtc-lexer.l"
4477 +{
4478 +                       yylloc.filenum = srcpos_filenum;
4479 +                       yylloc.first_line = yylineno;
4480 +                       DPRINT("Keyword: /dts-v1/\n");
4481 +                       dts_version = 1;
4482 +                       BEGIN_DEFAULT();
4483 +                       return DT_V1;
4484 +               }
4485 +       YY_BREAK
4486 +case 5:
4487 +YY_RULE_SETUP
4488 +#line 95 "dtc-lexer.l"
4489 +{
4490 +                       yylloc.filenum = srcpos_filenum;
4491 +                       yylloc.first_line = yylineno;
4492 +                       DPRINT("Keyword: /memreserve/\n");
4493 +                       BEGIN_DEFAULT();
4494 +                       return DT_MEMRESERVE;
4495 +               }
4496 +       YY_BREAK
4497 +case 6:
4498 +YY_RULE_SETUP
4499 +#line 103 "dtc-lexer.l"
4500 +{
4501 +                       yylloc.filenum = srcpos_filenum;
4502 +                       yylloc.first_line = yylineno;
4503 +                       DPRINT("Label: %s\n", yytext);
4504 +                       yylval.labelref = strdup(yytext);
4505 +                       yylval.labelref[yyleng-1] = '\0';
4506 +                       return DT_LABEL;
4507 +               }
4508 +       YY_BREAK
4509 +case 7:
4510 +YY_RULE_SETUP
4511 +#line 112 "dtc-lexer.l"
4512 +{
4513 +                       yylloc.filenum = srcpos_filenum;
4514 +                       yylloc.first_line = yylineno;
4515 +                       if (*yytext == 'b')
4516 +                               yylval.cbase = 2;
4517 +                       else if (*yytext == 'o')
4518 +                               yylval.cbase = 8;
4519 +                       else if (*yytext == 'd')
4520 +                               yylval.cbase = 10;
4521 +                       else
4522 +                               yylval.cbase = 16;
4523 +                       DPRINT("Base: %d\n", yylval.cbase);
4524 +                       return DT_BASE;
4525 +               }
4526 +       YY_BREAK
4527 +case 8:
4528 +YY_RULE_SETUP
4529 +#line 127 "dtc-lexer.l"
4530 +{
4531 +                       yylloc.filenum = srcpos_filenum;
4532 +                       yylloc.first_line = yylineno;
4533 +                       yylval.literal = strdup(yytext);
4534 +                       DPRINT("Literal: '%s'\n", yylval.literal);
4535 +                       return DT_LEGACYLITERAL;
4536 +               }
4537 +       YY_BREAK
4538 +case 9:
4539 +YY_RULE_SETUP
4540 +#line 135 "dtc-lexer.l"
4541 +{
4542 +                       yylloc.filenum = srcpos_filenum;
4543 +                       yylloc.first_line = yylineno;
4544 +                       yylval.literal = strdup(yytext);
4545 +                       DPRINT("Literal: '%s'\n", yylval.literal);
4546 +                       return DT_LITERAL;
4547 +               }
4548 +       YY_BREAK
4549 +case 10:
4550 +YY_RULE_SETUP
4551 +#line 143 "dtc-lexer.l"
4552 +{      /* label reference */
4553 +                       yylloc.filenum = srcpos_filenum;
4554 +                       yylloc.first_line = yylineno;
4555 +                       DPRINT("Ref: %s\n", yytext+1);
4556 +                       yylval.labelref = strdup(yytext+1);
4557 +                       return DT_REF;
4558 +               }
4559 +       YY_BREAK
4560 +case 11:
4561 +YY_RULE_SETUP
4562 +#line 151 "dtc-lexer.l"
4563 +{      /* new-style path reference */
4564 +                       yylloc.filenum = srcpos_filenum;
4565 +                       yylloc.first_line = yylineno;
4566 +                       yytext[yyleng-1] = '\0';
4567 +                       DPRINT("Ref: %s\n", yytext+2);
4568 +                       yylval.labelref = strdup(yytext+2);
4569 +                       return DT_REF;
4570 +               }
4571 +       YY_BREAK
4572 +case 12:
4573 +YY_RULE_SETUP
4574 +#line 160 "dtc-lexer.l"
4575 +{      /* old-style path reference */
4576 +                       yylloc.filenum = srcpos_filenum;
4577 +                       yylloc.first_line = yylineno;
4578 +                       DPRINT("Ref: %s\n", yytext+1);
4579 +                       yylval.labelref = strdup(yytext+1);
4580 +                       return DT_REF;
4581 +               }
4582 +       YY_BREAK
4583 +case 13:
4584 +YY_RULE_SETUP
4585 +#line 168 "dtc-lexer.l"
4586 +{
4587 +                       yylloc.filenum = srcpos_filenum;
4588 +                       yylloc.first_line = yylineno;
4589 +                       yylval.byte = strtol(yytext, NULL, 16);
4590 +                       DPRINT("Byte: %02x\n", (int)yylval.byte);
4591 +                       return DT_BYTE;
4592 +               }
4593 +       YY_BREAK
4594 +case 14:
4595 +YY_RULE_SETUP
4596 +#line 176 "dtc-lexer.l"
4597 +{
4598 +                       yylloc.filenum = srcpos_filenum;
4599 +                       yylloc.first_line = yylineno;
4600 +                       DPRINT("/BYTESTRING\n");
4601 +                       BEGIN_DEFAULT();
4602 +                       return ']';
4603 +               }
4604 +       YY_BREAK
4605 +case 15:
4606 +YY_RULE_SETUP
4607 +#line 184 "dtc-lexer.l"
4608 +{
4609 +                       yylloc.filenum = srcpos_filenum;
4610 +                       yylloc.first_line = yylineno;
4611 +                       DPRINT("PropNodeName: %s\n", yytext);
4612 +                       yylval.propnodename = strdup(yytext);
4613 +                       BEGIN_DEFAULT();
4614 +                       return DT_PROPNODENAME;
4615 +               }
4616 +       YY_BREAK
4617 +case 16:
4618 +/* rule 16 can match eol */
4619 +YY_RULE_SETUP
4620 +#line 194 "dtc-lexer.l"
4621 +/* eat whitespace */
4622 +       YY_BREAK
4623 +case 17:
4624 +/* rule 17 can match eol */
4625 +YY_RULE_SETUP
4626 +#line 196 "dtc-lexer.l"
4627 +{
4628 +                       yylloc.filenum = srcpos_filenum;
4629 +                       yylloc.first_line = yylineno;
4630 +                       DPRINT("Comment: %s\n", yytext);
4631 +                       /* eat comments */
4632 +               }
4633 +       YY_BREAK
4634 +case 18:
4635 +/* rule 18 can match eol */
4636 +YY_RULE_SETUP
4637 +#line 203 "dtc-lexer.l"
4638 +/* eat line comments */
4639 +       YY_BREAK
4640 +case 19:
4641 +YY_RULE_SETUP
4642 +#line 205 "dtc-lexer.l"
4643 +{
4644 +                       yylloc.filenum = srcpos_filenum;
4645 +                       yylloc.first_line = yylineno;
4646 +                       DPRINT("Char: %c (\\x%02x)\n", yytext[0],
4647 +                               (unsigned)yytext[0]);
4648 +                       if (yytext[0] == '[') {
4649 +                               DPRINT("<BYTESTRING>\n");
4650 +                               BEGIN(BYTESTRING);
4651 +                       }
4652 +                       if ((yytext[0] == '{')
4653 +                           || (yytext[0] == ';')) {
4654 +                               DPRINT("<PROPNODENAME>\n");
4655 +                               BEGIN(PROPNODENAME);
4656 +                       }
4657 +                       return yytext[0];
4658 +               }
4659 +       YY_BREAK
4660 +case 20:
4661 +YY_RULE_SETUP
4662 +#line 222 "dtc-lexer.l"
4663 +ECHO;
4664 +       YY_BREAK
4665 +#line 1111 "dtc-lexer.lex.c"
4666 +
4667 +       case YY_END_OF_BUFFER:
4668 +               {
4669 +               /* Amount of text matched not including the EOB char. */
4670 +               int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
4671 +
4672 +               /* Undo the effects of YY_DO_BEFORE_ACTION. */
4673 +               *yy_cp = (yy_hold_char);
4674 +               YY_RESTORE_YY_MORE_OFFSET
4675 +
4676 +               if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
4677 +                       {
4678 +                       /* We're scanning a new file or input source.  It's
4679 +                        * possible that this happened because the user
4680 +                        * just pointed yyin at a new source and called
4681 +                        * yylex().  If so, then we have to assure
4682 +                        * consistency between YY_CURRENT_BUFFER and our
4683 +                        * globals.  Here is the right place to do so, because
4684 +                        * this is the first action (other than possibly a
4685 +                        * back-up) that will match for the new input source.
4686 +                        */
4687 +                       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
4688 +                       YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
4689 +                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
4690 +                       }
4691 +
4692 +               /* Note that here we test for yy_c_buf_p "<=" to the position
4693 +                * of the first EOB in the buffer, since yy_c_buf_p will
4694 +                * already have been incremented past the NUL character
4695 +                * (since all states make transitions on EOB to the
4696 +                * end-of-buffer state).  Contrast this with the test
4697 +                * in input().
4698 +                */
4699 +               if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
4700 +                       { /* This was really a NUL. */
4701 +                       yy_state_type yy_next_state;
4702 +
4703 +                       (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
4704 +
4705 +                       yy_current_state = yy_get_previous_state(  );
4706 +
4707 +                       /* Okay, we're now positioned to make the NUL
4708 +                        * transition.  We couldn't have
4709 +                        * yy_get_previous_state() go ahead and do it
4710 +                        * for us because it doesn't know how to deal
4711 +                        * with the possibility of jamming (and we don't
4712 +                        * want to build jamming into it because then it
4713 +                        * will run more slowly).
4714 +                        */
4715 +
4716 +                       yy_next_state = yy_try_NUL_trans( yy_current_state );
4717 +
4718 +                       yy_bp = (yytext_ptr) + YY_MORE_ADJ;
4719 +
4720 +                       if ( yy_next_state )
4721 +                               {
4722 +                               /* Consume the NUL. */
4723 +                               yy_cp = ++(yy_c_buf_p);
4724 +                               yy_current_state = yy_next_state;
4725 +                               goto yy_match;
4726 +                               }
4727 +
4728 +                       else
4729 +                               {
4730 +                               yy_cp = (yy_c_buf_p);
4731 +                               goto yy_find_action;
4732 +                               }
4733 +                       }
4734 +
4735 +               else switch ( yy_get_next_buffer(  ) )
4736 +                       {
4737 +                       case EOB_ACT_END_OF_FILE:
4738 +                               {
4739 +                               (yy_did_buffer_switch_on_eof) = 0;
4740 +
4741 +                               if ( yywrap( ) )
4742 +                                       {
4743 +                                       /* Note: because we've taken care in
4744 +                                        * yy_get_next_buffer() to have set up
4745 +                                        * yytext, we can now set up
4746 +                                        * yy_c_buf_p so that if some total
4747 +                                        * hoser (like flex itself) wants to
4748 +                                        * call the scanner after we return the
4749 +                                        * YY_NULL, it'll still work - another
4750 +                                        * YY_NULL will get returned.
4751 +                                        */
4752 +                                       (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
4753 +
4754 +                                       yy_act = YY_STATE_EOF(YY_START);
4755 +                                       goto do_action;
4756 +                                       }
4757 +
4758 +                               else
4759 +                                       {
4760 +                                       if ( ! (yy_did_buffer_switch_on_eof) )
4761 +                                               YY_NEW_FILE;
4762 +                                       }
4763 +                               break;
4764 +                               }
4765 +
4766 +                       case EOB_ACT_CONTINUE_SCAN:
4767 +                               (yy_c_buf_p) =
4768 +                                       (yytext_ptr) + yy_amount_of_matched_text;
4769 +
4770 +                               yy_current_state = yy_get_previous_state(  );
4771 +
4772 +                               yy_cp = (yy_c_buf_p);
4773 +                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
4774 +                               goto yy_match;
4775 +
4776 +                       case EOB_ACT_LAST_MATCH:
4777 +                               (yy_c_buf_p) =
4778 +                               &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
4779 +
4780 +                               yy_current_state = yy_get_previous_state(  );
4781 +
4782 +                               yy_cp = (yy_c_buf_p);
4783 +                               yy_bp = (yytext_ptr) + YY_MORE_ADJ;
4784 +                               goto yy_find_action;
4785 +                       }
4786 +               break;
4787 +               }
4788 +
4789 +       default:
4790 +               YY_FATAL_ERROR(
4791 +                       "fatal flex scanner internal error--no action found" );
4792 +       } /* end of action switch */
4793 +               } /* end of scanning one token */
4794 +} /* end of yylex */
4795 +
4796 +/* yy_get_next_buffer - try to read in a new buffer
4797 + *
4798 + * Returns a code representing an action:
4799 + *     EOB_ACT_LAST_MATCH -
4800 + *     EOB_ACT_CONTINUE_SCAN - continue scanning from current position
4801 + *     EOB_ACT_END_OF_FILE - end of file
4802 + */
4803 +static int yy_get_next_buffer (void)
4804 +{
4805 +       register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
4806 +       register char *source = (yytext_ptr);
4807 +       register int number_to_move, i;
4808 +       int ret_val;
4809 +
4810 +       if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
4811 +               YY_FATAL_ERROR(
4812 +               "fatal flex scanner internal error--end of buffer missed" );
4813 +
4814 +       if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
4815 +               { /* Don't try to fill the buffer, so this is an EOF. */
4816 +               if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
4817 +                       {
4818 +                       /* We matched a single character, the EOB, so
4819 +                        * treat this as a final EOF.
4820 +                        */
4821 +                       return EOB_ACT_END_OF_FILE;
4822 +                       }
4823 +
4824 +               else
4825 +                       {
4826 +                       /* We matched some text prior to the EOB, first
4827 +                        * process it.
4828 +                        */
4829 +                       return EOB_ACT_LAST_MATCH;
4830 +                       }
4831 +               }
4832 +
4833 +       /* Try to read more data. */
4834 +
4835 +       /* First move last chars to start of buffer. */
4836 +       number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
4837 +
4838 +       for ( i = 0; i < number_to_move; ++i )
4839 +               *(dest++) = *(source++);
4840 +
4841 +       if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
4842 +               /* don't do the read, it's not guaranteed to return an EOF,
4843 +                * just force an EOF
4844 +                */
4845 +               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
4846 +
4847 +       else
4848 +               {
4849 +                       int num_to_read =
4850 +                       YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
4851 +
4852 +               while ( num_to_read <= 0 )
4853 +                       { /* Not enough room in the buffer - grow it. */
4854 +
4855 +                       /* just a shorter name for the current buffer */
4856 +                       YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
4857 +
4858 +                       int yy_c_buf_p_offset =
4859 +                               (int) ((yy_c_buf_p) - b->yy_ch_buf);
4860 +
4861 +                       if ( b->yy_is_our_buffer )
4862 +                               {
4863 +                               int new_size = b->yy_buf_size * 2;
4864 +
4865 +                               if ( new_size <= 0 )
4866 +                                       b->yy_buf_size += b->yy_buf_size / 8;
4867 +                               else
4868 +                                       b->yy_buf_size *= 2;
4869 +
4870 +                               b->yy_ch_buf = (char *)
4871 +                                       /* Include room in for 2 EOB chars. */
4872 +                                       yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2  );
4873 +                               }
4874 +                       else
4875 +                               /* Can't grow it, we don't own it. */
4876 +                               b->yy_ch_buf = 0;
4877 +
4878 +                       if ( ! b->yy_ch_buf )
4879 +                               YY_FATAL_ERROR(
4880 +                               "fatal error - scanner input buffer overflow" );
4881 +
4882 +                       (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
4883 +
4884 +                       num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
4885 +                                               number_to_move - 1;
4886 +
4887 +                       }
4888 +
4889 +               if ( num_to_read > YY_READ_BUF_SIZE )
4890 +                       num_to_read = YY_READ_BUF_SIZE;
4891 +
4892 +               /* Read in more data. */
4893 +               YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
4894 +                       (yy_n_chars), (size_t) num_to_read );
4895 +
4896 +               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
4897 +               }
4898 +
4899 +       if ( (yy_n_chars) == 0 )
4900 +               {
4901 +               if ( number_to_move == YY_MORE_ADJ )
4902 +                       {
4903 +                       ret_val = EOB_ACT_END_OF_FILE;
4904 +                       yyrestart(yyin  );
4905 +                       }
4906 +
4907 +               else
4908 +                       {
4909 +                       ret_val = EOB_ACT_LAST_MATCH;
4910 +                       YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
4911 +                               YY_BUFFER_EOF_PENDING;
4912 +                       }
4913 +               }
4914 +
4915 +       else
4916 +               ret_val = EOB_ACT_CONTINUE_SCAN;
4917 +
4918 +       (yy_n_chars) += number_to_move;
4919 +       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
4920 +       YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
4921 +
4922 +       (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
4923 +
4924 +       return ret_val;
4925 +}
4926 +
4927 +/* yy_get_previous_state - get the state just before the EOB char was reached */
4928 +
4929 +    static yy_state_type yy_get_previous_state (void)
4930 +{
4931 +       register yy_state_type yy_current_state;
4932 +       register char *yy_cp;
4933 +    
4934 +       yy_current_state = (yy_start);
4935 +
4936 +       for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
4937 +               {
4938 +               register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
4939 +               if ( yy_accept[yy_current_state] )
4940 +                       {
4941 +                       (yy_last_accepting_state) = yy_current_state;
4942 +                       (yy_last_accepting_cpos) = yy_cp;
4943 +                       }
4944 +               while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
4945 +                       {
4946 +                       yy_current_state = (int) yy_def[yy_current_state];
4947 +                       if ( yy_current_state >= 94 )
4948 +                               yy_c = yy_meta[(unsigned int) yy_c];
4949 +                       }
4950 +               yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
4951 +               }
4952 +
4953 +       return yy_current_state;
4954 +}
4955 +
4956 +/* yy_try_NUL_trans - try to make a transition on the NUL character
4957 + *
4958 + * synopsis
4959 + *     next_state = yy_try_NUL_trans( current_state );
4960 + */
4961 +    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state )
4962 +{
4963 +       register int yy_is_jam;
4964 +       register char *yy_cp = (yy_c_buf_p);
4965 +
4966 +       register YY_CHAR yy_c = 1;
4967 +       if ( yy_accept[yy_current_state] )
4968 +               {
4969 +               (yy_last_accepting_state) = yy_current_state;
4970 +               (yy_last_accepting_cpos) = yy_cp;
4971 +               }
4972 +       while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
4973 +               {
4974 +               yy_current_state = (int) yy_def[yy_current_state];
4975 +               if ( yy_current_state >= 94 )
4976 +                       yy_c = yy_meta[(unsigned int) yy_c];
4977 +               }
4978 +       yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
4979 +       yy_is_jam = (yy_current_state == 93);
4980 +
4981 +       return yy_is_jam ? 0 : yy_current_state;
4982 +}
4983 +
4984 +#ifndef YY_NO_INPUT
4985 +#ifdef __cplusplus
4986 +    static int yyinput (void)
4987 +#else
4988 +    static int input  (void)
4989 +#endif
4990 +
4991 +{
4992 +       int c;
4993 +    
4994 +       *(yy_c_buf_p) = (yy_hold_char);
4995 +
4996 +       if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
4997 +               {
4998 +               /* yy_c_buf_p now points to the character we want to return.
4999 +                * If this occurs *before* the EOB characters, then it's a
5000 +                * valid NUL; if not, then we've hit the end of the buffer.
5001 +                */
5002 +               if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
5003 +                       /* This was really a NUL. */
5004 +                       *(yy_c_buf_p) = '\0';
5005 +
5006 +               else
5007 +                       { /* need more input */
5008 +                       int offset = (yy_c_buf_p) - (yytext_ptr);
5009 +                       ++(yy_c_buf_p);
5010 +
5011 +                       switch ( yy_get_next_buffer(  ) )
5012 +                               {
5013 +                               case EOB_ACT_LAST_MATCH:
5014 +                                       /* This happens because yy_g_n_b()
5015 +                                        * sees that we've accumulated a
5016 +                                        * token and flags that we need to
5017 +                                        * try matching the token before
5018 +                                        * proceeding.  But for input(),
5019 +                                        * there's no matching to consider.
5020 +                                        * So convert the EOB_ACT_LAST_MATCH
5021 +                                        * to EOB_ACT_END_OF_FILE.
5022 +                                        */
5023 +
5024 +                                       /* Reset buffer status. */
5025 +                                       yyrestart(yyin );
5026 +
5027 +                                       /*FALLTHROUGH*/
5028 +
5029 +                               case EOB_ACT_END_OF_FILE:
5030 +                                       {
5031 +                                       if ( yywrap( ) )
5032 +                                               return EOF;
5033 +
5034 +                                       if ( ! (yy_did_buffer_switch_on_eof) )
5035 +                                               YY_NEW_FILE;
5036 +#ifdef __cplusplus
5037 +                                       return yyinput();
5038 +#else
5039 +                                       return input();
5040 +#endif
5041 +                                       }
5042 +
5043 +                               case EOB_ACT_CONTINUE_SCAN:
5044 +                                       (yy_c_buf_p) = (yytext_ptr) + offset;
5045 +                                       break;
5046 +                               }
5047 +                       }
5048 +               }
5049 +
5050 +       c = *(unsigned char *) (yy_c_buf_p);    /* cast for 8-bit char's */
5051 +       *(yy_c_buf_p) = '\0';   /* preserve yytext */
5052 +       (yy_hold_char) = *++(yy_c_buf_p);
5053 +
5054 +       if ( c == '\n' )
5055 +                  
5056 +    yylineno++;
5057 +;
5058 +
5059 +       return c;
5060 +}
5061 +#endif /* ifndef YY_NO_INPUT */
5062 +
5063 +/** Immediately switch to a different input stream.
5064 + * @param input_file A readable stream.
5065 + * 
5066 + * @note This function does not reset the start condition to @c INITIAL .
5067 + */
5068 +    void yyrestart  (FILE * input_file )
5069 +{
5070 +    
5071 +       if ( ! YY_CURRENT_BUFFER ){
5072 +        yyensure_buffer_stack ();
5073 +               YY_CURRENT_BUFFER_LVALUE =
5074 +            yy_create_buffer(yyin,YY_BUF_SIZE );
5075 +       }
5076 +
5077 +       yy_init_buffer(YY_CURRENT_BUFFER,input_file );
5078 +       yy_load_buffer_state( );
5079 +}
5080 +
5081 +/** Switch to a different input buffer.
5082 + * @param new_buffer The new input buffer.
5083 + * 
5084 + */
5085 +    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer )
5086 +{
5087 +    
5088 +       /* TODO. We should be able to replace this entire function body
5089 +        * with
5090 +        *              yypop_buffer_state();
5091 +        *              yypush_buffer_state(new_buffer);
5092 +     */
5093 +       yyensure_buffer_stack ();
5094 +       if ( YY_CURRENT_BUFFER == new_buffer )
5095 +               return;
5096 +
5097 +       if ( YY_CURRENT_BUFFER )
5098 +               {
5099 +               /* Flush out information for old buffer. */
5100 +               *(yy_c_buf_p) = (yy_hold_char);
5101 +               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
5102 +               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
5103 +               }
5104 +
5105 +       YY_CURRENT_BUFFER_LVALUE = new_buffer;
5106 +       yy_load_buffer_state( );
5107 +
5108 +       /* We don't actually know whether we did this switch during
5109 +        * EOF (yywrap()) processing, but the only time this flag
5110 +        * is looked at is after yywrap() is called, so it's safe
5111 +        * to go ahead and always set it.
5112 +        */
5113 +       (yy_did_buffer_switch_on_eof) = 1;
5114 +}
5115 +
5116 +static void yy_load_buffer_state  (void)
5117 +{
5118 +       (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
5119 +       (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
5120 +       yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
5121 +       (yy_hold_char) = *(yy_c_buf_p);
5122 +}
5123 +
5124 +/** Allocate and initialize an input buffer state.
5125 + * @param file A readable stream.
5126 + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
5127 + * 
5128 + * @return the allocated buffer state.
5129 + */
5130 +    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size )
5131 +{
5132 +       YY_BUFFER_STATE b;
5133 +    
5134 +       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
5135 +       if ( ! b )
5136 +               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
5137 +
5138 +       b->yy_buf_size = size;
5139 +
5140 +       /* yy_ch_buf has to be 2 characters longer than the size given because
5141 +        * we need to put in 2 end-of-buffer characters.
5142 +        */
5143 +       b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2  );
5144 +       if ( ! b->yy_ch_buf )
5145 +               YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
5146 +
5147 +       b->yy_is_our_buffer = 1;
5148 +
5149 +       yy_init_buffer(b,file );
5150 +
5151 +       return b;
5152 +}
5153 +
5154 +/** Destroy the buffer.
5155 + * @param b a buffer created with yy_create_buffer()
5156 + * 
5157 + */
5158 +    void yy_delete_buffer (YY_BUFFER_STATE  b )
5159 +{
5160 +    
5161 +       if ( ! b )
5162 +               return;
5163 +
5164 +       if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
5165 +               YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
5166 +
5167 +       if ( b->yy_is_our_buffer )
5168 +               yyfree((void *) b->yy_ch_buf  );
5169 +
5170 +       yyfree((void *) b  );
5171 +}
5172 +
5173 +#ifndef __cplusplus
5174 +extern int isatty (int );
5175 +#endif /* __cplusplus */
5176 +    
5177 +/* Initializes or reinitializes a buffer.
5178 + * This function is sometimes called more than once on the same buffer,
5179 + * such as during a yyrestart() or at EOF.
5180 + */
5181 +    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file )
5182 +
5183 +{
5184 +       int oerrno = errno;
5185 +    
5186 +       yy_flush_buffer(b );
5187 +
5188 +       b->yy_input_file = file;
5189 +       b->yy_fill_buffer = 1;
5190 +
5191 +    /* If b is the current buffer, then yy_init_buffer was _probably_
5192 +     * called from yyrestart() or through yy_get_next_buffer.
5193 +     * In that case, we don't want to reset the lineno or column.
5194 +     */
5195 +    if (b != YY_CURRENT_BUFFER){
5196 +        b->yy_bs_lineno = 1;
5197 +        b->yy_bs_column = 0;
5198 +    }
5199 +
5200 +        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
5201 +    
5202 +       errno = oerrno;
5203 +}
5204 +
5205 +/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
5206 + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
5207 + * 
5208 + */
5209 +    void yy_flush_buffer (YY_BUFFER_STATE  b )
5210 +{
5211 +       if ( ! b )
5212 +               return;
5213 +
5214 +       b->yy_n_chars = 0;
5215 +
5216 +       /* We always need two end-of-buffer characters.  The first causes
5217 +        * a transition to the end-of-buffer state.  The second causes
5218 +        * a jam in that state.
5219 +        */
5220 +       b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
5221 +       b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
5222 +
5223 +       b->yy_buf_pos = &b->yy_ch_buf[0];
5224 +
5225 +       b->yy_at_bol = 1;
5226 +       b->yy_buffer_status = YY_BUFFER_NEW;
5227 +
5228 +       if ( b == YY_CURRENT_BUFFER )
5229 +               yy_load_buffer_state( );
5230 +}
5231 +
5232 +/** Pushes the new state onto the stack. The new state becomes
5233 + *  the current state. This function will allocate the stack
5234 + *  if necessary.
5235 + *  @param new_buffer The new state.
5236 + *  
5237 + */
5238 +void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
5239 +{
5240 +       if (new_buffer == NULL)
5241 +               return;
5242 +
5243 +       yyensure_buffer_stack();
5244 +
5245 +       /* This block is copied from yy_switch_to_buffer. */
5246 +       if ( YY_CURRENT_BUFFER )
5247 +               {
5248 +               /* Flush out information for old buffer. */
5249 +               *(yy_c_buf_p) = (yy_hold_char);
5250 +               YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
5251 +               YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
5252 +               }
5253 +
5254 +       /* Only push if top exists. Otherwise, replace top. */
5255 +       if (YY_CURRENT_BUFFER)
5256 +               (yy_buffer_stack_top)++;
5257 +       YY_CURRENT_BUFFER_LVALUE = new_buffer;
5258 +
5259 +       /* copied from yy_switch_to_buffer. */
5260 +       yy_load_buffer_state( );
5261 +       (yy_did_buffer_switch_on_eof) = 1;
5262 +}
5263 +
5264 +/** Removes and deletes the top of the stack, if present.
5265 + *  The next element becomes the new top.
5266 + *  
5267 + */
5268 +void yypop_buffer_state (void)
5269 +{
5270 +       if (!YY_CURRENT_BUFFER)
5271 +               return;
5272 +
5273 +       yy_delete_buffer(YY_CURRENT_BUFFER );
5274 +       YY_CURRENT_BUFFER_LVALUE = NULL;
5275 +       if ((yy_buffer_stack_top) > 0)
5276 +               --(yy_buffer_stack_top);
5277 +
5278 +       if (YY_CURRENT_BUFFER) {
5279 +               yy_load_buffer_state( );
5280 +               (yy_did_buffer_switch_on_eof) = 1;
5281 +       }
5282 +}
5283 +
5284 +/* Allocates the stack if it does not exist.
5285 + *  Guarantees space for at least one push.
5286 + */
5287 +static void yyensure_buffer_stack (void)
5288 +{
5289 +       int num_to_alloc;
5290 +    
5291 +       if (!(yy_buffer_stack)) {
5292 +
5293 +               /* First allocation is just for 2 elements, since we don't know if this
5294 +                * scanner will even need a stack. We use 2 instead of 1 to avoid an
5295 +                * immediate realloc on the next call.
5296 +         */
5297 +               num_to_alloc = 1;
5298 +               (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
5299 +                                                               (num_to_alloc * sizeof(struct yy_buffer_state*)
5300 +                                                               );
5301 +               
5302 +               memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
5303 +                               
5304 +               (yy_buffer_stack_max) = num_to_alloc;
5305 +               (yy_buffer_stack_top) = 0;
5306 +               return;
5307 +       }
5308 +
5309 +       if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
5310 +
5311 +               /* Increase the buffer to prepare for a possible push. */
5312 +               int grow_size = 8 /* arbitrary grow size */;
5313 +
5314 +               num_to_alloc = (yy_buffer_stack_max) + grow_size;
5315 +               (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
5316 +                                                               ((yy_buffer_stack),
5317 +                                                               num_to_alloc * sizeof(struct yy_buffer_state*)
5318 +                                                               );
5319 +
5320 +               /* zero only the new slots.*/
5321 +               memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
5322 +               (yy_buffer_stack_max) = num_to_alloc;
5323 +       }
5324 +}
5325 +
5326 +/** Setup the input buffer state to scan directly from a user-specified character buffer.
5327 + * @param base the character buffer
5328 + * @param size the size in bytes of the character buffer
5329 + * 
5330 + * @return the newly allocated buffer state object. 
5331 + */
5332 +YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size )
5333 +{
5334 +       YY_BUFFER_STATE b;
5335 +    
5336 +       if ( size < 2 ||
5337 +            base[size-2] != YY_END_OF_BUFFER_CHAR ||
5338 +            base[size-1] != YY_END_OF_BUFFER_CHAR )
5339 +               /* They forgot to leave room for the EOB's. */
5340 +               return 0;
5341 +
5342 +       b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state )  );
5343 +       if ( ! b )
5344 +               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
5345 +
5346 +       b->yy_buf_size = size - 2;      /* "- 2" to take care of EOB's */
5347 +       b->yy_buf_pos = b->yy_ch_buf = base;
5348 +       b->yy_is_our_buffer = 0;
5349 +       b->yy_input_file = 0;
5350 +       b->yy_n_chars = b->yy_buf_size;
5351 +       b->yy_is_interactive = 0;
5352 +       b->yy_at_bol = 1;
5353 +       b->yy_fill_buffer = 0;
5354 +       b->yy_buffer_status = YY_BUFFER_NEW;
5355 +
5356 +       yy_switch_to_buffer(b  );
5357 +
5358 +       return b;
5359 +}
5360 +
5361 +/** Setup the input buffer state to scan a string. The next call to yylex() will
5362 + * scan from a @e copy of @a str.
5363 + * @param yystr a NUL-terminated string to scan
5364 + * 
5365 + * @return the newly allocated buffer state object.
5366 + * @note If you want to scan bytes that may contain NUL values, then use
5367 + *       yy_scan_bytes() instead.
5368 + */
5369 +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
5370 +{
5371 +    
5372 +       return yy_scan_bytes(yystr,strlen(yystr) );
5373 +}
5374 +
5375 +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
5376 + * scan from a @e copy of @a bytes.
5377 + * @param bytes the byte buffer to scan
5378 + * @param len the number of bytes in the buffer pointed to by @a bytes.
5379 + * 
5380 + * @return the newly allocated buffer state object.
5381 + */
5382 +YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len )
5383 +{
5384 +       YY_BUFFER_STATE b;
5385 +       char *buf;
5386 +       yy_size_t n;
5387 +       int i;
5388 +    
5389 +       /* Get memory for full buffer, including space for trailing EOB's. */
5390 +       n = _yybytes_len + 2;
5391 +       buf = (char *) yyalloc(n  );
5392 +       if ( ! buf )
5393 +               YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
5394 +
5395 +       for ( i = 0; i < _yybytes_len; ++i )
5396 +               buf[i] = yybytes[i];
5397 +
5398 +       buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
5399 +
5400 +       b = yy_scan_buffer(buf,n );
5401 +       if ( ! b )
5402 +               YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
5403 +
5404 +       /* It's okay to grow etc. this buffer, and we should throw it
5405 +        * away when we're done.
5406 +        */
5407 +       b->yy_is_our_buffer = 1;
5408 +
5409 +       return b;
5410 +}
5411 +
5412 +#ifndef YY_EXIT_FAILURE
5413 +#define YY_EXIT_FAILURE 2
5414 +#endif
5415 +
5416 +static void yy_fatal_error (yyconst char* msg )
5417 +{
5418 +       (void) fprintf( stderr, "%s\n", msg );
5419 +       exit( YY_EXIT_FAILURE );
5420 +}
5421 +
5422 +/* Redefine yyless() so it works in section 3 code. */
5423 +
5424 +#undef yyless
5425 +#define yyless(n) \
5426 +       do \
5427 +               { \
5428 +               /* Undo effects of setting up yytext. */ \
5429 +        int yyless_macro_arg = (n); \
5430 +        YY_LESS_LINENO(yyless_macro_arg);\
5431 +               yytext[yyleng] = (yy_hold_char); \
5432 +               (yy_c_buf_p) = yytext + yyless_macro_arg; \
5433 +               (yy_hold_char) = *(yy_c_buf_p); \
5434 +               *(yy_c_buf_p) = '\0'; \
5435 +               yyleng = yyless_macro_arg; \
5436 +               } \
5437 +       while ( 0 )
5438 +
5439 +/* Accessor  methods (get/set functions) to struct members. */
5440 +
5441 +/** Get the current line number.
5442 + * 
5443 + */
5444 +int yyget_lineno  (void)
5445 +{
5446 +        
5447 +    return yylineno;
5448 +}
5449 +
5450 +/** Get the input stream.
5451 + * 
5452 + */
5453 +FILE *yyget_in  (void)
5454 +{
5455 +        return yyin;
5456 +}
5457 +
5458 +/** Get the output stream.
5459 + * 
5460 + */
5461 +FILE *yyget_out  (void)
5462 +{
5463 +        return yyout;
5464 +}
5465 +
5466 +/** Get the length of the current token.
5467 + * 
5468 + */
5469 +int yyget_leng  (void)
5470 +{
5471 +        return yyleng;
5472 +}
5473 +
5474 +/** Get the current token.
5475 + * 
5476 + */
5477 +
5478 +char *yyget_text  (void)
5479 +{
5480 +        return yytext;
5481 +}
5482 +
5483 +/** Set the current line number.
5484 + * @param line_number
5485 + * 
5486 + */
5487 +void yyset_lineno (int  line_number )
5488 +{
5489 +    
5490 +    yylineno = line_number;
5491 +}
5492 +
5493 +/** Set the input stream. This does not discard the current
5494 + * input buffer.
5495 + * @param in_str A readable stream.
5496 + * 
5497 + * @see yy_switch_to_buffer
5498 + */
5499 +void yyset_in (FILE *  in_str )
5500 +{
5501 +        yyin = in_str ;
5502 +}
5503 +
5504 +void yyset_out (FILE *  out_str )
5505 +{
5506 +        yyout = out_str ;
5507 +}
5508 +
5509 +int yyget_debug  (void)
5510 +{
5511 +        return yy_flex_debug;
5512 +}
5513 +
5514 +void yyset_debug (int  bdebug )
5515 +{
5516 +        yy_flex_debug = bdebug ;
5517 +}
5518 +
5519 +static int yy_init_globals (void)
5520 +{
5521 +        /* Initialization is the same as for the non-reentrant scanner.
5522 +     * This function is called from yylex_destroy(), so don't allocate here.
5523 +     */
5524 +
5525 +    /* We do not touch yylineno unless the option is enabled. */
5526 +    yylineno =  1;
5527 +    
5528 +    (yy_buffer_stack) = 0;
5529 +    (yy_buffer_stack_top) = 0;
5530 +    (yy_buffer_stack_max) = 0;
5531 +    (yy_c_buf_p) = (char *) 0;
5532 +    (yy_init) = 0;
5533 +    (yy_start) = 0;
5534 +
5535 +/* Defined in main.c */
5536 +#ifdef YY_STDINIT
5537 +    yyin = stdin;
5538 +    yyout = stdout;
5539 +#else
5540 +    yyin = (FILE *) 0;
5541 +    yyout = (FILE *) 0;
5542 +#endif
5543 +
5544 +    /* For future reference: Set errno on error, since we are called by
5545 +     * yylex_init()
5546 +     */
5547 +    return 0;
5548 +}
5549 +
5550 +/* yylex_destroy is for both reentrant and non-reentrant scanners. */
5551 +int yylex_destroy  (void)
5552 +{
5553 +    
5554 +    /* Pop the buffer stack, destroying each element. */
5555 +       while(YY_CURRENT_BUFFER){
5556 +               yy_delete_buffer(YY_CURRENT_BUFFER  );
5557 +               YY_CURRENT_BUFFER_LVALUE = NULL;
5558 +               yypop_buffer_state();
5559 +       }
5560 +
5561 +       /* Destroy the stack itself. */
5562 +       yyfree((yy_buffer_stack) );
5563 +       (yy_buffer_stack) = NULL;
5564 +
5565 +    /* Reset the globals. This is important in a non-reentrant scanner so the next time
5566 +     * yylex() is called, initialization will occur. */
5567 +    yy_init_globals( );
5568 +
5569 +    return 0;
5570 +}
5571 +
5572 +/*
5573 + * Internal utility routines.
5574 + */
5575 +
5576 +#ifndef yytext_ptr
5577 +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
5578 +{
5579 +       register int i;
5580 +       for ( i = 0; i < n; ++i )
5581 +               s1[i] = s2[i];
5582 +}
5583 +#endif
5584 +
5585 +#ifdef YY_NEED_STRLEN
5586 +static int yy_flex_strlen (yyconst char * s )
5587 +{
5588 +       register int n;
5589 +       for ( n = 0; s[n]; ++n )
5590 +               ;
5591 +
5592 +       return n;
5593 +}
5594 +#endif
5595 +
5596 +void *yyalloc (yy_size_t  size )
5597 +{
5598 +       return (void *) malloc( size );
5599 +}
5600 +
5601 +void *yyrealloc  (void * ptr, yy_size_t  size )
5602 +{
5603 +       /* The cast to (char *) in the following accommodates both
5604 +        * implementations that use char* generic pointers, and those
5605 +        * that use void* generic pointers.  It works with the latter
5606 +        * because both ANSI C and C++ allow castless assignment from
5607 +        * any pointer type to void*, and deal with argument conversions
5608 +        * as though doing an assignment.
5609 +        */
5610 +       return (void *) realloc( (char *) ptr, size );
5611 +}
5612 +
5613 +void yyfree (void * ptr )
5614 +{
5615 +       free( (char *) ptr );   /* see yyrealloc() for (char *) cast */
5616 +}
5617 +
5618 +#define YYTABLES_NAME "yytables"
5619 +
5620 +#line 222 "dtc-lexer.l"
5621 +
5622 +
5623 +
5624 +
5625 +/*
5626 + * Stack of nested include file contexts.
5627 + */
5628 +
5629 +struct incl_file {
5630 +       int filenum;
5631 +       FILE *file;
5632 +       YY_BUFFER_STATE yy_prev_buf;
5633 +       int yy_prev_lineno;
5634 +       struct incl_file *prev;
5635 +};
5636 +
5637 +struct incl_file *incl_file_stack;
5638 +
5639 +
5640 +/*
5641 + * Detect infinite include recursion.
5642 + */
5643 +#define MAX_INCLUDE_DEPTH      (100)
5644 +
5645 +static int incl_depth = 0;
5646 +
5647 +
5648 +int push_input_file(const char *filename)
5649 +{
5650 +       FILE *f;
5651 +       struct incl_file *incl_file;
5652 +
5653 +       if (!filename) {
5654 +               yyerror("No include file name given.");
5655 +               return 0;
5656 +       }
5657 +
5658 +       if (incl_depth++ >= MAX_INCLUDE_DEPTH) {
5659 +               yyerror("Includes nested too deeply");
5660 +               return 0;
5661 +       }
5662 +
5663 +       f = dtc_open_file(filename);
5664 +
5665 +       incl_file = malloc(sizeof(struct incl_file));
5666 +       if (!incl_file) {
5667 +               yyerror("Can not allocate include file space.");
5668 +               return 0;
5669 +       }
5670 +
5671 +       /*
5672 +        * Save current context.
5673 +        */
5674 +       incl_file->yy_prev_buf = YY_CURRENT_BUFFER;
5675 +       incl_file->yy_prev_lineno = yylineno;
5676 +       incl_file->filenum = srcpos_filenum;
5677 +       incl_file->file = yyin;
5678 +       incl_file->prev = incl_file_stack;
5679 +
5680 +       incl_file_stack = incl_file;
5681 +
5682 +       /*
5683 +        * Establish new context.
5684 +        */
5685 +       srcpos_filenum = lookup_file_name(filename, 0);
5686 +       yylineno = 1;
5687 +       yyin = f;
5688 +       yy_switch_to_buffer(yy_create_buffer(yyin,YY_BUF_SIZE));
5689 +
5690 +       return 1;
5691 +}
5692 +
5693 +
5694 +int pop_input_file(void)
5695 +{
5696 +       struct incl_file *incl_file;
5697 +
5698 +       if (incl_file_stack == 0)
5699 +               return 0;
5700 +
5701 +       fclose(yyin);
5702 +
5703 +       /*
5704 +        * Pop.
5705 +        */
5706 +       --incl_depth;
5707 +       incl_file = incl_file_stack;
5708 +       incl_file_stack = incl_file->prev;
5709 +
5710 +       /*
5711 +        * Recover old context.
5712 +        */
5713 +       yy_delete_buffer(YY_CURRENT_BUFFER);
5714 +       yy_switch_to_buffer(incl_file->yy_prev_buf);
5715 +       yylineno = incl_file->yy_prev_lineno;
5716 +       srcpos_filenum = incl_file->filenum;
5717 +       yyin = incl_file->file;
5718 +
5719 +       /*
5720 +        * Free old state.
5721 +        */
5722 +       free(incl_file);
5723 +
5724 +       if (YY_CURRENT_BUFFER == 0)
5725 +               return 0;
5726 +
5727 +       return 1;
5728 +}
5729 +
5730 --- /dev/null
5731 +++ b/arch/powerpc/boot/dtc-src/dtc-parser.tab.c_shipped
5732 @@ -0,0 +1,1983 @@
5733 +/* A Bison parser, made by GNU Bison 2.3.  */
5734 +
5735 +/* Skeleton implementation for Bison's Yacc-like parsers in C
5736 +
5737 +   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
5738 +   Free Software Foundation, Inc.
5739 +
5740 +   This program is free software; you can redistribute it and/or modify
5741 +   it under the terms of the GNU General Public License as published by
5742 +   the Free Software Foundation; either version 2, or (at your option)
5743 +   any later version.
5744 +
5745 +   This program is distributed in the hope that it will be useful,
5746 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
5747 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
5748 +   GNU General Public License for more details.
5749 +
5750 +   You should have received a copy of the GNU General Public License
5751 +   along with this program; if not, write to the Free Software
5752 +   Foundation, Inc., 51 Franklin Street, Fifth Floor,
5753 +   Boston, MA 02110-1301, USA.  */
5754 +
5755 +/* As a special exception, you may create a larger work that contains
5756 +   part or all of the Bison parser skeleton and distribute that work
5757 +   under terms of your choice, so long as that work isn't itself a
5758 +   parser generator using the skeleton or a modified version thereof
5759 +   as a parser skeleton.  Alternatively, if you modify or redistribute
5760 +   the parser skeleton itself, you may (at your option) remove this
5761 +   special exception, which will cause the skeleton and the resulting
5762 +   Bison output files to be licensed under the GNU General Public
5763 +   License without this special exception.
5764 +
5765 +   This special exception was added by the Free Software Foundation in
5766 +   version 2.2 of Bison.  */
5767 +
5768 +/* C LALR(1) parser skeleton written by Richard Stallman, by
5769 +   simplifying the original so-called "semantic" parser.  */
5770 +
5771 +/* All symbols defined below should begin with yy or YY, to avoid
5772 +   infringing on user name space.  This should be done even for local
5773 +   variables, as they might otherwise be expanded by user macros.
5774 +   There are some unavoidable exceptions within include files to
5775 +   define necessary library symbols; they are noted "INFRINGES ON
5776 +   USER NAME SPACE" below.  */
5777 +
5778 +/* Identify Bison output.  */
5779 +#define YYBISON 1
5780 +
5781 +/* Bison version.  */
5782 +#define YYBISON_VERSION "2.3"
5783 +
5784 +/* Skeleton name.  */
5785 +#define YYSKELETON_NAME "yacc.c"
5786 +
5787 +/* Pure parsers.  */
5788 +#define YYPURE 0
5789 +
5790 +/* Using locations.  */
5791 +#define YYLSP_NEEDED 1
5792 +
5793 +
5794 +
5795 +/* Tokens.  */
5796 +#ifndef YYTOKENTYPE
5797 +# define YYTOKENTYPE
5798 +   /* Put the tokens into the symbol table, so that GDB and other debuggers
5799 +      know about them.  */
5800 +   enum yytokentype {
5801 +     DT_V1 = 258,
5802 +     DT_MEMRESERVE = 259,
5803 +     DT_PROPNODENAME = 260,
5804 +     DT_LITERAL = 261,
5805 +     DT_LEGACYLITERAL = 262,
5806 +     DT_BASE = 263,
5807 +     DT_BYTE = 264,
5808 +     DT_STRING = 265,
5809 +     DT_LABEL = 266,
5810 +     DT_REF = 267
5811 +   };
5812 +#endif
5813 +/* Tokens.  */
5814 +#define DT_V1 258
5815 +#define DT_MEMRESERVE 259
5816 +#define DT_PROPNODENAME 260
5817 +#define DT_LITERAL 261
5818 +#define DT_LEGACYLITERAL 262
5819 +#define DT_BASE 263
5820 +#define DT_BYTE 264
5821 +#define DT_STRING 265
5822 +#define DT_LABEL 266
5823 +#define DT_REF 267
5824 +
5825 +
5826 +
5827 +
5828 +/* Copy the first part of user declarations.  */
5829 +#line 23 "dtc-parser.y"
5830 +
5831 +#include "dtc.h"
5832 +#include "srcpos.h"
5833 +
5834 +int yylex(void);
5835 +unsigned long long eval_literal(const char *s, int base, int bits);
5836 +
5837 +extern struct boot_info *the_boot_info;
5838 +
5839 +
5840 +
5841 +/* Enabling traces.  */
5842 +#ifndef YYDEBUG
5843 +# define YYDEBUG 0
5844 +#endif
5845 +
5846 +/* Enabling verbose error messages.  */
5847 +#ifdef YYERROR_VERBOSE
5848 +# undef YYERROR_VERBOSE
5849 +# define YYERROR_VERBOSE 1
5850 +#else
5851 +# define YYERROR_VERBOSE 0
5852 +#endif
5853 +
5854 +/* Enabling the token table.  */
5855 +#ifndef YYTOKEN_TABLE
5856 +# define YYTOKEN_TABLE 0
5857 +#endif
5858 +
5859 +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
5860 +typedef union YYSTYPE
5861 +#line 34 "dtc-parser.y"
5862 +{
5863 +       char *propnodename;
5864 +       char *literal;
5865 +       char *labelref;
5866 +       unsigned int cbase;
5867 +       u8 byte;
5868 +       struct data data;
5869 +
5870 +       u64 addr;
5871 +       cell_t cell;
5872 +       struct property *prop;
5873 +       struct property *proplist;
5874 +       struct node *node;
5875 +       struct node *nodelist;
5876 +       struct reserve_info *re;
5877 +}
5878 +/* Line 187 of yacc.c.  */
5879 +#line 148 "dtc-parser.tab.c"
5880 +       YYSTYPE;
5881 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */
5882 +# define YYSTYPE_IS_DECLARED 1
5883 +# define YYSTYPE_IS_TRIVIAL 1
5884 +#endif
5885 +
5886 +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
5887 +typedef struct YYLTYPE
5888 +{
5889 +  int first_line;
5890 +  int first_column;
5891 +  int last_line;
5892 +  int last_column;
5893 +} YYLTYPE;
5894 +# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
5895 +# define YYLTYPE_IS_DECLARED 1
5896 +# define YYLTYPE_IS_TRIVIAL 1
5897 +#endif
5898 +
5899 +
5900 +/* Copy the second part of user declarations.  */
5901 +
5902 +
5903 +/* Line 216 of yacc.c.  */
5904 +#line 173 "dtc-parser.tab.c"
5905 +
5906 +#ifdef short
5907 +# undef short
5908 +#endif
5909 +
5910 +#ifdef YYTYPE_UINT8
5911 +typedef YYTYPE_UINT8 yytype_uint8;
5912 +#else
5913 +typedef unsigned char yytype_uint8;
5914 +#endif
5915 +
5916 +#ifdef YYTYPE_INT8
5917 +typedef YYTYPE_INT8 yytype_int8;
5918 +#elif (defined __STDC__ || defined __C99__FUNC__ \
5919 +     || defined __cplusplus || defined _MSC_VER)
5920 +typedef signed char yytype_int8;
5921 +#else
5922 +typedef short int yytype_int8;
5923 +#endif
5924 +
5925 +#ifdef YYTYPE_UINT16
5926 +typedef YYTYPE_UINT16 yytype_uint16;
5927 +#else
5928 +typedef unsigned short int yytype_uint16;
5929 +#endif
5930 +
5931 +#ifdef YYTYPE_INT16
5932 +typedef YYTYPE_INT16 yytype_int16;
5933 +#else
5934 +typedef short int yytype_int16;
5935 +#endif
5936 +
5937 +#ifndef YYSIZE_T
5938 +# ifdef __SIZE_TYPE__
5939 +#  define YYSIZE_T __SIZE_TYPE__
5940 +# elif defined size_t
5941 +#  define YYSIZE_T size_t
5942 +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
5943 +     || defined __cplusplus || defined _MSC_VER)
5944 +#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
5945 +#  define YYSIZE_T size_t
5946 +# else
5947 +#  define YYSIZE_T unsigned int
5948 +# endif
5949 +#endif
5950 +
5951 +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
5952 +
5953 +#ifndef YY_
5954 +# if YYENABLE_NLS
5955 +#  if ENABLE_NLS
5956 +#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
5957 +#   define YY_(msgid) dgettext ("bison-runtime", msgid)
5958 +#  endif
5959 +# endif
5960 +# ifndef YY_
5961 +#  define YY_(msgid) msgid
5962 +# endif
5963 +#endif
5964 +
5965 +/* Suppress unused-variable warnings by "using" E.  */
5966 +#if ! defined lint || defined __GNUC__
5967 +# define YYUSE(e) ((void) (e))
5968 +#else
5969 +# define YYUSE(e) /* empty */
5970 +#endif
5971 +
5972 +/* Identity function, used to suppress warnings about constant conditions.  */
5973 +#ifndef lint
5974 +# define YYID(n) (n)
5975 +#else
5976 +#if (defined __STDC__ || defined __C99__FUNC__ \
5977 +     || defined __cplusplus || defined _MSC_VER)
5978 +static int
5979 +YYID (int i)
5980 +#else
5981 +static int
5982 +YYID (i)
5983 +    int i;
5984 +#endif
5985 +{
5986 +  return i;
5987 +}
5988 +#endif
5989 +
5990 +#if ! defined yyoverflow || YYERROR_VERBOSE
5991 +
5992 +/* The parser invokes alloca or malloc; define the necessary symbols.  */
5993 +
5994 +# ifdef YYSTACK_USE_ALLOCA
5995 +#  if YYSTACK_USE_ALLOCA
5996 +#   ifdef __GNUC__
5997 +#    define YYSTACK_ALLOC __builtin_alloca
5998 +#   elif defined __BUILTIN_VA_ARG_INCR
5999 +#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
6000 +#   elif defined _AIX
6001 +#    define YYSTACK_ALLOC __alloca
6002 +#   elif defined _MSC_VER
6003 +#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
6004 +#    define alloca _alloca
6005 +#   else
6006 +#    define YYSTACK_ALLOC alloca
6007 +#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
6008 +     || defined __cplusplus || defined _MSC_VER)
6009 +#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
6010 +#     ifndef _STDLIB_H
6011 +#      define _STDLIB_H 1
6012 +#     endif
6013 +#    endif
6014 +#   endif
6015 +#  endif
6016 +# endif
6017 +
6018 +# ifdef YYSTACK_ALLOC
6019 +   /* Pacify GCC's `empty if-body' warning.  */
6020 +#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
6021 +#  ifndef YYSTACK_ALLOC_MAXIMUM
6022 +    /* The OS might guarantee only one guard page at the bottom of the stack,
6023 +       and a page size can be as small as 4096 bytes.  So we cannot safely
6024 +       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
6025 +       to allow for a few compiler-allocated temporary stack slots.  */
6026 +#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
6027 +#  endif
6028 +# else
6029 +#  define YYSTACK_ALLOC YYMALLOC
6030 +#  define YYSTACK_FREE YYFREE
6031 +#  ifndef YYSTACK_ALLOC_MAXIMUM
6032 +#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
6033 +#  endif
6034 +#  if (defined __cplusplus && ! defined _STDLIB_H \
6035 +       && ! ((defined YYMALLOC || defined malloc) \
6036 +            && (defined YYFREE || defined free)))
6037 +#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
6038 +#   ifndef _STDLIB_H
6039 +#    define _STDLIB_H 1
6040 +#   endif
6041 +#  endif
6042 +#  ifndef YYMALLOC
6043 +#   define YYMALLOC malloc
6044 +#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
6045 +     || defined __cplusplus || defined _MSC_VER)
6046 +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
6047 +#   endif
6048 +#  endif
6049 +#  ifndef YYFREE
6050 +#   define YYFREE free
6051 +#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
6052 +     || defined __cplusplus || defined _MSC_VER)
6053 +void free (void *); /* INFRINGES ON USER NAME SPACE */
6054 +#   endif
6055 +#  endif
6056 +# endif
6057 +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
6058 +
6059 +
6060 +#if (! defined yyoverflow \
6061 +     && (! defined __cplusplus \
6062 +        || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
6063 +            && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
6064 +
6065 +/* A type that is properly aligned for any stack member.  */
6066 +union yyalloc
6067 +{
6068 +  yytype_int16 yyss;
6069 +  YYSTYPE yyvs;
6070 +    YYLTYPE yyls;
6071 +};
6072 +
6073 +/* The size of the maximum gap between one aligned stack and the next.  */
6074 +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
6075 +
6076 +/* The size of an array large to enough to hold all stacks, each with
6077 +   N elements.  */
6078 +# define YYSTACK_BYTES(N) \
6079 +     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
6080 +      + 2 * YYSTACK_GAP_MAXIMUM)
6081 +
6082 +/* Copy COUNT objects from FROM to TO.  The source and destination do
6083 +   not overlap.  */
6084 +# ifndef YYCOPY
6085 +#  if defined __GNUC__ && 1 < __GNUC__
6086 +#   define YYCOPY(To, From, Count) \
6087 +      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
6088 +#  else
6089 +#   define YYCOPY(To, From, Count)             \
6090 +      do                                       \
6091 +       {                                       \
6092 +         YYSIZE_T yyi;                         \
6093 +         for (yyi = 0; yyi < (Count); yyi++)   \
6094 +           (To)[yyi] = (From)[yyi];            \
6095 +       }                                       \
6096 +      while (YYID (0))
6097 +#  endif
6098 +# endif
6099 +
6100 +/* Relocate STACK from its old location to the new one.  The
6101 +   local variables YYSIZE and YYSTACKSIZE give the old and new number of
6102 +   elements in the stack, and YYPTR gives the new location of the
6103 +   stack.  Advance YYPTR to a properly aligned location for the next
6104 +   stack.  */
6105 +# define YYSTACK_RELOCATE(Stack)                                       \
6106 +    do                                                                 \
6107 +      {                                                                        \
6108 +       YYSIZE_T yynewbytes;                                            \
6109 +       YYCOPY (&yyptr->Stack, Stack, yysize);                          \
6110 +       Stack = &yyptr->Stack;                                          \
6111 +       yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
6112 +       yyptr += yynewbytes / sizeof (*yyptr);                          \
6113 +      }                                                                        \
6114 +    while (YYID (0))
6115 +
6116 +#endif
6117 +
6118 +/* YYFINAL -- State number of the termination state.  */
6119 +#define YYFINAL  9
6120 +/* YYLAST -- Last index in YYTABLE.  */
6121 +#define YYLAST   60
6122 +
6123 +/* YYNTOKENS -- Number of terminals.  */
6124 +#define YYNTOKENS  24
6125 +/* YYNNTS -- Number of nonterminals.  */
6126 +#define YYNNTS  20
6127 +/* YYNRULES -- Number of rules.  */
6128 +#define YYNRULES  43
6129 +/* YYNRULES -- Number of states.  */
6130 +#define YYNSTATES  67
6131 +
6132 +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
6133 +#define YYUNDEFTOK  2
6134 +#define YYMAXUTOK   267
6135 +
6136 +#define YYTRANSLATE(YYX)                                               \
6137 +  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
6138 +
6139 +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
6140 +static const yytype_uint8 yytranslate[] =
6141 +{
6142 +       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6143 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6144 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6145 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6146 +       2,     2,     2,     2,    23,    14,     2,    15,     2,     2,
6147 +       2,     2,     2,     2,     2,     2,     2,     2,     2,    13,
6148 +      19,    18,    20,     2,     2,     2,     2,     2,     2,     2,
6149 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6150 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6151 +       2,    21,     2,    22,     2,     2,     2,     2,     2,     2,
6152 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6153 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6154 +       2,     2,     2,    16,     2,    17,     2,     2,     2,     2,
6155 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6156 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6157 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6158 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6159 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6160 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6161 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6162 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6163 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6164 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6165 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6166 +       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
6167 +       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
6168 +       5,     6,     7,     8,     9,    10,    11,    12
6169 +};
6170 +
6171 +#if YYDEBUG
6172 +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
6173 +   YYRHS.  */
6174 +static const yytype_uint8 yyprhs[] =
6175 +{
6176 +       0,     0,     3,     8,    11,    12,    15,    21,    22,    25,
6177 +      27,    34,    36,    38,    41,    47,    48,    51,    57,    61,
6178 +      64,    69,    74,    77,    80,    81,    84,    87,    88,    91,
6179 +      94,    97,    98,   100,   102,   105,   106,   109,   112,   113,
6180 +     116,   119,   123,   124
6181 +};
6182 +
6183 +/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
6184 +static const yytype_int8 yyrhs[] =
6185 +{
6186 +      25,     0,    -1,     3,    13,    26,    31,    -1,    28,    31,
6187 +      -1,    -1,    27,    26,    -1,    43,     4,    30,    30,    13,
6188 +      -1,    -1,    29,    28,    -1,    27,    -1,    43,     4,    30,
6189 +      14,    30,    13,    -1,     6,    -1,     7,    -1,    15,    32,
6190 +      -1,    16,    33,    41,    17,    13,    -1,    -1,    33,    34,
6191 +      -1,    43,     5,    18,    35,    13,    -1,    43,     5,    13,
6192 +      -1,    36,    10,    -1,    36,    19,    37,    20,    -1,    36,
6193 +      21,    40,    22,    -1,    36,    12,    -1,    35,    11,    -1,
6194 +      -1,    35,    23,    -1,    36,    11,    -1,    -1,    37,    39,
6195 +      -1,    37,    12,    -1,    37,    11,    -1,    -1,     8,    -1,
6196 +       6,    -1,    38,     7,    -1,    -1,    40,     9,    -1,    40,
6197 +      11,    -1,    -1,    42,    41,    -1,    42,    34,    -1,    43,
6198 +       5,    32,    -1,    -1,    11,    -1
6199 +};
6200 +
6201 +/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
6202 +static const yytype_uint16 yyrline[] =
6203 +{
6204 +       0,    85,    85,    89,    97,   100,   107,   115,   118,   125,
6205 +     129,   136,   140,   147,   154,   162,   165,   172,   176,   183,
6206 +     187,   191,   195,   199,   207,   210,   214,   222,   225,   229,
6207 +     234,   242,   245,   249,   253,   261,   264,   268,   276,   279,
6208 +     283,   291,   299,   302
6209 +};
6210 +#endif
6211 +
6212 +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
6213 +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
6214 +   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
6215 +static const char *const yytname[] =
6216 +{
6217 +  "$end", "error", "$undefined", "DT_V1", "DT_MEMRESERVE",
6218 +  "DT_PROPNODENAME", "DT_LITERAL", "DT_LEGACYLITERAL", "DT_BASE",
6219 +  "DT_BYTE", "DT_STRING", "DT_LABEL", "DT_REF", "';'", "'-'", "'/'", "'{'",
6220 +  "'}'", "'='", "'<'", "'>'", "'['", "']'", "','", "$accept", "sourcefile",
6221 +  "memreserves", "memreserve", "v0_memreserves", "v0_memreserve", "addr",
6222 +  "devicetree", "nodedef", "proplist", "propdef", "propdata",
6223 +  "propdataprefix", "celllist", "cellbase", "cellval", "bytestring",
6224 +  "subnodes", "subnode", "label", 0
6225 +};
6226 +#endif
6227 +
6228 +# ifdef YYPRINT
6229 +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
6230 +   token YYLEX-NUM.  */
6231 +static const yytype_uint16 yytoknum[] =
6232 +{
6233 +       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
6234 +     265,   266,   267,    59,    45,    47,   123,   125,    61,    60,
6235 +      62,    91,    93,    44
6236 +};
6237 +# endif
6238 +
6239 +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
6240 +static const yytype_uint8 yyr1[] =
6241 +{
6242 +       0,    24,    25,    25,    26,    26,    27,    28,    28,    29,
6243 +      29,    30,    30,    31,    32,    33,    33,    34,    34,    35,
6244 +      35,    35,    35,    35,    36,    36,    36,    37,    37,    37,
6245 +      37,    38,    38,    39,    39,    40,    40,    40,    41,    41,
6246 +      41,    42,    43,    43
6247 +};
6248 +
6249 +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
6250 +static const yytype_uint8 yyr2[] =
6251 +{
6252 +       0,     2,     4,     2,     0,     2,     5,     0,     2,     1,
6253 +       6,     1,     1,     2,     5,     0,     2,     5,     3,     2,
6254 +       4,     4,     2,     2,     0,     2,     2,     0,     2,     2,
6255 +       2,     0,     1,     1,     2,     0,     2,     2,     0,     2,
6256 +       2,     3,     0,     1
6257 +};
6258 +
6259 +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
6260 +   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
6261 +   means the default is an error.  */
6262 +static const yytype_uint8 yydefact[] =
6263 +{
6264 +       7,     0,    43,     0,     9,     0,     7,     0,     4,     1,
6265 +       0,     3,     8,     0,     0,     4,     0,    15,    13,    11,
6266 +      12,     0,     2,     5,     0,    38,     0,     0,     0,    16,
6267 +       0,    38,     0,     0,     6,     0,    40,    39,     0,    10,
6268 +      14,    18,    24,    41,     0,     0,    23,    17,    25,    19,
6269 +      26,    22,    27,    35,    31,     0,    33,    32,    30,    29,
6270 +      20,     0,    28,    36,    37,    21,    34
6271 +};
6272 +
6273 +/* YYDEFGOTO[NTERM-NUM].  */
6274 +static const yytype_int8 yydefgoto[] =
6275 +{
6276 +      -1,     3,    14,     4,     5,     6,    27,    11,    18,    25,
6277 +      29,    44,    45,    54,    61,    62,    55,    30,    31,     7
6278 +};
6279 +
6280 +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
6281 +   STATE-NUM.  */
6282 +#define YYPACT_NINF -13
6283 +static const yytype_int8 yypact[] =
6284 +{
6285 +      23,    11,   -13,    37,   -13,    -4,    18,    39,    18,   -13,
6286 +      28,   -13,   -13,    34,    -4,    18,    41,   -13,   -13,   -13,
6287 +     -13,    25,   -13,   -13,    34,    -3,    34,    33,    34,   -13,
6288 +      30,    -3,    43,    36,   -13,    38,   -13,   -13,    20,   -13,
6289 +     -13,   -13,   -13,   -13,     2,     9,   -13,   -13,   -13,   -13,
6290 +     -13,   -13,   -13,   -13,    -2,    -6,   -13,   -13,   -13,   -13,
6291 +     -13,    45,   -13,   -13,   -13,   -13,   -13
6292 +};
6293 +
6294 +/* YYPGOTO[NTERM-NUM].  */
6295 +static const yytype_int8 yypgoto[] =
6296 +{
6297 +     -13,   -13,    35,    27,    47,   -13,   -12,    40,    17,   -13,
6298 +      26,   -13,   -13,   -13,   -13,   -13,   -13,    29,   -13,    -8
6299 +};
6300 +
6301 +/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
6302 +   positive, shift that token.  If negative, reduce the rule which
6303 +   number is the opposite.  If zero, do what YYDEFACT says.
6304 +   If YYTABLE_NINF, syntax error.  */
6305 +#define YYTABLE_NINF -43
6306 +static const yytype_int8 yytable[] =
6307 +{
6308 +      16,    21,   -42,    63,    56,    64,    57,    16,     2,    58,
6309 +      59,    10,    28,    46,    33,    47,    65,    32,    60,    49,
6310 +      50,    51,   -42,    32,     8,    48,     1,   -42,    52,     2,
6311 +      53,    19,    20,    41,     2,    15,    17,     9,    42,    26,
6312 +      19,    20,    15,    13,    17,    24,    34,    35,    38,    39,
6313 +      23,    40,    66,    12,    22,    43,     0,    36,     0,     0,
6314 +      37
6315 +};
6316 +
6317 +static const yytype_int8 yycheck[] =
6318 +{
6319 +       8,    13,     5,     9,     6,    11,     8,    15,    11,    11,
6320 +      12,    15,    24,    11,    26,    13,    22,    25,    20,    10,
6321 +      11,    12,     4,    31,    13,    23,     3,     4,    19,    11,
6322 +      21,     6,     7,    13,    11,     8,    16,     0,    18,    14,
6323 +       6,     7,    15,     4,    16,     4,    13,    17,     5,    13,
6324 +      15,    13,     7,     6,    14,    38,    -1,    31,    -1,    -1,
6325 +      31
6326 +};
6327 +
6328 +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
6329 +   symbol of state STATE-NUM.  */
6330 +static const yytype_uint8 yystos[] =
6331 +{
6332 +       0,     3,    11,    25,    27,    28,    29,    43,    13,     0,
6333 +      15,    31,    28,     4,    26,    27,    43,    16,    32,     6,
6334 +       7,    30,    31,    26,     4,    33,    14,    30,    30,    34,
6335 +      41,    42,    43,    30,    13,    17,    34,    41,     5,    13,
6336 +      13,    13,    18,    32,    35,    36,    11,    13,    23,    10,
6337 +      11,    12,    19,    21,    37,    40,     6,     8,    11,    12,
6338 +      20,    38,    39,     9,    11,    22,     7
6339 +};
6340 +
6341 +#define yyerrok                (yyerrstatus = 0)
6342 +#define yyclearin      (yychar = YYEMPTY)
6343 +#define YYEMPTY                (-2)
6344 +#define YYEOF          0
6345 +
6346 +#define YYACCEPT       goto yyacceptlab
6347 +#define YYABORT                goto yyabortlab
6348 +#define YYERROR                goto yyerrorlab
6349 +
6350 +
6351 +/* Like YYERROR except do call yyerror.  This remains here temporarily
6352 +   to ease the transition to the new meaning of YYERROR, for GCC.
6353 +   Once GCC version 2 has supplanted version 1, this can go.  */
6354 +
6355 +#define YYFAIL         goto yyerrlab
6356 +
6357 +#define YYRECOVERING()  (!!yyerrstatus)
6358 +
6359 +#define YYBACKUP(Token, Value)                                 \
6360 +do                                                             \
6361 +  if (yychar == YYEMPTY && yylen == 1)                         \
6362 +    {                                                          \
6363 +      yychar = (Token);                                                \
6364 +      yylval = (Value);                                                \
6365 +      yytoken = YYTRANSLATE (yychar);                          \
6366 +      YYPOPSTACK (1);                                          \
6367 +      goto yybackup;                                           \
6368 +    }                                                          \
6369 +  else                                                         \
6370 +    {                                                          \
6371 +      yyerror (YY_("syntax error: cannot back up")); \
6372 +      YYERROR;                                                 \
6373 +    }                                                          \
6374 +while (YYID (0))
6375 +
6376 +
6377 +#define YYTERROR       1
6378 +#define YYERRCODE      256
6379 +
6380 +
6381 +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
6382 +   If N is 0, then set CURRENT to the empty location which ends
6383 +   the previous symbol: RHS[0] (always defined).  */
6384 +
6385 +#define YYRHSLOC(Rhs, K) ((Rhs)[K])
6386 +#ifndef YYLLOC_DEFAULT
6387 +# define YYLLOC_DEFAULT(Current, Rhs, N)                               \
6388 +    do                                                                 \
6389 +      if (YYID (N))                                                    \
6390 +       {                                                               \
6391 +         (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
6392 +         (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
6393 +         (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
6394 +         (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
6395 +       }                                                               \
6396 +      else                                                             \
6397 +       {                                                               \
6398 +         (Current).first_line   = (Current).last_line   =              \
6399 +           YYRHSLOC (Rhs, 0).last_line;                                \
6400 +         (Current).first_column = (Current).last_column =              \
6401 +           YYRHSLOC (Rhs, 0).last_column;                              \
6402 +       }                                                               \
6403 +    while (YYID (0))
6404 +#endif
6405 +
6406 +
6407 +/* YY_LOCATION_PRINT -- Print the location on the stream.
6408 +   This macro was not mandated originally: define only if we know
6409 +   we won't break user code: when these are the locations we know.  */
6410 +
6411 +#ifndef YY_LOCATION_PRINT
6412 +# if YYLTYPE_IS_TRIVIAL
6413 +#  define YY_LOCATION_PRINT(File, Loc)                 \
6414 +     fprintf (File, "%d.%d-%d.%d",                     \
6415 +             (Loc).first_line, (Loc).first_column,     \
6416 +             (Loc).last_line,  (Loc).last_column)
6417 +# else
6418 +#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
6419 +# endif
6420 +#endif
6421 +
6422 +
6423 +/* YYLEX -- calling `yylex' with the right arguments.  */
6424 +
6425 +#ifdef YYLEX_PARAM
6426 +# define YYLEX yylex (YYLEX_PARAM)
6427 +#else
6428 +# define YYLEX yylex ()
6429 +#endif
6430 +
6431 +/* Enable debugging if requested.  */
6432 +#if YYDEBUG
6433 +
6434 +# ifndef YYFPRINTF
6435 +#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
6436 +#  define YYFPRINTF fprintf
6437 +# endif
6438 +
6439 +# define YYDPRINTF(Args)                       \
6440 +do {                                           \
6441 +  if (yydebug)                                 \
6442 +    YYFPRINTF Args;                            \
6443 +} while (YYID (0))
6444 +
6445 +# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                   \
6446 +do {                                                                     \
6447 +  if (yydebug)                                                           \
6448 +    {                                                                    \
6449 +      YYFPRINTF (stderr, "%s ", Title);                                          \
6450 +      yy_symbol_print (stderr,                                           \
6451 +                 Type, Value, Location); \
6452 +      YYFPRINTF (stderr, "\n");                                                  \
6453 +    }                                                                    \
6454 +} while (YYID (0))
6455 +
6456 +
6457 +/*--------------------------------.
6458 +| Print this symbol on YYOUTPUT.  |
6459 +`--------------------------------*/
6460 +
6461 +/*ARGSUSED*/
6462 +#if (defined __STDC__ || defined __C99__FUNC__ \
6463 +     || defined __cplusplus || defined _MSC_VER)
6464 +static void
6465 +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
6466 +#else
6467 +static void
6468 +yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
6469 +    FILE *yyoutput;
6470 +    int yytype;
6471 +    YYSTYPE const * const yyvaluep;
6472 +    YYLTYPE const * const yylocationp;
6473 +#endif
6474 +{
6475 +  if (!yyvaluep)
6476 +    return;
6477 +  YYUSE (yylocationp);
6478 +# ifdef YYPRINT
6479 +  if (yytype < YYNTOKENS)
6480 +    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
6481 +# else
6482 +  YYUSE (yyoutput);
6483 +# endif
6484 +  switch (yytype)
6485 +    {
6486 +      default:
6487 +       break;
6488 +    }
6489 +}
6490 +
6491 +
6492 +/*--------------------------------.
6493 +| Print this symbol on YYOUTPUT.  |
6494 +`--------------------------------*/
6495 +
6496 +#if (defined __STDC__ || defined __C99__FUNC__ \
6497 +     || defined __cplusplus || defined _MSC_VER)
6498 +static void
6499 +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp)
6500 +#else
6501 +static void
6502 +yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
6503 +    FILE *yyoutput;
6504 +    int yytype;
6505 +    YYSTYPE const * const yyvaluep;
6506 +    YYLTYPE const * const yylocationp;
6507 +#endif
6508 +{
6509 +  if (yytype < YYNTOKENS)
6510 +    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
6511 +  else
6512 +    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
6513 +
6514 +  YY_LOCATION_PRINT (yyoutput, *yylocationp);
6515 +  YYFPRINTF (yyoutput, ": ");
6516 +  yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
6517 +  YYFPRINTF (yyoutput, ")");
6518 +}
6519 +
6520 +/*------------------------------------------------------------------.
6521 +| yy_stack_print -- Print the state stack from its BOTTOM up to its |
6522 +| TOP (included).                                                   |
6523 +`------------------------------------------------------------------*/
6524 +
6525 +#if (defined __STDC__ || defined __C99__FUNC__ \
6526 +     || defined __cplusplus || defined _MSC_VER)
6527 +static void
6528 +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
6529 +#else
6530 +static void
6531 +yy_stack_print (bottom, top)
6532 +    yytype_int16 *bottom;
6533 +    yytype_int16 *top;
6534 +#endif
6535 +{
6536 +  YYFPRINTF (stderr, "Stack now");
6537 +  for (; bottom <= top; ++bottom)
6538 +    YYFPRINTF (stderr, " %d", *bottom);
6539 +  YYFPRINTF (stderr, "\n");
6540 +}
6541 +
6542 +# define YY_STACK_PRINT(Bottom, Top)                           \
6543 +do {                                                           \
6544 +  if (yydebug)                                                 \
6545 +    yy_stack_print ((Bottom), (Top));                          \
6546 +} while (YYID (0))
6547 +
6548 +
6549 +/*------------------------------------------------.
6550 +| Report that the YYRULE is going to be reduced.  |
6551 +`------------------------------------------------*/
6552 +
6553 +#if (defined __STDC__ || defined __C99__FUNC__ \
6554 +     || defined __cplusplus || defined _MSC_VER)
6555 +static void
6556 +yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
6557 +#else
6558 +static void
6559 +yy_reduce_print (yyvsp, yylsp, yyrule)
6560 +    YYSTYPE *yyvsp;
6561 +    YYLTYPE *yylsp;
6562 +    int yyrule;
6563 +#endif
6564 +{
6565 +  int yynrhs = yyr2[yyrule];
6566 +  int yyi;
6567 +  unsigned long int yylno = yyrline[yyrule];
6568 +  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
6569 +            yyrule - 1, yylno);
6570 +  /* The symbols being reduced.  */
6571 +  for (yyi = 0; yyi < yynrhs; yyi++)
6572 +    {
6573 +      fprintf (stderr, "   $%d = ", yyi + 1);
6574 +      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
6575 +                      &(yyvsp[(yyi + 1) - (yynrhs)])
6576 +                      , &(yylsp[(yyi + 1) - (yynrhs)])                );
6577 +      fprintf (stderr, "\n");
6578 +    }
6579 +}
6580 +
6581 +# define YY_REDUCE_PRINT(Rule)         \
6582 +do {                                   \
6583 +  if (yydebug)                         \
6584 +    yy_reduce_print (yyvsp, yylsp, Rule); \
6585 +} while (YYID (0))
6586 +
6587 +/* Nonzero means print parse trace.  It is left uninitialized so that
6588 +   multiple parsers can coexist.  */
6589 +int yydebug;
6590 +#else /* !YYDEBUG */
6591 +# define YYDPRINTF(Args)
6592 +# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
6593 +# define YY_STACK_PRINT(Bottom, Top)
6594 +# define YY_REDUCE_PRINT(Rule)
6595 +#endif /* !YYDEBUG */
6596 +
6597 +
6598 +/* YYINITDEPTH -- initial size of the parser's stacks.  */
6599 +#ifndef        YYINITDEPTH
6600 +# define YYINITDEPTH 200
6601 +#endif
6602 +
6603 +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
6604 +   if the built-in stack extension method is used).
6605 +
6606 +   Do not make this value too large; the results are undefined if
6607 +   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
6608 +   evaluated with infinite-precision integer arithmetic.  */
6609 +
6610 +#ifndef YYMAXDEPTH
6611 +# define YYMAXDEPTH 10000
6612 +#endif
6613 +
6614 +\f
6615 +
6616 +#if YYERROR_VERBOSE
6617 +
6618 +# ifndef yystrlen
6619 +#  if defined __GLIBC__ && defined _STRING_H
6620 +#   define yystrlen strlen
6621 +#  else
6622 +/* Return the length of YYSTR.  */
6623 +#if (defined __STDC__ || defined __C99__FUNC__ \
6624 +     || defined __cplusplus || defined _MSC_VER)
6625 +static YYSIZE_T
6626 +yystrlen (const char *yystr)
6627 +#else
6628 +static YYSIZE_T
6629 +yystrlen (yystr)
6630 +    const char *yystr;
6631 +#endif
6632 +{
6633 +  YYSIZE_T yylen;
6634 +  for (yylen = 0; yystr[yylen]; yylen++)
6635 +    continue;
6636 +  return yylen;
6637 +}
6638 +#  endif
6639 +# endif
6640 +
6641 +# ifndef yystpcpy
6642 +#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
6643 +#   define yystpcpy stpcpy
6644 +#  else
6645 +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
6646 +   YYDEST.  */
6647 +#if (defined __STDC__ || defined __C99__FUNC__ \
6648 +     || defined __cplusplus || defined _MSC_VER)
6649 +static char *
6650 +yystpcpy (char *yydest, const char *yysrc)
6651 +#else
6652 +static char *
6653 +yystpcpy (yydest, yysrc)
6654 +    char *yydest;
6655 +    const char *yysrc;
6656 +#endif
6657 +{
6658 +  char *yyd = yydest;
6659 +  const char *yys = yysrc;
6660 +
6661 +  while ((*yyd++ = *yys++) != '\0')
6662 +    continue;
6663 +
6664 +  return yyd - 1;
6665 +}
6666 +#  endif
6667 +# endif
6668 +
6669 +# ifndef yytnamerr
6670 +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
6671 +   quotes and backslashes, so that it's suitable for yyerror.  The
6672 +   heuristic is that double-quoting is unnecessary unless the string
6673 +   contains an apostrophe, a comma, or backslash (other than
6674 +   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
6675 +   null, do not copy; instead, return the length of what the result
6676 +   would have been.  */
6677 +static YYSIZE_T
6678 +yytnamerr (char *yyres, const char *yystr)
6679 +{
6680 +  if (*yystr == '"')
6681 +    {
6682 +      YYSIZE_T yyn = 0;
6683 +      char const *yyp = yystr;
6684 +
6685 +      for (;;)
6686 +       switch (*++yyp)
6687 +         {
6688 +         case '\'':
6689 +         case ',':
6690 +           goto do_not_strip_quotes;
6691 +
6692 +         case '\\':
6693 +           if (*++yyp != '\\')
6694 +             goto do_not_strip_quotes;
6695 +           /* Fall through.  */
6696 +         default:
6697 +           if (yyres)
6698 +             yyres[yyn] = *yyp;
6699 +           yyn++;
6700 +           break;
6701 +
6702 +         case '"':
6703 +           if (yyres)
6704 +             yyres[yyn] = '\0';
6705 +           return yyn;
6706 +         }
6707 +    do_not_strip_quotes: ;
6708 +    }
6709 +
6710 +  if (! yyres)
6711 +    return yystrlen (yystr);
6712 +
6713 +  return yystpcpy (yyres, yystr) - yyres;
6714 +}
6715 +# endif
6716 +
6717 +/* Copy into YYRESULT an error message about the unexpected token
6718 +   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
6719 +   including the terminating null byte.  If YYRESULT is null, do not
6720 +   copy anything; just return the number of bytes that would be
6721 +   copied.  As a special case, return 0 if an ordinary "syntax error"
6722 +   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
6723 +   size calculation.  */
6724 +static YYSIZE_T
6725 +yysyntax_error (char *yyresult, int yystate, int yychar)
6726 +{
6727 +  int yyn = yypact[yystate];
6728 +
6729 +  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
6730 +    return 0;
6731 +  else
6732 +    {
6733 +      int yytype = YYTRANSLATE (yychar);
6734 +      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
6735 +      YYSIZE_T yysize = yysize0;
6736 +      YYSIZE_T yysize1;
6737 +      int yysize_overflow = 0;
6738 +      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
6739 +      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
6740 +      int yyx;
6741 +
6742 +# if 0
6743 +      /* This is so xgettext sees the translatable formats that are
6744 +        constructed on the fly.  */
6745 +      YY_("syntax error, unexpected %s");
6746 +      YY_("syntax error, unexpected %s, expecting %s");
6747 +      YY_("syntax error, unexpected %s, expecting %s or %s");
6748 +      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
6749 +      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
6750 +# endif
6751 +      char *yyfmt;
6752 +      char const *yyf;
6753 +      static char const yyunexpected[] = "syntax error, unexpected %s";
6754 +      static char const yyexpecting[] = ", expecting %s";
6755 +      static char const yyor[] = " or %s";
6756 +      char yyformat[sizeof yyunexpected
6757 +                   + sizeof yyexpecting - 1
6758 +                   + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
6759 +                      * (sizeof yyor - 1))];
6760 +      char const *yyprefix = yyexpecting;
6761 +
6762 +      /* Start YYX at -YYN if negative to avoid negative indexes in
6763 +        YYCHECK.  */
6764 +      int yyxbegin = yyn < 0 ? -yyn : 0;
6765 +
6766 +      /* Stay within bounds of both yycheck and yytname.  */
6767 +      int yychecklim = YYLAST - yyn + 1;
6768 +      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
6769 +      int yycount = 1;
6770 +
6771 +      yyarg[0] = yytname[yytype];
6772 +      yyfmt = yystpcpy (yyformat, yyunexpected);
6773 +
6774 +      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
6775 +       if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
6776 +         {
6777 +           if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
6778 +             {
6779 +               yycount = 1;
6780 +               yysize = yysize0;
6781 +               yyformat[sizeof yyunexpected - 1] = '\0';
6782 +               break;
6783 +             }
6784 +           yyarg[yycount++] = yytname[yyx];
6785 +           yysize1 = yysize + yytnamerr (0, yytname[yyx]);
6786 +           yysize_overflow |= (yysize1 < yysize);
6787 +           yysize = yysize1;
6788 +           yyfmt = yystpcpy (yyfmt, yyprefix);
6789 +           yyprefix = yyor;
6790 +         }
6791 +
6792 +      yyf = YY_(yyformat);
6793 +      yysize1 = yysize + yystrlen (yyf);
6794 +      yysize_overflow |= (yysize1 < yysize);
6795 +      yysize = yysize1;
6796 +
6797 +      if (yysize_overflow)
6798 +       return YYSIZE_MAXIMUM;
6799 +
6800 +      if (yyresult)
6801 +       {
6802 +         /* Avoid sprintf, as that infringes on the user's name space.
6803 +            Don't have undefined behavior even if the translation
6804 +            produced a string with the wrong number of "%s"s.  */
6805 +         char *yyp = yyresult;
6806 +         int yyi = 0;
6807 +         while ((*yyp = *yyf) != '\0')
6808 +           {
6809 +             if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
6810 +               {
6811 +                 yyp += yytnamerr (yyp, yyarg[yyi++]);
6812 +                 yyf += 2;
6813 +               }
6814 +             else
6815 +               {
6816 +                 yyp++;
6817 +                 yyf++;
6818 +               }
6819 +           }
6820 +       }
6821 +      return yysize;
6822 +    }
6823 +}
6824 +#endif /* YYERROR_VERBOSE */
6825 +\f
6826 +
6827 +/*-----------------------------------------------.
6828 +| Release the memory associated to this symbol.  |
6829 +`-----------------------------------------------*/
6830 +
6831 +/*ARGSUSED*/
6832 +#if (defined __STDC__ || defined __C99__FUNC__ \
6833 +     || defined __cplusplus || defined _MSC_VER)
6834 +static void
6835 +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
6836 +#else
6837 +static void
6838 +yydestruct (yymsg, yytype, yyvaluep, yylocationp)
6839 +    const char *yymsg;
6840 +    int yytype;
6841 +    YYSTYPE *yyvaluep;
6842 +    YYLTYPE *yylocationp;
6843 +#endif
6844 +{
6845 +  YYUSE (yyvaluep);
6846 +  YYUSE (yylocationp);
6847 +
6848 +  if (!yymsg)
6849 +    yymsg = "Deleting";
6850 +  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
6851 +
6852 +  switch (yytype)
6853 +    {
6854 +
6855 +      default:
6856 +       break;
6857 +    }
6858 +}
6859 +\f
6860 +
6861 +/* Prevent warnings from -Wmissing-prototypes.  */
6862 +
6863 +#ifdef YYPARSE_PARAM
6864 +#if defined __STDC__ || defined __cplusplus
6865 +int yyparse (void *YYPARSE_PARAM);
6866 +#else
6867 +int yyparse ();
6868 +#endif
6869 +#else /* ! YYPARSE_PARAM */
6870 +#if defined __STDC__ || defined __cplusplus
6871 +int yyparse (void);
6872 +#else
6873 +int yyparse ();
6874 +#endif
6875 +#endif /* ! YYPARSE_PARAM */
6876 +
6877 +
6878 +
6879 +/* The look-ahead symbol.  */
6880 +int yychar;
6881 +
6882 +/* The semantic value of the look-ahead symbol.  */
6883 +YYSTYPE yylval;
6884 +
6885 +/* Number of syntax errors so far.  */
6886 +int yynerrs;
6887 +/* Location data for the look-ahead symbol.  */
6888 +YYLTYPE yylloc;
6889 +
6890 +
6891 +
6892 +/*----------.
6893 +| yyparse.  |
6894 +`----------*/
6895 +
6896 +#ifdef YYPARSE_PARAM
6897 +#if (defined __STDC__ || defined __C99__FUNC__ \
6898 +     || defined __cplusplus || defined _MSC_VER)
6899 +int
6900 +yyparse (void *YYPARSE_PARAM)
6901 +#else
6902 +int
6903 +yyparse (YYPARSE_PARAM)
6904 +    void *YYPARSE_PARAM;
6905 +#endif
6906 +#else /* ! YYPARSE_PARAM */
6907 +#if (defined __STDC__ || defined __C99__FUNC__ \
6908 +     || defined __cplusplus || defined _MSC_VER)
6909 +int
6910 +yyparse (void)
6911 +#else
6912 +int
6913 +yyparse ()
6914 +
6915 +#endif
6916 +#endif
6917 +{
6918 +  
6919 +  int yystate;
6920 +  int yyn;
6921 +  int yyresult;
6922 +  /* Number of tokens to shift before error messages enabled.  */
6923 +  int yyerrstatus;
6924 +  /* Look-ahead token as an internal (translated) token number.  */
6925 +  int yytoken = 0;
6926 +#if YYERROR_VERBOSE
6927 +  /* Buffer for error messages, and its allocated size.  */
6928 +  char yymsgbuf[128];
6929 +  char *yymsg = yymsgbuf;
6930 +  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
6931 +#endif
6932 +
6933 +  /* Three stacks and their tools:
6934 +     `yyss': related to states,
6935 +     `yyvs': related to semantic values,
6936 +     `yyls': related to locations.
6937 +
6938 +     Refer to the stacks thru separate pointers, to allow yyoverflow
6939 +     to reallocate them elsewhere.  */
6940 +
6941 +  /* The state stack.  */
6942 +  yytype_int16 yyssa[YYINITDEPTH];
6943 +  yytype_int16 *yyss = yyssa;
6944 +  yytype_int16 *yyssp;
6945 +
6946 +  /* The semantic value stack.  */
6947 +  YYSTYPE yyvsa[YYINITDEPTH];
6948 +  YYSTYPE *yyvs = yyvsa;
6949 +  YYSTYPE *yyvsp;
6950 +
6951 +  /* The location stack.  */
6952 +  YYLTYPE yylsa[YYINITDEPTH];
6953 +  YYLTYPE *yyls = yylsa;
6954 +  YYLTYPE *yylsp;
6955 +  /* The locations where the error started and ended.  */
6956 +  YYLTYPE yyerror_range[2];
6957 +
6958 +#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
6959 +
6960 +  YYSIZE_T yystacksize = YYINITDEPTH;
6961 +
6962 +  /* The variables used to return semantic value and location from the
6963 +     action routines.  */
6964 +  YYSTYPE yyval;
6965 +  YYLTYPE yyloc;
6966 +
6967 +  /* The number of symbols on the RHS of the reduced rule.
6968 +     Keep to zero when no symbol should be popped.  */
6969 +  int yylen = 0;
6970 +
6971 +  YYDPRINTF ((stderr, "Starting parse\n"));
6972 +
6973 +  yystate = 0;
6974 +  yyerrstatus = 0;
6975 +  yynerrs = 0;
6976 +  yychar = YYEMPTY;            /* Cause a token to be read.  */
6977 +
6978 +  /* Initialize stack pointers.
6979 +     Waste one element of value and location stack
6980 +     so that they stay on the same level as the state stack.
6981 +     The wasted elements are never initialized.  */
6982 +
6983 +  yyssp = yyss;
6984 +  yyvsp = yyvs;
6985 +  yylsp = yyls;
6986 +#if YYLTYPE_IS_TRIVIAL
6987 +  /* Initialize the default location before parsing starts.  */
6988 +  yylloc.first_line   = yylloc.last_line   = 1;
6989 +  yylloc.first_column = yylloc.last_column = 0;
6990 +#endif
6991 +
6992 +  goto yysetstate;
6993 +
6994 +/*------------------------------------------------------------.
6995 +| yynewstate -- Push a new state, which is found in yystate.  |
6996 +`------------------------------------------------------------*/
6997 + yynewstate:
6998 +  /* In all cases, when you get here, the value and location stacks
6999 +     have just been pushed.  So pushing a state here evens the stacks.  */
7000 +  yyssp++;
7001 +
7002 + yysetstate:
7003 +  *yyssp = yystate;
7004 +
7005 +  if (yyss + yystacksize - 1 <= yyssp)
7006 +    {
7007 +      /* Get the current used size of the three stacks, in elements.  */
7008 +      YYSIZE_T yysize = yyssp - yyss + 1;
7009 +
7010 +#ifdef yyoverflow
7011 +      {
7012 +       /* Give user a chance to reallocate the stack.  Use copies of
7013 +          these so that the &'s don't force the real ones into
7014 +          memory.  */
7015 +       YYSTYPE *yyvs1 = yyvs;
7016 +       yytype_int16 *yyss1 = yyss;
7017 +       YYLTYPE *yyls1 = yyls;
7018 +
7019 +       /* Each stack pointer address is followed by the size of the
7020 +          data in use in that stack, in bytes.  This used to be a
7021 +          conditional around just the two extra args, but that might
7022 +          be undefined if yyoverflow is a macro.  */
7023 +       yyoverflow (YY_("memory exhausted"),
7024 +                   &yyss1, yysize * sizeof (*yyssp),
7025 +                   &yyvs1, yysize * sizeof (*yyvsp),
7026 +                   &yyls1, yysize * sizeof (*yylsp),
7027 +                   &yystacksize);
7028 +       yyls = yyls1;
7029 +       yyss = yyss1;
7030 +       yyvs = yyvs1;
7031 +      }
7032 +#else /* no yyoverflow */
7033 +# ifndef YYSTACK_RELOCATE
7034 +      goto yyexhaustedlab;
7035 +# else
7036 +      /* Extend the stack our own way.  */
7037 +      if (YYMAXDEPTH <= yystacksize)
7038 +       goto yyexhaustedlab;
7039 +      yystacksize *= 2;
7040 +      if (YYMAXDEPTH < yystacksize)
7041 +       yystacksize = YYMAXDEPTH;
7042 +
7043 +      {
7044 +       yytype_int16 *yyss1 = yyss;
7045 +       union yyalloc *yyptr =
7046 +         (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
7047 +       if (! yyptr)
7048 +         goto yyexhaustedlab;
7049 +       YYSTACK_RELOCATE (yyss);
7050 +       YYSTACK_RELOCATE (yyvs);
7051 +       YYSTACK_RELOCATE (yyls);
7052 +#  undef YYSTACK_RELOCATE
7053 +       if (yyss1 != yyssa)
7054 +         YYSTACK_FREE (yyss1);
7055 +      }
7056 +# endif
7057 +#endif /* no yyoverflow */
7058 +
7059 +      yyssp = yyss + yysize - 1;
7060 +      yyvsp = yyvs + yysize - 1;
7061 +      yylsp = yyls + yysize - 1;
7062 +
7063 +      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
7064 +                 (unsigned long int) yystacksize));
7065 +
7066 +      if (yyss + yystacksize - 1 <= yyssp)
7067 +       YYABORT;
7068 +    }
7069 +
7070 +  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
7071 +
7072 +  goto yybackup;
7073 +
7074 +/*-----------.
7075 +| yybackup.  |
7076 +`-----------*/
7077 +yybackup:
7078 +
7079 +  /* Do appropriate processing given the current state.  Read a
7080 +     look-ahead token if we need one and don't already have one.  */
7081 +
7082 +  /* First try to decide what to do without reference to look-ahead token.  */
7083 +  yyn = yypact[yystate];
7084 +  if (yyn == YYPACT_NINF)
7085 +    goto yydefault;
7086 +
7087 +  /* Not known => get a look-ahead token if don't already have one.  */
7088 +
7089 +  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol.  */
7090 +  if (yychar == YYEMPTY)
7091 +    {
7092 +      YYDPRINTF ((stderr, "Reading a token: "));
7093 +      yychar = YYLEX;
7094 +    }
7095 +
7096 +  if (yychar <= YYEOF)
7097 +    {
7098 +      yychar = yytoken = YYEOF;
7099 +      YYDPRINTF ((stderr, "Now at end of input.\n"));
7100 +    }
7101 +  else
7102 +    {
7103 +      yytoken = YYTRANSLATE (yychar);
7104 +      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
7105 +    }
7106 +
7107 +  /* If the proper action on seeing token YYTOKEN is to reduce or to
7108 +     detect an error, take that action.  */
7109 +  yyn += yytoken;
7110 +  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
7111 +    goto yydefault;
7112 +  yyn = yytable[yyn];
7113 +  if (yyn <= 0)
7114 +    {
7115 +      if (yyn == 0 || yyn == YYTABLE_NINF)
7116 +       goto yyerrlab;
7117 +      yyn = -yyn;
7118 +      goto yyreduce;
7119 +    }
7120 +
7121 +  if (yyn == YYFINAL)
7122 +    YYACCEPT;
7123 +
7124 +  /* Count tokens shifted since error; after three, turn off error
7125 +     status.  */
7126 +  if (yyerrstatus)
7127 +    yyerrstatus--;
7128 +
7129 +  /* Shift the look-ahead token.  */
7130 +  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
7131 +
7132 +  /* Discard the shifted token unless it is eof.  */
7133 +  if (yychar != YYEOF)
7134 +    yychar = YYEMPTY;
7135 +
7136 +  yystate = yyn;
7137 +  *++yyvsp = yylval;
7138 +  *++yylsp = yylloc;
7139 +  goto yynewstate;
7140 +
7141 +
7142 +/*-----------------------------------------------------------.
7143 +| yydefault -- do the default action for the current state.  |
7144 +`-----------------------------------------------------------*/
7145 +yydefault:
7146 +  yyn = yydefact[yystate];
7147 +  if (yyn == 0)
7148 +    goto yyerrlab;
7149 +  goto yyreduce;
7150 +
7151 +
7152 +/*-----------------------------.
7153 +| yyreduce -- Do a reduction.  |
7154 +`-----------------------------*/
7155 +yyreduce:
7156 +  /* yyn is the number of a rule to reduce with.  */
7157 +  yylen = yyr2[yyn];
7158 +
7159 +  /* If YYLEN is nonzero, implement the default value of the action:
7160 +     `$$ = $1'.
7161 +
7162 +     Otherwise, the following line sets YYVAL to garbage.
7163 +     This behavior is undocumented and Bison
7164 +     users should not rely upon it.  Assigning to YYVAL
7165 +     unconditionally makes the parser a bit smaller, and it avoids a
7166 +     GCC warning that YYVAL may be used uninitialized.  */
7167 +  yyval = yyvsp[1-yylen];
7168 +
7169 +  /* Default location.  */
7170 +  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
7171 +  YY_REDUCE_PRINT (yyn);
7172 +  switch (yyn)
7173 +    {
7174 +        case 2:
7175 +#line 86 "dtc-parser.y"
7176 +    {
7177 +                       the_boot_info = build_boot_info((yyvsp[(3) - (4)].re), (yyvsp[(4) - (4)].node));
7178 +               ;}
7179 +    break;
7180 +
7181 +  case 3:
7182 +#line 90 "dtc-parser.y"
7183 +    {
7184 +                       the_boot_info = build_boot_info((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].node));
7185 +               ;}
7186 +    break;
7187 +
7188 +  case 4:
7189 +#line 97 "dtc-parser.y"
7190 +    {
7191 +                       (yyval.re) = NULL;
7192 +               ;}
7193 +    break;
7194 +
7195 +  case 5:
7196 +#line 101 "dtc-parser.y"
7197 +    {
7198 +                       (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
7199 +               ;}
7200 +    break;
7201 +
7202 +  case 6:
7203 +#line 108 "dtc-parser.y"
7204 +    {
7205 +                       (yyval.re) = build_reserve_entry((yyvsp[(3) - (5)].addr), (yyvsp[(4) - (5)].addr), (yyvsp[(1) - (5)].labelref));
7206 +               ;}
7207 +    break;
7208 +
7209 +  case 7:
7210 +#line 115 "dtc-parser.y"
7211 +    {
7212 +                       (yyval.re) = NULL;
7213 +               ;}
7214 +    break;
7215 +
7216 +  case 8:
7217 +#line 119 "dtc-parser.y"
7218 +    {
7219 +                       (yyval.re) = chain_reserve_entry((yyvsp[(1) - (2)].re), (yyvsp[(2) - (2)].re));
7220 +               ;}
7221 +    break;
7222 +
7223 +  case 9:
7224 +#line 126 "dtc-parser.y"
7225 +    {
7226 +                       (yyval.re) = (yyvsp[(1) - (1)].re);
7227 +               ;}
7228 +    break;
7229 +
7230 +  case 10:
7231 +#line 130 "dtc-parser.y"
7232 +    {
7233 +                       (yyval.re) = build_reserve_entry((yyvsp[(3) - (6)].addr), (yyvsp[(5) - (6)].addr) - (yyvsp[(3) - (6)].addr) + 1, (yyvsp[(1) - (6)].labelref));
7234 +               ;}
7235 +    break;
7236 +
7237 +  case 11:
7238 +#line 137 "dtc-parser.y"
7239 +    {
7240 +                       (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 0, 64);
7241 +               ;}
7242 +    break;
7243 +
7244 +  case 12:
7245 +#line 141 "dtc-parser.y"
7246 +    {
7247 +                       (yyval.addr) = eval_literal((yyvsp[(1) - (1)].literal), 16, 64);
7248 +               ;}
7249 +    break;
7250 +
7251 +  case 13:
7252 +#line 148 "dtc-parser.y"
7253 +    {
7254 +                       (yyval.node) = name_node((yyvsp[(2) - (2)].node), "", NULL);
7255 +               ;}
7256 +    break;
7257 +
7258 +  case 14:
7259 +#line 155 "dtc-parser.y"
7260 +    {
7261 +                       (yyval.node) = build_node((yyvsp[(2) - (5)].proplist), (yyvsp[(3) - (5)].nodelist));
7262 +               ;}
7263 +    break;
7264 +
7265 +  case 15:
7266 +#line 162 "dtc-parser.y"
7267 +    {
7268 +                       (yyval.proplist) = NULL;
7269 +               ;}
7270 +    break;
7271 +
7272 +  case 16:
7273 +#line 166 "dtc-parser.y"
7274 +    {
7275 +                       (yyval.proplist) = chain_property((yyvsp[(2) - (2)].prop), (yyvsp[(1) - (2)].proplist));
7276 +               ;}
7277 +    break;
7278 +
7279 +  case 17:
7280 +#line 173 "dtc-parser.y"
7281 +    {
7282 +                       (yyval.prop) = build_property((yyvsp[(2) - (5)].propnodename), (yyvsp[(4) - (5)].data), (yyvsp[(1) - (5)].labelref));
7283 +               ;}
7284 +    break;
7285 +
7286 +  case 18:
7287 +#line 177 "dtc-parser.y"
7288 +    {
7289 +                       (yyval.prop) = build_property((yyvsp[(2) - (3)].propnodename), empty_data, (yyvsp[(1) - (3)].labelref));
7290 +               ;}
7291 +    break;
7292 +
7293 +  case 19:
7294 +#line 184 "dtc-parser.y"
7295 +    {
7296 +                       (yyval.data) = data_merge((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].data));
7297 +               ;}
7298 +    break;
7299 +
7300 +  case 20:
7301 +#line 188 "dtc-parser.y"
7302 +    {
7303 +                       (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
7304 +               ;}
7305 +    break;
7306 +
7307 +  case 21:
7308 +#line 192 "dtc-parser.y"
7309 +    {
7310 +                       (yyval.data) = data_merge((yyvsp[(1) - (4)].data), (yyvsp[(3) - (4)].data));
7311 +               ;}
7312 +    break;
7313 +
7314 +  case 22:
7315 +#line 196 "dtc-parser.y"
7316 +    {
7317 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), REF_PATH, (yyvsp[(2) - (2)].labelref));
7318 +               ;}
7319 +    break;
7320 +
7321 +  case 23:
7322 +#line 200 "dtc-parser.y"
7323 +    {
7324 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
7325 +               ;}
7326 +    break;
7327 +
7328 +  case 24:
7329 +#line 207 "dtc-parser.y"
7330 +    {
7331 +                       (yyval.data) = empty_data;
7332 +               ;}
7333 +    break;
7334 +
7335 +  case 25:
7336 +#line 211 "dtc-parser.y"
7337 +    {
7338 +                       (yyval.data) = (yyvsp[(1) - (2)].data);
7339 +               ;}
7340 +    break;
7341 +
7342 +  case 26:
7343 +#line 215 "dtc-parser.y"
7344 +    {
7345 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
7346 +               ;}
7347 +    break;
7348 +
7349 +  case 27:
7350 +#line 222 "dtc-parser.y"
7351 +    {
7352 +                       (yyval.data) = empty_data;
7353 +               ;}
7354 +    break;
7355 +
7356 +  case 28:
7357 +#line 226 "dtc-parser.y"
7358 +    {
7359 +                       (yyval.data) = data_append_cell((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].cell));
7360 +               ;}
7361 +    break;
7362 +
7363 +  case 29:
7364 +#line 230 "dtc-parser.y"
7365 +    {
7366 +                       (yyval.data) = data_append_cell(data_add_marker((yyvsp[(1) - (2)].data), REF_PHANDLE,
7367 +                                                             (yyvsp[(2) - (2)].labelref)), -1);
7368 +               ;}
7369 +    break;
7370 +
7371 +  case 30:
7372 +#line 235 "dtc-parser.y"
7373 +    {
7374 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
7375 +               ;}
7376 +    break;
7377 +
7378 +  case 31:
7379 +#line 242 "dtc-parser.y"
7380 +    {
7381 +                       (yyval.cbase) = 16;
7382 +               ;}
7383 +    break;
7384 +
7385 +  case 33:
7386 +#line 250 "dtc-parser.y"
7387 +    {
7388 +                       (yyval.cell) = eval_literal((yyvsp[(1) - (1)].literal), 0, 32);
7389 +               ;}
7390 +    break;
7391 +
7392 +  case 34:
7393 +#line 254 "dtc-parser.y"
7394 +    {
7395 +                       (yyval.cell) = eval_literal((yyvsp[(2) - (2)].literal), (yyvsp[(1) - (2)].cbase), 32);
7396 +               ;}
7397 +    break;
7398 +
7399 +  case 35:
7400 +#line 261 "dtc-parser.y"
7401 +    {
7402 +                       (yyval.data) = empty_data;
7403 +               ;}
7404 +    break;
7405 +
7406 +  case 36:
7407 +#line 265 "dtc-parser.y"
7408 +    {
7409 +                       (yyval.data) = data_append_byte((yyvsp[(1) - (2)].data), (yyvsp[(2) - (2)].byte));
7410 +               ;}
7411 +    break;
7412 +
7413 +  case 37:
7414 +#line 269 "dtc-parser.y"
7415 +    {
7416 +                       (yyval.data) = data_add_marker((yyvsp[(1) - (2)].data), LABEL, (yyvsp[(2) - (2)].labelref));
7417 +               ;}
7418 +    break;
7419 +
7420 +  case 38:
7421 +#line 276 "dtc-parser.y"
7422 +    {
7423 +                       (yyval.nodelist) = NULL;
7424 +               ;}
7425 +    break;
7426 +
7427 +  case 39:
7428 +#line 280 "dtc-parser.y"
7429 +    {
7430 +                       (yyval.nodelist) = chain_node((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].nodelist));
7431 +               ;}
7432 +    break;
7433 +
7434 +  case 40:
7435 +#line 284 "dtc-parser.y"
7436 +    {
7437 +                       yyerror("syntax error: properties must precede subnodes\n");
7438 +                       YYERROR;
7439 +               ;}
7440 +    break;
7441 +
7442 +  case 41:
7443 +#line 292 "dtc-parser.y"
7444 +    {
7445 +                       (yyval.node) = name_node((yyvsp[(3) - (3)].node), (yyvsp[(2) - (3)].propnodename), (yyvsp[(1) - (3)].labelref));
7446 +               ;}
7447 +    break;
7448 +
7449 +  case 42:
7450 +#line 299 "dtc-parser.y"
7451 +    {
7452 +                       (yyval.labelref) = NULL;
7453 +               ;}
7454 +    break;
7455 +
7456 +  case 43:
7457 +#line 303 "dtc-parser.y"
7458 +    {
7459 +                       (yyval.labelref) = (yyvsp[(1) - (1)].labelref);
7460 +               ;}
7461 +    break;
7462 +
7463 +
7464 +/* Line 1267 of yacc.c.  */
7465 +#line 1734 "dtc-parser.tab.c"
7466 +      default: break;
7467 +    }
7468 +  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
7469 +
7470 +  YYPOPSTACK (yylen);
7471 +  yylen = 0;
7472 +  YY_STACK_PRINT (yyss, yyssp);
7473 +
7474 +  *++yyvsp = yyval;
7475 +  *++yylsp = yyloc;
7476 +
7477 +  /* Now `shift' the result of the reduction.  Determine what state
7478 +     that goes to, based on the state we popped back to and the rule
7479 +     number reduced by.  */
7480 +
7481 +  yyn = yyr1[yyn];
7482 +
7483 +  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
7484 +  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
7485 +    yystate = yytable[yystate];
7486 +  else
7487 +    yystate = yydefgoto[yyn - YYNTOKENS];
7488 +
7489 +  goto yynewstate;
7490 +
7491 +
7492 +/*------------------------------------.
7493 +| yyerrlab -- here on detecting error |
7494 +`------------------------------------*/
7495 +yyerrlab:
7496 +  /* If not already recovering from an error, report this error.  */
7497 +  if (!yyerrstatus)
7498 +    {
7499 +      ++yynerrs;
7500 +#if ! YYERROR_VERBOSE
7501 +      yyerror (YY_("syntax error"));
7502 +#else
7503 +      {
7504 +       YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
7505 +       if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
7506 +         {
7507 +           YYSIZE_T yyalloc = 2 * yysize;
7508 +           if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
7509 +             yyalloc = YYSTACK_ALLOC_MAXIMUM;
7510 +           if (yymsg != yymsgbuf)
7511 +             YYSTACK_FREE (yymsg);
7512 +           yymsg = (char *) YYSTACK_ALLOC (yyalloc);
7513 +           if (yymsg)
7514 +             yymsg_alloc = yyalloc;
7515 +           else
7516 +             {
7517 +               yymsg = yymsgbuf;
7518 +               yymsg_alloc = sizeof yymsgbuf;
7519 +             }
7520 +         }
7521 +
7522 +       if (0 < yysize && yysize <= yymsg_alloc)
7523 +         {
7524 +           (void) yysyntax_error (yymsg, yystate, yychar);
7525 +           yyerror (yymsg);
7526 +         }
7527 +       else
7528 +         {
7529 +           yyerror (YY_("syntax error"));
7530 +           if (yysize != 0)
7531 +             goto yyexhaustedlab;
7532 +         }
7533 +      }
7534 +#endif
7535 +    }
7536 +
7537 +  yyerror_range[0] = yylloc;
7538 +
7539 +  if (yyerrstatus == 3)
7540 +    {
7541 +      /* If just tried and failed to reuse look-ahead token after an
7542 +        error, discard it.  */
7543 +
7544 +      if (yychar <= YYEOF)
7545 +       {
7546 +         /* Return failure if at end of input.  */
7547 +         if (yychar == YYEOF)
7548 +           YYABORT;
7549 +       }
7550 +      else
7551 +       {
7552 +         yydestruct ("Error: discarding",
7553 +                     yytoken, &yylval, &yylloc);
7554 +         yychar = YYEMPTY;
7555 +       }
7556 +    }
7557 +
7558 +  /* Else will try to reuse look-ahead token after shifting the error
7559 +     token.  */
7560 +  goto yyerrlab1;
7561 +
7562 +
7563 +/*---------------------------------------------------.
7564 +| yyerrorlab -- error raised explicitly by YYERROR.  |
7565 +`---------------------------------------------------*/
7566 +yyerrorlab:
7567 +
7568 +  /* Pacify compilers like GCC when the user code never invokes
7569 +     YYERROR and the label yyerrorlab therefore never appears in user
7570 +     code.  */
7571 +  if (/*CONSTCOND*/ 0)
7572 +     goto yyerrorlab;
7573 +
7574 +  yyerror_range[0] = yylsp[1-yylen];
7575 +  /* Do not reclaim the symbols of the rule which action triggered
7576 +     this YYERROR.  */
7577 +  YYPOPSTACK (yylen);
7578 +  yylen = 0;
7579 +  YY_STACK_PRINT (yyss, yyssp);
7580 +  yystate = *yyssp;
7581 +  goto yyerrlab1;
7582 +
7583 +
7584 +/*-------------------------------------------------------------.
7585 +| yyerrlab1 -- common code for both syntax error and YYERROR.  |
7586 +`-------------------------------------------------------------*/
7587 +yyerrlab1:
7588 +  yyerrstatus = 3;     /* Each real token shifted decrements this.  */
7589 +
7590 +  for (;;)
7591 +    {
7592 +      yyn = yypact[yystate];
7593 +      if (yyn != YYPACT_NINF)
7594 +       {
7595 +         yyn += YYTERROR;
7596 +         if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
7597 +           {
7598 +             yyn = yytable[yyn];
7599 +             if (0 < yyn)
7600 +               break;
7601 +           }
7602 +       }
7603 +
7604 +      /* Pop the current state because it cannot handle the error token.  */
7605 +      if (yyssp == yyss)
7606 +       YYABORT;
7607 +
7608 +      yyerror_range[0] = *yylsp;
7609 +      yydestruct ("Error: popping",
7610 +                 yystos[yystate], yyvsp, yylsp);
7611 +      YYPOPSTACK (1);
7612 +      yystate = *yyssp;
7613 +      YY_STACK_PRINT (yyss, yyssp);
7614 +    }
7615 +
7616 +  if (yyn == YYFINAL)
7617 +    YYACCEPT;
7618 +
7619 +  *++yyvsp = yylval;
7620 +
7621 +  yyerror_range[1] = yylloc;
7622 +  /* Using YYLLOC is tempting, but would change the location of
7623 +     the look-ahead.  YYLOC is available though.  */
7624 +  YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
7625 +  *++yylsp = yyloc;
7626 +
7627 +  /* Shift the error token.  */
7628 +  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
7629 +
7630 +  yystate = yyn;
7631 +  goto yynewstate;
7632 +
7633 +
7634 +/*-------------------------------------.
7635 +| yyacceptlab -- YYACCEPT comes here.  |
7636 +`-------------------------------------*/
7637 +yyacceptlab:
7638 +  yyresult = 0;
7639 +  goto yyreturn;
7640 +
7641 +/*-----------------------------------.
7642 +| yyabortlab -- YYABORT comes here.  |
7643 +`-----------------------------------*/
7644 +yyabortlab:
7645 +  yyresult = 1;
7646 +  goto yyreturn;
7647 +
7648 +#ifndef yyoverflow
7649 +/*-------------------------------------------------.
7650 +| yyexhaustedlab -- memory exhaustion comes here.  |
7651 +`-------------------------------------------------*/
7652 +yyexhaustedlab:
7653 +  yyerror (YY_("memory exhausted"));
7654 +  yyresult = 2;
7655 +  /* Fall through.  */
7656 +#endif
7657 +
7658 +yyreturn:
7659 +  if (yychar != YYEOF && yychar != YYEMPTY)
7660 +     yydestruct ("Cleanup: discarding lookahead",
7661 +                yytoken, &yylval, &yylloc);
7662 +  /* Do not reclaim the symbols of the rule which action triggered
7663 +     this YYABORT or YYACCEPT.  */
7664 +  YYPOPSTACK (yylen);
7665 +  YY_STACK_PRINT (yyss, yyssp);
7666 +  while (yyssp != yyss)
7667 +    {
7668 +      yydestruct ("Cleanup: popping",
7669 +                 yystos[*yyssp], yyvsp, yylsp);
7670 +      YYPOPSTACK (1);
7671 +    }
7672 +#ifndef yyoverflow
7673 +  if (yyss != yyssa)
7674 +    YYSTACK_FREE (yyss);
7675 +#endif
7676 +#if YYERROR_VERBOSE
7677 +  if (yymsg != yymsgbuf)
7678 +    YYSTACK_FREE (yymsg);
7679 +#endif
7680 +  /* Make sure YYID is used.  */
7681 +  return YYID (yyresult);
7682 +}
7683 +
7684 +
7685 +#line 308 "dtc-parser.y"
7686 +
7687 +
7688 +void yyerror (char const *s)
7689 +{
7690 +       const char *fname = srcpos_filename_for_num(yylloc.filenum);
7691 +
7692 +       if (strcmp(fname, "-") == 0)
7693 +               fname = "stdin";
7694 +
7695 +       fprintf(stderr, "%s:%d %s\n",
7696 +               fname, yylloc.first_line, s);
7697 +}
7698 +
7699 +unsigned long long eval_literal(const char *s, int base, int bits)
7700 +{
7701 +       unsigned long long val;
7702 +       char *e;
7703 +
7704 +       errno = 0;
7705 +       val = strtoull(s, &e, base);
7706 +       if (*e)
7707 +               yyerror("bad characters in literal");
7708 +       else if ((errno == ERANGE)
7709 +                || ((bits < 64) && (val >= (1ULL << bits))))
7710 +               yyerror("literal out of range");
7711 +       else if (errno != 0)
7712 +               yyerror("bad literal");
7713 +       return val;
7714 +}
7715 +
7716 --- /dev/null
7717 +++ b/arch/powerpc/boot/dtc-src/dtc-parser.tab.h_shipped
7718 @@ -0,0 +1,111 @@
7719 +/* A Bison parser, made by GNU Bison 2.3.  */
7720 +
7721 +/* Skeleton interface for Bison's Yacc-like parsers in C
7722 +
7723 +   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7724 +   Free Software Foundation, Inc.
7725 +
7726 +   This program is free software; you can redistribute it and/or modify
7727 +   it under the terms of the GNU General Public License as published by
7728 +   the Free Software Foundation; either version 2, or (at your option)
7729 +   any later version.
7730 +
7731 +   This program is distributed in the hope that it will be useful,
7732 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
7733 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
7734 +   GNU General Public License for more details.
7735 +
7736 +   You should have received a copy of the GNU General Public License
7737 +   along with this program; if not, write to the Free Software
7738 +   Foundation, Inc., 51 Franklin Street, Fifth Floor,
7739 +   Boston, MA 02110-1301, USA.  */
7740 +
7741 +/* As a special exception, you may create a larger work that contains
7742 +   part or all of the Bison parser skeleton and distribute that work
7743 +   under terms of your choice, so long as that work isn't itself a
7744 +   parser generator using the skeleton or a modified version thereof
7745 +   as a parser skeleton.  Alternatively, if you modify or redistribute
7746 +   the parser skeleton itself, you may (at your option) remove this
7747 +   special exception, which will cause the skeleton and the resulting
7748 +   Bison output files to be licensed under the GNU General Public
7749 +   License without this special exception.
7750 +
7751 +   This special exception was added by the Free Software Foundation in
7752 +   version 2.2 of Bison.  */
7753 +
7754 +/* Tokens.  */
7755 +#ifndef YYTOKENTYPE
7756 +# define YYTOKENTYPE
7757 +   /* Put the tokens into the symbol table, so that GDB and other debuggers
7758 +      know about them.  */
7759 +   enum yytokentype {
7760 +     DT_V1 = 258,
7761 +     DT_MEMRESERVE = 259,
7762 +     DT_PROPNODENAME = 260,
7763 +     DT_LITERAL = 261,
7764 +     DT_LEGACYLITERAL = 262,
7765 +     DT_BASE = 263,
7766 +     DT_BYTE = 264,
7767 +     DT_STRING = 265,
7768 +     DT_LABEL = 266,
7769 +     DT_REF = 267
7770 +   };
7771 +#endif
7772 +/* Tokens.  */
7773 +#define DT_V1 258
7774 +#define DT_MEMRESERVE 259
7775 +#define DT_PROPNODENAME 260
7776 +#define DT_LITERAL 261
7777 +#define DT_LEGACYLITERAL 262
7778 +#define DT_BASE 263
7779 +#define DT_BYTE 264
7780 +#define DT_STRING 265
7781 +#define DT_LABEL 266
7782 +#define DT_REF 267
7783 +
7784 +
7785 +
7786 +
7787 +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
7788 +typedef union YYSTYPE
7789 +#line 34 "dtc-parser.y"
7790 +{
7791 +       char *propnodename;
7792 +       char *literal;
7793 +       char *labelref;
7794 +       unsigned int cbase;
7795 +       u8 byte;
7796 +       struct data data;
7797 +
7798 +       u64 addr;
7799 +       cell_t cell;
7800 +       struct property *prop;
7801 +       struct property *proplist;
7802 +       struct node *node;
7803 +       struct node *nodelist;
7804 +       struct reserve_info *re;
7805 +}
7806 +/* Line 1489 of yacc.c.  */
7807 +#line 90 "dtc-parser.tab.h"
7808 +       YYSTYPE;
7809 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */
7810 +# define YYSTYPE_IS_DECLARED 1
7811 +# define YYSTYPE_IS_TRIVIAL 1
7812 +#endif
7813 +
7814 +extern YYSTYPE yylval;
7815 +
7816 +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
7817 +typedef struct YYLTYPE
7818 +{
7819 +  int first_line;
7820 +  int first_column;
7821 +  int last_line;
7822 +  int last_column;
7823 +} YYLTYPE;
7824 +# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
7825 +# define YYLTYPE_IS_DECLARED 1
7826 +# define YYLTYPE_IS_TRIVIAL 1
7827 +#endif
7828 +
7829 +extern YYLTYPE yylloc;
7830 --- /dev/null
7831 +++ b/arch/powerpc/boot/dtc-src/dtc-parser.y
7832 @@ -0,0 +1,336 @@
7833 +/*
7834 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
7835 + *
7836 + *
7837 + * This program is free software; you can redistribute it and/or
7838 + * modify it under the terms of the GNU General Public License as
7839 + * published by the Free Software Foundation; either version 2 of the
7840 + * License, or (at your option) any later version.
7841 + *
7842 + *  This program is distributed in the hope that it will be useful,
7843 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
7844 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7845 + *  General Public License for more details.
7846 + *
7847 + *  You should have received a copy of the GNU General Public License
7848 + *  along with this program; if not, write to the Free Software
7849 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
7850 + *                                                                   USA
7851 + */
7852 +
7853 +%locations
7854 +
7855 +%{
7856 +#include "dtc.h"
7857 +#include "srcpos.h"
7858 +
7859 +int yylex(void);
7860 +unsigned long long eval_literal(const char *s, int base, int bits);
7861 +
7862 +extern struct boot_info *the_boot_info;
7863 +
7864 +%}
7865 +
7866 +%union {
7867 +       char *propnodename;
7868 +       char *literal;
7869 +       char *labelref;
7870 +       unsigned int cbase;
7871 +       u8 byte;
7872 +       struct data data;
7873 +
7874 +       u64 addr;
7875 +       cell_t cell;
7876 +       struct property *prop;
7877 +       struct property *proplist;
7878 +       struct node *node;
7879 +       struct node *nodelist;
7880 +       struct reserve_info *re;
7881 +}
7882 +
7883 +%token DT_V1
7884 +%token DT_MEMRESERVE
7885 +%token <propnodename> DT_PROPNODENAME
7886 +%token <literal> DT_LITERAL
7887 +%token <literal> DT_LEGACYLITERAL
7888 +%token <cbase> DT_BASE
7889 +%token <byte> DT_BYTE
7890 +%token <data> DT_STRING
7891 +%token <labelref> DT_LABEL
7892 +%token <labelref> DT_REF
7893 +
7894 +%type <data> propdata
7895 +%type <data> propdataprefix
7896 +%type <re> memreserve
7897 +%type <re> memreserves
7898 +%type <re> v0_memreserve
7899 +%type <re> v0_memreserves
7900 +%type <addr> addr
7901 +%type <data> celllist
7902 +%type <cbase> cellbase
7903 +%type <cell> cellval
7904 +%type <data> bytestring
7905 +%type <prop> propdef
7906 +%type <proplist> proplist
7907 +
7908 +%type <node> devicetree
7909 +%type <node> nodedef
7910 +%type <node> subnode
7911 +%type <nodelist> subnodes
7912 +%type <labelref> label
7913 +
7914 +%%
7915 +
7916 +sourcefile:
7917 +         DT_V1 ';' memreserves devicetree
7918 +               {
7919 +                       the_boot_info = build_boot_info($3, $4);
7920 +               }
7921 +       | v0_memreserves devicetree
7922 +               {
7923 +                       the_boot_info = build_boot_info($1, $2);
7924 +               }
7925 +       ;
7926 +
7927 +memreserves:
7928 +         /* empty */
7929 +               {
7930 +                       $$ = NULL;
7931 +               }
7932 +       | memreserve memreserves
7933 +               {
7934 +                       $$ = chain_reserve_entry($1, $2);
7935 +               }
7936 +       ;
7937 +
7938 +memreserve:
7939 +         label DT_MEMRESERVE addr addr ';'
7940 +               {
7941 +                       $$ = build_reserve_entry($3, $4, $1);
7942 +               }
7943 +       ;
7944 +
7945 +v0_memreserves:
7946 +         /* empty */
7947 +               {
7948 +                       $$ = NULL;
7949 +               }
7950 +       | v0_memreserve v0_memreserves
7951 +               {
7952 +                       $$ = chain_reserve_entry($1, $2);
7953 +               };
7954 +       ;
7955 +
7956 +v0_memreserve:
7957 +         memreserve
7958 +               {
7959 +                       $$ = $1;
7960 +               }
7961 +       | label DT_MEMRESERVE addr '-' addr ';'
7962 +               {
7963 +                       $$ = build_reserve_entry($3, $5 - $3 + 1, $1);
7964 +               }
7965 +       ;
7966 +
7967 +addr:
7968 +         DT_LITERAL
7969 +               {
7970 +                       $$ = eval_literal($1, 0, 64);
7971 +               }
7972 +       | DT_LEGACYLITERAL
7973 +               {
7974 +                       $$ = eval_literal($1, 16, 64);
7975 +               }
7976 +         ;
7977 +
7978 +devicetree:
7979 +         '/' nodedef
7980 +               {
7981 +                       $$ = name_node($2, "", NULL);
7982 +               }
7983 +       ;
7984 +
7985 +nodedef:
7986 +         '{' proplist subnodes '}' ';'
7987 +               {
7988 +                       $$ = build_node($2, $3);
7989 +               }
7990 +       ;
7991 +
7992 +proplist:
7993 +         /* empty */
7994 +               {
7995 +                       $$ = NULL;
7996 +               }
7997 +       | proplist propdef
7998 +               {
7999 +                       $$ = chain_property($2, $1);
8000 +               }
8001 +       ;
8002 +
8003 +propdef:
8004 +         label DT_PROPNODENAME '=' propdata ';'
8005 +               {
8006 +                       $$ = build_property($2, $4, $1);
8007 +               }
8008 +       | label DT_PROPNODENAME ';'
8009 +               {
8010 +                       $$ = build_property($2, empty_data, $1);
8011 +               }
8012 +       ;
8013 +
8014 +propdata:
8015 +         propdataprefix DT_STRING
8016 +               {
8017 +                       $$ = data_merge($1, $2);
8018 +               }
8019 +       | propdataprefix '<' celllist '>'
8020 +               {
8021 +                       $$ = data_merge($1, $3);
8022 +               }
8023 +       | propdataprefix '[' bytestring ']'
8024 +               {
8025 +                       $$ = data_merge($1, $3);
8026 +               }
8027 +       | propdataprefix DT_REF
8028 +               {
8029 +                       $$ = data_add_marker($1, REF_PATH, $2);
8030 +               }
8031 +       | propdata DT_LABEL
8032 +               {
8033 +                       $$ = data_add_marker($1, LABEL, $2);
8034 +               }
8035 +       ;
8036 +
8037 +propdataprefix:
8038 +         /* empty */
8039 +               {
8040 +                       $$ = empty_data;
8041 +               }
8042 +       | propdata ','
8043 +               {
8044 +                       $$ = $1;
8045 +               }
8046 +       | propdataprefix DT_LABEL
8047 +               {
8048 +                       $$ = data_add_marker($1, LABEL, $2);
8049 +               }
8050 +       ;
8051 +
8052 +celllist:
8053 +         /* empty */
8054 +               {
8055 +                       $$ = empty_data;
8056 +               }
8057 +       | celllist cellval
8058 +               {
8059 +                       $$ = data_append_cell($1, $2);
8060 +               }
8061 +       | celllist DT_REF
8062 +               {
8063 +                       $$ = data_append_cell(data_add_marker($1, REF_PHANDLE,
8064 +                                                             $2), -1);
8065 +               }
8066 +       | celllist DT_LABEL
8067 +               {
8068 +                       $$ = data_add_marker($1, LABEL, $2);
8069 +               }
8070 +       ;
8071 +
8072 +cellbase:
8073 +         /* empty */
8074 +               {
8075 +                       $$ = 16;
8076 +               }
8077 +       | DT_BASE
8078 +       ;
8079 +
8080 +cellval:
8081 +         DT_LITERAL
8082 +               {
8083 +                       $$ = eval_literal($1, 0, 32);
8084 +               }
8085 +       | cellbase DT_LEGACYLITERAL
8086 +               {
8087 +                       $$ = eval_literal($2, $1, 32);
8088 +               }
8089 +       ;
8090 +
8091 +bytestring:
8092 +         /* empty */
8093 +               {
8094 +                       $$ = empty_data;
8095 +               }
8096 +       | bytestring DT_BYTE
8097 +               {
8098 +                       $$ = data_append_byte($1, $2);
8099 +               }
8100 +       | bytestring DT_LABEL
8101 +               {
8102 +                       $$ = data_add_marker($1, LABEL, $2);
8103 +               }
8104 +       ;
8105 +
8106 +subnodes:
8107 +         /* empty */
8108 +               {
8109 +                       $$ = NULL;
8110 +               }
8111 +       |  subnode subnodes
8112 +               {
8113 +                       $$ = chain_node($1, $2);
8114 +               }
8115 +       | subnode propdef
8116 +               {
8117 +                       yyerror("syntax error: properties must precede subnodes\n");
8118 +                       YYERROR;
8119 +               }
8120 +       ;
8121 +
8122 +subnode:
8123 +         label DT_PROPNODENAME nodedef
8124 +               {
8125 +                       $$ = name_node($3, $2, $1);
8126 +               }
8127 +       ;
8128 +
8129 +label:
8130 +         /* empty */
8131 +               {
8132 +                       $$ = NULL;
8133 +               }
8134 +       | DT_LABEL
8135 +               {
8136 +                       $$ = $1;
8137 +               }
8138 +       ;
8139 +
8140 +%%
8141 +
8142 +void yyerror (char const *s)
8143 +{
8144 +       const char *fname = srcpos_filename_for_num(yylloc.filenum);
8145 +
8146 +       if (strcmp(fname, "-") == 0)
8147 +               fname = "stdin";
8148 +
8149 +       fprintf(stderr, "%s:%d %s\n",
8150 +               fname, yylloc.first_line, s);
8151 +}
8152 +
8153 +unsigned long long eval_literal(const char *s, int base, int bits)
8154 +{
8155 +       unsigned long long val;
8156 +       char *e;
8157 +
8158 +       errno = 0;
8159 +       val = strtoull(s, &e, base);
8160 +       if (*e)
8161 +               yyerror("bad characters in literal");
8162 +       else if ((errno == ERANGE)
8163 +                || ((bits < 64) && (val >= (1ULL << bits))))
8164 +               yyerror("literal out of range");
8165 +       else if (errno != 0)
8166 +               yyerror("bad literal");
8167 +       return val;
8168 +}
8169 --- /dev/null
8170 +++ b/arch/powerpc/boot/dtc-src/dtc.c
8171 @@ -0,0 +1,231 @@
8172 +/*
8173 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
8174 + *
8175 + *
8176 + * This program is free software; you can redistribute it and/or
8177 + * modify it under the terms of the GNU General Public License as
8178 + * published by the Free Software Foundation; either version 2 of the
8179 + * License, or (at your option) any later version.
8180 + *
8181 + *  This program is distributed in the hope that it will be useful,
8182 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
8183 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8184 + *  General Public License for more details.
8185 + *
8186 + *  You should have received a copy of the GNU General Public License
8187 + *  along with this program; if not, write to the Free Software
8188 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
8189 + *                                                                   USA
8190 + */
8191 +
8192 +#include "dtc.h"
8193 +#include "srcpos.h"
8194 +
8195 +#include "version_gen.h"
8196 +
8197 +/*
8198 + * Command line options
8199 + */
8200 +int quiet;             /* Level of quietness */
8201 +int reservenum;                /* Number of memory reservation slots */
8202 +int minsize;           /* Minimum blob size */
8203 +int padsize;           /* Additional padding to blob */
8204 +
8205 +char *join_path(const char *path, const char *name)
8206 +{
8207 +       int lenp = strlen(path);
8208 +       int lenn = strlen(name);
8209 +       int len;
8210 +       int needslash = 1;
8211 +       char *str;
8212 +
8213 +       len = lenp + lenn + 2;
8214 +       if ((lenp > 0) && (path[lenp-1] == '/')) {
8215 +               needslash = 0;
8216 +               len--;
8217 +       }
8218 +
8219 +       str = xmalloc(len);
8220 +       memcpy(str, path, lenp);
8221 +       if (needslash) {
8222 +               str[lenp] = '/';
8223 +               lenp++;
8224 +       }
8225 +       memcpy(str+lenp, name, lenn+1);
8226 +       return str;
8227 +}
8228 +
8229 +void fill_fullpaths(struct node *tree, const char *prefix)
8230 +{
8231 +       struct node *child;
8232 +       const char *unit;
8233 +
8234 +       tree->fullpath = join_path(prefix, tree->name);
8235 +
8236 +       unit = strchr(tree->name, '@');
8237 +       if (unit)
8238 +               tree->basenamelen = unit - tree->name;
8239 +       else
8240 +               tree->basenamelen = strlen(tree->name);
8241 +
8242 +       for_each_child(tree, child)
8243 +               fill_fullpaths(child, tree->fullpath);
8244 +}
8245 +
8246 +static void  __attribute__ ((noreturn)) usage(void)
8247 +{
8248 +       fprintf(stderr, "Usage:\n");
8249 +       fprintf(stderr, "\tdtc [options] <input file>\n");
8250 +       fprintf(stderr, "\nOptions:\n");
8251 +       fprintf(stderr, "\t-h\n");
8252 +       fprintf(stderr, "\t\tThis help text\n");
8253 +       fprintf(stderr, "\t-q\n");
8254 +       fprintf(stderr, "\t\tQuiet: -q suppress warnings, -qq errors, -qqq all\n");
8255 +       fprintf(stderr, "\t-I <input format>\n");
8256 +       fprintf(stderr, "\t\tInput formats are:\n");
8257 +       fprintf(stderr, "\t\t\tdts - device tree source text\n");
8258 +       fprintf(stderr, "\t\t\tdtb - device tree blob\n");
8259 +       fprintf(stderr, "\t\t\tfs - /proc/device-tree style directory\n");
8260 +       fprintf(stderr, "\t-o <output file>\n");
8261 +       fprintf(stderr, "\t-O <output format>\n");
8262 +       fprintf(stderr, "\t\tOutput formats are:\n");
8263 +       fprintf(stderr, "\t\t\tdts - device tree source text\n");
8264 +       fprintf(stderr, "\t\t\tdtb - device tree blob\n");
8265 +       fprintf(stderr, "\t\t\tasm - assembler source\n");
8266 +       fprintf(stderr, "\t-V <output version>\n");
8267 +       fprintf(stderr, "\t\tBlob version to produce, defaults to %d (relevant for dtb\n\t\tand asm output only)\n", DEFAULT_FDT_VERSION);
8268 +       fprintf(stderr, "\t-R <number>\n");
8269 +       fprintf(stderr, "\t\tMake space for <number> reserve map entries (relevant for \n\t\tdtb and asm output only)\n");
8270 +       fprintf(stderr, "\t-S <bytes>\n");
8271 +       fprintf(stderr, "\t\tMake the blob at least <bytes> long (extra space)\n");
8272 +       fprintf(stderr, "\t-p <bytes>\n");
8273 +       fprintf(stderr, "\t\tAdd padding to the blob of <bytes> long (extra space)\n");
8274 +       fprintf(stderr, "\t-b <number>\n");
8275 +       fprintf(stderr, "\t\tSet the physical boot cpu\n");
8276 +       fprintf(stderr, "\t-f\n");
8277 +       fprintf(stderr, "\t\tForce - try to produce output even if the input tree has errors\n");
8278 +       fprintf(stderr, "\t-v\n");
8279 +       fprintf(stderr, "\t\tPrint DTC version and exit\n");
8280 +       exit(2);
8281 +}
8282 +
8283 +int main(int argc, char *argv[])
8284 +{
8285 +       struct boot_info *bi;
8286 +       const char *inform = "dts";
8287 +       const char *outform = "dts";
8288 +       const char *outname = "-";
8289 +       int force = 0, check = 0;
8290 +       const char *arg;
8291 +       int opt;
8292 +       FILE *inf = NULL;
8293 +       FILE *outf = NULL;
8294 +       int outversion = DEFAULT_FDT_VERSION;
8295 +       int boot_cpuid_phys = 0xfeedbeef;
8296 +
8297 +       quiet      = 0;
8298 +       reservenum = 0;
8299 +       minsize    = 0;
8300 +       padsize    = 0;
8301 +
8302 +       while ((opt = getopt(argc, argv, "hI:O:o:V:R:S:p:fcqb:v")) != EOF) {
8303 +               switch (opt) {
8304 +               case 'I':
8305 +                       inform = optarg;
8306 +                       break;
8307 +               case 'O':
8308 +                       outform = optarg;
8309 +                       break;
8310 +               case 'o':
8311 +                       outname = optarg;
8312 +                       break;
8313 +               case 'V':
8314 +                       outversion = strtol(optarg, NULL, 0);
8315 +                       break;
8316 +               case 'R':
8317 +                       reservenum = strtol(optarg, NULL, 0);
8318 +                       break;
8319 +               case 'S':
8320 +                       minsize = strtol(optarg, NULL, 0);
8321 +                       break;
8322 +               case 'p':
8323 +                       padsize = strtol(optarg, NULL, 0);
8324 +                       break;
8325 +               case 'f':
8326 +                       force = 1;
8327 +                       break;
8328 +               case 'c':
8329 +                       check = 1;
8330 +                       break;
8331 +               case 'q':
8332 +                       quiet++;
8333 +                       break;
8334 +               case 'b':
8335 +                       boot_cpuid_phys = strtol(optarg, NULL, 0);
8336 +                       break;
8337 +               case 'v':
8338 +                   printf("Version: %s\n", DTC_VERSION);
8339 +                   exit(0);
8340 +               case 'h':
8341 +               default:
8342 +                       usage();
8343 +               }
8344 +       }
8345 +
8346 +       if (argc > (optind+1))
8347 +               usage();
8348 +       else if (argc < (optind+1))
8349 +               arg = "-";
8350 +       else
8351 +               arg = argv[optind];
8352 +
8353 +       /* minsize and padsize are mutually exclusive */
8354 +       if ((minsize) && (padsize)) {
8355 +               die("Can't set both -p and -S\n");
8356 +       }
8357 +
8358 +       fprintf(stderr, "DTC: %s->%s  on file \"%s\"\n",
8359 +               inform, outform, arg);
8360 +
8361 +       if (streq(inform, "dts")) {
8362 +               bi = dt_from_source(arg);
8363 +       } else if (streq(inform, "fs")) {
8364 +               bi = dt_from_fs(arg);
8365 +       } else if(streq(inform, "dtb")) {
8366 +               inf = dtc_open_file(arg);
8367 +               bi = dt_from_blob(inf);
8368 +       } else {
8369 +               die("Unknown input format \"%s\"\n", inform);
8370 +       }
8371 +
8372 +       if (inf && (inf != stdin))
8373 +               fclose(inf);
8374 +
8375 +       if (! bi || ! bi->dt)
8376 +               die("Couldn't read input tree\n");
8377 +
8378 +       process_checks(force, bi, check, outversion, boot_cpuid_phys);
8379 +
8380 +       if (streq(outname, "-")) {
8381 +               outf = stdout;
8382 +       } else {
8383 +               outf = fopen(outname, "w");
8384 +               if (! outf)
8385 +                       die("Couldn't open output file %s: %s\n",
8386 +                           outname, strerror(errno));
8387 +       }
8388 +
8389 +       if (streq(outform, "dts")) {
8390 +               dt_to_source(outf, bi);
8391 +       } else if (streq(outform, "dtb")) {
8392 +               dt_to_blob(outf, bi, outversion, boot_cpuid_phys);
8393 +       } else if (streq(outform, "asm")) {
8394 +               dt_to_asm(outf, bi, outversion, boot_cpuid_phys);
8395 +       } else if (streq(outform, "null")) {
8396 +               /* do nothing */
8397 +       } else {
8398 +               die("Unknown output format \"%s\"\n", outform);
8399 +       }
8400 +
8401 +       exit(0);
8402 +}
8403 --- /dev/null
8404 +++ b/arch/powerpc/boot/dtc-src/dtc.h
8405 @@ -0,0 +1,269 @@
8406 +#ifndef _DTC_H
8407 +#define _DTC_H
8408 +
8409 +/*
8410 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
8411 + *
8412 + *
8413 + * This program is free software; you can redistribute it and/or
8414 + * modify it under the terms of the GNU General Public License as
8415 + * published by the Free Software Foundation; either version 2 of the
8416 + * License, or (at your option) any later version.
8417 + *
8418 + *  This program is distributed in the hope that it will be useful,
8419 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
8420 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8421 + *  General Public License for more details.
8422 + *
8423 + *  You should have received a copy of the GNU General Public License
8424 + *  along with this program; if not, write to the Free Software
8425 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
8426 + *                                                                   USA
8427 + */
8428 +
8429 +#include <stdio.h>
8430 +#include <string.h>
8431 +#include <stdlib.h>
8432 +#include <stdint.h>
8433 +#include <stdarg.h>
8434 +#include <assert.h>
8435 +#include <ctype.h>
8436 +#include <errno.h>
8437 +#include <unistd.h>
8438 +#include <netinet/in.h>
8439 +#include <endian.h>
8440 +#include <byteswap.h>
8441 +
8442 +#include <fdt.h>
8443 +
8444 +#define DEFAULT_FDT_VERSION    17
8445 +/*
8446 + * Command line options
8447 + */
8448 +extern int quiet;              /* Level of quietness */
8449 +extern int reservenum;         /* Number of memory reservation slots */
8450 +extern int minsize;            /* Minimum blob size */
8451 +extern int padsize;            /* Additional padding to blob */
8452 +
8453 +static inline void __attribute__((noreturn)) die(char * str, ...)
8454 +{
8455 +       va_list ap;
8456 +
8457 +       va_start(ap, str);
8458 +       fprintf(stderr, "FATAL ERROR: ");
8459 +       vfprintf(stderr, str, ap);
8460 +       exit(1);
8461 +}
8462 +
8463 +static inline void *xmalloc(size_t len)
8464 +{
8465 +       void *new = malloc(len);
8466 +
8467 +       if (! new)
8468 +               die("malloc() failed\n");
8469 +
8470 +       return new;
8471 +}
8472 +
8473 +static inline void *xrealloc(void *p, size_t len)
8474 +{
8475 +       void *new = realloc(p, len);
8476 +
8477 +       if (! new)
8478 +               die("realloc() failed (len=%d)\n", len);
8479 +
8480 +       return new;
8481 +}
8482 +
8483 +typedef uint8_t u8;
8484 +typedef uint16_t u16;
8485 +typedef uint32_t u32;
8486 +typedef uint64_t u64;
8487 +typedef u32 cell_t;
8488 +
8489 +#define cpu_to_be16(x) htons(x)
8490 +#define be16_to_cpu(x) ntohs(x)
8491 +
8492 +#define cpu_to_be32(x) htonl(x)
8493 +#define be32_to_cpu(x) ntohl(x)
8494 +
8495 +#if __BYTE_ORDER == __BIG_ENDIAN
8496 +#define cpu_to_be64(x) (x)
8497 +#define be64_to_cpu(x) (x)
8498 +#else
8499 +#define cpu_to_be64(x) bswap_64(x)
8500 +#define be64_to_cpu(x) bswap_64(x)
8501 +#endif
8502 +
8503 +#define streq(a, b)    (strcmp((a), (b)) == 0)
8504 +#define strneq(a, b, n)        (strncmp((a), (b), (n)) == 0)
8505 +
8506 +#define ALIGN(x, a)    (((x) + (a) - 1) & ~((a) - 1))
8507 +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
8508 +
8509 +/* Data blobs */
8510 +enum markertype {
8511 +       REF_PHANDLE,
8512 +       REF_PATH,
8513 +       LABEL,
8514 +};
8515 +
8516 +struct  marker {
8517 +       enum markertype type;
8518 +       int offset;
8519 +       char *ref;
8520 +       struct marker *next;
8521 +};
8522 +
8523 +struct data {
8524 +       int len;
8525 +       char *val;
8526 +       int asize;
8527 +       struct marker *markers;
8528 +};
8529 +
8530 +
8531 +#define empty_data ((struct data){ /* all .members = 0 or NULL */ })
8532 +
8533 +#define for_each_marker(m) \
8534 +       for (; (m); (m) = (m)->next)
8535 +#define for_each_marker_of_type(m, t) \
8536 +       for_each_marker(m) \
8537 +               if ((m)->type == (t))
8538 +
8539 +void data_free(struct data d);
8540 +
8541 +struct data data_grow_for(struct data d, int xlen);
8542 +
8543 +struct data data_copy_mem(const char *mem, int len);
8544 +struct data data_copy_escape_string(const char *s, int len);
8545 +struct data data_copy_file(FILE *f, size_t len);
8546 +
8547 +struct data data_append_data(struct data d, const void *p, int len);
8548 +struct data data_insert_at_marker(struct data d, struct marker *m,
8549 +                                 const void *p, int len);
8550 +struct data data_merge(struct data d1, struct data d2);
8551 +struct data data_append_cell(struct data d, cell_t word);
8552 +struct data data_append_re(struct data d, const struct fdt_reserve_entry *re);
8553 +struct data data_append_addr(struct data d, u64 addr);
8554 +struct data data_append_byte(struct data d, uint8_t byte);
8555 +struct data data_append_zeroes(struct data d, int len);
8556 +struct data data_append_align(struct data d, int align);
8557 +
8558 +struct data data_add_marker(struct data d, enum markertype type, char *ref);
8559 +
8560 +int data_is_one_string(struct data d);
8561 +
8562 +/* DT constraints */
8563 +
8564 +#define MAX_PROPNAME_LEN       31
8565 +#define MAX_NODENAME_LEN       31
8566 +
8567 +/* Live trees */
8568 +struct property {
8569 +       char *name;
8570 +       struct data val;
8571 +
8572 +       struct property *next;
8573 +
8574 +       char *label;
8575 +};
8576 +
8577 +struct node {
8578 +       char *name;
8579 +       struct property *proplist;
8580 +       struct node *children;
8581 +
8582 +       struct node *parent;
8583 +       struct node *next_sibling;
8584 +
8585 +       char *fullpath;
8586 +       int basenamelen;
8587 +
8588 +       cell_t phandle;
8589 +       int addr_cells, size_cells;
8590 +
8591 +       char *label;
8592 +};
8593 +
8594 +#define for_each_property(n, p) \
8595 +       for ((p) = (n)->proplist; (p); (p) = (p)->next)
8596 +
8597 +#define for_each_child(n, c)   \
8598 +       for ((c) = (n)->children; (c); (c) = (c)->next_sibling)
8599 +
8600 +struct property *build_property(char *name, struct data val, char *label);
8601 +struct property *chain_property(struct property *first, struct property *list);
8602 +struct property *reverse_properties(struct property *first);
8603 +
8604 +struct node *build_node(struct property *proplist, struct node *children);
8605 +struct node *name_node(struct node *node, char *name, char *label);
8606 +struct node *chain_node(struct node *first, struct node *list);
8607 +
8608 +void add_property(struct node *node, struct property *prop);
8609 +void add_child(struct node *parent, struct node *child);
8610 +
8611 +const char *get_unitname(struct node *node);
8612 +struct property *get_property(struct node *node, const char *propname);
8613 +cell_t propval_cell(struct property *prop);
8614 +struct node *get_subnode(struct node *node, const char *nodename);
8615 +struct node *get_node_by_path(struct node *tree, const char *path);
8616 +struct node *get_node_by_label(struct node *tree, const char *label);
8617 +struct node *get_node_by_phandle(struct node *tree, cell_t phandle);
8618 +struct node *get_node_by_ref(struct node *tree, const char *ref);
8619 +cell_t get_node_phandle(struct node *root, struct node *node);
8620 +
8621 +/* Boot info (tree plus memreserve information */
8622 +
8623 +struct reserve_info {
8624 +       struct fdt_reserve_entry re;
8625 +
8626 +       struct reserve_info *next;
8627 +
8628 +       char *label;
8629 +};
8630 +
8631 +struct reserve_info *build_reserve_entry(u64 start, u64 len, char *label);
8632 +struct reserve_info *chain_reserve_entry(struct reserve_info *first,
8633 +                                        struct reserve_info *list);
8634 +struct reserve_info *add_reserve_entry(struct reserve_info *list,
8635 +                                      struct reserve_info *new);
8636 +
8637 +
8638 +struct boot_info {
8639 +       struct reserve_info *reservelist;
8640 +       struct node *dt;                /* the device tree */
8641 +};
8642 +
8643 +struct boot_info *build_boot_info(struct reserve_info *reservelist,
8644 +                                 struct node *tree);
8645 +
8646 +/* Checks */
8647 +
8648 +void process_checks(int force, struct boot_info *bi,
8649 +                   int checkflag, int outversion, int boot_cpuid_phys);
8650 +
8651 +/* Flattened trees */
8652 +
8653 +void dt_to_blob(FILE *f, struct boot_info *bi, int version,
8654 +               int boot_cpuid_phys);
8655 +void dt_to_asm(FILE *f, struct boot_info *bi, int version,
8656 +              int boot_cpuid_phys);
8657 +
8658 +struct boot_info *dt_from_blob(FILE *f);
8659 +
8660 +/* Tree source */
8661 +
8662 +void dt_to_source(FILE *f, struct boot_info *bi);
8663 +struct boot_info *dt_from_source(const char *f);
8664 +
8665 +/* FS trees */
8666 +
8667 +struct boot_info *dt_from_fs(const char *dirname);
8668 +
8669 +/* misc */
8670 +
8671 +char *join_path(const char *path, const char *name);
8672 +void fill_fullpaths(struct node *tree, const char *prefix);
8673 +
8674 +#endif /* _DTC_H */
8675 --- /dev/null
8676 +++ b/arch/powerpc/boot/dtc-src/flattree.c
8677 @@ -0,0 +1,968 @@
8678 +/*
8679 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
8680 + *
8681 + *
8682 + * This program is free software; you can redistribute it and/or
8683 + * modify it under the terms of the GNU General Public License as
8684 + * published by the Free Software Foundation; either version 2 of the
8685 + * License, or (at your option) any later version.
8686 + *
8687 + *  This program is distributed in the hope that it will be useful,
8688 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
8689 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8690 + *  General Public License for more details.
8691 + *
8692 + *  You should have received a copy of the GNU General Public License
8693 + *  along with this program; if not, write to the Free Software
8694 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
8695 + *                                                                   USA
8696 + */
8697 +
8698 +#include "dtc.h"
8699 +
8700 +#define FTF_FULLPATH   0x1
8701 +#define FTF_VARALIGN   0x2
8702 +#define FTF_NAMEPROPS  0x4
8703 +#define FTF_BOOTCPUID  0x8
8704 +#define FTF_STRTABSIZE 0x10
8705 +#define FTF_STRUCTSIZE 0x20
8706 +#define FTF_NOPS       0x40
8707 +
8708 +static struct version_info {
8709 +       int version;
8710 +       int last_comp_version;
8711 +       int hdr_size;
8712 +       int flags;
8713 +} version_table[] = {
8714 +       {1, 1, FDT_V1_SIZE,
8715 +        FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS},
8716 +       {2, 1, FDT_V2_SIZE,
8717 +        FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS|FTF_BOOTCPUID},
8718 +       {3, 1, FDT_V3_SIZE,
8719 +        FTF_FULLPATH|FTF_VARALIGN|FTF_NAMEPROPS|FTF_BOOTCPUID|FTF_STRTABSIZE},
8720 +       {16, 16, FDT_V3_SIZE,
8721 +        FTF_BOOTCPUID|FTF_STRTABSIZE|FTF_NOPS},
8722 +       {17, 16, FDT_V17_SIZE,
8723 +        FTF_BOOTCPUID|FTF_STRTABSIZE|FTF_STRUCTSIZE|FTF_NOPS},
8724 +};
8725 +
8726 +struct emitter {
8727 +       void (*cell)(void *, cell_t);
8728 +       void (*string)(void *, char *, int);
8729 +       void (*align)(void *, int);
8730 +       void (*data)(void *, struct data);
8731 +       void (*beginnode)(void *, const char *);
8732 +       void (*endnode)(void *, const char *);
8733 +       void (*property)(void *, const char *);
8734 +};
8735 +
8736 +static void bin_emit_cell(void *e, cell_t val)
8737 +{
8738 +       struct data *dtbuf = e;
8739 +
8740 +       *dtbuf = data_append_cell(*dtbuf, val);
8741 +}
8742 +
8743 +static void bin_emit_string(void *e, char *str, int len)
8744 +{
8745 +       struct data *dtbuf = e;
8746 +
8747 +       if (len == 0)
8748 +               len = strlen(str);
8749 +
8750 +       *dtbuf = data_append_data(*dtbuf, str, len);
8751 +       *dtbuf = data_append_byte(*dtbuf, '\0');
8752 +}
8753 +
8754 +static void bin_emit_align(void *e, int a)
8755 +{
8756 +       struct data *dtbuf = e;
8757 +
8758 +       *dtbuf = data_append_align(*dtbuf, a);
8759 +}
8760 +
8761 +static void bin_emit_data(void *e, struct data d)
8762 +{
8763 +       struct data *dtbuf = e;
8764 +
8765 +       *dtbuf = data_append_data(*dtbuf, d.val, d.len);
8766 +}
8767 +
8768 +static void bin_emit_beginnode(void *e, const char *label)
8769 +{
8770 +       bin_emit_cell(e, FDT_BEGIN_NODE);
8771 +}
8772 +
8773 +static void bin_emit_endnode(void *e, const char *label)
8774 +{
8775 +       bin_emit_cell(e, FDT_END_NODE);
8776 +}
8777 +
8778 +static void bin_emit_property(void *e, const char *label)
8779 +{
8780 +       bin_emit_cell(e, FDT_PROP);
8781 +}
8782 +
8783 +static struct emitter bin_emitter = {
8784 +       .cell = bin_emit_cell,
8785 +       .string = bin_emit_string,
8786 +       .align = bin_emit_align,
8787 +       .data = bin_emit_data,
8788 +       .beginnode = bin_emit_beginnode,
8789 +       .endnode = bin_emit_endnode,
8790 +       .property = bin_emit_property,
8791 +};
8792 +
8793 +static void emit_label(FILE *f, const char *prefix, const char *label)
8794 +{
8795 +       fprintf(f, "\t.globl\t%s_%s\n", prefix, label);
8796 +       fprintf(f, "%s_%s:\n", prefix, label);
8797 +       fprintf(f, "_%s_%s:\n", prefix, label);
8798 +}
8799 +
8800 +static void emit_offset_label(FILE *f, const char *label, int offset)
8801 +{
8802 +       fprintf(f, "\t.globl\t%s\n", label);
8803 +       fprintf(f, "%s\t= . + %d\n", label, offset);
8804 +}
8805 +
8806 +static void asm_emit_cell(void *e, cell_t val)
8807 +{
8808 +       FILE *f = e;
8809 +
8810 +       fprintf(f, "\t.long\t0x%x\n", val);
8811 +}
8812 +
8813 +static void asm_emit_string(void *e, char *str, int len)
8814 +{
8815 +       FILE *f = e;
8816 +       char c = 0;
8817 +
8818 +       if (len != 0) {
8819 +               /* XXX: ewww */
8820 +               c = str[len];
8821 +               str[len] = '\0';
8822 +       }
8823 +
8824 +       fprintf(f, "\t.string\t\"%s\"\n", str);
8825 +
8826 +       if (len != 0) {
8827 +               str[len] = c;
8828 +       }
8829 +}
8830 +
8831 +static void asm_emit_align(void *e, int a)
8832 +{
8833 +       FILE *f = e;
8834 +
8835 +       fprintf(f, "\t.balign\t%d\n", a);
8836 +}
8837 +
8838 +static void asm_emit_data(void *e, struct data d)
8839 +{
8840 +       FILE *f = e;
8841 +       int off = 0;
8842 +       struct marker *m;
8843 +
8844 +       m = d.markers;
8845 +       while (m) {
8846 +               if (m->type == LABEL)
8847 +                       emit_offset_label(f, m->ref, m->offset);
8848 +               m = m->next;
8849 +       }
8850 +
8851 +       while ((d.len - off) >= sizeof(u32)) {
8852 +               fprintf(f, "\t.long\t0x%x\n",
8853 +                       be32_to_cpu(*((u32 *)(d.val+off))));
8854 +               off += sizeof(u32);
8855 +       }
8856 +
8857 +       if ((d.len - off) >= sizeof(u16)) {
8858 +               fprintf(f, "\t.short\t0x%hx\n",
8859 +                       be16_to_cpu(*((u16 *)(d.val+off))));
8860 +               off += sizeof(u16);
8861 +       }
8862 +
8863 +       if ((d.len - off) >= 1) {
8864 +               fprintf(f, "\t.byte\t0x%hhx\n", d.val[off]);
8865 +               off += 1;
8866 +       }
8867 +
8868 +       assert(off == d.len);
8869 +}
8870 +
8871 +static void asm_emit_beginnode(void *e, const char *label)
8872 +{
8873 +       FILE *f = e;
8874 +
8875 +       if (label) {
8876 +               fprintf(f, "\t.globl\t%s\n", label);
8877 +               fprintf(f, "%s:\n", label);
8878 +       }
8879 +       fprintf(f, "\t.long\tFDT_BEGIN_NODE\n");
8880 +}
8881 +
8882 +static void asm_emit_endnode(void *e, const char *label)
8883 +{
8884 +       FILE *f = e;
8885 +
8886 +       fprintf(f, "\t.long\tFDT_END_NODE\n");
8887 +       if (label) {
8888 +               fprintf(f, "\t.globl\t%s_end\n", label);
8889 +               fprintf(f, "%s_end:\n", label);
8890 +       }
8891 +}
8892 +
8893 +static void asm_emit_property(void *e, const char *label)
8894 +{
8895 +       FILE *f = e;
8896 +
8897 +       if (label) {
8898 +               fprintf(f, "\t.globl\t%s\n", label);
8899 +               fprintf(f, "%s:\n", label);
8900 +       }
8901 +       fprintf(f, "\t.long\tFDT_PROP\n");
8902 +}
8903 +
8904 +static struct emitter asm_emitter = {
8905 +       .cell = asm_emit_cell,
8906 +       .string = asm_emit_string,
8907 +       .align = asm_emit_align,
8908 +       .data = asm_emit_data,
8909 +       .beginnode = asm_emit_beginnode,
8910 +       .endnode = asm_emit_endnode,
8911 +       .property = asm_emit_property,
8912 +};
8913 +
8914 +static int stringtable_insert(struct data *d, const char *str)
8915 +{
8916 +       int i;
8917 +
8918 +       /* FIXME: do this more efficiently? */
8919 +
8920 +       for (i = 0; i < d->len; i++) {
8921 +               if (streq(str, d->val + i))
8922 +                       return i;
8923 +       }
8924 +
8925 +       *d = data_append_data(*d, str, strlen(str)+1);
8926 +       return i;
8927 +}
8928 +
8929 +static void flatten_tree(struct node *tree, struct emitter *emit,
8930 +                        void *etarget, struct data *strbuf,
8931 +                        struct version_info *vi)
8932 +{
8933 +       struct property *prop;
8934 +       struct node *child;
8935 +       int seen_name_prop = 0;
8936 +
8937 +       emit->beginnode(etarget, tree->label);
8938 +
8939 +       if (vi->flags & FTF_FULLPATH)
8940 +               emit->string(etarget, tree->fullpath, 0);
8941 +       else
8942 +               emit->string(etarget, tree->name, 0);
8943 +
8944 +       emit->align(etarget, sizeof(cell_t));
8945 +
8946 +       for_each_property(tree, prop) {
8947 +               int nameoff;
8948 +
8949 +               if (streq(prop->name, "name"))
8950 +                       seen_name_prop = 1;
8951 +
8952 +               nameoff = stringtable_insert(strbuf, prop->name);
8953 +
8954 +               emit->property(etarget, prop->label);
8955 +               emit->cell(etarget, prop->val.len);
8956 +               emit->cell(etarget, nameoff);
8957 +
8958 +               if ((vi->flags & FTF_VARALIGN) && (prop->val.len >= 8))
8959 +                       emit->align(etarget, 8);
8960 +
8961 +               emit->data(etarget, prop->val);
8962 +               emit->align(etarget, sizeof(cell_t));
8963 +       }
8964 +
8965 +       if ((vi->flags & FTF_NAMEPROPS) && !seen_name_prop) {
8966 +               emit->property(etarget, NULL);
8967 +               emit->cell(etarget, tree->basenamelen+1);
8968 +               emit->cell(etarget, stringtable_insert(strbuf, "name"));
8969 +
8970 +               if ((vi->flags & FTF_VARALIGN) && ((tree->basenamelen+1) >= 8))
8971 +                       emit->align(etarget, 8);
8972 +
8973 +               emit->string(etarget, tree->name, tree->basenamelen);
8974 +               emit->align(etarget, sizeof(cell_t));
8975 +       }
8976 +
8977 +       for_each_child(tree, child) {
8978 +               flatten_tree(child, emit, etarget, strbuf, vi);
8979 +       }
8980 +
8981 +       emit->endnode(etarget, tree->label);
8982 +}
8983 +
8984 +static struct data flatten_reserve_list(struct reserve_info *reservelist,
8985 +                                struct version_info *vi)
8986 +{
8987 +       struct reserve_info *re;
8988 +       struct data d = empty_data;
8989 +       static struct fdt_reserve_entry null_re = {0,0};
8990 +       int    j;
8991 +
8992 +       for (re = reservelist; re; re = re->next) {
8993 +               d = data_append_re(d, &re->re);
8994 +       }
8995 +       /*
8996 +        * Add additional reserved slots if the user asked for them.
8997 +        */
8998 +       for (j = 0; j < reservenum; j++) {
8999 +               d = data_append_re(d, &null_re);
9000 +       }
9001 +
9002 +       return d;
9003 +}
9004 +
9005 +static void make_fdt_header(struct fdt_header *fdt,
9006 +                           struct version_info *vi,
9007 +                           int reservesize, int dtsize, int strsize,
9008 +                           int boot_cpuid_phys)
9009 +{
9010 +       int reserve_off;
9011 +
9012 +       reservesize += sizeof(struct fdt_reserve_entry);
9013 +
9014 +       memset(fdt, 0xff, sizeof(*fdt));
9015 +
9016 +       fdt->magic = cpu_to_be32(FDT_MAGIC);
9017 +       fdt->version = cpu_to_be32(vi->version);
9018 +       fdt->last_comp_version = cpu_to_be32(vi->last_comp_version);
9019 +
9020 +       /* Reserve map should be doubleword aligned */
9021 +       reserve_off = ALIGN(vi->hdr_size, 8);
9022 +
9023 +       fdt->off_mem_rsvmap = cpu_to_be32(reserve_off);
9024 +       fdt->off_dt_struct = cpu_to_be32(reserve_off + reservesize);
9025 +       fdt->off_dt_strings = cpu_to_be32(reserve_off + reservesize
9026 +                                         + dtsize);
9027 +       fdt->totalsize = cpu_to_be32(reserve_off + reservesize + dtsize + strsize);
9028 +
9029 +       if (vi->flags & FTF_BOOTCPUID)
9030 +               fdt->boot_cpuid_phys = cpu_to_be32(boot_cpuid_phys);
9031 +       if (vi->flags & FTF_STRTABSIZE)
9032 +               fdt->size_dt_strings = cpu_to_be32(strsize);
9033 +       if (vi->flags & FTF_STRUCTSIZE)
9034 +               fdt->size_dt_struct = cpu_to_be32(dtsize);
9035 +}
9036 +
9037 +void dt_to_blob(FILE *f, struct boot_info *bi, int version,
9038 +               int boot_cpuid_phys)
9039 +{
9040 +       struct version_info *vi = NULL;
9041 +       int i;
9042 +       struct data blob       = empty_data;
9043 +       struct data reservebuf = empty_data;
9044 +       struct data dtbuf      = empty_data;
9045 +       struct data strbuf     = empty_data;
9046 +       struct fdt_header fdt;
9047 +       int padlen = 0;
9048 +
9049 +       for (i = 0; i < ARRAY_SIZE(version_table); i++) {
9050 +               if (version_table[i].version == version)
9051 +                       vi = &version_table[i];
9052 +       }
9053 +       if (!vi)
9054 +               die("Unknown device tree blob version %d\n", version);
9055 +
9056 +       flatten_tree(bi->dt, &bin_emitter, &dtbuf, &strbuf, vi);
9057 +       bin_emit_cell(&dtbuf, FDT_END);
9058 +
9059 +       reservebuf = flatten_reserve_list(bi->reservelist, vi);
9060 +
9061 +       /* Make header */
9062 +       make_fdt_header(&fdt, vi, reservebuf.len, dtbuf.len, strbuf.len,
9063 +                       boot_cpuid_phys);
9064 +
9065 +       /*
9066 +        * If the user asked for more space than is used, adjust the totalsize.
9067 +        */
9068 +       if (minsize > 0) {
9069 +               padlen = minsize - be32_to_cpu(fdt.totalsize);
9070 +               if ((padlen < 0) && (quiet < 1))
9071 +                       fprintf(stderr,
9072 +                               "Warning: blob size %d >= minimum size %d\n",
9073 +                               be32_to_cpu(fdt.totalsize), minsize);
9074 +       }
9075 +
9076 +       if (padsize > 0)
9077 +               padlen = padsize;
9078 +
9079 +       if (padlen > 0) {
9080 +               int tsize = be32_to_cpu(fdt.totalsize);
9081 +               tsize += padlen;
9082 +               fdt.totalsize = cpu_to_be32(tsize);
9083 +       }
9084 +
9085 +       /*
9086 +        * Assemble the blob: start with the header, add with alignment
9087 +        * the reserve buffer, add the reserve map terminating zeroes,
9088 +        * the device tree itself, and finally the strings.
9089 +        */
9090 +       blob = data_append_data(blob, &fdt, sizeof(fdt));
9091 +       blob = data_append_align(blob, 8);
9092 +       blob = data_merge(blob, reservebuf);
9093 +       blob = data_append_zeroes(blob, sizeof(struct fdt_reserve_entry));
9094 +       blob = data_merge(blob, dtbuf);
9095 +       blob = data_merge(blob, strbuf);
9096 +
9097 +       /*
9098 +        * If the user asked for more space than is used, pad out the blob.
9099 +        */
9100 +       if (padlen > 0)
9101 +               blob = data_append_zeroes(blob, padlen);
9102 +
9103 +       fwrite(blob.val, blob.len, 1, f);
9104 +
9105 +       if (ferror(f))
9106 +               die("Error writing device tree blob: %s\n", strerror(errno));
9107 +
9108 +       /*
9109 +        * data_merge() frees the right-hand element so only the blob
9110 +        * remains to be freed.
9111 +        */
9112 +       data_free(blob);
9113 +}
9114 +
9115 +static void dump_stringtable_asm(FILE *f, struct data strbuf)
9116 +{
9117 +       const char *p;
9118 +       int len;
9119 +
9120 +       p = strbuf.val;
9121 +
9122 +       while (p < (strbuf.val + strbuf.len)) {
9123 +               len = strlen(p);
9124 +               fprintf(f, "\t.string \"%s\"\n", p);
9125 +               p += len+1;
9126 +       }
9127 +}
9128 +
9129 +void dt_to_asm(FILE *f, struct boot_info *bi, int version, int boot_cpuid_phys)
9130 +{
9131 +       struct version_info *vi = NULL;
9132 +       int i;
9133 +       struct data strbuf = empty_data;
9134 +       struct reserve_info *re;
9135 +       const char *symprefix = "dt";
9136 +
9137 +       for (i = 0; i < ARRAY_SIZE(version_table); i++) {
9138 +               if (version_table[i].version == version)
9139 +                       vi = &version_table[i];
9140 +       }
9141 +       if (!vi)
9142 +               die("Unknown device tree blob version %d\n", version);
9143 +
9144 +       fprintf(f, "/* autogenerated by dtc, do not edit */\n\n");
9145 +       fprintf(f, "#define FDT_MAGIC 0x%x\n", FDT_MAGIC);
9146 +       fprintf(f, "#define FDT_BEGIN_NODE 0x%x\n", FDT_BEGIN_NODE);
9147 +       fprintf(f, "#define FDT_END_NODE 0x%x\n", FDT_END_NODE);
9148 +       fprintf(f, "#define FDT_PROP 0x%x\n", FDT_PROP);
9149 +       fprintf(f, "#define FDT_END 0x%x\n", FDT_END);
9150 +       fprintf(f, "\n");
9151 +
9152 +       emit_label(f, symprefix, "blob_start");
9153 +       emit_label(f, symprefix, "header");
9154 +       fprintf(f, "\t.long\tFDT_MAGIC\t\t\t\t/* magic */\n");
9155 +       fprintf(f, "\t.long\t_%s_blob_abs_end - _%s_blob_start\t/* totalsize */\n",
9156 +               symprefix, symprefix);
9157 +       fprintf(f, "\t.long\t_%s_struct_start - _%s_blob_start\t/* off_dt_struct */\n",
9158 +               symprefix, symprefix);
9159 +       fprintf(f, "\t.long\t_%s_strings_start - _%s_blob_start\t/* off_dt_strings */\n",
9160 +               symprefix, symprefix);
9161 +       fprintf(f, "\t.long\t_%s_reserve_map - _%s_blob_start\t/* off_dt_strings */\n",
9162 +               symprefix, symprefix);
9163 +       fprintf(f, "\t.long\t%d\t\t\t\t\t/* version */\n", vi->version);
9164 +       fprintf(f, "\t.long\t%d\t\t\t\t\t/* last_comp_version */\n",
9165 +               vi->last_comp_version);
9166 +
9167 +       if (vi->flags & FTF_BOOTCPUID)
9168 +               fprintf(f, "\t.long\t%i\t\t\t\t\t/* boot_cpuid_phys */\n",
9169 +                       boot_cpuid_phys);
9170 +
9171 +       if (vi->flags & FTF_STRTABSIZE)
9172 +               fprintf(f, "\t.long\t_%s_strings_end - _%s_strings_start\t/* size_dt_strings */\n",
9173 +                       symprefix, symprefix);
9174 +
9175 +       if (vi->flags & FTF_STRUCTSIZE)
9176 +               fprintf(f, "\t.long\t_%s_struct_end - _%s_struct_start\t/* size_dt_struct */\n",
9177 +                       symprefix, symprefix);
9178 +
9179 +       /*
9180 +        * Reserve map entries.
9181 +        * Align the reserve map to a doubleword boundary.
9182 +        * Each entry is an (address, size) pair of u64 values.
9183 +        * Always supply a zero-sized temination entry.
9184 +        */
9185 +       asm_emit_align(f, 8);
9186 +       emit_label(f, symprefix, "reserve_map");
9187 +
9188 +       fprintf(f, "/* Memory reserve map from source file */\n");
9189 +
9190 +       /*
9191 +        * Use .long on high and low halfs of u64s to avoid .quad
9192 +        * as it appears .quad isn't available in some assemblers.
9193 +        */
9194 +       for (re = bi->reservelist; re; re = re->next) {
9195 +               if (re->label) {
9196 +                       fprintf(f, "\t.globl\t%s\n", re->label);
9197 +                       fprintf(f, "%s:\n", re->label);
9198 +               }
9199 +               fprintf(f, "\t.long\t0x%08x, 0x%08x\n",
9200 +                       (unsigned int)(re->re.address >> 32),
9201 +                       (unsigned int)(re->re.address & 0xffffffff));
9202 +               fprintf(f, "\t.long\t0x%08x, 0x%08x\n",
9203 +                       (unsigned int)(re->re.size >> 32),
9204 +                       (unsigned int)(re->re.size & 0xffffffff));
9205 +       }
9206 +       for (i = 0; i < reservenum; i++) {
9207 +               fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
9208 +       }
9209 +
9210 +       fprintf(f, "\t.long\t0, 0\n\t.long\t0, 0\n");
9211 +
9212 +       emit_label(f, symprefix, "struct_start");
9213 +       flatten_tree(bi->dt, &asm_emitter, f, &strbuf, vi);
9214 +       fprintf(f, "\t.long\tFDT_END\n");
9215 +       emit_label(f, symprefix, "struct_end");
9216 +
9217 +       emit_label(f, symprefix, "strings_start");
9218 +       dump_stringtable_asm(f, strbuf);
9219 +       emit_label(f, symprefix, "strings_end");
9220 +
9221 +       emit_label(f, symprefix, "blob_end");
9222 +
9223 +       /*
9224 +        * If the user asked for more space than is used, pad it out.
9225 +        */
9226 +       if (minsize > 0) {
9227 +               fprintf(f, "\t.space\t%d - (_%s_blob_end - _%s_blob_start), 0\n",
9228 +                       minsize, symprefix, symprefix);
9229 +       }
9230 +       if (padsize > 0) {
9231 +               fprintf(f, "\t.space\t%d, 0\n", padsize);
9232 +       }
9233 +       emit_label(f, symprefix, "blob_abs_end");
9234 +
9235 +       data_free(strbuf);
9236 +}
9237 +
9238 +struct inbuf {
9239 +       char *base, *limit, *ptr;
9240 +};
9241 +
9242 +static void inbuf_init(struct inbuf *inb, void *base, void *limit)
9243 +{
9244 +       inb->base = base;
9245 +       inb->limit = limit;
9246 +       inb->ptr = inb->base;
9247 +}
9248 +
9249 +static void flat_read_chunk(struct inbuf *inb, void *p, int len)
9250 +{
9251 +       if ((inb->ptr + len) > inb->limit)
9252 +               die("Premature end of data parsing flat device tree\n");
9253 +
9254 +       memcpy(p, inb->ptr, len);
9255 +
9256 +       inb->ptr += len;
9257 +}
9258 +
9259 +static u32 flat_read_word(struct inbuf *inb)
9260 +{
9261 +       u32 val;
9262 +
9263 +       assert(((inb->ptr - inb->base) % sizeof(val)) == 0);
9264 +
9265 +       flat_read_chunk(inb, &val, sizeof(val));
9266 +
9267 +       return be32_to_cpu(val);
9268 +}
9269 +
9270 +static void flat_realign(struct inbuf *inb, int align)
9271 +{
9272 +       int off = inb->ptr - inb->base;
9273 +
9274 +       inb->ptr = inb->base + ALIGN(off, align);
9275 +       if (inb->ptr > inb->limit)
9276 +               die("Premature end of data parsing flat device tree\n");
9277 +}
9278 +
9279 +static char *flat_read_string(struct inbuf *inb)
9280 +{
9281 +       int len = 0;
9282 +       const char *p = inb->ptr;
9283 +       char *str;
9284 +
9285 +       do {
9286 +               if (p >= inb->limit)
9287 +                       die("Premature end of data parsing flat device tree\n");
9288 +               len++;
9289 +       } while ((*p++) != '\0');
9290 +
9291 +       str = strdup(inb->ptr);
9292 +
9293 +       inb->ptr += len;
9294 +
9295 +       flat_realign(inb, sizeof(u32));
9296 +
9297 +       return str;
9298 +}
9299 +
9300 +static struct data flat_read_data(struct inbuf *inb, int len)
9301 +{
9302 +       struct data d = empty_data;
9303 +
9304 +       if (len == 0)
9305 +               return empty_data;
9306 +
9307 +       d = data_grow_for(d, len);
9308 +       d.len = len;
9309 +
9310 +       flat_read_chunk(inb, d.val, len);
9311 +
9312 +       flat_realign(inb, sizeof(u32));
9313 +
9314 +       return d;
9315 +}
9316 +
9317 +static char *flat_read_stringtable(struct inbuf *inb, int offset)
9318 +{
9319 +       const char *p;
9320 +
9321 +       p = inb->base + offset;
9322 +       while (1) {
9323 +               if (p >= inb->limit || p < inb->base)
9324 +                       die("String offset %d overruns string table\n",
9325 +                           offset);
9326 +
9327 +               if (*p == '\0')
9328 +                       break;
9329 +
9330 +               p++;
9331 +       }
9332 +
9333 +       return strdup(inb->base + offset);
9334 +}
9335 +
9336 +static struct property *flat_read_property(struct inbuf *dtbuf,
9337 +                                          struct inbuf *strbuf, int flags)
9338 +{
9339 +       u32 proplen, stroff;
9340 +       char *name;
9341 +       struct data val;
9342 +
9343 +       proplen = flat_read_word(dtbuf);
9344 +       stroff = flat_read_word(dtbuf);
9345 +
9346 +       name = flat_read_stringtable(strbuf, stroff);
9347 +
9348 +       if ((flags & FTF_VARALIGN) && (proplen >= 8))
9349 +               flat_realign(dtbuf, 8);
9350 +
9351 +       val = flat_read_data(dtbuf, proplen);
9352 +
9353 +       return build_property(name, val, NULL);
9354 +}
9355 +
9356 +
9357 +static struct reserve_info *flat_read_mem_reserve(struct inbuf *inb)
9358 +{
9359 +       struct reserve_info *reservelist = NULL;
9360 +       struct reserve_info *new;
9361 +       const char *p;
9362 +       struct fdt_reserve_entry re;
9363 +
9364 +       /*
9365 +        * Each entry is a pair of u64 (addr, size) values for 4 cell_t's.
9366 +        * List terminates at an entry with size equal to zero.
9367 +        *
9368 +        * First pass, count entries.
9369 +        */
9370 +       p = inb->ptr;
9371 +       while (1) {
9372 +               flat_read_chunk(inb, &re, sizeof(re));
9373 +               re.address  = be64_to_cpu(re.address);
9374 +               re.size = be64_to_cpu(re.size);
9375 +               if (re.size == 0)
9376 +                       break;
9377 +
9378 +               new = build_reserve_entry(re.address, re.size, NULL);
9379 +               reservelist = add_reserve_entry(reservelist, new);
9380 +       }
9381 +
9382 +       return reservelist;
9383 +}
9384 +
9385 +
9386 +static char *nodename_from_path(const char *ppath, const char *cpath)
9387 +{
9388 +       const char *lslash;
9389 +       int plen;
9390 +
9391 +       lslash = strrchr(cpath, '/');
9392 +       if (! lslash)
9393 +               return NULL;
9394 +
9395 +       plen = lslash - cpath;
9396 +
9397 +       if (streq(cpath, "/") && streq(ppath, ""))
9398 +               return "";
9399 +
9400 +       if ((plen == 0) && streq(ppath, "/"))
9401 +               return strdup(lslash+1);
9402 +
9403 +       if (! strneq(ppath, cpath, plen))
9404 +               return NULL;
9405 +
9406 +       return strdup(lslash+1);
9407 +}
9408 +
9409 +static const char PROPCHAR[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,._+*#?-";
9410 +static const char UNITCHAR[] = "0123456789abcdef,";
9411 +
9412 +static int check_node_name(const char *name)
9413 +{
9414 +       const char *atpos;
9415 +       int basenamelen;
9416 +
9417 +       atpos = strrchr(name, '@');
9418 +
9419 +       if (atpos)
9420 +               basenamelen = atpos - name;
9421 +       else
9422 +               basenamelen = strlen(name);
9423 +
9424 +       if (strspn(name, PROPCHAR) < basenamelen)
9425 +               return -1;
9426 +
9427 +       if (atpos
9428 +           && ((basenamelen + 1 + strspn(atpos+1, UNITCHAR)) < strlen(name)))
9429 +               return -1;
9430 +
9431 +       return basenamelen;
9432 +}
9433 +
9434 +static struct node *unflatten_tree(struct inbuf *dtbuf,
9435 +                                  struct inbuf *strbuf,
9436 +                                  const char *parent_path, int flags)
9437 +{
9438 +       struct node *node;
9439 +       u32 val;
9440 +
9441 +       node = build_node(NULL, NULL);
9442 +
9443 +       if (flags & FTF_FULLPATH) {
9444 +               node->fullpath = flat_read_string(dtbuf);
9445 +               node->name = nodename_from_path(parent_path, node->fullpath);
9446 +
9447 +               if (! node->name)
9448 +                       die("Path \"%s\" is not valid as a child of \"%s\"\n",
9449 +                           node->fullpath, parent_path);
9450 +       } else {
9451 +               node->name = flat_read_string(dtbuf);
9452 +               node->fullpath = join_path(parent_path, node->name);
9453 +       }
9454 +
9455 +       node->basenamelen = check_node_name(node->name);
9456 +       if (node->basenamelen < 0) {
9457 +               fprintf(stderr, "Warning \"%s\" has incorrect format\n", node->name);
9458 +       }
9459 +
9460 +       do {
9461 +               struct property *prop;
9462 +               struct node *child;
9463 +
9464 +               val = flat_read_word(dtbuf);
9465 +               switch (val) {
9466 +               case FDT_PROP:
9467 +                       if (node->children)
9468 +                               fprintf(stderr, "Warning: Flat tree input has "
9469 +                                       "subnodes preceding a property.\n");
9470 +                       prop = flat_read_property(dtbuf, strbuf, flags);
9471 +                       add_property(node, prop);
9472 +                       break;
9473 +
9474 +               case FDT_BEGIN_NODE:
9475 +                       child = unflatten_tree(dtbuf,strbuf, node->fullpath,
9476 +                                              flags);
9477 +                       add_child(node, child);
9478 +                       break;
9479 +
9480 +               case FDT_END_NODE:
9481 +                       break;
9482 +
9483 +               case FDT_END:
9484 +                       die("Premature FDT_END in device tree blob\n");
9485 +                       break;
9486 +
9487 +               case FDT_NOP:
9488 +                       if (!(flags & FTF_NOPS))
9489 +                               fprintf(stderr, "Warning: NOP tag found in flat tree"
9490 +                                       " version <16\n");
9491 +
9492 +                       /* Ignore */
9493 +                       break;
9494 +
9495 +               default:
9496 +                       die("Invalid opcode word %08x in device tree blob\n",
9497 +                           val);
9498 +               }
9499 +       } while (val != FDT_END_NODE);
9500 +
9501 +       return node;
9502 +}
9503 +
9504 +
9505 +struct boot_info *dt_from_blob(FILE *f)
9506 +{
9507 +       u32 magic, totalsize, version, size_str, size_dt;
9508 +       u32 off_dt, off_str, off_mem_rsvmap;
9509 +       int rc;
9510 +       char *blob;
9511 +       struct fdt_header *fdt;
9512 +       char *p;
9513 +       struct inbuf dtbuf, strbuf;
9514 +       struct inbuf memresvbuf;
9515 +       int sizeleft;
9516 +       struct reserve_info *reservelist;
9517 +       struct node *tree;
9518 +       u32 val;
9519 +       int flags = 0;
9520 +
9521 +       rc = fread(&magic, sizeof(magic), 1, f);
9522 +       if (ferror(f))
9523 +               die("Error reading DT blob magic number: %s\n",
9524 +                   strerror(errno));
9525 +       if (rc < 1) {
9526 +               if (feof(f))
9527 +                       die("EOF reading DT blob magic number\n");
9528 +               else
9529 +                       die("Mysterious short read reading magic number\n");
9530 +       }
9531 +
9532 +       magic = be32_to_cpu(magic);
9533 +       if (magic != FDT_MAGIC)
9534 +               die("Blob has incorrect magic number\n");
9535 +
9536 +       rc = fread(&totalsize, sizeof(totalsize), 1, f);
9537 +       if (ferror(f))
9538 +               die("Error reading DT blob size: %s\n", strerror(errno));
9539 +       if (rc < 1) {
9540 +               if (feof(f))
9541 +                       die("EOF reading DT blob size\n");
9542 +               else
9543 +                       die("Mysterious short read reading blob size\n");
9544 +       }
9545 +
9546 +       totalsize = be32_to_cpu(totalsize);
9547 +       if (totalsize < FDT_V1_SIZE)
9548 +               die("DT blob size (%d) is too small\n", totalsize);
9549 +
9550 +       blob = xmalloc(totalsize);
9551 +
9552 +       fdt = (struct fdt_header *)blob;
9553 +       fdt->magic = cpu_to_be32(magic);
9554 +       fdt->totalsize = cpu_to_be32(totalsize);
9555 +
9556 +       sizeleft = totalsize - sizeof(magic) - sizeof(totalsize);
9557 +       p = blob + sizeof(magic)  + sizeof(totalsize);
9558 +
9559 +       while (sizeleft) {
9560 +               if (feof(f))
9561 +                       die("EOF before reading %d bytes of DT blob\n",
9562 +                           totalsize);
9563 +
9564 +               rc = fread(p, 1, sizeleft, f);
9565 +               if (ferror(f))
9566 +                       die("Error reading DT blob: %s\n",
9567 +                           strerror(errno));
9568 +
9569 +               sizeleft -= rc;
9570 +               p += rc;
9571 +       }
9572 +
9573 +       off_dt = be32_to_cpu(fdt->off_dt_struct);
9574 +       off_str = be32_to_cpu(fdt->off_dt_strings);
9575 +       off_mem_rsvmap = be32_to_cpu(fdt->off_mem_rsvmap);
9576 +       version = be32_to_cpu(fdt->version);
9577 +
9578 +       fprintf(stderr, "\tmagic:\t\t\t0x%x\n", magic);
9579 +       fprintf(stderr, "\ttotalsize:\t\t%d\n", totalsize);
9580 +       fprintf(stderr, "\toff_dt_struct:\t\t0x%x\n", off_dt);
9581 +       fprintf(stderr, "\toff_dt_strings:\t\t0x%x\n", off_str);
9582 +       fprintf(stderr, "\toff_mem_rsvmap:\t\t0x%x\n", off_mem_rsvmap);
9583 +       fprintf(stderr, "\tversion:\t\t0x%x\n", version );
9584 +       fprintf(stderr, "\tlast_comp_version:\t0x%x\n",
9585 +               be32_to_cpu(fdt->last_comp_version));
9586 +
9587 +       if (off_mem_rsvmap >= totalsize)
9588 +               die("Mem Reserve structure offset exceeds total size\n");
9589 +
9590 +       if (off_dt >= totalsize)
9591 +               die("DT structure offset exceeds total size\n");
9592 +
9593 +       if (off_str > totalsize)
9594 +               die("String table offset exceeds total size\n");
9595 +
9596 +       if (version >= 2)
9597 +               fprintf(stderr, "\tboot_cpuid_phys:\t0x%x\n",
9598 +                       be32_to_cpu(fdt->boot_cpuid_phys));
9599 +
9600 +       size_str = -1;
9601 +       if (version >= 3) {
9602 +               size_str = be32_to_cpu(fdt->size_dt_strings);
9603 +               fprintf(stderr, "\tsize_dt_strings:\t%d\n", size_str);
9604 +               if (off_str+size_str > totalsize)
9605 +                       die("String table extends past total size\n");
9606 +       }
9607 +
9608 +       if (version >= 17) {
9609 +               size_dt = be32_to_cpu(fdt->size_dt_struct);
9610 +               fprintf(stderr, "\tsize_dt_struct:\t\t%d\n", size_dt);
9611 +               if (off_dt+size_dt > totalsize)
9612 +                       die("Structure block extends past total size\n");
9613 +       }
9614 +
9615 +       if (version < 16) {
9616 +               flags |= FTF_FULLPATH | FTF_NAMEPROPS | FTF_VARALIGN;
9617 +       } else {
9618 +               flags |= FTF_NOPS;
9619 +       }
9620 +
9621 +       inbuf_init(&memresvbuf,
9622 +                  blob + off_mem_rsvmap, blob + totalsize);
9623 +       inbuf_init(&dtbuf, blob + off_dt, blob + totalsize);
9624 +       if (size_str >= 0)
9625 +               inbuf_init(&strbuf, blob + off_str, blob + off_str + size_str);
9626 +       else
9627 +               inbuf_init(&strbuf, blob + off_str, blob + totalsize);
9628 +
9629 +       reservelist = flat_read_mem_reserve(&memresvbuf);
9630 +
9631 +       val = flat_read_word(&dtbuf);
9632 +
9633 +       if (val != FDT_BEGIN_NODE)
9634 +               die("Device tree blob doesn't begin with FDT_BEGIN_NODE (begins with 0x%08x)\n", val);
9635 +
9636 +       tree = unflatten_tree(&dtbuf, &strbuf, "", flags);
9637 +
9638 +       val = flat_read_word(&dtbuf);
9639 +       if (val != FDT_END)
9640 +               die("Device tree blob doesn't end with FDT_END\n");
9641 +
9642 +       free(blob);
9643 +
9644 +       return build_boot_info(reservelist, tree);
9645 +}
9646 --- /dev/null
9647 +++ b/arch/powerpc/boot/dtc-src/fstree.c
9648 @@ -0,0 +1,94 @@
9649 +/*
9650 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
9651 + *
9652 + *
9653 + * This program is free software; you can redistribute it and/or
9654 + * modify it under the terms of the GNU General Public License as
9655 + * published by the Free Software Foundation; either version 2 of the
9656 + * License, or (at your option) any later version.
9657 + *
9658 + *  This program is distributed in the hope that it will be useful,
9659 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
9660 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9661 + *  General Public License for more details.
9662 + *
9663 + *  You should have received a copy of the GNU General Public License
9664 + *  along with this program; if not, write to the Free Software
9665 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
9666 + *                                                                   USA
9667 + */
9668 +
9669 +#include "dtc.h"
9670 +
9671 +#include <dirent.h>
9672 +#include <sys/stat.h>
9673 +
9674 +static struct node *read_fstree(const char *dirname)
9675 +{
9676 +       DIR *d;
9677 +       struct dirent *de;
9678 +       struct stat st;
9679 +       struct node *tree;
9680 +
9681 +       d = opendir(dirname);
9682 +       if (! d)
9683 +               die("opendir(): %s\n", strerror(errno));
9684 +
9685 +       tree = build_node(NULL, NULL);
9686 +
9687 +       while ((de = readdir(d)) != NULL) {
9688 +               char *tmpnam;
9689 +
9690 +               if (streq(de->d_name, ".")
9691 +                   || streq(de->d_name, ".."))
9692 +                       continue;
9693 +
9694 +               tmpnam = join_path(dirname, de->d_name);
9695 +
9696 +               if (lstat(tmpnam, &st) < 0)
9697 +                       die("stat(%s): %s\n", tmpnam, strerror(errno));
9698 +
9699 +               if (S_ISREG(st.st_mode)) {
9700 +                       struct property *prop;
9701 +                       FILE *pfile;
9702 +
9703 +                       pfile = fopen(tmpnam, "r");
9704 +                       if (! pfile) {
9705 +                               fprintf(stderr,
9706 +                                       "WARNING: Cannot open %s: %s\n",
9707 +                                       tmpnam, strerror(errno));
9708 +                       } else {
9709 +                               prop = build_property(strdup(de->d_name),
9710 +                                                     data_copy_file(pfile,
9711 +                                                                    st.st_size),
9712 +                                                     NULL);
9713 +                               add_property(tree, prop);
9714 +                               fclose(pfile);
9715 +                       }
9716 +               } else if (S_ISDIR(st.st_mode)) {
9717 +                       struct node *newchild;
9718 +
9719 +                       newchild = read_fstree(tmpnam);
9720 +                       newchild = name_node(newchild, strdup(de->d_name),
9721 +                                            NULL);
9722 +                       add_child(tree, newchild);
9723 +               }
9724 +
9725 +               free(tmpnam);
9726 +       }
9727 +
9728 +       return tree;
9729 +}
9730 +
9731 +struct boot_info *dt_from_fs(const char *dirname)
9732 +{
9733 +       struct node *tree;
9734 +
9735 +       tree = read_fstree(dirname);
9736 +       tree = name_node(tree, "", NULL);
9737 +
9738 +       fill_fullpaths(tree, "");
9739 +
9740 +       return build_boot_info(NULL, tree);
9741 +}
9742 +
9743 --- /dev/null
9744 +++ b/arch/powerpc/boot/dtc-src/livetree.c
9745 @@ -0,0 +1,305 @@
9746 +/*
9747 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
9748 + *
9749 + *
9750 + * This program is free software; you can redistribute it and/or
9751 + * modify it under the terms of the GNU General Public License as
9752 + * published by the Free Software Foundation; either version 2 of the
9753 + * License, or (at your option) any later version.
9754 + *
9755 + *  This program is distributed in the hope that it will be useful,
9756 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
9757 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9758 + *  General Public License for more details.
9759 + *
9760 + *  You should have received a copy of the GNU General Public License
9761 + *  along with this program; if not, write to the Free Software
9762 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
9763 + *                                                                   USA
9764 + */
9765 +
9766 +#include "dtc.h"
9767 +
9768 +/*
9769 + * Tree building functions
9770 + */
9771 +
9772 +struct property *build_property(char *name, struct data val, char *label)
9773 +{
9774 +       struct property *new = xmalloc(sizeof(*new));
9775 +
9776 +       new->name = name;
9777 +       new->val = val;
9778 +
9779 +       new->next = NULL;
9780 +
9781 +       new->label = label;
9782 +
9783 +       return new;
9784 +}
9785 +
9786 +struct property *chain_property(struct property *first, struct property *list)
9787 +{
9788 +       assert(first->next == NULL);
9789 +
9790 +       first->next = list;
9791 +       return first;
9792 +}
9793 +
9794 +struct property *reverse_properties(struct property *first)
9795 +{
9796 +       struct property *p = first;
9797 +       struct property *head = NULL;
9798 +       struct property *next;
9799 +
9800 +       while (p) {
9801 +               next = p->next;
9802 +               p->next = head;
9803 +               head = p;
9804 +               p = next;
9805 +       }
9806 +       return head;
9807 +}
9808 +
9809 +struct node *build_node(struct property *proplist, struct node *children)
9810 +{
9811 +       struct node *new = xmalloc(sizeof(*new));
9812 +       struct node *child;
9813 +
9814 +       memset(new, 0, sizeof(*new));
9815 +
9816 +       new->proplist = reverse_properties(proplist);
9817 +       new->children = children;
9818 +
9819 +       for_each_child(new, child) {
9820 +               child->parent = new;
9821 +       }
9822 +
9823 +       return new;
9824 +}
9825 +
9826 +struct node *name_node(struct node *node, char *name, char * label)
9827 +{
9828 +       assert(node->name == NULL);
9829 +
9830 +       node->name = name;
9831 +
9832 +       node->label = label;
9833 +
9834 +       return node;
9835 +}
9836 +
9837 +struct node *chain_node(struct node *first, struct node *list)
9838 +{
9839 +       assert(first->next_sibling == NULL);
9840 +
9841 +       first->next_sibling = list;
9842 +       return first;
9843 +}
9844 +
9845 +void add_property(struct node *node, struct property *prop)
9846 +{
9847 +       struct property **p;
9848 +
9849 +       prop->next = NULL;
9850 +
9851 +       p = &node->proplist;
9852 +       while (*p)
9853 +               p = &((*p)->next);
9854 +
9855 +       *p = prop;
9856 +}
9857 +
9858 +void add_child(struct node *parent, struct node *child)
9859 +{
9860 +       struct node **p;
9861 +
9862 +       child->next_sibling = NULL;
9863 +
9864 +       p = &parent->children;
9865 +       while (*p)
9866 +               p = &((*p)->next_sibling);
9867 +
9868 +       *p = child;
9869 +}
9870 +
9871 +struct reserve_info *build_reserve_entry(u64 address, u64 size, char *label)
9872 +{
9873 +       struct reserve_info *new = xmalloc(sizeof(*new));
9874 +
9875 +       new->re.address = address;
9876 +       new->re.size = size;
9877 +
9878 +       new->next = NULL;
9879 +
9880 +       new->label = label;
9881 +
9882 +       return new;
9883 +}
9884 +
9885 +struct reserve_info *chain_reserve_entry(struct reserve_info *first,
9886 +                                       struct reserve_info *list)
9887 +{
9888 +       assert(first->next == NULL);
9889 +
9890 +       first->next = list;
9891 +       return first;
9892 +}
9893 +
9894 +struct reserve_info *add_reserve_entry(struct reserve_info *list,
9895 +                                     struct reserve_info *new)
9896 +{
9897 +       struct reserve_info *last;
9898 +
9899 +       new->next = NULL;
9900 +
9901 +       if (! list)
9902 +               return new;
9903 +
9904 +       for (last = list; last->next; last = last->next)
9905 +               ;
9906 +
9907 +       last->next = new;
9908 +
9909 +       return list;
9910 +}
9911 +
9912 +struct boot_info *build_boot_info(struct reserve_info *reservelist,
9913 +                                 struct node *tree)
9914 +{
9915 +       struct boot_info *bi;
9916 +
9917 +       bi = xmalloc(sizeof(*bi));
9918 +       bi->reservelist = reservelist;
9919 +       bi->dt = tree;
9920 +
9921 +       return bi;
9922 +}
9923 +
9924 +/*
9925 + * Tree accessor functions
9926 + */
9927 +
9928 +const char *get_unitname(struct node *node)
9929 +{
9930 +       if (node->name[node->basenamelen] == '\0')
9931 +               return "";
9932 +       else
9933 +               return node->name + node->basenamelen + 1;
9934 +}
9935 +
9936 +struct property *get_property(struct node *node, const char *propname)
9937 +{
9938 +       struct property *prop;
9939 +
9940 +       for_each_property(node, prop)
9941 +               if (streq(prop->name, propname))
9942 +                       return prop;
9943 +
9944 +       return NULL;
9945 +}
9946 +
9947 +cell_t propval_cell(struct property *prop)
9948 +{
9949 +       assert(prop->val.len == sizeof(cell_t));
9950 +       return be32_to_cpu(*((cell_t *)prop->val.val));
9951 +}
9952 +
9953 +struct node *get_subnode(struct node *node, const char *nodename)
9954 +{
9955 +       struct node *child;
9956 +
9957 +       for_each_child(node, child)
9958 +               if (streq(child->name, nodename))
9959 +                       return child;
9960 +
9961 +       return NULL;
9962 +}
9963 +
9964 +struct node *get_node_by_path(struct node *tree, const char *path)
9965 +{
9966 +       const char *p;
9967 +       struct node *child;
9968 +
9969 +       if (!path || ! (*path))
9970 +               return tree;
9971 +
9972 +       while (path[0] == '/')
9973 +               path++;
9974 +
9975 +       p = strchr(path, '/');
9976 +
9977 +       for_each_child(tree, child) {
9978 +               if (p && strneq(path, child->name, p-path))
9979 +                       return get_node_by_path(child, p+1);
9980 +               else if (!p && streq(path, child->name))
9981 +                       return child;
9982 +       }
9983 +
9984 +       return NULL;
9985 +}
9986 +
9987 +struct node *get_node_by_label(struct node *tree, const char *label)
9988 +{
9989 +       struct node *child, *node;
9990 +
9991 +       assert(label && (strlen(label) > 0));
9992 +
9993 +       if (tree->label && streq(tree->label, label))
9994 +               return tree;
9995 +
9996 +       for_each_child(tree, child) {
9997 +               node = get_node_by_label(child, label);
9998 +               if (node)
9999 +                       return node;
10000 +       }
10001 +
10002 +       return NULL;
10003 +}
10004 +
10005 +struct node *get_node_by_phandle(struct node *tree, cell_t phandle)
10006 +{
10007 +       struct node *child, *node;
10008 +
10009 +       assert((phandle != 0) && (phandle != -1));
10010 +
10011 +       if (tree->phandle == phandle)
10012 +               return tree;
10013 +
10014 +       for_each_child(tree, child) {
10015 +               node = get_node_by_phandle(child, phandle);
10016 +               if (node)
10017 +                       return node;
10018 +       }
10019 +
10020 +       return NULL;
10021 +}
10022 +
10023 +struct node *get_node_by_ref(struct node *tree, const char *ref)
10024 +{
10025 +       if (ref[0] == '/')
10026 +               return get_node_by_path(tree, ref);
10027 +       else
10028 +               return get_node_by_label(tree, ref);
10029 +}
10030 +
10031 +cell_t get_node_phandle(struct node *root, struct node *node)
10032 +{
10033 +       static cell_t phandle = 1; /* FIXME: ick, static local */
10034 +
10035 +       if ((node->phandle != 0) && (node->phandle != -1))
10036 +               return node->phandle;
10037 +
10038 +       assert(! get_property(node, "linux,phandle"));
10039 +
10040 +       while (get_node_by_phandle(root, phandle))
10041 +               phandle++;
10042 +
10043 +       node->phandle = phandle;
10044 +       add_property(node,
10045 +                    build_property("linux,phandle",
10046 +                                   data_append_cell(empty_data, phandle),
10047 +                                   NULL));
10048 +
10049 +       return node->phandle;
10050 +}
10051 --- /dev/null
10052 +++ b/arch/powerpc/boot/dtc-src/srcpos.c
10053 @@ -0,0 +1,105 @@
10054 +/*
10055 + * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
10056 + *
10057 + * This program is free software; you can redistribute it and/or
10058 + * modify it under the terms of the GNU General Public License as
10059 + * published by the Free Software Foundation; either version 2 of the
10060 + * License, or (at your option) any later version.
10061 + *
10062 + *  This program is distributed in the hope that it will be useful,
10063 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10064 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10065 + *  General Public License for more details.
10066 + *
10067 + *  You should have received a copy of the GNU General Public License
10068 + *  along with this program; if not, write to the Free Software
10069 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
10070 + *                                                                   USA
10071 + */
10072 +
10073 +#include "dtc.h"
10074 +#include "srcpos.h"
10075 +
10076 +
10077 +/*
10078 + * Record the complete unique set of opened file names.
10079 + * Primarily used to cache source position file names.
10080 + */
10081 +#define MAX_N_FILE_NAMES       (100)
10082 +
10083 +const char *file_names[MAX_N_FILE_NAMES];
10084 +static int n_file_names = 0;
10085 +
10086 +/*
10087 + * Like yylineno, this is the current open file pos.
10088 + */
10089 +
10090 +int srcpos_filenum = -1;
10091 +
10092 +
10093 +
10094 +FILE *dtc_open_file(const char *fname)
10095 +{
10096 +       FILE *f;
10097 +
10098 +       if (lookup_file_name(fname, 1) < 0)
10099 +               die("Too many files opened\n");
10100 +
10101 +       if (streq(fname, "-"))
10102 +               f = stdin;
10103 +       else
10104 +               f = fopen(fname, "r");
10105 +
10106 +       if (! f)
10107 +               die("Couldn't open \"%s\": %s\n", fname, strerror(errno));
10108 +
10109 +       return f;
10110 +}
10111 +
10112 +
10113 +
10114 +/*
10115 + * Locate and optionally add filename fname in the file_names[] array.
10116 + *
10117 + * If the filename is currently not in the array and the boolean
10118 + * add_it is non-zero, an attempt to add the filename will be made.
10119 + *
10120 + * Returns;
10121 + *    Index [0..MAX_N_FILE_NAMES) where the filename is kept
10122 + *    -1 if the name can not be recorded
10123 + */
10124 +
10125 +int lookup_file_name(const char *fname, int add_it)
10126 +{
10127 +       int i;
10128 +
10129 +       for (i = 0; i < n_file_names; i++) {
10130 +               if (strcmp(file_names[i], fname) == 0)
10131 +                       return i;
10132 +       }
10133 +
10134 +       if (add_it) {
10135 +               if (n_file_names < MAX_N_FILE_NAMES) {
10136 +                       file_names[n_file_names] = strdup(fname);
10137 +                       return n_file_names++;
10138 +               }
10139 +       }
10140 +
10141 +       return -1;
10142 +}
10143 +
10144 +
10145 +const char *srcpos_filename_for_num(int filenum)
10146 +{
10147 +       if (0 <= filenum && filenum < n_file_names) {
10148 +               return file_names[filenum];
10149 +       }
10150 +
10151 +       return 0;
10152 +}
10153 +
10154 +
10155 +const char *srcpos_get_filename(void)
10156 +{
10157 +       return srcpos_filename_for_num(srcpos_filenum);
10158 +}
10159 --- /dev/null
10160 +++ b/arch/powerpc/boot/dtc-src/srcpos.h
10161 @@ -0,0 +1,75 @@
10162 +/*
10163 + * Copyright 2007 Jon Loeliger, Freescale Semiconductor, Inc.
10164 + *
10165 + * This program is free software; you can redistribute it and/or
10166 + * modify it under the terms of the GNU General Public License as
10167 + * published by the Free Software Foundation; either version 2 of the
10168 + * License, or (at your option) any later version.
10169 + *
10170 + *  This program is distributed in the hope that it will be useful,
10171 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10172 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10173 + *  General Public License for more details.
10174 + *
10175 + *  You should have received a copy of the GNU General Public License
10176 + *  along with this program; if not, write to the Free Software
10177 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
10178 + *                                                                   USA
10179 + */
10180 +
10181 +/*
10182 + * Augment the standard YYLTYPE with a filenum index into an
10183 + * array of all opened filenames.
10184 + */
10185 +
10186 +#if ! defined(YYLTYPE) && ! defined(YYLTYPE_IS_DECLARED)
10187 +typedef struct YYLTYPE {
10188 +    int first_line;
10189 +    int first_column;
10190 +    int last_line;
10191 +    int last_column;
10192 +    int filenum;
10193 +} YYLTYPE;
10194 +
10195 +#define YYLTYPE_IS_DECLARED    1
10196 +#define YYLTYPE_IS_TRIVIAL     1
10197 +#endif
10198 +
10199 +/* Cater to old parser templates. */
10200 +#ifndef YYID
10201 +#define YYID(n)        (n)
10202 +#endif
10203 +
10204 +#define YYLLOC_DEFAULT(Current, Rhs, N)                                        \
10205 +    do                                                                 \
10206 +      if (YYID (N))                                                    \
10207 +       {                                                               \
10208 +         (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
10209 +         (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
10210 +         (Current).last_line    = YYRHSLOC (Rhs, N).last_line;         \
10211 +         (Current).last_column  = YYRHSLOC (Rhs, N).last_column;       \
10212 +         (Current).filenum      = YYRHSLOC (Rhs, N).filenum;           \
10213 +       }                                                               \
10214 +      else                                                             \
10215 +       {                                                               \
10216 +         (Current).first_line   = (Current).last_line   =              \
10217 +           YYRHSLOC (Rhs, 0).last_line;                                \
10218 +         (Current).first_column = (Current).last_column =              \
10219 +           YYRHSLOC (Rhs, 0).last_column;                              \
10220 +         (Current).filenum      = YYRHSLOC (Rhs, 0).filenum;           \
10221 +       }                                                               \
10222 +    while (YYID (0))
10223 +
10224 +
10225 +
10226 +extern void yyerror(char const *);
10227 +
10228 +extern int srcpos_filenum;
10229 +
10230 +extern int push_input_file(const char *filename);
10231 +extern int pop_input_file(void);
10232 +
10233 +extern FILE *dtc_open_file(const char *fname);
10234 +extern int lookup_file_name(const char *fname, int add_it);
10235 +extern const char *srcpos_filename_for_num(int filenum);
10236 +const char *srcpos_get_filename(void);
10237 --- /dev/null
10238 +++ b/arch/powerpc/boot/dtc-src/treesource.c
10239 @@ -0,0 +1,275 @@
10240 +/*
10241 + * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation.  2005.
10242 + *
10243 + *
10244 + * This program is free software; you can redistribute it and/or
10245 + * modify it under the terms of the GNU General Public License as
10246 + * published by the Free Software Foundation; either version 2 of the
10247 + * License, or (at your option) any later version.
10248 + *
10249 + *  This program is distributed in the hope that it will be useful,
10250 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
10251 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10252 + *  General Public License for more details.
10253 + *
10254 + *  You should have received a copy of the GNU General Public License
10255 + *  along with this program; if not, write to the Free Software
10256 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
10257 + *                                                                   USA
10258 + */
10259 +
10260 +#include "dtc.h"
10261 +#include "srcpos.h"
10262 +
10263 +extern FILE *yyin;
10264 +extern int yyparse(void);
10265 +extern void yyerror(char const *);
10266 +
10267 +struct boot_info *the_boot_info;
10268 +
10269 +struct boot_info *dt_from_source(const char *fname)
10270 +{
10271 +       the_boot_info = NULL;
10272 +
10273 +       push_input_file(fname);
10274 +
10275 +       if (yyparse() != 0)
10276 +               return NULL;
10277 +
10278 +       fill_fullpaths(the_boot_info->dt, "");
10279 +
10280 +       return the_boot_info;
10281 +}
10282 +
10283 +static void write_prefix(FILE *f, int level)
10284 +{
10285 +       int i;
10286 +
10287 +       for (i = 0; i < level; i++)
10288 +               fputc('\t', f);
10289 +}
10290 +
10291 +int isstring(char c)
10292 +{
10293 +       return (isprint(c)
10294 +               || (c == '\0')
10295 +               || strchr("\a\b\t\n\v\f\r", c));
10296 +}
10297 +
10298 +static void write_propval_string(FILE *f, struct data val)
10299 +{
10300 +       const char *str = val.val;
10301 +       int i;
10302 +       int newchunk = 1;
10303 +       struct marker *m = val.markers;
10304 +
10305 +       assert(str[val.len-1] == '\0');
10306 +
10307 +       for (i = 0; i < (val.len-1); i++) {
10308 +               char c = str[i];
10309 +
10310 +               if (newchunk) {
10311 +                       while (m && (m->offset <= i)) {
10312 +                               if (m->type == LABEL) {
10313 +                                       assert(m->offset == i);
10314 +                                       fprintf(f, "%s: ", m->ref);
10315 +                               }
10316 +                               m = m->next;
10317 +                       }
10318 +                       fprintf(f, "\"");
10319 +                       newchunk = 0;
10320 +               }
10321 +
10322 +               switch (c) {
10323 +               case '\a':
10324 +                       fprintf(f, "\\a");
10325 +                       break;
10326 +               case '\b':
10327 +                       fprintf(f, "\\b");
10328 +                       break;
10329 +               case '\t':
10330 +                       fprintf(f, "\\t");
10331 +                       break;
10332 +               case '\n':
10333 +                       fprintf(f, "\\n");
10334 +                       break;
10335 +               case '\v':
10336 +                       fprintf(f, "\\v");
10337 +                       break;
10338 +               case '\f':
10339 +                       fprintf(f, "\\f");
10340 +                       break;
10341 +               case '\r':
10342 +                       fprintf(f, "\\r");
10343 +                       break;
10344 +               case '\\':
10345 +                       fprintf(f, "\\\\");
10346 +                       break;
10347 +               case '\"':
10348 +                       fprintf(f, "\\\"");
10349 +                       break;
10350 +               case '\0':
10351 +                       fprintf(f, "\", ");
10352 +                       newchunk = 1;
10353 +                       break;
10354 +               default:
10355 +                       if (isprint(c))
10356 +                               fprintf(f, "%c", c);
10357 +                       else
10358 +                               fprintf(f, "\\x%02hhx", c);
10359 +               }
10360 +       }
10361 +       fprintf(f, "\"");
10362 +
10363 +       /* Wrap up any labels at the end of the value */
10364 +       for_each_marker_of_type(m, LABEL) {
10365 +               assert (m->offset == val.len);
10366 +               fprintf(f, " %s:", m->ref);
10367 +       }
10368 +}
10369 +
10370 +static void write_propval_cells(FILE *f, struct data val)
10371 +{
10372 +       void *propend = val.val + val.len;
10373 +       cell_t *cp = (cell_t *)val.val;
10374 +       struct marker *m = val.markers;
10375 +
10376 +       fprintf(f, "<");
10377 +       for (;;) {
10378 +               while (m && (m->offset <= ((char *)cp - val.val))) {
10379 +                       if (m->type == LABEL) {
10380 +                               assert(m->offset == ((char *)cp - val.val));
10381 +                               fprintf(f, "%s: ", m->ref);
10382 +                       }
10383 +                       m = m->next;
10384 +               }
10385 +
10386 +               fprintf(f, "0x%x", be32_to_cpu(*cp++));
10387 +               if ((void *)cp >= propend)
10388 +                       break;
10389 +               fprintf(f, " ");
10390 +       }
10391 +
10392 +       /* Wrap up any labels at the end of the value */
10393 +       for_each_marker_of_type(m, LABEL) {
10394 +               assert (m->offset == val.len);
10395 +               fprintf(f, " %s:", m->ref);
10396 +       }
10397 +       fprintf(f, ">");
10398 +}
10399 +
10400 +static void write_propval_bytes(FILE *f, struct data val)
10401 +{
10402 +       void *propend = val.val + val.len;
10403 +       const char *bp = val.val;
10404 +       struct marker *m = val.markers;
10405 +
10406 +       fprintf(f, "[");
10407 +       for (;;) {
10408 +               while (m && (m->offset == (bp-val.val))) {
10409 +                       if (m->type == LABEL)
10410 +                               fprintf(f, "%s: ", m->ref);
10411 +                       m = m->next;
10412 +               }
10413 +
10414 +               fprintf(f, "%02hhx", *bp++);
10415 +               if ((void *)bp >= propend)
10416 +                       break;
10417 +               fprintf(f, " ");
10418 +       }
10419 +
10420 +       /* Wrap up any labels at the end of the value */
10421 +       for_each_marker_of_type(m, LABEL) {
10422 +               assert (m->offset == val.len);
10423 +               fprintf(f, " %s:", m->ref);
10424 +       }
10425 +       fprintf(f, "]");
10426 +}
10427 +
10428 +static void write_propval(FILE *f, struct property *prop)
10429 +{
10430 +       int len = prop->val.len;
10431 +       const char *p = prop->val.val;
10432 +       struct marker *m = prop->val.markers;
10433 +       int nnotstring = 0, nnul = 0;
10434 +       int nnotstringlbl = 0, nnotcelllbl = 0;
10435 +       int i;
10436 +
10437 +       if (len == 0) {
10438 +               fprintf(f, ";\n");
10439 +               return;
10440 +       }
10441 +
10442 +       for (i = 0; i < len; i++) {
10443 +               if (! isstring(p[i]))
10444 +                       nnotstring++;
10445 +               if (p[i] == '\0')
10446 +                       nnul++;
10447 +       }
10448 +
10449 +       for_each_marker_of_type(m, LABEL) {
10450 +               if ((m->offset > 0) && (prop->val.val[m->offset - 1] != '\0'))
10451 +                       nnotstringlbl++;
10452 +               if ((m->offset % sizeof(cell_t)) != 0)
10453 +                       nnotcelllbl++;
10454 +       }
10455 +
10456 +       fprintf(f, " = ");
10457 +       if ((p[len-1] == '\0') && (nnotstring == 0) && (nnul < (len-nnul))
10458 +           && (nnotstringlbl == 0)) {
10459 +               write_propval_string(f, prop->val);
10460 +       } else if (((len % sizeof(cell_t)) == 0) && (nnotcelllbl == 0)) {
10461 +               write_propval_cells(f, prop->val);
10462 +       } else {
10463 +               write_propval_bytes(f, prop->val);
10464 +       }
10465 +
10466 +       fprintf(f, ";\n");
10467 +}
10468 +
10469 +static void write_tree_source_node(FILE *f, struct node *tree, int level)
10470 +{
10471 +       struct property *prop;
10472 +       struct node *child;
10473 +
10474 +       write_prefix(f, level);
10475 +       if (tree->label)
10476 +               fprintf(f, "%s: ", tree->label);
10477 +       if (tree->name && (*tree->name))
10478 +               fprintf(f, "%s {\n", tree->name);
10479 +       else
10480 +               fprintf(f, "/ {\n");
10481 +
10482 +       for_each_property(tree, prop) {
10483 +               write_prefix(f, level+1);
10484 +               if (prop->label)
10485 +                       fprintf(f, "%s: ", prop->label);
10486 +               fprintf(f, "%s", prop->name);
10487 +               write_propval(f, prop);
10488 +       }
10489 +       for_each_child(tree, child) {
10490 +               fprintf(f, "\n");
10491 +               write_tree_source_node(f, child, level+1);
10492 +       }
10493 +       write_prefix(f, level);
10494 +       fprintf(f, "};\n");
10495 +}
10496 +
10497 +
10498 +void dt_to_source(FILE *f, struct boot_info *bi)
10499 +{
10500 +       struct reserve_info *re;
10501 +
10502 +       fprintf(f, "/dts-v1/;\n\n");
10503 +
10504 +       for (re = bi->reservelist; re; re = re->next) {
10505 +               if (re->label)
10506 +                       fprintf(f, "%s: ", re->label);
10507 +               fprintf(f, "/memreserve/\t0x%016llx 0x%016llx;\n",
10508 +                       (unsigned long long)re->re.address,
10509 +                       (unsigned long long)re->re.size);
10510 +       }
10511 +
10512 +       write_tree_source_node(f, bi->dt, 0);
10513 +}
10514 +
10515 --- /dev/null
10516 +++ b/arch/powerpc/boot/dtc-src/version_gen.h
10517 @@ -0,0 +1 @@
10518 +#define DTC_VERSION "DTC 1.0.0-gd6f9b62f"
10519 --- /dev/null
10520 +++ b/arch/powerpc/boot/dts/adder875-redboot.dts
10521 @@ -0,0 +1,184 @@
10522 +/*
10523 + * Device Tree Source for MPC885 ADS running RedBoot
10524 + *
10525 + * Copyright 2006 MontaVista Software, Inc.
10526 + * Copyright 2007 Freescale Semiconductor, Inc.
10527 + *
10528 + * This program is free software; you can redistribute  it and/or modify it
10529 + * under  the terms of  the GNU General  Public License as published by the
10530 + * Free Software Foundation;  either version 2 of the  License, or (at your
10531 + * option) any later version.
10532 + */
10533 +
10534 +/dts-v1/;
10535 +/ {
10536 +       model = "Analogue & Micro Adder MPC875";
10537 +       compatible = "analogue-and-micro,adder875";
10538 +       #address-cells = <1>;
10539 +       #size-cells = <1>;
10540 +
10541 +       aliases {
10542 +               console = &console;
10543 +               ethernet0 = &eth0;
10544 +               ethernet1 = &eth1;
10545 +       };
10546 +
10547 +       cpus {
10548 +               #address-cells = <1>;
10549 +               #size-cells = <0>;
10550 +
10551 +               PowerPC,875@0 {
10552 +                       device_type = "cpu";
10553 +                       reg = <0>;
10554 +                       d-cache-line-size = <16>;
10555 +                       i-cache-line-size = <16>;
10556 +                       d-cache-size = <8192>;
10557 +                       i-cache-size = <8192>;
10558 +                       timebase-frequency = <0>;
10559 +                       bus-frequency = <0>;
10560 +                       clock-frequency = <0>;
10561 +                       interrupts = <15 2>;    // decrementer interrupt
10562 +                       interrupt-parent = <&PIC>;
10563 +               };
10564 +       };
10565 +
10566 +       memory {
10567 +               device_type = "memory";
10568 +               reg = <0 0x01000000>;
10569 +       };
10570 +
10571 +       localbus@fa200100 {
10572 +               compatible = "fsl,mpc885-localbus", "fsl,pq1-localbus",
10573 +                            "simple-bus";
10574 +               #address-cells = <2>;
10575 +               #size-cells = <1>;
10576 +               reg = <0xfa200100 0x40>;
10577 +
10578 +               ranges = <
10579 +                       0 0 0xfe000000 0x00800000
10580 +                       2 0 0xfa100000 0x00008000
10581 +               >;
10582 +
10583 +               flash@0,0 {
10584 +                       compatible = "cfi-flash";
10585 +                       reg = <0 0 0x800000>;
10586 +                       bank-width = <2>;
10587 +                       device-width = <2>;
10588 +               };
10589 +       };
10590 +
10591 +       soc@fa200000 {
10592 +               compatible = "fsl,mpc875-immr", "fsl,pq1-soc", "simple-bus";
10593 +               #address-cells = <1>;
10594 +               #size-cells = <1>;
10595 +               ranges = <0 0xfa200000 0x00004000>;
10596 +
10597 +               // Temporary until code stops depending on it.
10598 +               device_type = "soc";
10599 +
10600 +               // Temporary until get_immrbase() is fixed.
10601 +               reg = <0xfa200000 0x4000>;
10602 +
10603 +               mdio@e00 {
10604 +                       compatible = "fsl,mpc875-fec-mdio", "fsl,pq1-fec-mdio";
10605 +                       reg = <0xe00 0x188>;
10606 +                       #address-cells = <1>;
10607 +                       #size-cells = <0>;
10608 +
10609 +                       PHY0: ethernet-phy@0 {
10610 +                               reg = <0>;
10611 +                               device_type = "ethernet-phy";
10612 +                       };
10613 +
10614 +                       PHY1: ethernet-phy@1 {
10615 +                               reg = <1>;
10616 +                               device_type = "ethernet-phy";
10617 +                       };
10618 +               };
10619 +
10620 +               eth0: ethernet@e00 {
10621 +                       device_type = "network";
10622 +                       compatible = "fsl,mpc875-fec-enet",
10623 +                                    "fsl,pq1-fec-enet";
10624 +                       reg = <0xe00 0x188>;
10625 +                       local-mac-address = [ 00 00 00 00 00 00 ];
10626 +                       interrupts = <3 1>;
10627 +                       interrupt-parent = <&PIC>;
10628 +                       phy-handle = <&PHY0>;
10629 +                       linux,network-index = <0>;
10630 +               };
10631 +
10632 +               eth1: ethernet@1e00 {
10633 +                       device_type = "network";
10634 +                       compatible = "fsl,mpc875-fec-enet",
10635 +                                    "fsl,pq1-fec-enet";
10636 +                       reg = <0x1e00 0x188>;
10637 +                       local-mac-address = [ 00 00 00 00 00 00 ];
10638 +                       interrupts = <7 1>;
10639 +                       interrupt-parent = <&PIC>;
10640 +                       phy-handle = <&PHY1>;
10641 +                       linux,network-index = <1>;
10642 +               };
10643 +
10644 +               PIC: interrupt-controller@0 {
10645 +                       interrupt-controller;
10646 +                       #interrupt-cells = <2>;
10647 +                       reg = <0 0x24>;
10648 +                       compatible = "fsl,mpc875-pic", "fsl,pq1-pic";
10649 +               };
10650 +
10651 +               cpm@9c0 {
10652 +                       #address-cells = <1>;
10653 +                       #size-cells = <1>;
10654 +                       compatible = "fsl,mpc875-cpm", "fsl,cpm1", "simple-bus";
10655 +                       interrupts = <0>;       // cpm error interrupt
10656 +                       interrupt-parent = <&CPM_PIC>;
10657 +                       reg = <0x9c0 0x40>;
10658 +                       ranges;
10659 +
10660 +                       muram {
10661 +                               #address-cells = <1>;
10662 +                               #size-cells = <1>;
10663 +                               ranges = <0 0x2000 0x2000>;
10664 +
10665 +                               data@0 {
10666 +                                       compatible = "fsl,cpm-muram-data";
10667 +                                       reg = <0 0x1c00>;
10668 +                               };
10669 +                       };
10670 +
10671 +                       brg@9f0 {
10672 +                               compatible = "fsl,mpc875-brg",
10673 +                                            "fsl,cpm1-brg",
10674 +                                            "fsl,cpm-brg";
10675 +                               reg = <0x9f0 0x10>;
10676 +                       };
10677 +
10678 +                       CPM_PIC: interrupt-controller@930 {
10679 +                               interrupt-controller;
10680 +                               #interrupt-cells = <1>;
10681 +                               interrupts = <5 2 0 2>;
10682 +                               interrupt-parent = <&PIC>;
10683 +                               reg = <0x930 0x20>;
10684 +                               compatible = "fsl,mpc875-cpm-pic",
10685 +                                            "fsl,cpm1-pic";
10686 +                       };
10687 +
10688 +                       console: serial@a80 {
10689 +                               device_type = "serial";
10690 +                               compatible = "fsl,mpc875-smc-uart",
10691 +                                            "fsl,cpm1-smc-uart";
10692 +                               reg = <0xa80 0x10 0x3e80 0x40>;
10693 +                               interrupts = <4>;
10694 +                               interrupt-parent = <&CPM_PIC>;
10695 +                               fsl,cpm-brg = <1>;
10696 +                               fsl,cpm-command = <0x0090>;
10697 +                               current-speed = <115200>;
10698 +                       };
10699 +               };
10700 +       };
10701 +
10702 +       chosen {
10703 +               linux,stdout-path = &console;
10704 +       };
10705 +};
10706 --- /dev/null
10707 +++ b/arch/powerpc/boot/dts/adder875-uboot.dts
10708 @@ -0,0 +1,183 @@
10709 +/*
10710 + * Device Tree Source for MPC885 ADS running U-Boot
10711 + *
10712 + * Copyright 2006 MontaVista Software, Inc.
10713 + * Copyright 2007 Freescale Semiconductor, Inc.
10714 + *
10715 + * This program is free software; you can redistribute  it and/or modify it
10716 + * under  the terms of  the GNU General  Public License as published by the
10717 + * Free Software Foundation;  either version 2 of the  License, or (at your
10718 + * option) any later version.
10719 + */
10720 +
10721 +/dts-v1/;
10722 +/ {
10723 +       model = "Analogue & Micro Adder MPC875";
10724 +       compatible = "analogue-and-micro,adder875";
10725 +       #address-cells = <1>;
10726 +       #size-cells = <1>;
10727 +
10728 +       aliases {
10729 +               console = &console;
10730 +               ethernet0 = &eth0;
10731 +               ethernet1 = &eth1;
10732 +       };
10733 +
10734 +       cpus {
10735 +               #address-cells = <1>;
10736 +               #size-cells = <0>;
10737 +
10738 +               PowerPC,875@0 {
10739 +                       device_type = "cpu";
10740 +                       reg = <0>;
10741 +                       d-cache-line-size = <16>;
10742 +                       i-cache-line-size = <16>;
10743 +                       d-cache-size = <8192>;
10744 +                       i-cache-size = <8192>;
10745 +                       timebase-frequency = <0>;
10746 +                       bus-frequency = <0>;
10747 +                       clock-frequency = <0>;
10748 +                       interrupts = <15 2>;    // decrementer interrupt
10749 +                       interrupt-parent = <&PIC>;
10750 +               };
10751 +       };
10752 +
10753 +       memory {
10754 +               device_type = "memory";
10755 +               reg = <0 0x01000000>;
10756 +       };
10757 +
10758 +       localbus@ff000100 {
10759 +               compatible = "fsl,mpc885-localbus", "fsl,pq1-localbus",
10760 +                            "simple-bus";
10761 +               #address-cells = <2>;
10762 +               #size-cells = <1>;
10763 +               reg = <0xff000100 0x40>;
10764 +
10765 +               ranges = <
10766 +                       0 0 0xfe000000 0x01000000
10767 +               >;
10768 +
10769 +               flash@0,0 {
10770 +                       compatible = "cfi-flash";
10771 +                       reg = <0 0 0x800000>;
10772 +                       bank-width = <2>;
10773 +                       device-width = <2>;
10774 +               };
10775 +       };
10776 +
10777 +       soc@ff000000 {
10778 +               compatible = "fsl,mpc875-immr", "fsl,pq1-soc", "simple-bus";
10779 +               #address-cells = <1>;
10780 +               #size-cells = <1>;
10781 +               ranges = <0 0xff000000 0x00004000>;
10782 +
10783 +               // Temporary until code stops depending on it.
10784 +               device_type = "soc";
10785 +
10786 +               // Temporary until get_immrbase() is fixed.
10787 +               reg = <0xff000000 0x4000>;
10788 +
10789 +               mdio@e00 {
10790 +                       compatible = "fsl,mpc875-fec-mdio", "fsl,pq1-fec-mdio";
10791 +                       reg = <0xe00 0x188>;
10792 +                       #address-cells = <1>;
10793 +                       #size-cells = <0>;
10794 +
10795 +                       PHY0: ethernet-phy@0 {
10796 +                               reg = <0>;
10797 +                               device_type = "ethernet-phy";
10798 +                       };
10799 +
10800 +                       PHY1: ethernet-phy@1 {
10801 +                               reg = <1>;
10802 +                               device_type = "ethernet-phy";
10803 +                       };
10804 +               };
10805 +
10806 +               eth0: ethernet@e00 {
10807 +                       device_type = "network";
10808 +                       compatible = "fsl,mpc875-fec-enet",
10809 +                                    "fsl,pq1-fec-enet";
10810 +                       reg = <0xe00 0x188>;
10811 +                       local-mac-address = [ 00 00 00 00 00 00 ];
10812 +                       interrupts = <3 1>;
10813 +                       interrupt-parent = <&PIC>;
10814 +                       phy-handle = <&PHY0>;
10815 +                       linux,network-index = <0>;
10816 +               };
10817 +
10818 +               eth1: ethernet@1e00 {
10819 +                       device_type = "network";
10820 +                       compatible = "fsl,mpc875-fec-enet",
10821 +                                    "fsl,pq1-fec-enet";
10822 +                       reg = <0x1e00 0x188>;
10823 +                       local-mac-address = [ 00 00 00 00 00 00 ];
10824 +                       interrupts = <7 1>;
10825 +                       interrupt-parent = <&PIC>;
10826 +                       phy-handle = <&PHY1>;
10827 +                       linux,network-index = <1>;
10828 +               };
10829 +
10830 +               PIC: interrupt-controller@0 {
10831 +                       interrupt-controller;
10832 +                       #interrupt-cells = <2>;
10833 +                       reg = <0 0x24>;
10834 +                       compatible = "fsl,mpc875-pic", "fsl,pq1-pic";
10835 +               };
10836 +
10837 +               cpm@9c0 {
10838 +                       #address-cells = <1>;
10839 +                       #size-cells = <1>;
10840 +                       compatible = "fsl,mpc875-cpm", "fsl,cpm1", "simple-bus";
10841 +                       interrupts = <0>;       // cpm error interrupt
10842 +                       interrupt-parent = <&CPM_PIC>;
10843 +                       reg = <0x9c0 0x40>;
10844 +                       ranges;
10845 +
10846 +                       muram {
10847 +                               #address-cells = <1>;
10848 +                               #size-cells = <1>;
10849 +                               ranges = <0 0x2000 0x2000>;
10850 +
10851 +                               data@0 {
10852 +                                       compatible = "fsl,cpm-muram-data";
10853 +                                       reg = <0 0x1c00>;
10854 +                               };
10855 +                       };
10856 +
10857 +                       brg@9f0 {
10858 +                               compatible = "fsl,mpc875-brg",
10859 +                                            "fsl,cpm1-brg",
10860 +                                            "fsl,cpm-brg";
10861 +                               reg = <0x9f0 0x10>;
10862 +                       };
10863 +
10864 +                       CPM_PIC: interrupt-controller@930 {
10865 +                               interrupt-controller;
10866 +                               #interrupt-cells = <1>;
10867 +                               interrupts = <5 2 0 2>;
10868 +                               interrupt-parent = <&PIC>;
10869 +                               reg = <0x930 0x20>;
10870 +                               compatible = "fsl,mpc875-cpm-pic",
10871 +                                            "fsl,cpm1-pic";
10872 +                       };
10873 +
10874 +                       console: serial@a80 {
10875 +                               device_type = "serial";
10876 +                               compatible = "fsl,mpc875-smc-uart",
10877 +                                            "fsl,cpm1-smc-uart";
10878 +                               reg = <0xa80 0x10 0x3e80 0x40>;
10879 +                               interrupts = <4>;
10880 +                               interrupt-parent = <&CPM_PIC>;
10881 +                               fsl,cpm-brg = <1>;
10882 +                               fsl,cpm-command = <0x0090>;
10883 +                               current-speed = <115200>;
10884 +                       };
10885 +               };
10886 +       };
10887 +
10888 +       chosen {
10889 +               linux,stdout-path = &console;
10890 +       };
10891 +};
10892 --- a/arch/powerpc/boot/dts/bamboo.dts
10893 +++ b/arch/powerpc/boot/dts/bamboo.dts
10894 @@ -16,14 +16,24 @@
10895         #size-cells = <1>;
10896         model = "amcc,bamboo";
10897         compatible = "amcc,bamboo";
10898 -       dcr-parent = <&/cpus/PowerPC,440EP@0>;
10899 +       dcr-parent = <&/cpus/cpu@0>;
10900 +
10901 +       aliases {
10902 +               ethernet0 = &EMAC0;
10903 +               ethernet1 = &EMAC1;
10904 +               serial0 = &UART0;
10905 +               serial1 = &UART1;
10906 +               serial2 = &UART2;
10907 +               serial3 = &UART3;
10908 +       };
10909  
10910         cpus {
10911                 #address-cells = <1>;
10912                 #size-cells = <0>;
10913  
10914 -               PowerPC,440EP@0 {
10915 +               cpu@0 {
10916                         device_type = "cpu";
10917 +                       model = "PowerPC,440EP";
10918                         reg = <0>;
10919                         clock-frequency = <0>; /* Filled in by zImage */
10920                         timebase-frequency = <0>; /* Filled in by zImage */
10921 @@ -126,7 +136,6 @@
10922                                 #address-cells = <2>;
10923                                 #size-cells = <1>;
10924                                 clock-frequency = <0>; /* Filled in by zImage */
10925 -                               ranges;
10926                                 interrupts = <5 1>;
10927                                 interrupt-parent = <&UIC1>;
10928                         };
10929 @@ -238,11 +247,56 @@
10930                                 zmii-device = <&ZMII0>;
10931                                 zmii-channel = <1>;
10932                         };
10933 +
10934 +                       usb@ef601000 {
10935 +                               compatible = "ohci-be";
10936 +                               reg = <ef601000 80>;
10937 +                               interrupts = <8 1 9 1>;
10938 +                               interrupt-parent = < &UIC1 >;
10939 +                       };
10940 +               };
10941 +
10942 +               PCI0: pci@ec000000 {
10943 +                       device_type = "pci";
10944 +                       #interrupt-cells = <1>;
10945 +                       #size-cells = <2>;
10946 +                       #address-cells = <3>;
10947 +                       compatible = "ibm,plb440ep-pci", "ibm,plb-pci";
10948 +                       primary;
10949 +                       reg = <0 eec00000 8     /* Config space access */
10950 +                              0 eed00000 4     /* IACK */
10951 +                              0 eed00000 4     /* Special cycle */
10952 +                              0 ef400000 40>;  /* Internal registers */
10953 +
10954 +                       /* Outbound ranges, one memory and one IO,
10955 +                        * later cannot be changed. Chip supports a second
10956 +                        * IO range but we don't use it for now
10957 +                        */
10958 +                       ranges = <02000000 0 a0000000 0 a0000000 0 20000000
10959 +                                 01000000 0 00000000 0 e8000000 0 00010000>;
10960 +
10961 +                       /* Inbound 2GB range starting at 0 */
10962 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
10963 +
10964 +                       /* Bamboo has all 4 IRQ pins tied together per slot */
10965 +                       interrupt-map-mask = <f800 0 0 0>;
10966 +                       interrupt-map = <
10967 +                               /* IDSEL 1 */
10968 +                               0800 0 0 0 &UIC0 1c 8
10969 +
10970 +                               /* IDSEL 2 */
10971 +                               1000 0 0 0 &UIC0 1b 8
10972 +
10973 +                               /* IDSEL 3 */
10974 +                               1800 0 0 0 &UIC0 1a 8
10975 +
10976 +                               /* IDSEL 4 */
10977 +                               2000 0 0 0 &UIC0 19 8
10978 +                       >;
10979                 };
10980         };
10981  
10982         chosen {
10983                 linux,stdout-path = "/plb/opb/serial@ef600300";
10984 -               bootargs = "console=ttyS0,115200";
10985         };
10986  };
10987 --- /dev/null
10988 +++ b/arch/powerpc/boot/dts/cm5200.dts
10989 @@ -0,0 +1,236 @@
10990 +/*
10991 + * CM5200 board Device Tree Source
10992 + *
10993 + * Copyright (C) 2007 Semihalf
10994 + * Marian Balakowicz <m8@semihalf.com>
10995 + *
10996 + * This program is free software; you can redistribute  it and/or modify it
10997 + * under  the terms of  the GNU General  Public License as published by the
10998 + * Free Software Foundation;  either version 2 of the  License, or (at your
10999 + * option) any later version.
11000 + */
11001 +
11002 +/*
11003 + * WARNING: Do not depend on this tree layout remaining static just yet.
11004 + * The MPC5200 device tree conventions are still in flux
11005 + * Keep an eye on the linuxppc-dev mailing list for more details
11006 + */
11007 +
11008 +/ {
11009 +       model = "schindler,cm5200";
11010 +       compatible = "schindler,cm5200";
11011 +       #address-cells = <1>;
11012 +       #size-cells = <1>;
11013 +
11014 +       cpus {
11015 +               #address-cells = <1>;
11016 +               #size-cells = <0>;
11017 +
11018 +               PowerPC,5200@0 {
11019 +                       device_type = "cpu";
11020 +                       reg = <0>;
11021 +                       d-cache-line-size = <20>;
11022 +                       i-cache-line-size = <20>;
11023 +                       d-cache-size = <4000>;          // L1, 16K
11024 +                       i-cache-size = <4000>;          // L1, 16K
11025 +                       timebase-frequency = <0>;       // from bootloader
11026 +                       bus-frequency = <0>;            // from bootloader
11027 +                       clock-frequency = <0>;          // from bootloader
11028 +               };
11029 +       };
11030 +
11031 +       memory {
11032 +               device_type = "memory";
11033 +               reg = <00000000 04000000>;      // 64MB
11034 +       };
11035 +
11036 +       soc5200@f0000000 {
11037 +               model = "fsl,mpc5200b";
11038 +               compatible = "fsl,mpc5200b";
11039 +               revision = "";                  // from bootloader
11040 +               device_type = "soc";
11041 +               ranges = <0 f0000000 0000c000>;
11042 +               reg = <f0000000 00000100>;
11043 +               bus-frequency = <0>;            // from bootloader
11044 +               system-frequency = <0>;         // from bootloader
11045 +
11046 +               cdm@200 {
11047 +                       compatible = "mpc5200b-cdm","mpc5200-cdm";
11048 +                       reg = <200 38>;
11049 +               };
11050 +
11051 +               mpc5200_pic: pic@500 {
11052 +                       // 5200 interrupts are encoded into two levels;
11053 +                       interrupt-controller;
11054 +                       #interrupt-cells = <3>;
11055 +                       compatible = "mpc5200b-pic","mpc5200-pic";
11056 +                       reg = <500 80>;
11057 +               };
11058 +
11059 +               gpt@600 {       // General Purpose Timer
11060 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11061 +                       reg = <600 10>;
11062 +                       interrupts = <1 9 0>;
11063 +                       interrupt-parent = <&mpc5200_pic>;
11064 +                       fsl,has-wdt;
11065 +               };
11066 +
11067 +               gpt@610 {       // General Purpose Timer
11068 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11069 +                       reg = <610 10>;
11070 +                       interrupts = <1 a 0>;
11071 +                       interrupt-parent = <&mpc5200_pic>;
11072 +               };
11073 +
11074 +               gpt@620 {       // General Purpose Timer
11075 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11076 +                       reg = <620 10>;
11077 +                       interrupts = <1 b 0>;
11078 +                       interrupt-parent = <&mpc5200_pic>;
11079 +               };
11080 +
11081 +               gpt@630 {       // General Purpose Timer
11082 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11083 +                       reg = <630 10>;
11084 +                       interrupts = <1 c 0>;
11085 +                       interrupt-parent = <&mpc5200_pic>;
11086 +               };
11087 +
11088 +               gpt@640 {       // General Purpose Timer
11089 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11090 +                       reg = <640 10>;
11091 +                       interrupts = <1 d 0>;
11092 +                       interrupt-parent = <&mpc5200_pic>;
11093 +               };
11094 +
11095 +               gpt@650 {       // General Purpose Timer
11096 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11097 +                       reg = <650 10>;
11098 +                       interrupts = <1 e 0>;
11099 +                       interrupt-parent = <&mpc5200_pic>;
11100 +               };
11101 +
11102 +               gpt@660 {       // General Purpose Timer
11103 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11104 +                       reg = <660 10>;
11105 +                       interrupts = <1 f 0>;
11106 +                       interrupt-parent = <&mpc5200_pic>;
11107 +               };
11108 +
11109 +               gpt@670 {       // General Purpose Timer
11110 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
11111 +                       reg = <670 10>;
11112 +                       interrupts = <1 10 0>;
11113 +                       interrupt-parent = <&mpc5200_pic>;
11114 +               };
11115 +
11116 +               rtc@800 {       // Real time clock
11117 +                       compatible = "mpc5200b-rtc","mpc5200-rtc";
11118 +                       reg = <800 100>;
11119 +                       interrupts = <1 5 0 1 6 0>;
11120 +                       interrupt-parent = <&mpc5200_pic>;
11121 +               };
11122 +
11123 +               gpio@b00 {
11124 +                       compatible = "mpc5200b-gpio","mpc5200-gpio";
11125 +                       reg = <b00 40>;
11126 +                       interrupts = <1 7 0>;
11127 +                       interrupt-parent = <&mpc5200_pic>;
11128 +               };
11129 +
11130 +               gpio-wkup@c00 {
11131 +                       compatible = "mpc5200b-gpio-wkup","mpc5200-gpio-wkup";
11132 +                       reg = <c00 40>;
11133 +                       interrupts = <1 8 0 0 3 0>;
11134 +                       interrupt-parent = <&mpc5200_pic>;
11135 +               };
11136 +
11137 +               spi@f00 {
11138 +                       compatible = "mpc5200b-spi","mpc5200-spi";
11139 +                       reg = <f00 20>;
11140 +                       interrupts = <2 d 0 2 e 0>;
11141 +                       interrupt-parent = <&mpc5200_pic>;
11142 +               };
11143 +
11144 +               usb@1000 {
11145 +                       device_type = "usb-ohci-be";
11146 +                       compatible = "mpc5200b-ohci","mpc5200-ohci","ohci-be";
11147 +                       reg = <1000 ff>;
11148 +                       interrupts = <2 6 0>;
11149 +                       interrupt-parent = <&mpc5200_pic>;
11150 +               };
11151 +
11152 +               dma-controller@1200 {
11153 +                       compatible = "mpc5200b-bestcomm","mpc5200-bestcomm";
11154 +                       reg = <1200 80>;
11155 +                       interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
11156 +                                     3 4 0  3 5 0  3 6 0  3 7 0
11157 +                                     3 8 0  3 9 0  3 a 0  3 b 0
11158 +                                     3 c 0  3 d 0  3 e 0  3 f 0>;
11159 +                       interrupt-parent = <&mpc5200_pic>;
11160 +               };
11161 +
11162 +               xlb@1f00 {
11163 +                       compatible = "mpc5200b-xlb","mpc5200-xlb";
11164 +                       reg = <1f00 100>;
11165 +               };
11166 +
11167 +               serial@2000 {           // PSC1
11168 +                       device_type = "serial";
11169 +                       compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
11170 +                       port-number = <0>;  // Logical port assignment
11171 +                       reg = <2000 100>;
11172 +                       interrupts = <2 1 0>;
11173 +                       interrupt-parent = <&mpc5200_pic>;
11174 +               };
11175 +
11176 +               serial@2200 {           // PSC2
11177 +                       device_type = "serial";
11178 +                       compatible = "mpc5200-psc-uart";
11179 +                       port-number = <1>;  // Logical port assignment
11180 +                       reg = <2200 100>;
11181 +                       interrupts = <2 2 0>;
11182 +                       interrupt-parent = <&mpc5200_pic>;
11183 +               };
11184 +
11185 +               serial@2400 {           // PSC3
11186 +                       device_type = "serial";
11187 +                       compatible = "mpc5200-psc-uart";
11188 +                       port-number = <2>;  // Logical port assignment
11189 +                       reg = <2400 100>;
11190 +                       interrupts = <2 3 0>;
11191 +                       interrupt-parent = <&mpc5200_pic>;
11192 +               };
11193 +
11194 +               serial@2c00 {           // PSC6
11195 +                       device_type = "serial";
11196 +                       compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
11197 +                       port-number = <5>;  // Logical port assignment
11198 +                       reg = <2c00 100>;
11199 +                       interrupts = <2 4 0>;
11200 +                       interrupt-parent = <&mpc5200_pic>;
11201 +               };
11202 +
11203 +               ethernet@3000 {
11204 +                       device_type = "network";
11205 +                       compatible = "mpc5200b-fec","mpc5200-fec";
11206 +                       reg = <3000 800>;
11207 +                       local-mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by U-Boot */
11208 +                       interrupts = <2 5 0>;
11209 +                       interrupt-parent = <&mpc5200_pic>;
11210 +               };
11211 +
11212 +               i2c@3d40 {
11213 +                       compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
11214 +                       reg = <3d40 40>;
11215 +                       interrupts = <2 10 0>;
11216 +                       interrupt-parent = <&mpc5200_pic>;
11217 +                       fsl5200-clocking;
11218 +               };
11219 +
11220 +               sram@8000 {
11221 +                       compatible = "mpc5200b-sram","mpc5200-sram";
11222 +                       reg = <8000 4000>;
11223 +               };
11224 +       };
11225 +};
11226 --- a/arch/powerpc/boot/dts/ebony.dts
11227 +++ b/arch/powerpc/boot/dts/ebony.dts
11228 @@ -16,14 +16,22 @@
11229         #size-cells = <1>;
11230         model = "ibm,ebony";
11231         compatible = "ibm,ebony";
11232 -       dcr-parent = <&/cpus/PowerPC,440GP@0>;
11233 +       dcr-parent = <&/cpus/cpu@0>;
11234 +
11235 +       aliases {
11236 +               ethernet0 = &EMAC0;
11237 +               ethernet1 = &EMAC1;
11238 +               serial0 = &UART0;
11239 +               serial1 = &UART1;
11240 +       };
11241  
11242         cpus {
11243                 #address-cells = <1>;
11244                 #size-cells = <0>;
11245  
11246 -               PowerPC,440GP@0 {
11247 +               cpu@0 {
11248                         device_type = "cpu";
11249 +                       model = "PowerPC,440GP";
11250                         reg = <0>;
11251                         clock-frequency = <0>; // Filled in by zImage
11252                         timebase-frequency = <0>; // Filled in by zImage
11253 @@ -150,9 +158,10 @@
11254                                         };
11255                                 };
11256  
11257 -                               ds1743@1,0 {
11258 +                               nvram@1,0 {
11259                                         /* NVRAM & RTC */
11260 -                                       compatible = "ds1743";
11261 +                                       compatible = "ds1743-nvram";
11262 +                                       #bytes = <2000>;
11263                                         reg = <1 0 2000>;
11264                                 };
11265  
11266 @@ -284,12 +293,43 @@
11267  
11268                 };
11269  
11270 -               PCIX0: pci@1234 {
11271 +               PCIX0: pci@20ec00000 {
11272                         device_type = "pci";
11273 -                       /* FIXME */
11274 -                       reg = <2 0ec00000 8
11275 -                              2 0ec80000 f0
11276 -                              2 0ec80100 fc>;
11277 +                       #interrupt-cells = <1>;
11278 +                       #size-cells = <2>;
11279 +                       #address-cells = <3>;
11280 +                       compatible = "ibm,plb440gp-pcix", "ibm,plb-pcix";
11281 +                       primary;
11282 +                       reg = <2 0ec00000 8     /* Config space access */
11283 +                              0 0 0            /* no IACK cycles */
11284 +                              2 0ed00000 4     /* Special cycles */
11285 +                              2 0ec80000 f0    /* Internal registers */
11286 +                              2 0ec80100 fc>;  /* Internal messaging registers */
11287 +
11288 +                       /* Outbound ranges, one memory and one IO,
11289 +                        * later cannot be changed
11290 +                        */
11291 +                       ranges = <02000000 0 80000000 00000003 80000000 0 80000000
11292 +                                 01000000 0 00000000 00000002 08000000 0 00010000>;
11293 +
11294 +                       /* Inbound 2GB range starting at 0 */
11295 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
11296 +
11297 +                       /* Ebony has all 4 IRQ pins tied together per slot */
11298 +                       interrupt-map-mask = <f800 0 0 0>;
11299 +                       interrupt-map = <
11300 +                               /* IDSEL 1 */
11301 +                               0800 0 0 0 &UIC0 17 8
11302 +
11303 +                               /* IDSEL 2 */
11304 +                               1000 0 0 0 &UIC0 18 8
11305 +
11306 +                               /* IDSEL 3 */
11307 +                               1800 0 0 0 &UIC0 19 8
11308 +
11309 +                               /* IDSEL 4 */
11310 +                               2000 0 0 0 &UIC0 1a 8
11311 +                       >;
11312                 };
11313         };
11314  
11315 --- /dev/null
11316 +++ b/arch/powerpc/boot/dts/ep405.dts
11317 @@ -0,0 +1,228 @@
11318 +/*
11319 + * Device Tree Source for EP405
11320 + *
11321 + * Copyright 2007 IBM Corp.
11322 + * Benjamin Herrenschmidt <benh@kernel.crashing.org>
11323 + *
11324 + * This file is licensed under the terms of the GNU General Public
11325 + * License version 2.  This program is licensed "as is" without
11326 + * any warranty of any kind, whether express or implied.
11327 + */
11328 +
11329 +/ {
11330 +       #address-cells = <1>;
11331 +       #size-cells = <1>;
11332 +       model = "ep405";
11333 +       compatible = "ep405";
11334 +       dcr-parent = <&/cpus/cpu@0>;
11335 +
11336 +       aliases {
11337 +               ethernet0 = &EMAC;
11338 +               serial0 = &UART0;
11339 +               serial1 = &UART1;
11340 +       };
11341 +
11342 +       cpus {
11343 +               #address-cells = <1>;
11344 +               #size-cells = <0>;
11345 +
11346 +               cpu@0 {
11347 +                       device_type = "cpu";
11348 +                       model = "PowerPC,405GP";
11349 +                       reg = <0>;
11350 +                       clock-frequency = <bebc200>; /* Filled in by zImage */
11351 +                       timebase-frequency = <0>; /* Filled in by zImage */
11352 +                       i-cache-line-size = <20>;
11353 +                       d-cache-line-size = <20>;
11354 +                       i-cache-size = <4000>;
11355 +                       d-cache-size = <4000>;
11356 +                       dcr-controller;
11357 +                       dcr-access-method = "native";
11358 +               };
11359 +       };
11360 +
11361 +       memory {
11362 +               device_type = "memory";
11363 +               reg = <0 0>; /* Filled in by zImage */
11364 +       };
11365 +
11366 +       UIC0: interrupt-controller {
11367 +               compatible = "ibm,uic";
11368 +               interrupt-controller;
11369 +               cell-index = <0>;
11370 +               dcr-reg = <0c0 9>;
11371 +               #address-cells = <0>;
11372 +               #size-cells = <0>;
11373 +               #interrupt-cells = <2>;
11374 +       };
11375 +
11376 +       plb {
11377 +               compatible = "ibm,plb3";
11378 +               #address-cells = <1>;
11379 +               #size-cells = <1>;
11380 +               ranges;
11381 +               clock-frequency = <0>; /* Filled in by zImage */
11382 +
11383 +               SDRAM0: memory-controller {
11384 +                       compatible = "ibm,sdram-405gp";
11385 +                       dcr-reg = <010 2>;
11386 +               };
11387 +
11388 +               MAL: mcmal {
11389 +                       compatible = "ibm,mcmal-405gp", "ibm,mcmal";
11390 +                       dcr-reg = <180 62>;
11391 +                       num-tx-chans = <1>;
11392 +                       num-rx-chans = <1>;
11393 +                       interrupt-parent = <&UIC0>;
11394 +                       interrupts = <
11395 +                               b 4 /* TXEOB */
11396 +                               c 4 /* RXEOB */
11397 +                               a 4 /* SERR */
11398 +                               d 4 /* TXDE */
11399 +                               e 4 /* RXDE */>;
11400 +               };
11401 +
11402 +               POB0: opb {
11403 +                       compatible = "ibm,opb-405gp", "ibm,opb";
11404 +                       #address-cells = <1>;
11405 +                       #size-cells = <1>;
11406 +                       ranges = <ef600000 ef600000 a00000>;
11407 +                       dcr-reg = <0a0 5>;
11408 +                       clock-frequency = <0>; /* Filled in by zImage */
11409 +
11410 +                       UART0: serial@ef600300 {
11411 +                               device_type = "serial";
11412 +                               compatible = "ns16550";
11413 +                               reg = <ef600300 8>;
11414 +                               virtual-reg = <ef600300>;
11415 +                               clock-frequency = <0>; /* Filled in by zImage */
11416 +                               current-speed = <2580>;
11417 +                               interrupt-parent = <&UIC0>;
11418 +                               interrupts = <0 4>;
11419 +                       };
11420 +
11421 +                       UART1: serial@ef600400 {
11422 +                               device_type = "serial";
11423 +                               compatible = "ns16550";
11424 +                               reg = <ef600400 8>;
11425 +                               virtual-reg = <ef600400>;
11426 +                               clock-frequency = <0>; /* Filled in by zImage */
11427 +                               current-speed = <2580>;
11428 +                               interrupt-parent = <&UIC0>;
11429 +                               interrupts = <1 4>;
11430 +                       };
11431 +
11432 +                       IIC: i2c@ef600500 {
11433 +                               compatible = "ibm,iic-405gp", "ibm,iic";
11434 +                               reg = <ef600500 11>;
11435 +                               interrupt-parent = <&UIC0>;
11436 +                               interrupts = <2 4>;
11437 +                       };
11438 +
11439 +                       GPIO: gpio@ef600700 {
11440 +                               compatible = "ibm,gpio-405gp";
11441 +                               reg = <ef600700 20>;
11442 +                       };
11443 +
11444 +                       EMAC: ethernet@ef600800 {
11445 +                               linux,network-index = <0>;
11446 +                               device_type = "network";
11447 +                               compatible = "ibm,emac-405gp", "ibm,emac";
11448 +                               interrupt-parent = <&UIC0>;
11449 +                               interrupts = <
11450 +                                       f 4 /* Ethernet */
11451 +                                       9 4 /* Ethernet Wake Up */>;
11452 +                               local-mac-address = [000000000000]; /* Filled in by zImage */
11453 +                               reg = <ef600800 70>;
11454 +                               mal-device = <&MAL>;
11455 +                               mal-tx-channel = <0>;
11456 +                               mal-rx-channel = <0>;
11457 +                               cell-index = <0>;
11458 +                               max-frame-size = <5dc>;
11459 +                               rx-fifo-size = <1000>;
11460 +                               tx-fifo-size = <800>;
11461 +                               phy-mode = "rmii";
11462 +                               phy-map = <00000000>;
11463 +                       };
11464 +
11465 +               };
11466 +
11467 +               EBC0: ebc {
11468 +                       compatible = "ibm,ebc-405gp", "ibm,ebc";
11469 +                       dcr-reg = <012 2>;
11470 +                       #address-cells = <2>;
11471 +                       #size-cells = <1>;
11472 +
11473 +
11474 +                       /* The ranges property is supplied by the bootwrapper
11475 +                        * and is based on the firmware's configuration of the
11476 +                        * EBC bridge
11477 +                        */
11478 +                       clock-frequency = <0>; /* Filled in by zImage */
11479 +
11480 +                       /* NVRAM and RTC */
11481 +                       nvrtc@4,200000 {
11482 +                               compatible = "ds1742";
11483 +                               reg = <4 200000 0>; /* size fixed up by zImage */
11484 +                       };
11485 +
11486 +                       /* "BCSR" CPLD contains a PCI irq controller */
11487 +                       bcsr@4,0 {
11488 +                               compatible = "ep405-bcsr";
11489 +                               reg = <4 0 10>;
11490 +                               interrupt-controller;
11491 +                               /* Routing table */
11492 +                               irq-routing = [ 00      /* SYSERR */
11493 +                                               01      /* STTM */
11494 +                                               01      /* RTC */
11495 +                                               01      /* FENET */
11496 +                                               02      /* NB PCIIRQ mux ? */
11497 +                                               03      /* SB Winbond 8259 ? */
11498 +                                               04      /* Serial Ring */
11499 +                                               05      /* USB (ep405pc) */
11500 +                                               06      /* XIRQ 0 */
11501 +                                               06      /* XIRQ 1 */
11502 +                                               06      /* XIRQ 2 */
11503 +                                               06      /* XIRQ 3 */
11504 +                                               06      /* XIRQ 4 */
11505 +                                               06      /* XIRQ 5 */
11506 +                                               06      /* XIRQ 6 */
11507 +                                               07];    /* Reserved */
11508 +                       };
11509 +               };
11510 +
11511 +               PCI0: pci@ec000000 {
11512 +                       device_type = "pci";
11513 +                       #interrupt-cells = <1>;
11514 +                       #size-cells = <2>;
11515 +                       #address-cells = <3>;
11516 +                       compatible = "ibm,plb405gp-pci", "ibm,plb-pci";
11517 +                       primary;
11518 +                       reg = <eec00000 8       /* Config space access */
11519 +                              eed80000 4       /* IACK */
11520 +                              eed80000 4       /* Special cycle */
11521 +                              ef480000 40>;    /* Internal registers */
11522 +
11523 +                       /* Outbound ranges, one memory and one IO,
11524 +                        * later cannot be changed. Chip supports a second
11525 +                        * IO range but we don't use it for now
11526 +                        */
11527 +                       ranges = <02000000 0 80000000 80000000 0 20000000
11528 +                                 01000000 0 00000000 e8000000 0 00010000>;
11529 +
11530 +                       /* Inbound 2GB range starting at 0 */
11531 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
11532 +
11533 +                       /* That's all I know about IRQs on that thing ... */
11534 +                       interrupt-map-mask = <f800 0 0 0>;
11535 +                       interrupt-map = <
11536 +                               /* USB */
11537 +                               7000 0 0 0 &UIC0 1e 8 /* IRQ5 */
11538 +                       >;
11539 +               };
11540 +       };
11541 +
11542 +       chosen {
11543 +               linux,stdout-path = "/plb/opb/serial@ef600300";
11544 +       };
11545 +};
11546 --- /dev/null
11547 +++ b/arch/powerpc/boot/dts/ep8248e.dts
11548 @@ -0,0 +1,207 @@
11549 +/*
11550 + * Device Tree for the Embedded Planet EP8248E board running PlanetCore.
11551 + *
11552 + * Copyright 2007 Freescale Semiconductor Inc.
11553 + *
11554 + * This program is free software; you can redistribute  it and/or modify it
11555 + * under  the terms of  the GNU General  Public License as published by the
11556 + * Free Software Foundation;  either version 2 of the  License, or (at your
11557 + * option) any later version.
11558 + */
11559 +
11560 +/dts-v1/;
11561 +/ {
11562 +       model = "EP8248E";
11563 +       compatible = "fsl,ep8248e";
11564 +       #address-cells = <1>;
11565 +       #size-cells = <1>;
11566 +
11567 +       aliases {
11568 +               planetcore-SMC1 = &smc1;
11569 +               planetcore-SCC1 = &scc1;
11570 +               ethernet0 = &eth0;
11571 +               ethernet1 = &eth1;
11572 +               serial0 = &smc1;
11573 +               serial1 = &scc1;
11574 +       };
11575 +
11576 +       cpus {
11577 +               #address-cells = <1>;
11578 +               #size-cells = <0>;
11579 +
11580 +               PowerPC,8248@0 {
11581 +                       device_type = "cpu";
11582 +                       reg = <0>;
11583 +                       d-cache-line-size = <32>;
11584 +                       i-cache-line-size = <32>;
11585 +                       d-cache-size = <16384>;
11586 +                       i-cache-size = <16384>;
11587 +                       timebase-frequency = <0>;
11588 +                       clock-frequency = <0>;
11589 +               };
11590 +       };
11591 +
11592 +       localbus@f0010100 {
11593 +               compatible = "fsl,mpc8248-localbus",
11594 +                            "fsl,pq2-localbus",
11595 +                            "simple-bus";
11596 +               #address-cells = <2>;
11597 +               #size-cells = <1>;
11598 +               reg = <0xf0010100 0x40>;
11599 +
11600 +               ranges = <0 0 0xfc000000 0x04000000
11601 +                         1 0 0xfa000000 0x00008000>;
11602 +
11603 +               flash@0,3800000 {
11604 +                       compatible = "cfi-flash";
11605 +                       reg = <0 0x3800000 0x800000>;
11606 +                       bank-width = <4>;
11607 +                       device-width = <2>;
11608 +               };
11609 +
11610 +               bcsr@1,0 {
11611 +                       #address-cells = <2>;
11612 +                       #size-cells = <1>;
11613 +                       reg = <1 0 0x10>;
11614 +                       compatible = "fsl,ep8248e-bcsr";
11615 +                       ranges;
11616 +
11617 +                       mdio {
11618 +                               device_type = "mdio";
11619 +                               compatible = "fsl,ep8248e-mdio-bitbang";
11620 +                               #address-cells = <1>;
11621 +                               #size-cells = <0>;
11622 +                               reg = <1 8 1>;
11623 +
11624 +                               PHY0: ethernet-phy@0 {
11625 +                                       interrupt-parent = <&PIC>;
11626 +                                       reg = <0>;
11627 +                                       device_type = "ethernet-phy";
11628 +                               };
11629 +
11630 +                               PHY1: ethernet-phy@1 {
11631 +                                       interrupt-parent = <&PIC>;
11632 +                                       reg = <1>;
11633 +                                       device_type = "ethernet-phy";
11634 +                               };
11635 +                       };
11636 +               };
11637 +       };
11638 +
11639 +       memory {
11640 +               device_type = "memory";
11641 +               reg = <0 0>;
11642 +       };
11643 +
11644 +       soc@f0000000 {
11645 +               #address-cells = <1>;
11646 +               #size-cells = <1>;
11647 +               compatible = "fsl,mpc8248-immr", "fsl,pq2-soc", "simple-bus";
11648 +               ranges = <0x00000000 0xf0000000 0x00053000>;
11649 +
11650 +               // Temporary until code stops depending on it.
11651 +               device_type = "soc";
11652 +
11653 +               // Temporary -- will go away once kernel uses ranges for get_immrbase().
11654 +               reg = <0xf0000000 0x00053000>;
11655 +
11656 +               cpm@119c0 {
11657 +                       #address-cells = <1>;
11658 +                       #size-cells = <1>;
11659 +                       #interrupt-cells = <2>;
11660 +                       compatible = "fsl,mpc8248-cpm", "fsl,cpm2",
11661 +                                    "simple-bus";
11662 +                       reg = <0x119c0 0x30>;
11663 +                       ranges;
11664 +
11665 +                       muram {
11666 +                               #address-cells = <1>;
11667 +                               #size-cells = <1>;
11668 +                               ranges = <0 0 0x10000>;
11669 +
11670 +                               data@0 {
11671 +                                       compatible = "fsl,cpm-muram-data";
11672 +                                       reg = <0 0x1100 0x1140
11673 +                                              0xec0 0x9800 0x800>;
11674 +                               };
11675 +                       };
11676 +
11677 +                       brg@119f0 {
11678 +                               compatible = "fsl,mpc8248-brg",
11679 +                                            "fsl,cpm2-brg",
11680 +                                            "fsl,cpm-brg";
11681 +                               reg = <0x119f0 0x10 0x115f0 0x10>;
11682 +                       };
11683 +
11684 +                       /* Monitor port/SMC1 */
11685 +                       smc1: serial@11a80 {
11686 +                               device_type = "serial";
11687 +                               compatible = "fsl,mpc8248-smc-uart",
11688 +                                            "fsl,cpm2-smc-uart";
11689 +                               reg = <0x11a80 0x20 0x1100 0x40>;
11690 +                               interrupts = <4 8>;
11691 +                               interrupt-parent = <&PIC>;
11692 +                               fsl,cpm-brg = <7>;
11693 +                               fsl,cpm-command = <0x1d000000>;
11694 +                               linux,planetcore-label = "SMC1";
11695 +                       };
11696 +
11697 +                       /* "Serial" port/SCC1 */
11698 +                       scc1: serial@11a00 {
11699 +                               device_type = "serial";
11700 +                               compatible = "fsl,mpc8248-scc-uart",
11701 +                                            "fsl,cpm2-scc-uart";
11702 +                               reg = <0x11a00 0x20 0x8000 0x100>;
11703 +                               interrupts = <40 8>;
11704 +                               interrupt-parent = <&PIC>;
11705 +                               fsl,cpm-brg = <1>;
11706 +                               fsl,cpm-command = <0x00800000>;
11707 +                               linux,planetcore-label = "SCC1";
11708 +                       };
11709 +
11710 +                       eth0: ethernet@11300 {
11711 +                               device_type = "network";
11712 +                               compatible = "fsl,mpc8248-fcc-enet",
11713 +                                            "fsl,cpm2-fcc-enet";
11714 +                               reg = <0x11300 0x20 0x8400 0x100 0x11390 1>;
11715 +                               local-mac-address = [ 00 00 00 00 00 00 ];
11716 +                               interrupts = <32 8>;
11717 +                               interrupt-parent = <&PIC>;
11718 +                               phy-handle = <&PHY0>;
11719 +                               linux,network-index = <0>;
11720 +                               fsl,cpm-command = <0x12000300>;
11721 +                       };
11722 +
11723 +                       eth1: ethernet@11320 {
11724 +                               device_type = "network";
11725 +                               compatible = "fsl,mpc8248-fcc-enet",
11726 +                                            "fsl,cpm2-fcc-enet";
11727 +                               reg = <0x11320 0x20 0x8500 0x100 0x113b0 1>;
11728 +                               local-mac-address = [ 00 00 00 00 00 00 ];
11729 +                               interrupts = <33 8>;
11730 +                               interrupt-parent = <&PIC>;
11731 +                               phy-handle = <&PHY1>;
11732 +                               linux,network-index = <1>;
11733 +                               fsl,cpm-command = <0x16200300>;
11734 +                       };
11735 +
11736 +                       usb@11b60 {
11737 +                               #address-cells = <1>;
11738 +                               #size-cells = <0>;
11739 +                               compatible = "fsl,mpc8248-usb",
11740 +                                            "fsl,cpm2-usb";
11741 +                               reg = <0x11b60 0x18 0x8b00 0x100>;
11742 +                               interrupt-parent = <&PIC>;
11743 +                               interrupts = <11 8>;
11744 +                               fsl,cpm-command = <0x2e600000>;
11745 +                       };
11746 +               };
11747 +
11748 +               PIC: interrupt-controller@10c00 {
11749 +                       #interrupt-cells = <2>;
11750 +                       interrupt-controller;
11751 +                       reg = <0x10c00 0x80>;
11752 +                       compatible = "fsl,mpc8248-pic", "fsl,pq2-pic";
11753 +               };
11754 +       };
11755 +};
11756 --- /dev/null
11757 +++ b/arch/powerpc/boot/dts/haleakala.dts
11758 @@ -0,0 +1,274 @@
11759 +/*
11760 + * Device Tree Source for AMCC Haleakala (405EXr)
11761 + *
11762 + * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
11763 + *
11764 + * This file is licensed under the terms of the GNU General Public
11765 + * License version 2.  This program is licensed "as is" without
11766 + * any warranty of any kind, whether express or implied.
11767 + */
11768 +
11769 +/ {
11770 +       #address-cells = <1>;
11771 +       #size-cells = <1>;
11772 +       model = "amcc,haleakala";
11773 +       compatible = "amcc,kilauea";
11774 +       dcr-parent = <&/cpus/cpu@0>;
11775 +
11776 +       aliases {
11777 +               ethernet0 = &EMAC0;
11778 +               serial0 = &UART0;
11779 +               serial1 = &UART1;
11780 +       };
11781 +
11782 +       cpus {
11783 +               #address-cells = <1>;
11784 +               #size-cells = <0>;
11785 +
11786 +               cpu@0 {
11787 +                       device_type = "cpu";
11788 +                       model = "PowerPC,405EXr";
11789 +                       reg = <0>;
11790 +                       clock-frequency = <0>; /* Filled in by U-Boot */
11791 +                       timebase-frequency = <0>; /* Filled in by U-Boot */
11792 +                       i-cache-line-size = <20>;
11793 +                       d-cache-line-size = <20>;
11794 +                       i-cache-size = <4000>; /* 16 kB */
11795 +                       d-cache-size = <4000>; /* 16 kB */
11796 +                       dcr-controller;
11797 +                       dcr-access-method = "native";
11798 +               };
11799 +       };
11800 +
11801 +       memory {
11802 +               device_type = "memory";
11803 +               reg = <0 0>; /* Filled in by U-Boot */
11804 +       };
11805 +
11806 +       UIC0: interrupt-controller {
11807 +               compatible = "ibm,uic-405exr", "ibm,uic";
11808 +               interrupt-controller;
11809 +               cell-index = <0>;
11810 +               dcr-reg = <0c0 009>;
11811 +               #address-cells = <0>;
11812 +               #size-cells = <0>;
11813 +               #interrupt-cells = <2>;
11814 +       };
11815 +
11816 +       UIC1: interrupt-controller1 {
11817 +               compatible = "ibm,uic-405exr","ibm,uic";
11818 +               interrupt-controller;
11819 +               cell-index = <1>;
11820 +               dcr-reg = <0d0 009>;
11821 +               #address-cells = <0>;
11822 +               #size-cells = <0>;
11823 +               #interrupt-cells = <2>;
11824 +               interrupts = <1e 4 1f 4>; /* cascade */
11825 +               interrupt-parent = <&UIC0>;
11826 +       };
11827 +
11828 +       UIC2: interrupt-controller2 {
11829 +               compatible = "ibm,uic-405exr","ibm,uic";
11830 +               interrupt-controller;
11831 +               cell-index = <2>;
11832 +               dcr-reg = <0e0 009>;
11833 +               #address-cells = <0>;
11834 +               #size-cells = <0>;
11835 +               #interrupt-cells = <2>;
11836 +               interrupts = <1c 4 1d 4>; /* cascade */
11837 +               interrupt-parent = <&UIC0>;
11838 +       };
11839 +
11840 +       plb {
11841 +               compatible = "ibm,plb-405exr", "ibm,plb4";
11842 +               #address-cells = <1>;
11843 +               #size-cells = <1>;
11844 +               ranges;
11845 +               clock-frequency = <0>; /* Filled in by U-Boot */
11846 +
11847 +               SDRAM0: memory-controller {
11848 +                       compatible = "ibm,sdram-405exr";
11849 +                       dcr-reg = <010 2>;
11850 +               };
11851 +
11852 +               MAL0: mcmal {
11853 +                       compatible = "ibm,mcmal-405exr", "ibm,mcmal2";
11854 +                       dcr-reg = <180 62>;
11855 +                       num-tx-chans = <2>;
11856 +                       num-rx-chans = <2>;
11857 +                       interrupt-parent = <&MAL0>;
11858 +                       interrupts = <0 1 2 3 4>;
11859 +                       #interrupt-cells = <1>;
11860 +                       #address-cells = <0>;
11861 +                       #size-cells = <0>;
11862 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
11863 +                                       /*RXEOB*/ 1 &UIC0 b 4
11864 +                                       /*SERR*/  2 &UIC1 0 4
11865 +                                       /*TXDE*/  3 &UIC1 1 4
11866 +                                       /*RXDE*/  4 &UIC1 2 4>;
11867 +                       interrupt-map-mask = <ffffffff>;
11868 +               };
11869 +
11870 +               POB0: opb {
11871 +                       compatible = "ibm,opb-405exr", "ibm,opb";
11872 +                       #address-cells = <1>;
11873 +                       #size-cells = <1>;
11874 +                       ranges = <80000000 80000000 10000000
11875 +                                 ef600000 ef600000 a00000
11876 +                                 f0000000 f0000000 10000000>;
11877 +                       dcr-reg = <0a0 5>;
11878 +                       clock-frequency = <0>; /* Filled in by U-Boot */
11879 +
11880 +                       EBC0: ebc {
11881 +                               compatible = "ibm,ebc-405exr", "ibm,ebc";
11882 +                               dcr-reg = <012 2>;
11883 +                               #address-cells = <2>;
11884 +                               #size-cells = <1>;
11885 +                               clock-frequency = <0>; /* Filled in by U-Boot */
11886 +                               /* ranges property is supplied by U-Boot */
11887 +                               interrupts = <5 1>;
11888 +                               interrupt-parent = <&UIC1>;
11889 +
11890 +                               nor_flash@0,0 {
11891 +                                       compatible = "amd,s29gl512n", "cfi-flash";
11892 +                                       bank-width = <2>;
11893 +                                       reg = <0 000000 4000000>;
11894 +                                       #address-cells = <1>;
11895 +                                       #size-cells = <1>;
11896 +                                       partition@0 {
11897 +                                               label = "kernel";
11898 +                                               reg = <0 200000>;
11899 +                                       };
11900 +                                       partition@200000 {
11901 +                                               label = "root";
11902 +                                               reg = <200000 200000>;
11903 +                                       };
11904 +                                       partition@400000 {
11905 +                                               label = "user";
11906 +                                               reg = <400000 3b60000>;
11907 +                                       };
11908 +                                       partition@3f60000 {
11909 +                                               label = "env";
11910 +                                               reg = <3f60000 40000>;
11911 +                                       };
11912 +                                       partition@3fa0000 {
11913 +                                               label = "u-boot";
11914 +                                               reg = <3fa0000 60000>;
11915 +                                       };
11916 +                               };
11917 +                       };
11918 +
11919 +                       UART0: serial@ef600200 {
11920 +                               device_type = "serial";
11921 +                               compatible = "ns16550";
11922 +                               reg = <ef600200 8>;
11923 +                               virtual-reg = <ef600200>;
11924 +                               clock-frequency = <0>; /* Filled in by U-Boot */
11925 +                               current-speed = <0>;
11926 +                               interrupt-parent = <&UIC0>;
11927 +                               interrupts = <1a 4>;
11928 +                       };
11929 +
11930 +                       UART1: serial@ef600300 {
11931 +                               device_type = "serial";
11932 +                               compatible = "ns16550";
11933 +                               reg = <ef600300 8>;
11934 +                               virtual-reg = <ef600300>;
11935 +                               clock-frequency = <0>; /* Filled in by U-Boot */
11936 +                               current-speed = <0>;
11937 +                               interrupt-parent = <&UIC0>;
11938 +                               interrupts = <1 4>;
11939 +                       };
11940 +
11941 +                       IIC0: i2c@ef600400 {
11942 +                               compatible = "ibm,iic-405exr", "ibm,iic";
11943 +                               reg = <ef600400 14>;
11944 +                               interrupt-parent = <&UIC0>;
11945 +                               interrupts = <2 4>;
11946 +                       };
11947 +
11948 +                       IIC1: i2c@ef600500 {
11949 +                               compatible = "ibm,iic-405exr", "ibm,iic";
11950 +                               reg = <ef600500 14>;
11951 +                               interrupt-parent = <&UIC0>;
11952 +                               interrupts = <7 4>;
11953 +                       };
11954 +
11955 +
11956 +                       RGMII0: emac-rgmii@ef600b00 {
11957 +                               compatible = "ibm,rgmii-405exr", "ibm,rgmii";
11958 +                               reg = <ef600b00 104>;
11959 +                               has-mdio;
11960 +                       };
11961 +
11962 +                       EMAC0: ethernet@ef600900 {
11963 +                               linux,network-index = <0>;
11964 +                               device_type = "network";
11965 +                               compatible = "ibm,emac-405exr", "ibm,emac4";
11966 +                               interrupt-parent = <&EMAC0>;
11967 +                               interrupts = <0 1>;
11968 +                               #interrupt-cells = <1>;
11969 +                               #address-cells = <0>;
11970 +                               #size-cells = <0>;
11971 +                               interrupt-map = </*Status*/ 0 &UIC0 18 4
11972 +                                               /*Wake*/  1 &UIC1 1d 4>;
11973 +                               reg = <ef600900 70>;
11974 +                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
11975 +                               mal-device = <&MAL0>;
11976 +                               mal-tx-channel = <0>;
11977 +                               mal-rx-channel = <0>;
11978 +                               cell-index = <0>;
11979 +                               max-frame-size = <5dc>;
11980 +                               rx-fifo-size = <1000>;
11981 +                               tx-fifo-size = <800>;
11982 +                               phy-mode = "rgmii";
11983 +                               phy-map = <00000000>;
11984 +                               rgmii-device = <&RGMII0>;
11985 +                               rgmii-channel = <0>;
11986 +                               has-inverted-stacr-oc;
11987 +                               has-new-stacr-staopc;
11988 +                       };
11989 +               };
11990 +
11991 +               PCIE0: pciex@0a0000000 {
11992 +                       device_type = "pci";
11993 +                       #interrupt-cells = <1>;
11994 +                       #size-cells = <2>;
11995 +                       #address-cells = <3>;
11996 +                       compatible = "ibm,plb-pciex-405exr", "ibm,plb-pciex";
11997 +                       primary;
11998 +                       port = <0>; /* port number */
11999 +                       reg = <a0000000 20000000        /* Config space access */
12000 +                              ef000000 00001000>;      /* Registers */
12001 +                       dcr-reg = <040 020>;
12002 +                       sdr-base = <400>;
12003 +
12004 +                       /* Outbound ranges, one memory and one IO,
12005 +                        * later cannot be changed
12006 +                        */
12007 +                       ranges = <02000000 0 80000000 90000000 0 08000000
12008 +                                 01000000 0 00000000 e0000000 0 00010000>;
12009 +
12010 +                       /* Inbound 2GB range starting at 0 */
12011 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
12012 +
12013 +                       /* This drives busses 0x00 to 0x3f */
12014 +                       bus-range = <00 3f>;
12015 +
12016 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12017 +                        * to invert PCIe legacy interrupts).
12018 +                        * We are de-swizzling here because the numbers are actually for
12019 +                        * port of the root complex virtual P2P bridge. But I want
12020 +                        * to avoid putting a node for it in the tree, so the numbers
12021 +                        * below are basically de-swizzled numbers.
12022 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12023 +                        */
12024 +                       interrupt-map-mask = <0000 0 0 7>;
12025 +                       interrupt-map = <
12026 +                               0000 0 0 1 &UIC2 0 4 /* swizzled int A */
12027 +                               0000 0 0 2 &UIC2 1 4 /* swizzled int B */
12028 +                               0000 0 0 3 &UIC2 2 4 /* swizzled int C */
12029 +                               0000 0 0 4 &UIC2 3 4 /* swizzled int D */>;
12030 +               };
12031 +       };
12032 +};
12033 --- /dev/null
12034 +++ b/arch/powerpc/boot/dts/katmai.dts
12035 @@ -0,0 +1,400 @@
12036 +/*
12037 + * Device Tree Source for AMCC Katmai eval board
12038 + *
12039 + * Copyright (c) 2006, 2007 IBM Corp.
12040 + * Benjamin Herrenschmidt <benh@kernel.crashing.org>
12041 + *
12042 + * Copyright (c) 2006, 2007 IBM Corp.
12043 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
12044 + *
12045 + * This file is licensed under the terms of the GNU General Public
12046 + * License version 2.  This program is licensed "as is" without
12047 + * any warranty of any kind, whether express or implied.
12048 + */
12049 +
12050 +/ {
12051 +       #address-cells = <2>;
12052 +       #size-cells = <1>;
12053 +       model = "amcc,katmai";
12054 +       compatible = "amcc,katmai";
12055 +       dcr-parent = <&/cpus/cpu@0>;
12056 +
12057 +       aliases {
12058 +               ethernet0 = &EMAC0;
12059 +               serial0 = &UART0;
12060 +               serial1 = &UART1;
12061 +               serial2 = &UART2;
12062 +       };
12063 +
12064 +       cpus {
12065 +               #address-cells = <1>;
12066 +               #size-cells = <0>;
12067 +
12068 +               cpu@0 {
12069 +                       device_type = "cpu";
12070 +                       model = "PowerPC,440SPe";
12071 +                       reg = <0>;
12072 +                       clock-frequency = <0>; /* Filled in by zImage */
12073 +                       timebase-frequency = <0>; /* Filled in by zImage */
12074 +                       i-cache-line-size = <20>;
12075 +                       d-cache-line-size = <20>;
12076 +                       i-cache-size = <20000>;
12077 +                       d-cache-size = <20000>;
12078 +                       dcr-controller;
12079 +                       dcr-access-method = "native";
12080 +               };
12081 +       };
12082 +
12083 +       memory {
12084 +               device_type = "memory";
12085 +               reg = <0 0 0>; /* Filled in by zImage */
12086 +       };
12087 +
12088 +       UIC0: interrupt-controller0 {
12089 +               compatible = "ibm,uic-440spe","ibm,uic";
12090 +               interrupt-controller;
12091 +               cell-index = <0>;
12092 +               dcr-reg = <0c0 009>;
12093 +               #address-cells = <0>;
12094 +               #size-cells = <0>;
12095 +               #interrupt-cells = <2>;
12096 +       };
12097 +
12098 +       UIC1: interrupt-controller1 {
12099 +               compatible = "ibm,uic-440spe","ibm,uic";
12100 +               interrupt-controller;
12101 +               cell-index = <1>;
12102 +               dcr-reg = <0d0 009>;
12103 +               #address-cells = <0>;
12104 +               #size-cells = <0>;
12105 +               #interrupt-cells = <2>;
12106 +               interrupts = <1e 4 1f 4>; /* cascade */
12107 +               interrupt-parent = <&UIC0>;
12108 +       };
12109 +
12110 +       UIC2: interrupt-controller2 {
12111 +               compatible = "ibm,uic-440spe","ibm,uic";
12112 +               interrupt-controller;
12113 +               cell-index = <2>;
12114 +               dcr-reg = <0e0 009>;
12115 +               #address-cells = <0>;
12116 +               #size-cells = <0>;
12117 +               #interrupt-cells = <2>;
12118 +               interrupts = <a 4 b 4>; /* cascade */
12119 +               interrupt-parent = <&UIC0>;
12120 +       };
12121 +
12122 +       UIC3: interrupt-controller3 {
12123 +               compatible = "ibm,uic-440spe","ibm,uic";
12124 +               interrupt-controller;
12125 +               cell-index = <3>;
12126 +               dcr-reg = <0f0 009>;
12127 +               #address-cells = <0>;
12128 +               #size-cells = <0>;
12129 +               #interrupt-cells = <2>;
12130 +               interrupts = <10 4 11 4>; /* cascade */
12131 +               interrupt-parent = <&UIC0>;
12132 +       };
12133 +
12134 +       SDR0: sdr {
12135 +               compatible = "ibm,sdr-440spe";
12136 +               dcr-reg = <00e 002>;
12137 +       };
12138 +
12139 +       CPR0: cpr {
12140 +               compatible = "ibm,cpr-440spe";
12141 +               dcr-reg = <00c 002>;
12142 +       };
12143 +
12144 +       plb {
12145 +               compatible = "ibm,plb-440spe", "ibm,plb-440gp", "ibm,plb4";
12146 +               #address-cells = <2>;
12147 +               #size-cells = <1>;
12148 +               ranges;
12149 +               clock-frequency = <0>; /* Filled in by zImage */
12150 +
12151 +               SDRAM0: sdram {
12152 +                       compatible = "ibm,sdram-440spe", "ibm,sdram-405gp";
12153 +                       dcr-reg = <010 2>;
12154 +               };
12155 +
12156 +               MAL0: mcmal {
12157 +                       compatible = "ibm,mcmal-440spe", "ibm,mcmal2";
12158 +                       dcr-reg = <180 62>;
12159 +                       num-tx-chans = <2>;
12160 +                       num-rx-chans = <1>;
12161 +                       interrupt-parent = <&MAL0>;
12162 +                       interrupts = <0 1 2 3 4>;
12163 +                       #interrupt-cells = <1>;
12164 +                       #address-cells = <0>;
12165 +                       #size-cells = <0>;
12166 +                       interrupt-map = </*TXEOB*/ 0 &UIC1 6 4
12167 +                                        /*RXEOB*/ 1 &UIC1 7 4
12168 +                                        /*SERR*/  2 &UIC1 1 4
12169 +                                        /*TXDE*/  3 &UIC1 2 4
12170 +                                        /*RXDE*/  4 &UIC1 3 4>;
12171 +               };
12172 +
12173 +               POB0: opb {
12174 +                       compatible = "ibm,opb-440spe", "ibm,opb-440gp", "ibm,opb";
12175 +                       #address-cells = <1>;
12176 +                       #size-cells = <1>;
12177 +                       ranges = <00000000 4 e0000000 20000000>;
12178 +                       clock-frequency = <0>; /* Filled in by zImage */
12179 +
12180 +                       EBC0: ebc {
12181 +                               compatible = "ibm,ebc-440spe", "ibm,ebc-440gp", "ibm,ebc";
12182 +                               dcr-reg = <012 2>;
12183 +                               #address-cells = <2>;
12184 +                               #size-cells = <1>;
12185 +                               clock-frequency = <0>; /* Filled in by zImage */
12186 +                               interrupts = <5 1>;
12187 +                               interrupt-parent = <&UIC1>;
12188 +                       };
12189 +
12190 +                       UART0: serial@10000200 {
12191 +                               device_type = "serial";
12192 +                               compatible = "ns16550";
12193 +                               reg = <10000200 8>;
12194 +                               virtual-reg = <a0000200>;
12195 +                               clock-frequency = <0>; /* Filled in by zImage */
12196 +                               current-speed = <1c200>;
12197 +                               interrupt-parent = <&UIC0>;
12198 +                               interrupts = <0 4>;
12199 +                       };
12200 +
12201 +                       UART1: serial@10000300 {
12202 +                               device_type = "serial";
12203 +                               compatible = "ns16550";
12204 +                               reg = <10000300 8>;
12205 +                               virtual-reg = <a0000300>;
12206 +                               clock-frequency = <0>;
12207 +                               current-speed = <0>;
12208 +                               interrupt-parent = <&UIC0>;
12209 +                               interrupts = <1 4>;
12210 +                       };
12211 +
12212 +
12213 +                       UART2: serial@10000600 {
12214 +                               device_type = "serial";
12215 +                               compatible = "ns16550";
12216 +                               reg = <10000600 8>;
12217 +                               virtual-reg = <a0000600>;
12218 +                               clock-frequency = <0>;
12219 +                               current-speed = <0>;
12220 +                               interrupt-parent = <&UIC1>;
12221 +                               interrupts = <5 4>;
12222 +                       };
12223 +
12224 +                       IIC0: i2c@10000400 {
12225 +                               device_type = "i2c";
12226 +                               compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic";
12227 +                               reg = <10000400 14>;
12228 +                               interrupt-parent = <&UIC0>;
12229 +                               interrupts = <2 4>;
12230 +                       };
12231 +
12232 +                       IIC1: i2c@10000500 {
12233 +                               device_type = "i2c";
12234 +                               compatible = "ibm,iic-440spe", "ibm,iic-440gp", "ibm,iic";
12235 +                               reg = <10000500 14>;
12236 +                               interrupt-parent = <&UIC0>;
12237 +                               interrupts = <3 4>;
12238 +                       };
12239 +
12240 +                       EMAC0: ethernet@10000800 {
12241 +                               linux,network-index = <0>;
12242 +                               device_type = "network";
12243 +                               compatible = "ibm,emac-440spe", "ibm,emac4";
12244 +                               interrupt-parent = <&UIC1>;
12245 +                               interrupts = <1c 4 1d 4>;
12246 +                               reg = <10000800 70>;
12247 +                               local-mac-address = [000000000000];
12248 +                               mal-device = <&MAL0>;
12249 +                               mal-tx-channel = <0>;
12250 +                               mal-rx-channel = <0>;
12251 +                               cell-index = <0>;
12252 +                               max-frame-size = <5dc>;
12253 +                               rx-fifo-size = <1000>;
12254 +                               tx-fifo-size = <800>;
12255 +                               phy-mode = "gmii";
12256 +                               phy-map = <00000000>;
12257 +                               has-inverted-stacr-oc;
12258 +                               has-new-stacr-staopc;
12259 +                       };
12260 +               };
12261 +
12262 +               PCIX0: pci@c0ec00000 {
12263 +                       device_type = "pci";
12264 +                       #interrupt-cells = <1>;
12265 +                       #size-cells = <2>;
12266 +                       #address-cells = <3>;
12267 +                       compatible = "ibm,plb-pcix-440spe", "ibm,plb-pcix";
12268 +                       primary;
12269 +                       large-inbound-windows;
12270 +                       enable-msi-hole;
12271 +                       reg = <c 0ec00000   8   /* Config space access */
12272 +                              0 0 0            /* no IACK cycles */
12273 +                              c 0ed00000   4   /* Special cycles */
12274 +                              c 0ec80000 100   /* Internal registers */
12275 +                              c 0ec80100  fc>; /* Internal messaging registers */
12276 +
12277 +                       /* Outbound ranges, one memory and one IO,
12278 +                        * later cannot be changed
12279 +                        */
12280 +                       ranges = <02000000 0 80000000 0000000d 80000000 0 80000000
12281 +                                 01000000 0 00000000 0000000c 08000000 0 00010000>;
12282 +
12283 +                       /* Inbound 2GB range starting at 0 */
12284 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
12285 +
12286 +                       /* This drives busses 0 to 0xf */
12287 +                       bus-range = <0 f>;
12288 +
12289 +                       /*
12290 +                        * On Katmai, the following PCI-X interrupts signals
12291 +                        * have to be enabled via jumpers (only INTA is
12292 +                        * enabled per default):
12293 +                        *
12294 +                        * INTB: J3: 1-2
12295 +                        * INTC: J2: 1-2
12296 +                        * INTD: J1: 1-2
12297 +                        */
12298 +                       interrupt-map-mask = <f800 0 0 7>;
12299 +                       interrupt-map = <
12300 +                               /* IDSEL 1 */
12301 +                               0800 0 0 1 &UIC1 14 8
12302 +                               0800 0 0 2 &UIC1 13 8
12303 +                               0800 0 0 3 &UIC1 12 8
12304 +                               0800 0 0 4 &UIC1 11 8
12305 +                       >;
12306 +               };
12307 +
12308 +               PCIE0: pciex@d00000000 {
12309 +                       device_type = "pci";
12310 +                       #interrupt-cells = <1>;
12311 +                       #size-cells = <2>;
12312 +                       #address-cells = <3>;
12313 +                       compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex";
12314 +                       primary;
12315 +                       port = <0>; /* port number */
12316 +                       reg = <d 00000000 20000000      /* Config space access */
12317 +                              c 10000000 00001000>;    /* Registers */
12318 +                       dcr-reg = <100 020>;
12319 +                       sdr-base = <300>;
12320 +
12321 +                       /* Outbound ranges, one memory and one IO,
12322 +                        * later cannot be changed
12323 +                        */
12324 +                       ranges = <02000000 0 80000000 0000000e 00000000 0 80000000
12325 +                                 01000000 0 00000000 0000000f 80000000 0 00010000>;
12326 +
12327 +                       /* Inbound 2GB range starting at 0 */
12328 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
12329 +
12330 +                       /* This drives busses 10 to 0x1f */
12331 +                       bus-range = <10 1f>;
12332 +
12333 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12334 +                        * to invert PCIe legacy interrupts).
12335 +                        * We are de-swizzling here because the numbers are actually for
12336 +                        * port of the root complex virtual P2P bridge. But I want
12337 +                        * to avoid putting a node for it in the tree, so the numbers
12338 +                        * below are basically de-swizzled numbers.
12339 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12340 +                        */
12341 +                       interrupt-map-mask = <0000 0 0 7>;
12342 +                       interrupt-map = <
12343 +                               0000 0 0 1 &UIC3 0 4 /* swizzled int A */
12344 +                               0000 0 0 2 &UIC3 1 4 /* swizzled int B */
12345 +                               0000 0 0 3 &UIC3 2 4 /* swizzled int C */
12346 +                               0000 0 0 4 &UIC3 3 4 /* swizzled int D */>;
12347 +               };
12348 +
12349 +               PCIE1: pciex@d20000000 {
12350 +                       device_type = "pci";
12351 +                       #interrupt-cells = <1>;
12352 +                       #size-cells = <2>;
12353 +                       #address-cells = <3>;
12354 +                       compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex";
12355 +                       primary;
12356 +                       port = <1>; /* port number */
12357 +                       reg = <d 20000000 20000000      /* Config space access */
12358 +                              c 10001000 00001000>;    /* Registers */
12359 +                       dcr-reg = <120 020>;
12360 +                       sdr-base = <340>;
12361 +
12362 +                       /* Outbound ranges, one memory and one IO,
12363 +                        * later cannot be changed
12364 +                        */
12365 +                       ranges = <02000000 0 80000000 0000000e 80000000 0 80000000
12366 +                                 01000000 0 00000000 0000000f 80010000 0 00010000>;
12367 +
12368 +                       /* Inbound 2GB range starting at 0 */
12369 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
12370 +
12371 +                       /* This drives busses 10 to 0x1f */
12372 +                       bus-range = <20 2f>;
12373 +
12374 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12375 +                        * to invert PCIe legacy interrupts).
12376 +                        * We are de-swizzling here because the numbers are actually for
12377 +                        * port of the root complex virtual P2P bridge. But I want
12378 +                        * to avoid putting a node for it in the tree, so the numbers
12379 +                        * below are basically de-swizzled numbers.
12380 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12381 +                        */
12382 +                       interrupt-map-mask = <0000 0 0 7>;
12383 +                       interrupt-map = <
12384 +                               0000 0 0 1 &UIC3 4 4 /* swizzled int A */
12385 +                               0000 0 0 2 &UIC3 5 4 /* swizzled int B */
12386 +                               0000 0 0 3 &UIC3 6 4 /* swizzled int C */
12387 +                               0000 0 0 4 &UIC3 7 4 /* swizzled int D */>;
12388 +               };
12389 +
12390 +               PCIE2: pciex@d40000000 {
12391 +                       device_type = "pci";
12392 +                       #interrupt-cells = <1>;
12393 +                       #size-cells = <2>;
12394 +                       #address-cells = <3>;
12395 +                       compatible = "ibm,plb-pciex-440spe", "ibm,plb-pciex";
12396 +                       primary;
12397 +                       port = <2>; /* port number */
12398 +                       reg = <d 40000000 20000000      /* Config space access */
12399 +                              c 10002000 00001000>;    /* Registers */
12400 +                       dcr-reg = <140 020>;
12401 +                       sdr-base = <370>;
12402 +
12403 +                       /* Outbound ranges, one memory and one IO,
12404 +                        * later cannot be changed
12405 +                        */
12406 +                       ranges = <02000000 0 80000000 0000000f 00000000 0 80000000
12407 +                                 01000000 0 00000000 0000000f 80020000 0 00010000>;
12408 +
12409 +                       /* Inbound 2GB range starting at 0 */
12410 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
12411 +
12412 +                       /* This drives busses 10 to 0x1f */
12413 +                       bus-range = <30 3f>;
12414 +
12415 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12416 +                        * to invert PCIe legacy interrupts).
12417 +                        * We are de-swizzling here because the numbers are actually for
12418 +                        * port of the root complex virtual P2P bridge. But I want
12419 +                        * to avoid putting a node for it in the tree, so the numbers
12420 +                        * below are basically de-swizzled numbers.
12421 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12422 +                        */
12423 +                       interrupt-map-mask = <0000 0 0 7>;
12424 +                       interrupt-map = <
12425 +                               0000 0 0 1 &UIC3 8 4 /* swizzled int A */
12426 +                               0000 0 0 2 &UIC3 9 4 /* swizzled int B */
12427 +                               0000 0 0 3 &UIC3 a 4 /* swizzled int C */
12428 +                               0000 0 0 4 &UIC3 b 4 /* swizzled int D */>;
12429 +               };
12430 +       };
12431 +
12432 +       chosen {
12433 +               linux,stdout-path = "/plb/opb/serial@10000200";
12434 +       };
12435 +};
12436 --- a/arch/powerpc/boot/dts/kilauea.dts
12437 +++ b/arch/powerpc/boot/dts/kilauea.dts
12438 @@ -13,14 +13,22 @@
12439         #size-cells = <1>;
12440         model = "amcc,kilauea";
12441         compatible = "amcc,kilauea";
12442 -       dcr-parent = <&/cpus/PowerPC,405EX@0>;
12443 +       dcr-parent = <&/cpus/cpu@0>;
12444 +
12445 +       aliases {
12446 +               ethernet0 = &EMAC0;
12447 +               ethernet1 = &EMAC1;
12448 +               serial0 = &UART0;
12449 +               serial1 = &UART1;
12450 +       };
12451  
12452         cpus {
12453                 #address-cells = <1>;
12454                 #size-cells = <0>;
12455  
12456 -               PowerPC,405EX@0 {
12457 +               cpu@0 {
12458                         device_type = "cpu";
12459 +                       model = "PowerPC,405EX";
12460                         reg = <0>;
12461                         clock-frequency = <0>; /* Filled in by U-Boot */
12462                         timebase-frequency = <0>; /* Filled in by U-Boot */
12463 @@ -194,6 +202,7 @@
12464                                 device_type = "rgmii-interface";
12465                                 compatible = "ibm,rgmii-405ex", "ibm,rgmii";
12466                                 reg = <ef600b00 104>;
12467 +                               has-mdio;
12468                         };
12469  
12470                         EMAC0: ethernet@ef600900 {
12471 @@ -220,6 +229,8 @@
12472                                 phy-map = <00000000>;
12473                                 rgmii-device = <&RGMII0>;
12474                                 rgmii-channel = <0>;
12475 +                               has-inverted-stacr-oc;
12476 +                               has-new-stacr-staopc;
12477                         };
12478  
12479                         EMAC1: ethernet@ef600a00 {
12480 @@ -246,7 +257,91 @@
12481                                 phy-map = <00000000>;
12482                                 rgmii-device = <&RGMII0>;
12483                                 rgmii-channel = <1>;
12484 +                               has-inverted-stacr-oc;
12485 +                               has-new-stacr-staopc;
12486                         };
12487                 };
12488 +
12489 +               PCIE0: pciex@0a0000000 {
12490 +                       device_type = "pci";
12491 +                       #interrupt-cells = <1>;
12492 +                       #size-cells = <2>;
12493 +                       #address-cells = <3>;
12494 +                       compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
12495 +                       primary;
12496 +                       port = <0>; /* port number */
12497 +                       reg = <a0000000 20000000        /* Config space access */
12498 +                              ef000000 00001000>;      /* Registers */
12499 +                       dcr-reg = <040 020>;
12500 +                       sdr-base = <400>;
12501 +
12502 +                       /* Outbound ranges, one memory and one IO,
12503 +                        * later cannot be changed
12504 +                        */
12505 +                       ranges = <02000000 0 80000000 90000000 0 08000000
12506 +                                 01000000 0 00000000 e0000000 0 00010000>;
12507 +
12508 +                       /* Inbound 2GB range starting at 0 */
12509 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
12510 +
12511 +                       /* This drives busses 0x00 to 0x3f */
12512 +                       bus-range = <00 3f>;
12513 +
12514 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12515 +                        * to invert PCIe legacy interrupts).
12516 +                        * We are de-swizzling here because the numbers are actually for
12517 +                        * port of the root complex virtual P2P bridge. But I want
12518 +                        * to avoid putting a node for it in the tree, so the numbers
12519 +                        * below are basically de-swizzled numbers.
12520 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12521 +                        */
12522 +                       interrupt-map-mask = <0000 0 0 7>;
12523 +                       interrupt-map = <
12524 +                               0000 0 0 1 &UIC2 0 4 /* swizzled int A */
12525 +                               0000 0 0 2 &UIC2 1 4 /* swizzled int B */
12526 +                               0000 0 0 3 &UIC2 2 4 /* swizzled int C */
12527 +                               0000 0 0 4 &UIC2 3 4 /* swizzled int D */>;
12528 +               };
12529 +
12530 +               PCIE1: pciex@0c0000000 {
12531 +                       device_type = "pci";
12532 +                       #interrupt-cells = <1>;
12533 +                       #size-cells = <2>;
12534 +                       #address-cells = <3>;
12535 +                       compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
12536 +                       primary;
12537 +                       port = <1>; /* port number */
12538 +                       reg = <c0000000 20000000        /* Config space access */
12539 +                              ef001000 00001000>;      /* Registers */
12540 +                       dcr-reg = <060 020>;
12541 +                       sdr-base = <440>;
12542 +
12543 +                       /* Outbound ranges, one memory and one IO,
12544 +                        * later cannot be changed
12545 +                        */
12546 +                       ranges = <02000000 0 80000000 98000000 0 08000000
12547 +                                 01000000 0 00000000 e0010000 0 00010000>;
12548 +
12549 +                       /* Inbound 2GB range starting at 0 */
12550 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
12551 +
12552 +                       /* This drives busses 0x40 to 0x7f */
12553 +                       bus-range = <40 7f>;
12554 +
12555 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
12556 +                        * to invert PCIe legacy interrupts).
12557 +                        * We are de-swizzling here because the numbers are actually for
12558 +                        * port of the root complex virtual P2P bridge. But I want
12559 +                        * to avoid putting a node for it in the tree, so the numbers
12560 +                        * below are basically de-swizzled numbers.
12561 +                        * The real slot is on idsel 0, so the swizzling is 1:1
12562 +                        */
12563 +                       interrupt-map-mask = <0000 0 0 7>;
12564 +                       interrupt-map = <
12565 +                               0000 0 0 1 &UIC2 b 4 /* swizzled int A */
12566 +                               0000 0 0 2 &UIC2 c 4 /* swizzled int B */
12567 +                               0000 0 0 3 &UIC2 d 4 /* swizzled int C */
12568 +                               0000 0 0 4 &UIC2 e 4 /* swizzled int D */>;
12569 +               };
12570         };
12571  };
12572 --- a/arch/powerpc/boot/dts/kuroboxHD.dts
12573 +++ b/arch/powerpc/boot/dts/kuroboxHD.dts
12574 @@ -23,6 +23,12 @@
12575         #address-cells = <1>;
12576         #size-cells = <1>;
12577  
12578 +       aliases {
12579 +               serial0 = &serial0;
12580 +               serial1 = &serial1;
12581 +               pci0 = &pci0;
12582 +       };
12583 +
12584         cpus {
12585                 #address-cells = <1>;
12586                 #size-cells = <0>;
12587 @@ -60,7 +66,7 @@
12588                 i2c@80003000 {
12589                         #address-cells = <1>;
12590                         #size-cells = <0>;
12591 -                       device_type = "i2c";
12592 +                       cell-index = <0>;
12593                         compatible = "fsl-i2c";
12594                         reg = <80003000 1000>;
12595                         interrupts = <5 2>;
12596 @@ -73,7 +79,8 @@
12597                         };
12598                 };
12599  
12600 -               serial@80004500 {
12601 +               serial0: serial@80004500 {
12602 +                       cell-index = <0>;
12603                         device_type = "serial";
12604                         compatible = "ns16550";
12605                         reg = <80004500 8>;
12606 @@ -83,7 +90,8 @@
12607                         interrupt-parent = <&mpic>;
12608                 };
12609  
12610 -               serial@80004600 {
12611 +               serial1: serial@80004600 {
12612 +                       cell-index = <1>;
12613                         device_type = "serial";
12614                         compatible = "ns16550";
12615                         reg = <80004600 8>;
12616 @@ -102,7 +110,7 @@
12617                         reg = <80040000 40000>;
12618                 };
12619  
12620 -               pci@fec00000 {
12621 +               pci0: pci@fec00000 {
12622                         #address-cells = <3>;
12623                         #size-cells = <2>;
12624                         #interrupt-cells = <1>;
12625 --- a/arch/powerpc/boot/dts/kuroboxHG.dts
12626 +++ b/arch/powerpc/boot/dts/kuroboxHG.dts
12627 @@ -23,6 +23,12 @@
12628         #address-cells = <1>;
12629         #size-cells = <1>;
12630  
12631 +       aliases {
12632 +               serial0 = &serial0;
12633 +               serial1 = &serial1;
12634 +               pci0 = &pci0;
12635 +       };
12636 +
12637         cpus {
12638                 #address-cells = <1>;
12639                 #size-cells = <0>;
12640 @@ -60,7 +66,7 @@
12641                 i2c@80003000 {
12642                         #address-cells = <1>;
12643                         #size-cells = <0>;
12644 -                       device_type = "i2c";
12645 +                       cell-index = <0>;
12646                         compatible = "fsl-i2c";
12647                         reg = <80003000 1000>;
12648                         interrupts = <5 2>;
12649 @@ -73,7 +79,8 @@
12650                         };
12651                 };
12652  
12653 -               serial@80004500 {
12654 +               serial0: serial@80004500 {
12655 +                       cell-index = <0>;
12656                         device_type = "serial";
12657                         compatible = "ns16550";
12658                         reg = <80004500 8>;
12659 @@ -83,7 +90,8 @@
12660                         interrupt-parent = <&mpic>;
12661                 };
12662  
12663 -               serial@80004600 {
12664 +               serial1: serial@80004600 {
12665 +                       cell-index = <1>;
12666                         device_type = "serial";
12667                         compatible = "ns16550";
12668                         reg = <80004600 8>;
12669 @@ -102,7 +110,7 @@
12670                         reg = <80040000 40000>;
12671                 };
12672  
12673 -               pci@fec00000 {
12674 +               pci0: pci@fec00000 {
12675                         #address-cells = <3>;
12676                         #size-cells = <2>;
12677                         #interrupt-cells = <1>;
12678 --- a/arch/powerpc/boot/dts/lite5200.dts
12679 +++ b/arch/powerpc/boot/dts/lite5200.dts
12680 @@ -19,7 +19,7 @@
12681  / {
12682         model = "fsl,lite5200";
12683         // revision = "1.0";
12684 -       compatible = "fsl,lite5200","generic-mpc5200";
12685 +       compatible = "fsl,lite5200";
12686         #address-cells = <1>;
12687         #size-cells = <1>;
12688  
12689 @@ -284,7 +284,8 @@
12690                 };
12691  
12692                 i2c@3d00 {
12693 -                       device_type = "i2c";
12694 +                       #address-cells = <1>;
12695 +                       #size-cells = <0>;
12696                         compatible = "mpc5200-i2c","fsl-i2c";
12697                         cell-index = <0>;
12698                         reg = <3d00 40>;
12699 @@ -294,7 +295,8 @@
12700                 };
12701  
12702                 i2c@3d40 {
12703 -                       device_type = "i2c";
12704 +                       #address-cells = <1>;
12705 +                       #size-cells = <0>;
12706                         compatible = "mpc5200-i2c","fsl-i2c";
12707                         cell-index = <1>;
12708                         reg = <3d40 40>;
12709 --- a/arch/powerpc/boot/dts/lite5200b.dts
12710 +++ b/arch/powerpc/boot/dts/lite5200b.dts
12711 @@ -19,7 +19,7 @@
12712  / {
12713         model = "fsl,lite5200b";
12714         // revision = "1.0";
12715 -       compatible = "fsl,lite5200b","generic-mpc5200";
12716 +       compatible = "fsl,lite5200b";
12717         #address-cells = <1>;
12718         #size-cells = <1>;
12719  
12720 @@ -300,7 +300,8 @@
12721                 };
12722  
12723                 i2c@3d00 {
12724 -                       device_type = "i2c";
12725 +                       #address-cells = <1>;
12726 +                       #size-cells = <0>;
12727                         compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
12728                         cell-index = <0>;
12729                         reg = <3d00 40>;
12730 @@ -310,7 +311,8 @@
12731                 };
12732  
12733                 i2c@3d40 {
12734 -                       device_type = "i2c";
12735 +                       #address-cells = <1>;
12736 +                       #size-cells = <0>;
12737                         compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
12738                         cell-index = <1>;
12739                         reg = <3d40 40>;
12740 --- /dev/null
12741 +++ b/arch/powerpc/boot/dts/makalu.dts
12742 @@ -0,0 +1,347 @@
12743 +/*
12744 + * Device Tree Source for AMCC Makalu (405EX)
12745 + *
12746 + * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
12747 + *
12748 + * This file is licensed under the terms of the GNU General Public
12749 + * License version 2.  This program is licensed "as is" without
12750 + * any warranty of any kind, whether express or implied.
12751 + */
12752 +
12753 +/ {
12754 +       #address-cells = <1>;
12755 +       #size-cells = <1>;
12756 +       model = "amcc,makalu";
12757 +       compatible = "amcc,makalu";
12758 +       dcr-parent = <&/cpus/cpu@0>;
12759 +
12760 +       aliases {
12761 +               ethernet0 = &EMAC0;
12762 +               ethernet1 = &EMAC1;
12763 +               serial0 = &UART0;
12764 +               serial1 = &UART1;
12765 +       };
12766 +
12767 +       cpus {
12768 +               #address-cells = <1>;
12769 +               #size-cells = <0>;
12770 +
12771 +               cpu@0 {
12772 +                       device_type = "cpu";
12773 +                       model = "PowerPC,405EX";
12774 +                       reg = <0>;
12775 +                       clock-frequency = <0>; /* Filled in by U-Boot */
12776 +                       timebase-frequency = <0>; /* Filled in by U-Boot */
12777 +                       i-cache-line-size = <20>;
12778 +                       d-cache-line-size = <20>;
12779 +                       i-cache-size = <4000>; /* 16 kB */
12780 +                       d-cache-size = <4000>; /* 16 kB */
12781 +                       dcr-controller;
12782 +                       dcr-access-method = "native";
12783 +               };
12784 +       };
12785 +
12786 +       memory {
12787 +               device_type = "memory";
12788 +               reg = <0 0>; /* Filled in by U-Boot */
12789 +       };
12790 +
12791 +       UIC0: interrupt-controller {
12792 +               compatible = "ibm,uic-405ex", "ibm,uic";
12793 +               interrupt-controller;
12794 +               cell-index = <0>;
12795 +               dcr-reg = <0c0 009>;
12796 +               #address-cells = <0>;
12797 +               #size-cells = <0>;
12798 +               #interrupt-cells = <2>;
12799 +       };
12800 +
12801 +       UIC1: interrupt-controller1 {
12802 +               compatible = "ibm,uic-405ex","ibm,uic";
12803 +               interrupt-controller;
12804 +               cell-index = <1>;
12805 +               dcr-reg = <0d0 009>;
12806 +               #address-cells = <0>;
12807 +               #size-cells = <0>;
12808 +               #interrupt-cells = <2>;
12809 +               interrupts = <1e 4 1f 4>; /* cascade */
12810 +               interrupt-parent = <&UIC0>;
12811 +       };
12812 +
12813 +       UIC2: interrupt-controller2 {
12814 +               compatible = "ibm,uic-405ex","ibm,uic";
12815 +               interrupt-controller;
12816 +               cell-index = <2>;
12817 +               dcr-reg = <0e0 009>;
12818 +               #address-cells = <0>;
12819 +               #size-cells = <0>;
12820 +               #interrupt-cells = <2>;
12821 +               interrupts = <1c 4 1d 4>; /* cascade */
12822 +               interrupt-parent = <&UIC0>;
12823 +       };
12824 +
12825 +       plb {
12826 +               compatible = "ibm,plb-405ex", "ibm,plb4";
12827 +               #address-cells = <1>;
12828 +               #size-cells = <1>;
12829 +               ranges;
12830 +               clock-frequency = <0>; /* Filled in by U-Boot */
12831 +
12832 +               SDRAM0: memory-controller {
12833 +                       compatible = "ibm,sdram-405ex";
12834 +                       dcr-reg = <010 2>;
12835 +               };
12836 +
12837 +               MAL0: mcmal {
12838 +                       compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
12839 +                       dcr-reg = <180 62>;
12840 +                       num-tx-chans = <2>;
12841 +                       num-rx-chans = <2>;
12842 +                       interrupt-parent = <&MAL0>;
12843 +                       interrupts = <0 1 2 3 4>;
12844 +                       #interrupt-cells = <1>;
12845 +                       #address-cells = <0>;
12846 +                       #size-cells = <0>;
12847 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
12848 +                                       /*RXEOB*/ 1 &UIC0 b 4
12849 +                                       /*SERR*/  2 &UIC1 0 4
12850 +                                       /*TXDE*/  3 &UIC1 1 4
12851 +                                       /*RXDE*/  4 &UIC1 2 4>;
12852 +                       interrupt-map-mask = <ffffffff>;
12853 +               };
12854 +
12855 +               POB0: opb {
12856 +                       compatible = "ibm,opb-405ex", "ibm,opb";
12857 +                       #address-cells = <1>;
12858 +                       #size-cells = <1>;
12859 +                       ranges = <80000000 80000000 10000000
12860 +                                 ef600000 ef600000 a00000
12861 +                                 f0000000 f0000000 10000000>;
12862 +                       dcr-reg = <0a0 5>;
12863 +                       clock-frequency = <0>; /* Filled in by U-Boot */
12864 +
12865 +                       EBC0: ebc {
12866 +                               compatible = "ibm,ebc-405ex", "ibm,ebc";
12867 +                               dcr-reg = <012 2>;
12868 +                               #address-cells = <2>;
12869 +                               #size-cells = <1>;
12870 +                               clock-frequency = <0>; /* Filled in by U-Boot */
12871 +                               /* ranges property is supplied by U-Boot */
12872 +                               interrupts = <5 1>;
12873 +                               interrupt-parent = <&UIC1>;
12874 +
12875 +                               nor_flash@0,0 {
12876 +                                       compatible = "amd,s29gl512n", "cfi-flash";
12877 +                                       bank-width = <2>;
12878 +                                       reg = <0 000000 4000000>;
12879 +                                       #address-cells = <1>;
12880 +                                       #size-cells = <1>;
12881 +                                       partition@0 {
12882 +                                               label = "kernel";
12883 +                                               reg = <0 200000>;
12884 +                                       };
12885 +                                       partition@200000 {
12886 +                                               label = "root";
12887 +                                               reg = <200000 200000>;
12888 +                                       };
12889 +                                       partition@400000 {
12890 +                                               label = "user";
12891 +                                               reg = <400000 3b60000>;
12892 +                                       };
12893 +                                       partition@3f60000 {
12894 +                                               label = "env";
12895 +                                               reg = <3f60000 40000>;
12896 +                                       };
12897 +                                       partition@3fa0000 {
12898 +                                               label = "u-boot";
12899 +                                               reg = <3fa0000 60000>;
12900 +                                       };
12901 +                               };
12902 +                       };
12903 +
12904 +                       UART0: serial@ef600200 {
12905 +                               device_type = "serial";
12906 +                               compatible = "ns16550";
12907 +                               reg = <ef600200 8>;
12908 +                               virtual-reg = <ef600200>;
12909 +                               clock-frequency = <0>; /* Filled in by U-Boot */
12910 +                               current-speed = <0>;
12911 +                               interrupt-parent = <&UIC0>;
12912 +                               interrupts = <1a 4>;
12913 +                       };
12914 +
12915 +                       UART1: serial@ef600300 {
12916 +                               device_type = "serial";
12917 +                               compatible = "ns16550";
12918 +                               reg = <ef600300 8>;
12919 +                               virtual-reg = <ef600300>;
12920 +                               clock-frequency = <0>; /* Filled in by U-Boot */
12921 +                               current-speed = <0>;
12922 +                               interrupt-parent = <&UIC0>;
12923 +                               interrupts = <1 4>;
12924 +                       };
12925 +
12926 +                       IIC0: i2c@ef600400 {
12927 +                               device_type = "i2c";
12928 +                               compatible = "ibm,iic-405ex", "ibm,iic";
12929 +                               reg = <ef600400 14>;
12930 +                               interrupt-parent = <&UIC0>;
12931 +                               interrupts = <2 4>;
12932 +                       };
12933 +
12934 +                       IIC1: i2c@ef600500 {
12935 +                               device_type = "i2c";
12936 +                               compatible = "ibm,iic-405ex", "ibm,iic";
12937 +                               reg = <ef600500 14>;
12938 +                               interrupt-parent = <&UIC0>;
12939 +                               interrupts = <7 4>;
12940 +                       };
12941 +
12942 +
12943 +                       RGMII0: emac-rgmii@ef600b00 {
12944 +                               device_type = "rgmii-interface";
12945 +                               compatible = "ibm,rgmii-405ex", "ibm,rgmii";
12946 +                               reg = <ef600b00 104>;
12947 +                               has-mdio;
12948 +                       };
12949 +
12950 +                       EMAC0: ethernet@ef600900 {
12951 +                               linux,network-index = <0>;
12952 +                               device_type = "network";
12953 +                               compatible = "ibm,emac-405ex", "ibm,emac4";
12954 +                               interrupt-parent = <&EMAC0>;
12955 +                               interrupts = <0 1>;
12956 +                               #interrupt-cells = <1>;
12957 +                               #address-cells = <0>;
12958 +                               #size-cells = <0>;
12959 +                               interrupt-map = </*Status*/ 0 &UIC0 18 4
12960 +                                               /*Wake*/  1 &UIC1 1d 4>;
12961 +                               reg = <ef600900 70>;
12962 +                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
12963 +                               mal-device = <&MAL0>;
12964 +                               mal-tx-channel = <0>;
12965 +                               mal-rx-channel = <0>;
12966 +                               cell-index = <0>;
12967 +                               max-frame-size = <5dc>;
12968 +                               rx-fifo-size = <1000>;
12969 +                               tx-fifo-size = <800>;
12970 +                               phy-mode = "rgmii";
12971 +                               phy-map = <0000003f>;   /* Start at 6 */
12972 +                               rgmii-device = <&RGMII0>;
12973 +                               rgmii-channel = <0>;
12974 +                               has-inverted-stacr-oc;
12975 +                               has-new-stacr-staopc;
12976 +                       };
12977 +
12978 +                       EMAC1: ethernet@ef600a00 {
12979 +                               linux,network-index = <1>;
12980 +                               device_type = "network";
12981 +                               compatible = "ibm,emac-405ex", "ibm,emac4";
12982 +                               interrupt-parent = <&EMAC1>;
12983 +                               interrupts = <0 1>;
12984 +                               #interrupt-cells = <1>;
12985 +                               #address-cells = <0>;
12986 +                               #size-cells = <0>;
12987 +                               interrupt-map = </*Status*/ 0 &UIC0 19 4
12988 +                                               /*Wake*/  1 &UIC1 1f 4>;
12989 +                               reg = <ef600a00 70>;
12990 +                               local-mac-address = [000000000000]; /* Filled in by U-Boot */
12991 +                               mal-device = <&MAL0>;
12992 +                               mal-tx-channel = <1>;
12993 +                               mal-rx-channel = <1>;
12994 +                               cell-index = <1>;
12995 +                               max-frame-size = <5dc>;
12996 +                               rx-fifo-size = <1000>;
12997 +                               tx-fifo-size = <800>;
12998 +                               phy-mode = "rgmii";
12999 +                               phy-map = <00000000>;
13000 +                               rgmii-device = <&RGMII0>;
13001 +                               rgmii-channel = <1>;
13002 +                               has-inverted-stacr-oc;
13003 +                               has-new-stacr-staopc;
13004 +                       };
13005 +               };
13006 +
13007 +               PCIE0: pciex@0a0000000 {
13008 +                       device_type = "pci";
13009 +                       #interrupt-cells = <1>;
13010 +                       #size-cells = <2>;
13011 +                       #address-cells = <3>;
13012 +                       compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
13013 +                       primary;
13014 +                       port = <0>; /* port number */
13015 +                       reg = <a0000000 20000000        /* Config space access */
13016 +                              ef000000 00001000>;      /* Registers */
13017 +                       dcr-reg = <040 020>;
13018 +                       sdr-base = <400>;
13019 +
13020 +                       /* Outbound ranges, one memory and one IO,
13021 +                        * later cannot be changed
13022 +                        */
13023 +                       ranges = <02000000 0 80000000 90000000 0 08000000
13024 +                                 01000000 0 00000000 e0000000 0 00010000>;
13025 +
13026 +                       /* Inbound 2GB range starting at 0 */
13027 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
13028 +
13029 +                       /* This drives busses 0x00 to 0x3f */
13030 +                       bus-range = <00 3f>;
13031 +
13032 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
13033 +                        * to invert PCIe legacy interrupts).
13034 +                        * We are de-swizzling here because the numbers are actually for
13035 +                        * port of the root complex virtual P2P bridge. But I want
13036 +                        * to avoid putting a node for it in the tree, so the numbers
13037 +                        * below are basically de-swizzled numbers.
13038 +                        * The real slot is on idsel 0, so the swizzling is 1:1
13039 +                        */
13040 +                       interrupt-map-mask = <0000 0 0 7>;
13041 +                       interrupt-map = <
13042 +                               0000 0 0 1 &UIC2 0 4 /* swizzled int A */
13043 +                               0000 0 0 2 &UIC2 1 4 /* swizzled int B */
13044 +                               0000 0 0 3 &UIC2 2 4 /* swizzled int C */
13045 +                               0000 0 0 4 &UIC2 3 4 /* swizzled int D */>;
13046 +               };
13047 +
13048 +               PCIE1: pciex@0c0000000 {
13049 +                       device_type = "pci";
13050 +                       #interrupt-cells = <1>;
13051 +                       #size-cells = <2>;
13052 +                       #address-cells = <3>;
13053 +                       compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex";
13054 +                       primary;
13055 +                       port = <1>; /* port number */
13056 +                       reg = <c0000000 20000000        /* Config space access */
13057 +                              ef001000 00001000>;      /* Registers */
13058 +                       dcr-reg = <060 020>;
13059 +                       sdr-base = <440>;
13060 +
13061 +                       /* Outbound ranges, one memory and one IO,
13062 +                        * later cannot be changed
13063 +                        */
13064 +                       ranges = <02000000 0 80000000 98000000 0 08000000
13065 +                                 01000000 0 00000000 e0010000 0 00010000>;
13066 +
13067 +                       /* Inbound 2GB range starting at 0 */
13068 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
13069 +
13070 +                       /* This drives busses 0x40 to 0x7f */
13071 +                       bus-range = <40 7f>;
13072 +
13073 +                       /* Legacy interrupts (note the weird polarity, the bridge seems
13074 +                        * to invert PCIe legacy interrupts).
13075 +                        * We are de-swizzling here because the numbers are actually for
13076 +                        * port of the root complex virtual P2P bridge. But I want
13077 +                        * to avoid putting a node for it in the tree, so the numbers
13078 +                        * below are basically de-swizzled numbers.
13079 +                        * The real slot is on idsel 0, so the swizzling is 1:1
13080 +                        */
13081 +                       interrupt-map-mask = <0000 0 0 7>;
13082 +                       interrupt-map = <
13083 +                               0000 0 0 1 &UIC2 b 4 /* swizzled int A */
13084 +                               0000 0 0 2 &UIC2 c 4 /* swizzled int B */
13085 +                               0000 0 0 3 &UIC2 d 4 /* swizzled int C */
13086 +                               0000 0 0 4 &UIC2 e 4 /* swizzled int D */>;
13087 +               };
13088 +       };
13089 +};
13090 --- /dev/null
13091 +++ b/arch/powerpc/boot/dts/motionpro.dts
13092 @@ -0,0 +1,309 @@
13093 +/*
13094 + * Motion-PRO board Device Tree Source
13095 + *
13096 + * Copyright (C) 2007 Semihalf
13097 + * Marian Balakowicz <m8@semihalf.com>
13098 + *
13099 + * This program is free software; you can redistribute  it and/or modify it
13100 + * under  the terms of  the GNU General  Public License as published by the
13101 + * Free Software Foundation;  either version 2 of the  License, or (at your
13102 + * option) any later version.
13103 + */
13104 +
13105 +/*
13106 + * WARNING: Do not depend on this tree layout remaining static just yet.
13107 + * The MPC5200 device tree conventions are still in flux
13108 + * Keep an eye on the linuxppc-dev mailing list for more details
13109 + */
13110 +
13111 +/ {
13112 +       model = "promess,motionpro";
13113 +       compatible = "promess,motionpro";
13114 +       #address-cells = <1>;
13115 +       #size-cells = <1>;
13116 +
13117 +       cpus {
13118 +               #address-cells = <1>;
13119 +               #size-cells = <0>;
13120 +
13121 +               PowerPC,5200@0 {
13122 +                       device_type = "cpu";
13123 +                       reg = <0>;
13124 +                       d-cache-line-size = <20>;
13125 +                       i-cache-line-size = <20>;
13126 +                       d-cache-size = <4000>;          // L1, 16K
13127 +                       i-cache-size = <4000>;          // L1, 16K
13128 +                       timebase-frequency = <0>;       // from bootloader
13129 +                       bus-frequency = <0>;            // from bootloader
13130 +                       clock-frequency = <0>;          // from bootloader
13131 +               };
13132 +       };
13133 +
13134 +       memory {
13135 +               device_type = "memory";
13136 +               reg = <00000000 04000000>;      // 64MB
13137 +       };
13138 +
13139 +       soc5200@f0000000 {
13140 +               model = "fsl,mpc5200b";
13141 +               compatible = "fsl,mpc5200b";
13142 +               revision = "";                  // from bootloader
13143 +               device_type = "soc";
13144 +               ranges = <0 f0000000 0000c000>;
13145 +               reg = <f0000000 00000100>;
13146 +               bus-frequency = <0>;            // from bootloader
13147 +               system-frequency = <0>;         // from bootloader
13148 +
13149 +               cdm@200 {
13150 +                       compatible = "mpc5200b-cdm","mpc5200-cdm";
13151 +                       reg = <200 38>;
13152 +               };
13153 +
13154 +               mpc5200_pic: pic@500 {
13155 +                       // 5200 interrupts are encoded into two levels;
13156 +                       interrupt-controller;
13157 +                       #interrupt-cells = <3>;
13158 +                       compatible = "mpc5200b-pic","mpc5200-pic";
13159 +                       reg = <500 80>;
13160 +               };
13161 +
13162 +               gpt@600 {       // General Purpose Timer
13163 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13164 +                       reg = <600 10>;
13165 +                       interrupts = <1 9 0>;
13166 +                       interrupt-parent = <&mpc5200_pic>;
13167 +                       fsl,has-wdt;
13168 +               };
13169 +
13170 +               gpt@610 {       // General Purpose Timer
13171 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13172 +                       reg = <610 10>;
13173 +                       interrupts = <1 a 0>;
13174 +                       interrupt-parent = <&mpc5200_pic>;
13175 +               };
13176 +
13177 +               gpt@620 {       // General Purpose Timer
13178 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13179 +                       reg = <620 10>;
13180 +                       interrupts = <1 b 0>;
13181 +                       interrupt-parent = <&mpc5200_pic>;
13182 +               };
13183 +
13184 +               gpt@630 {       // General Purpose Timer
13185 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13186 +                       reg = <630 10>;
13187 +                       interrupts = <1 c 0>;
13188 +                       interrupt-parent = <&mpc5200_pic>;
13189 +               };
13190 +
13191 +               gpt@640 {       // General Purpose Timer
13192 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13193 +                       reg = <640 10>;
13194 +                       interrupts = <1 d 0>;
13195 +                       interrupt-parent = <&mpc5200_pic>;
13196 +               };
13197 +
13198 +               gpt@650 {       // General Purpose Timer
13199 +                       compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
13200 +                       reg = <650 10>;
13201 +                       interrupts = <1 e 0>;
13202 +                       interrupt-parent = <&mpc5200_pic>;
13203 +               };
13204 +
13205 +               motionpro-led@660 {     // Motion-PRO status LED
13206 +                       compatible = "promess,motionpro-led";
13207 +                       label = "motionpro-statusled";
13208 +                       reg = <660 10>;
13209 +                       interrupts = <1 f 0>;
13210 +                       interrupt-parent = <&mpc5200_pic>;
13211 +                       blink-delay = <64>; // 100 msec
13212 +               };
13213 +
13214 +               motionpro-led@670 {     // Motion-PRO ready LED
13215 +                       compatible = "promess,motionpro-led";
13216 +                       label = "motionpro-readyled";
13217 +                       reg = <670 10>;
13218 +                       interrupts = <1 10 0>;
13219 +                       interrupt-parent = <&mpc5200_pic>;
13220 +               };
13221 +
13222 +               rtc@800 {       // Real time clock
13223 +                       compatible = "mpc5200b-rtc","mpc5200-rtc";
13224 +                       reg = <800 100>;
13225 +                       interrupts = <1 5 0 1 6 0>;
13226 +                       interrupt-parent = <&mpc5200_pic>;
13227 +               };
13228 +
13229 +               mscan@980 {
13230 +                       compatible = "mpc5200b-mscan","mpc5200-mscan";
13231 +                       interrupts = <2 12 0>;
13232 +                       interrupt-parent = <&mpc5200_pic>;
13233 +                       reg = <980 80>;
13234 +               };
13235 +
13236 +               gpio@b00 {
13237 +                       compatible = "mpc5200b-gpio","mpc5200-gpio";
13238 +                       reg = <b00 40>;
13239 +                       interrupts = <1 7 0>;
13240 +                       interrupt-parent = <&mpc5200_pic>;
13241 +               };
13242 +
13243 +               gpio-wkup@c00 {
13244 +                       compatible = "mpc5200b-gpio-wkup","mpc5200-gpio-wkup";
13245 +                       reg = <c00 40>;
13246 +                       interrupts = <1 8 0 0 3 0>;
13247 +                       interrupt-parent = <&mpc5200_pic>;
13248 +               };
13249 +
13250 +
13251 +               spi@f00 {
13252 +                       compatible = "mpc5200b-spi","mpc5200-spi";
13253 +                       reg = <f00 20>;
13254 +                       interrupts = <2 d 0 2 e 0>;
13255 +                       interrupt-parent = <&mpc5200_pic>;
13256 +               };
13257 +
13258 +               usb@1000 {
13259 +                       compatible = "mpc5200b-ohci","mpc5200-ohci","ohci-be";
13260 +                       reg = <1000 ff>;
13261 +                       interrupts = <2 6 0>;
13262 +                       interrupt-parent = <&mpc5200_pic>;
13263 +               };
13264 +
13265 +               dma-controller@1200 {
13266 +                       compatible = "mpc5200b-bestcomm","mpc5200-bestcomm";
13267 +                       reg = <1200 80>;
13268 +                       interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
13269 +                                     3 4 0  3 5 0  3 6 0  3 7 0
13270 +                                     3 8 0  3 9 0  3 a 0  3 b 0
13271 +                                     3 c 0  3 d 0  3 e 0  3 f 0>;
13272 +                       interrupt-parent = <&mpc5200_pic>;
13273 +               };
13274 +
13275 +               xlb@1f00 {
13276 +                       compatible = "mpc5200b-xlb","mpc5200-xlb";
13277 +                       reg = <1f00 100>;
13278 +               };
13279 +
13280 +               serial@2000 {           // PSC1
13281 +                       device_type = "serial";
13282 +                       compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
13283 +                       port-number = <0>;  // Logical port assignment
13284 +                       reg = <2000 100>;
13285 +                       interrupts = <2 1 0>;
13286 +                       interrupt-parent = <&mpc5200_pic>;
13287 +               };
13288 +
13289 +               // PSC2 in spi master mode 
13290 +               spi@2200 {              // PSC2
13291 +                       compatible = "mpc5200b-psc-spi","mpc5200-psc-spi";
13292 +                       cell-index = <1>;
13293 +                       reg = <2200 100>;
13294 +                       interrupts = <2 2 0>;
13295 +                       interrupt-parent = <&mpc5200_pic>;
13296 +               };
13297 +
13298 +               // PSC5 in uart mode
13299 +               serial@2800 {           // PSC5
13300 +                       device_type = "serial";
13301 +                       compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
13302 +                       port-number = <4>;  // Logical port assignment
13303 +                       reg = <2800 100>;
13304 +                       interrupts = <2 c 0>;
13305 +                       interrupt-parent = <&mpc5200_pic>;
13306 +               };
13307 +
13308 +               ethernet@3000 {
13309 +                       device_type = "network";
13310 +                       compatible = "mpc5200b-fec","mpc5200-fec";
13311 +                       reg = <3000 800>;
13312 +                       local-mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by U-Boot */
13313 +                       interrupts = <2 5 0>;
13314 +                       interrupt-parent = <&mpc5200_pic>;
13315 +               };
13316 +
13317 +               ata@3a00 {
13318 +                       compatible = "mpc5200b-ata","mpc5200-ata";
13319 +                       reg = <3a00 100>;
13320 +                       interrupts = <2 7 0>;
13321 +                       interrupt-parent = <&mpc5200_pic>;
13322 +               };
13323 +
13324 +               i2c@3d40 {
13325 +                       compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
13326 +                       reg = <3d40 40>;
13327 +                       interrupts = <2 10 0>;
13328 +                       interrupt-parent = <&mpc5200_pic>;
13329 +                       fsl5200-clocking;
13330 +               };
13331 +
13332 +               sram@8000 {
13333 +                       compatible = "mpc5200b-sram","mpc5200-sram";
13334 +                       reg = <8000 4000>;
13335 +               };
13336 +       };
13337 +
13338 +       lpb {
13339 +               model = "fsl,lpb";
13340 +               compatible = "fsl,lpb";
13341 +               #address-cells = <2>;
13342 +               #size-cells = <1>;
13343 +               ranges = <1 0 50000000 00010000
13344 +                         2 0 50010000 00010000
13345 +                         3 0 50020000 00010000>;
13346 +
13347 +               // 8-bit DualPort SRAM on LocalPlus Bus CS1
13348 +               kollmorgen@1,0 {
13349 +                       compatible = "promess,motionpro-kollmorgen";
13350 +                       reg = <1 0 10000>;
13351 +                       interrupts = <1 1 0>;
13352 +                       interrupt-parent = <&mpc5200_pic>;
13353 +               };
13354 +
13355 +               // 8-bit board CPLD on LocalPlus Bus CS2
13356 +               cpld@2,0 {
13357 +                       compatible = "promess,motionpro-cpld";
13358 +                       reg = <2 0 10000>;
13359 +               };
13360 +
13361 +               // 8-bit custom Anybus Module on LocalPlus Bus CS3
13362 +               anybus@3,0 {
13363 +                       compatible = "promess,motionpro-anybus";
13364 +                       reg = <3 0 10000>;
13365 +               };
13366 +               pro_module_general@3,0 {
13367 +                       compatible = "promess,pro_module_general";
13368 +                       reg = <3 0 3>;
13369 +               };
13370 +               pro_module_dio@3,800 {
13371 +                       compatible = "promess,pro_module_dio";
13372 +                       reg = <3 800 2>;
13373 +               };
13374 +       };
13375 +
13376 +       pci@f0000d00 {
13377 +               #interrupt-cells = <1>;
13378 +               #size-cells = <2>;
13379 +               #address-cells = <3>;
13380 +               device_type = "pci";
13381 +               compatible = "mpc5200b-pci","mpc5200-pci";
13382 +               reg = <f0000d00 100>;
13383 +               interrupt-map-mask = <f800 0 0 7>;
13384 +               interrupt-map = <c000 0 0 1 &mpc5200_pic 0 0 3 // 1st slot
13385 +                                c000 0 0 2 &mpc5200_pic 1 1 3
13386 +                                c000 0 0 3 &mpc5200_pic 1 2 3
13387 +                                c000 0 0 4 &mpc5200_pic 1 3 3
13388 +
13389 +                                c800 0 0 1 &mpc5200_pic 1 1 3 // 2nd slot
13390 +                                c800 0 0 2 &mpc5200_pic 1 2 3
13391 +                                c800 0 0 3 &mpc5200_pic 1 3 3
13392 +                                c800 0 0 4 &mpc5200_pic 0 0 3>;
13393 +               clock-frequency = <0>; // From boot loader
13394 +               interrupts = <2 8 0 2 9 0 2 a 0>;
13395 +               interrupt-parent = <&mpc5200_pic>;
13396 +               bus-range = <0 0>;
13397 +               ranges = <42000000 0 80000000 80000000 0 20000000
13398 +                         02000000 0 a0000000 a0000000 0 10000000
13399 +                         01000000 0 00000000 b0000000 0 01000000>;
13400 +       };
13401 +};
13402 --- a/arch/powerpc/boot/dts/mpc8313erdb.dts
13403 +++ b/arch/powerpc/boot/dts/mpc8313erdb.dts
13404 @@ -15,6 +15,14 @@
13405         #address-cells = <1>;
13406         #size-cells = <1>;
13407  
13408 +       aliases {
13409 +               ethernet0 = &enet0;
13410 +               ethernet1 = &enet1;
13411 +               serial0 = &serial0;
13412 +               serial1 = &serial1;
13413 +               pci0 = &pci0;
13414 +       };
13415 +
13416         cpus {
13417                 #address-cells = <1>;
13418                 #size-cells = <0>;
13419 @@ -37,10 +45,58 @@
13420                 reg = <00000000 08000000>;      // 128MB at 0
13421         };
13422  
13423 +       localbus@e0005000 {
13424 +               #address-cells = <2>;
13425 +               #size-cells = <1>;
13426 +               compatible = "fsl,mpc8313-elbc", "fsl,elbc", "simple-bus";
13427 +               reg = <e0005000 1000>;
13428 +               interrupts = <d#77 8>;
13429 +               interrupt-parent = <&ipic>;
13430 +
13431 +               // CS0 and CS1 are swapped when
13432 +               // booting from nand, but the
13433 +               // addresses are the same.
13434 +               ranges = <0 0 fe000000 00800000
13435 +                         1 0 e2800000 00008000
13436 +                         2 0 f0000000 00020000
13437 +                         3 0 fa000000 00008000>;
13438 +
13439 +               flash@0,0 {
13440 +                       #address-cells = <1>;
13441 +                       #size-cells = <1>;
13442 +                       compatible = "cfi-flash";
13443 +                       reg = <0 0 800000>;
13444 +                       bank-width = <2>;
13445 +                       device-width = <1>;
13446 +               };
13447 +
13448 +               nand@1,0 {
13449 +                       #address-cells = <1>;
13450 +                       #size-cells = <1>;
13451 +                       compatible = "fsl,mpc8313-fcm-nand",
13452 +                                    "fsl,elbc-fcm-nand";
13453 +                       reg = <1 0 2000>;
13454 +
13455 +                       u-boot@0 {
13456 +                               reg = <0 100000>;
13457 +                               read-only;
13458 +                       };
13459 +
13460 +                       kernel@100000 {
13461 +                               reg = <100000 300000>;
13462 +                       };
13463 +
13464 +                       fs@400000 {
13465 +                               reg = <400000 1c00000>;
13466 +                       };
13467 +               };
13468 +       };
13469 +
13470         soc8313@e0000000 {
13471                 #address-cells = <1>;
13472                 #size-cells = <1>;
13473                 device_type = "soc";
13474 +               compatible = "simple-bus";
13475                 ranges = <0 e0000000 00100000>;
13476                 reg = <e0000000 00000200>;
13477                 bus-frequency = <0>;
13478 @@ -52,7 +108,9 @@
13479                 };
13480  
13481                 i2c@3000 {
13482 -                       device_type = "i2c";
13483 +                       #address-cells = <1>;
13484 +                       #size-cells = <0>;
13485 +                       cell-index = <0>;
13486                         compatible = "fsl-i2c";
13487                         reg = <3000 100>;
13488                         interrupts = <e 8>;
13489 @@ -61,7 +119,9 @@
13490                 };
13491  
13492                 i2c@3100 {
13493 -                       device_type = "i2c";
13494 +                       #address-cells = <1>;
13495 +                       #size-cells = <0>;
13496 +                       cell-index = <1>;
13497                         compatible = "fsl-i2c";
13498                         reg = <3100 100>;
13499                         interrupts = <f 8>;
13500 @@ -80,7 +140,6 @@
13501  
13502                 /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
13503                 usb@23000 {
13504 -                       device_type = "usb";
13505                         compatible = "fsl-usb2-dr";
13506                         reg = <23000 1000>;
13507                         #address-cells = <1>;
13508 @@ -91,11 +150,10 @@
13509                 };
13510  
13511                 mdio@24520 {
13512 -                       device_type = "mdio";
13513 -                       compatible = "gianfar";
13514 -                       reg = <24520 20>;
13515                         #address-cells = <1>;
13516                         #size-cells = <0>;
13517 +                       compatible = "fsl,gianfar-mdio";
13518 +                       reg = <24520 20>;
13519                         phy1: ethernet-phy@1 {
13520                                 interrupt-parent = < &ipic >;
13521                                 interrupts = <13 8>;
13522 @@ -110,7 +168,8 @@
13523                         };
13524                 };
13525  
13526 -               ethernet@24000 {
13527 +               enet0: ethernet@24000 {
13528 +                       cell-index = <0>;
13529                         device_type = "network";
13530                         model = "eTSEC";
13531                         compatible = "gianfar";
13532 @@ -121,7 +180,8 @@
13533                         phy-handle = < &phy1 >;
13534                 };
13535  
13536 -               ethernet@25000 {
13537 +               enet1: ethernet@25000 {
13538 +                       cell-index = <1>;
13539                         device_type = "network";
13540                         model = "eTSEC";
13541                         compatible = "gianfar";
13542 @@ -132,7 +192,8 @@
13543                         phy-handle = < &phy4 >;
13544                 };
13545  
13546 -               serial@4500 {
13547 +               serial0: serial@4500 {
13548 +                       cell-index = <0>;
13549                         device_type = "serial";
13550                         compatible = "ns16550";
13551                         reg = <4500 100>;
13552 @@ -141,7 +202,8 @@
13553                         interrupt-parent = < &ipic >;
13554                 };
13555  
13556 -               serial@4600 {
13557 +               serial1: serial@4600 {
13558 +                       cell-index = <1>;
13559                         device_type = "serial";
13560                         compatible = "ns16550";
13561                         reg = <4600 100>;
13562 @@ -179,7 +241,8 @@
13563                 };
13564         };
13565  
13566 -       pci@e0008500 {
13567 +       pci0: pci@e0008500 {
13568 +               cell-index = <1>;
13569                 interrupt-map-mask = <f800 0 0 7>;
13570                 interrupt-map = <
13571  
13572 --- a/arch/powerpc/boot/dts/mpc832x_mds.dts
13573 +++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
13574 @@ -7,6 +7,18 @@
13575   * under  the terms of  the GNU General  Public License as published by the
13576   * Free Software Foundation;  either version 2 of the  License, or (at your
13577   * option) any later version.
13578 +
13579 + * To enable external serial I/O on a Freescale MPC 8323 SYS/MDS board, do
13580 + * this:
13581 + *
13582 + * 1) On chip U61, lift (disconnect) pins 21 (TXD) and 22 (RXD) from the board.
13583 + * 2) Solder a wire from U61-21 to P19A-23.  P19 is a grid of pins on the board
13584 + *    next to the serial ports.
13585 + * 3) Solder a wire from U61-22 to P19K-22.
13586 + *
13587 + * Note that there's a typo in the schematic.  The board labels the last column
13588 + * of pins "P19K", but in the schematic, that column is called "P19J".  So if
13589 + * you're going by the schematic, the pin is called "P19J-K22".
13590   */
13591  
13592  / {
13593 @@ -15,6 +27,14 @@
13594         #address-cells = <1>;
13595         #size-cells = <1>;
13596  
13597 +       aliases {
13598 +               ethernet0 = &enet0;
13599 +               ethernet1 = &enet1;
13600 +               serial0 = &serial0;
13601 +               serial1 = &serial1;
13602 +               pci0 = &pci0;
13603 +       };
13604 +
13605         cpus {
13606                 #address-cells = <1>;
13607                 #size-cells = <0>;
13608 @@ -59,7 +79,7 @@
13609                 i2c@3000 {
13610                         #address-cells = <1>;
13611                         #size-cells = <0>;
13612 -                       device_type = "i2c";
13613 +                       cell-index = <0>;
13614                         compatible = "fsl-i2c";
13615                         reg = <3000 100>;
13616                         interrupts = <e 8>;
13617 @@ -72,7 +92,8 @@
13618                         };
13619                 };
13620  
13621 -               serial@4500 {
13622 +               serial0: serial@4500 {
13623 +                       cell-index = <0>;
13624                         device_type = "serial";
13625                         compatible = "ns16550";
13626                         reg = <4500 100>;
13627 @@ -81,7 +102,8 @@
13628                         interrupt-parent = < &ipic >;
13629                 };
13630  
13631 -               serial@4600 {
13632 +               serial1: serial@4600 {
13633 +                       cell-index = <1>;
13634                         device_type = "serial";
13635                         compatible = "ns16550";
13636                         reg = <4600 100>;
13637 @@ -159,6 +181,23 @@
13638                                         1 1e  1  0  1  0        /* TX_EN */
13639                                         1 1f  2  0  1  0>;/* CRS */
13640                         };
13641 +                       pio5: ucc_pin@05 {
13642 +                               pio-map = <
13643 +                               /*
13644 +                                *                    open       has
13645 +                                *   port  pin  dir  drain  sel  irq
13646 +                                */
13647 +                                       2    0    1      0    2    0  /* TxD5 */
13648 +                                       2    8    2      0    2    0  /* RxD5 */
13649 +
13650 +                                       2   1d    2      0    0    0  /* CTS5 */
13651 +                                       2   1f    1      0    2    0  /* RTS5 */
13652 +
13653 +                                       2   18    2      0    0    0  /* CD */
13654 +
13655 +                               >;
13656 +                       };
13657 +
13658                 };
13659         };
13660  
13661 @@ -166,6 +205,7 @@
13662                 #address-cells = <1>;
13663                 #size-cells = <1>;
13664                 device_type = "qe";
13665 +               compatible = "fsl,qe";
13666                 model = "QE";
13667                 ranges = <0 e0100000 00100000>;
13668                 reg = <e0100000 480>;
13669 @@ -200,7 +240,6 @@
13670                 };
13671  
13672                 usb@6c0 {
13673 -                       device_type = "usb";
13674                         compatible = "qe_udc";
13675                         reg = <6c0 40 8B00 100>;
13676                         interrupts = <b>;
13677 @@ -208,48 +247,58 @@
13678                         mode = "slave";
13679                 };
13680  
13681 -               ucc@2200 {
13682 +               enet0: ucc@2200 {
13683                         device_type = "network";
13684                         compatible = "ucc_geth";
13685                         model = "UCC";
13686 +                       cell-index = <3>;
13687                         device-id = <3>;
13688                         reg = <2200 200>;
13689                         interrupts = <22>;
13690                         interrupt-parent = < &qeic >;
13691 -                       /*
13692 -                        * mac-address is deprecated and will be removed
13693 -                        * in 2.6.25.  Only recent versions of
13694 -                        * U-Boot support local-mac-address, however.
13695 -                        */
13696 -                       mac-address = [ 00 00 00 00 00 00 ];
13697                         local-mac-address = [ 00 00 00 00 00 00 ];
13698 -                       rx-clock = <19>;
13699 -                       tx-clock = <1a>;
13700 +                       rx-clock-name = "clk9";
13701 +                       tx-clock-name = "clk10";
13702                         phy-handle = < &phy3 >;
13703                         pio-handle = < &pio3 >;
13704                 };
13705  
13706 -               ucc@3200 {
13707 +               enet1: ucc@3200 {
13708                         device_type = "network";
13709                         compatible = "ucc_geth";
13710                         model = "UCC";
13711 +                       cell-index = <4>;
13712                         device-id = <4>;
13713                         reg = <3200 200>;
13714                         interrupts = <23>;
13715                         interrupt-parent = < &qeic >;
13716 -                       /*
13717 -                        * mac-address is deprecated and will be removed
13718 -                        * in 2.6.25.  Only recent versions of
13719 -                        * U-Boot support local-mac-address, however.
13720 -                        */
13721 -                       mac-address = [ 00 00 00 00 00 00 ];
13722                         local-mac-address = [ 00 00 00 00 00 00 ];
13723 -                       rx-clock = <17>;
13724 -                       tx-clock = <18>;
13725 +                       rx-clock-name = "clk7";
13726 +                       tx-clock-name = "clk8";
13727                         phy-handle = < &phy4 >;
13728                         pio-handle = < &pio4 >;
13729                 };
13730  
13731 +               ucc@2400 {
13732 +                       device_type = "serial";
13733 +                       compatible = "ucc_uart";
13734 +                       model = "UCC";
13735 +                       device-id = <5>;        /* The UCC number, 1-7*/
13736 +                       port-number = <0>;      /* Which ttyQEx device */
13737 +                       soft-uart;              /* We need Soft-UART */
13738 +                       reg = <2400 200>;
13739 +                       interrupts = <28>;      /* From Table 18-12 */
13740 +                       interrupt-parent = < &qeic >;
13741 +                       /*
13742 +                        * For Soft-UART, we need to set TX to 1X, which
13743 +                        * means specifying separate clock sources.
13744 +                        */
13745 +                       rx-clock-name = "brg5";
13746 +                       tx-clock-name = "brg6";
13747 +                       pio-handle = < &pio5 >;
13748 +               };
13749 +
13750 +
13751                 mdio@2320 {
13752                         #address-cells = <1>;
13753                         #size-cells = <0>;
13754 @@ -283,7 +332,8 @@
13755                 };
13756         };
13757  
13758 -       pci@e0008500 {
13759 +       pci0: pci@e0008500 {
13760 +               cell-index = <1>;
13761                 interrupt-map-mask = <f800 0 0 7>;
13762                 interrupt-map = <
13763                                 /* IDSEL 0x11 AD17 */
13764 --- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
13765 +++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
13766 @@ -15,6 +15,14 @@
13767         #address-cells = <1>;
13768         #size-cells = <1>;
13769  
13770 +       aliases {
13771 +               ethernet0 = &enet0;
13772 +               ethernet1 = &enet1;
13773 +               serial0 = &serial0;
13774 +               serial1 = &serial1;
13775 +               pci0 = &pci0;
13776 +       };
13777 +
13778         cpus {
13779                 #address-cells = <1>;
13780                 #size-cells = <0>;
13781 @@ -52,7 +60,9 @@
13782                 };
13783  
13784                 i2c@3000 {
13785 -                       device_type = "i2c";
13786 +                       #address-cells = <1>;
13787 +                       #size-cells = <0>;
13788 +                       cell-index = <0>;
13789                         compatible = "fsl-i2c";
13790                         reg = <3000 100>;
13791                         interrupts = <e 8>;
13792 @@ -60,7 +70,8 @@
13793                         dfsrr;
13794                 };
13795  
13796 -               serial@4500 {
13797 +               serial0: serial@4500 {
13798 +                       cell-index = <0>;
13799                         device_type = "serial";
13800                         compatible = "ns16550";
13801                         reg = <4500 100>;
13802 @@ -69,7 +80,8 @@
13803                         interrupt-parent = <&pic>;
13804                 };
13805  
13806 -               serial@4600 {
13807 +               serial1: serial@4600 {
13808 +                       cell-index = <1>;
13809                         device_type = "serial";
13810                         compatible = "ns16550";
13811                         reg = <4600 100>;
13812 @@ -187,44 +199,34 @@
13813                         mode = "cpu";
13814                 };
13815  
13816 -               ucc@3000 {
13817 +               enet0: ucc@3000 {
13818                         device_type = "network";
13819                         compatible = "ucc_geth";
13820                         model = "UCC";
13821 +                       cell-index = <2>;
13822                         device-id = <2>;
13823                         reg = <3000 200>;
13824                         interrupts = <21>;
13825                         interrupt-parent = <&qeic>;
13826 -                       /*
13827 -                        * mac-address is deprecated and will be removed
13828 -                        * in 2.6.25.  Only recent versions of
13829 -                        * U-Boot support local-mac-address, however.
13830 -                        */
13831 -                       mac-address = [ 00 00 00 00 00 00 ];
13832                         local-mac-address = [ 00 00 00 00 00 00 ];
13833 -                       rx-clock = <20>;
13834 -                       tx-clock = <13>;
13835 +                       rx-clock-name = "clk16";
13836 +                       tx-clock-name = "clk3";
13837                         phy-handle = <&phy00>;
13838                         pio-handle = <&ucc2pio>;
13839                 };
13840  
13841 -               ucc@2200 {
13842 +               enet1: ucc@2200 {
13843                         device_type = "network";
13844                         compatible = "ucc_geth";
13845                         model = "UCC";
13846 +                       cell-index = <3>;
13847                         device-id = <3>;
13848                         reg = <2200 200>;
13849                         interrupts = <22>;
13850                         interrupt-parent = <&qeic>;
13851 -                       /*
13852 -                        * mac-address is deprecated and will be removed
13853 -                        * in 2.6.25.  Only recent versions of
13854 -                        * U-Boot support local-mac-address, however.
13855 -                        */
13856 -                       mac-address = [ 00 00 00 00 00 00 ];
13857                         local-mac-address = [ 00 00 00 00 00 00 ];
13858 -                       rx-clock = <19>;
13859 -                       tx-clock = <1a>;
13860 +                       rx-clock-name = "clk9";
13861 +                       tx-clock-name = "clk10";
13862                         phy-handle = <&phy04>;
13863                         pio-handle = <&ucc3pio>;
13864                 };
13865 @@ -262,7 +264,8 @@
13866                 };
13867         };
13868  
13869 -       pci@e0008500 {
13870 +       pci0: pci@e0008500 {
13871 +               cell-index = <1>;
13872                 interrupt-map-mask = <f800 0 0 7>;
13873                 interrupt-map = <
13874                                 /* IDSEL 0x10 AD16 (USB) */
13875 --- a/arch/powerpc/boot/dts/mpc8349emitx.dts
13876 +++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
13877 @@ -14,6 +14,15 @@
13878         #address-cells = <1>;
13879         #size-cells = <1>;
13880  
13881 +       aliases {
13882 +               ethernet0 = &enet0;
13883 +               ethernet1 = &enet1;
13884 +               serial0 = &serial0;
13885 +               serial1 = &serial1;
13886 +               pci0 = &pci0;
13887 +               pci1 = &pci1;
13888 +       };
13889 +
13890         cpus {
13891                 #address-cells = <1>;
13892                 #size-cells = <0>;
13893 @@ -51,7 +60,9 @@
13894                 };
13895  
13896                 i2c@3000 {
13897 -                       device_type = "i2c";
13898 +                       #address-cells = <1>;
13899 +                       #size-cells = <0>;
13900 +                       cell-index = <0>;
13901                         compatible = "fsl-i2c";
13902                         reg = <3000 100>;
13903                         interrupts = <e 8>;
13904 @@ -60,7 +71,9 @@
13905                 };
13906  
13907                 i2c@3100 {
13908 -                       device_type = "i2c";
13909 +                       #address-cells = <1>;
13910 +                       #size-cells = <0>;
13911 +                       cell-index = <1>;
13912                         compatible = "fsl-i2c";
13913                         reg = <3100 100>;
13914                         interrupts = <f 8>;
13915 @@ -78,7 +91,6 @@
13916                 };
13917  
13918                 usb@22000 {
13919 -                       device_type = "usb";
13920                         compatible = "fsl-usb2-mph";
13921                         reg = <22000 1000>;
13922                         #address-cells = <1>;
13923 @@ -90,7 +102,6 @@
13924                 };
13925  
13926                 usb@23000 {
13927 -                       device_type = "usb";
13928                         compatible = "fsl-usb2-dr";
13929                         reg = <23000 1000>;
13930                         #address-cells = <1>;
13931 @@ -102,11 +113,10 @@
13932                 };
13933  
13934                 mdio@24520 {
13935 -                       device_type = "mdio";
13936 -                       compatible = "gianfar";
13937 -                       reg = <24520 20>;
13938                         #address-cells = <1>;
13939                         #size-cells = <0>;
13940 +                       compatible = "fsl,gianfar-mdio";
13941 +                       reg = <24520 20>;
13942  
13943                         /* Vitesse 8201 */
13944                         phy1c: ethernet-phy@1c {
13945 @@ -115,27 +125,14 @@
13946                                 reg = <1c>;
13947                                 device_type = "ethernet-phy";
13948                         };
13949 -
13950 -                       /* Vitesse 7385 */
13951 -                       phy1f: ethernet-phy@1f {
13952 -                               interrupt-parent = < &ipic >;
13953 -                               interrupts = <12 8>;
13954 -                               reg = <1f>;
13955 -                               device_type = "ethernet-phy";
13956 -                       };
13957                 };
13958  
13959 -               ethernet@24000 {
13960 +               enet0: ethernet@24000 {
13961 +                       cell-index = <0>;
13962                         device_type = "network";
13963                         model = "TSEC";
13964                         compatible = "gianfar";
13965                         reg = <24000 1000>;
13966 -                       /*
13967 -                        * address is deprecated and will be removed
13968 -                        * in 2.6.25.  Only recent versions of
13969 -                        * U-Boot support local-mac-address, however.
13970 -                        */
13971 -                       address = [ 00 00 00 00 00 00 ];
13972                         local-mac-address = [ 00 00 00 00 00 00 ];
13973                         interrupts = <20 8 21 8 22 8>;
13974                         interrupt-parent = < &ipic >;
13975 @@ -143,27 +140,22 @@
13976                         linux,network-index = <0>;
13977                 };
13978  
13979 -               ethernet@25000 {
13980 -                       #address-cells = <1>;
13981 -                       #size-cells = <0>;
13982 +               enet1: ethernet@25000 {
13983 +                       cell-index = <1>;
13984                         device_type = "network";
13985                         model = "TSEC";
13986                         compatible = "gianfar";
13987                         reg = <25000 1000>;
13988 -                       /*
13989 -                        * address is deprecated and will be removed
13990 -                        * in 2.6.25.  Only recent versions of
13991 -                        * U-Boot support local-mac-address, however.
13992 -                        */
13993 -                       address = [ 00 00 00 00 00 00 ];
13994                         local-mac-address = [ 00 00 00 00 00 00 ];
13995                         interrupts = <23 8 24 8 25 8>;
13996                         interrupt-parent = < &ipic >;
13997 -                       phy-handle = < &phy1f >;
13998 +                       /* Vitesse 7385 isn't on the MDIO bus */
13999 +                       fixed-link = <1 1 d#1000 0 0>;
14000                         linux,network-index = <1>;
14001                 };
14002  
14003 -               serial@4500 {
14004 +               serial0: serial@4500 {
14005 +                       cell-index = <0>;
14006                         device_type = "serial";
14007                         compatible = "ns16550";
14008                         reg = <4500 100>;
14009 @@ -172,7 +164,8 @@
14010                         interrupt-parent = < &ipic >;
14011                 };
14012  
14013 -               serial@4600 {
14014 +               serial1: serial@4600 {
14015 +                       cell-index = <1>;
14016                         device_type = "serial";
14017                         compatible = "ns16550";
14018                         reg = <4600 100>;
14019 @@ -203,7 +196,8 @@
14020                 };
14021         };
14022  
14023 -       pci@e0008500 {
14024 +       pci0: pci@e0008500 {
14025 +               cell-index = <1>;
14026                 interrupt-map-mask = <f800 0 0 7>;
14027                 interrupt-map = <
14028                                 /* IDSEL 0x10 - SATA */
14029 @@ -224,7 +218,8 @@
14030                 device_type = "pci";
14031         };
14032  
14033 -       pci@e0008600 {
14034 +       pci1: pci@e0008600 {
14035 +               cell-index = <2>;
14036                 interrupt-map-mask = <f800 0 0 7>;
14037                 interrupt-map = <
14038                                 /* IDSEL 0x0E - MiniPCI Slot */
14039 @@ -249,6 +244,21 @@
14040                 device_type = "pci";
14041         };
14042  
14043 -
14044 -
14045 +       localbus@e0005000 {
14046 +               #address-cells = <2>;
14047 +               #size-cells = <1>;
14048 +               compatible = "fsl,mpc8349e-localbus",
14049 +                            "fsl,pq2pro-localbus";
14050 +               reg = <e0005000 d8>;
14051 +               ranges = <3 0 f0000000 210>;
14052 +
14053 +               pata@3,0 {
14054 +                       compatible = "fsl,mpc8349emitx-pata", "ata-generic";
14055 +                       reg = <3 0 10 3 20c 4>;
14056 +                       reg-shift = <1>;
14057 +                       pio-mode = <6>;
14058 +                       interrupts = <17 8>;
14059 +                       interrupt-parent = <&ipic>;
14060 +               };
14061 +       };
14062  };
14063 --- a/arch/powerpc/boot/dts/mpc8349emitxgp.dts
14064 +++ b/arch/powerpc/boot/dts/mpc8349emitxgp.dts
14065 @@ -14,6 +14,13 @@
14066         #address-cells = <1>;
14067         #size-cells = <1>;
14068  
14069 +       aliases {
14070 +               ethernet0 = &enet0;
14071 +               serial0 = &serial0;
14072 +               serial1 = &serial1;
14073 +               pci0 = &pci0;
14074 +       };
14075 +
14076         cpus {
14077                 #address-cells = <1>;
14078                 #size-cells = <0>;
14079 @@ -51,7 +58,9 @@
14080                 };
14081  
14082                 i2c@3000 {
14083 -                       device_type = "i2c";
14084 +                       #address-cells = <1>;
14085 +                       #size-cells = <0>;
14086 +                       cell-index = <0>;
14087                         compatible = "fsl-i2c";
14088                         reg = <3000 100>;
14089                         interrupts = <e 8>;
14090 @@ -60,7 +69,9 @@
14091                 };
14092  
14093                 i2c@3100 {
14094 -                       device_type = "i2c";
14095 +                       #address-cells = <1>;
14096 +                       #size-cells = <0>;
14097 +                       cell-index = <1>;
14098                         compatible = "fsl-i2c";
14099                         reg = <3100 100>;
14100                         interrupts = <f 8>;
14101 @@ -78,7 +89,6 @@
14102                 };
14103  
14104                 usb@23000 {
14105 -                       device_type = "usb";
14106                         compatible = "fsl-usb2-dr";
14107                         reg = <23000 1000>;
14108                         #address-cells = <1>;
14109 @@ -90,11 +100,10 @@
14110                 };
14111  
14112                 mdio@24520 {
14113 -                       device_type = "mdio";
14114 -                       compatible = "gianfar";
14115 -                       reg = <24520 20>;
14116                         #address-cells = <1>;
14117                         #size-cells = <0>;
14118 +                       compatible = "fsl,gianfar-mdio";
14119 +                       reg = <24520 20>;
14120  
14121                         /* Vitesse 8201 */
14122                         phy1c: ethernet-phy@1c {
14123 @@ -105,7 +114,8 @@
14124                         };
14125                 };
14126  
14127 -               ethernet@24000 {
14128 +               enet0: ethernet@24000 {
14129 +                       cell-index = <0>;
14130                         device_type = "network";
14131                         model = "TSEC";
14132                         compatible = "gianfar";
14133 @@ -117,7 +127,8 @@
14134                         linux,network-index = <0>;
14135                 };
14136  
14137 -               serial@4500 {
14138 +               serial0: serial@4500 {
14139 +                       cell-index = <0>;
14140                         device_type = "serial";
14141                         compatible = "ns16550";
14142                         reg = <4500 100>;
14143 @@ -126,7 +137,8 @@
14144                         interrupt-parent = < &ipic >;
14145                 };
14146  
14147 -               serial@4600 {
14148 +               serial1: serial@4600 {
14149 +                       cell-index = <1>;
14150                         device_type = "serial";
14151                         compatible = "ns16550";
14152                         reg = <4600 100>;
14153 @@ -157,7 +169,8 @@
14154                 };
14155         };
14156  
14157 -       pci@e0008600 {
14158 +       pci0: pci@e0008600 {
14159 +               cell-index = <2>;
14160                 interrupt-map-mask = <f800 0 0 7>;
14161                 interrupt-map = <
14162                                 /* IDSEL 0x0F - PCI Slot */
14163 --- a/arch/powerpc/boot/dts/mpc834x_mds.dts
14164 +++ b/arch/powerpc/boot/dts/mpc834x_mds.dts
14165 @@ -15,6 +15,15 @@
14166         #address-cells = <1>;
14167         #size-cells = <1>;
14168  
14169 +       aliases {
14170 +               ethernet0 = &enet0;
14171 +               ethernet1 = &enet1;
14172 +               serial0 = &serial0;
14173 +               serial1 = &serial1;
14174 +               pci0 = &pci0;
14175 +               pci1 = &pci1;
14176 +       };
14177 +
14178         cpus {
14179                 #address-cells = <1>;
14180                 #size-cells = <0>;
14181 @@ -59,7 +68,7 @@
14182                 i2c@3000 {
14183                         #address-cells = <1>;
14184                         #size-cells = <0>;
14185 -                       device_type = "i2c";
14186 +                       cell-index = <0>;
14187                         compatible = "fsl-i2c";
14188                         reg = <3000 100>;
14189                         interrupts = <e 8>;
14190 @@ -75,7 +84,7 @@
14191                 i2c@3100 {
14192                         #address-cells = <1>;
14193                         #size-cells = <0>;
14194 -                       device_type = "i2c";
14195 +                       cell-index = <1>;
14196                         compatible = "fsl-i2c";
14197                         reg = <3100 100>;
14198                         interrupts = <f 8>;
14199 @@ -95,7 +104,6 @@
14200                 /* phy type (ULPI or SERIAL) are only types supportted for MPH */
14201                 /* port = 0 or 1 */
14202                 usb@22000 {
14203 -                       device_type = "usb";
14204                         compatible = "fsl-usb2-mph";
14205                         reg = <22000 1000>;
14206                         #address-cells = <1>;
14207 @@ -107,7 +115,6 @@
14208                 };
14209                 /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
14210                 usb@23000 {
14211 -                       device_type = "usb";
14212                         compatible = "fsl-usb2-dr";
14213                         reg = <23000 1000>;
14214                         #address-cells = <1>;
14215 @@ -119,11 +126,11 @@
14216                 };
14217  
14218                 mdio@24520 {
14219 -                       device_type = "mdio";
14220 -                       compatible = "gianfar";
14221 -                       reg = <24520 20>;
14222                         #address-cells = <1>;
14223                         #size-cells = <0>;
14224 +                       compatible = "fsl,gianfar-mdio";
14225 +                       reg = <24520 20>;
14226 +
14227                         phy0: ethernet-phy@0 {
14228                                 interrupt-parent = < &ipic >;
14229                                 interrupts = <11 8>;
14230 @@ -138,17 +145,12 @@
14231                         };
14232                 };
14233  
14234 -               ethernet@24000 {
14235 +               enet0: ethernet@24000 {
14236 +                       cell-index = <0>;
14237                         device_type = "network";
14238                         model = "TSEC";
14239                         compatible = "gianfar";
14240                         reg = <24000 1000>;
14241 -                       /*
14242 -                        * address is deprecated and will be removed
14243 -                        * in 2.6.25.  Only recent versions of
14244 -                        * U-Boot support local-mac-address, however.
14245 -                        */
14246 -                       address = [ 00 00 00 00 00 00 ];
14247                         local-mac-address = [ 00 00 00 00 00 00 ];
14248                         interrupts = <20 8 21 8 22 8>;
14249                         interrupt-parent = < &ipic >;
14250 @@ -156,19 +158,12 @@
14251                         linux,network-index = <0>;
14252                 };
14253  
14254 -               ethernet@25000 {
14255 -                       #address-cells = <1>;
14256 -                       #size-cells = <0>;
14257 +               enet1: ethernet@25000 {
14258 +                       cell-index = <1>;
14259                         device_type = "network";
14260                         model = "TSEC";
14261                         compatible = "gianfar";
14262                         reg = <25000 1000>;
14263 -                       /*
14264 -                        * address is deprecated and will be removed
14265 -                        * in 2.6.25.  Only recent versions of
14266 -                        * U-Boot support local-mac-address, however.
14267 -                        */
14268 -                       address = [ 00 00 00 00 00 00 ];
14269                         local-mac-address = [ 00 00 00 00 00 00 ];
14270                         interrupts = <23 8 24 8 25 8>;
14271                         interrupt-parent = < &ipic >;
14272 @@ -176,7 +171,8 @@
14273                         linux,network-index = <1>;
14274                 };
14275  
14276 -               serial@4500 {
14277 +               serial0: serial@4500 {
14278 +                       cell-index = <0>;
14279                         device_type = "serial";
14280                         compatible = "ns16550";
14281                         reg = <4500 100>;
14282 @@ -185,7 +181,8 @@
14283                         interrupt-parent = < &ipic >;
14284                 };
14285  
14286 -               serial@4600 {
14287 +               serial1: serial@4600 {
14288 +                       cell-index = <1>;
14289                         device_type = "serial";
14290                         compatible = "ns16550";
14291                         reg = <4600 100>;
14292 @@ -225,7 +222,8 @@
14293                 };
14294         };
14295  
14296 -       pci@e0008500 {
14297 +       pci0: pci@e0008500 {
14298 +               cell-index = <1>;
14299                 interrupt-map-mask = <f800 0 0 7>;
14300                 interrupt-map = <
14301  
14302 @@ -285,7 +283,8 @@
14303                 device_type = "pci";
14304         };
14305  
14306 -       pci@e0008600 {
14307 +       pci1: pci@e0008600 {
14308 +               cell-index = <2>;
14309                 interrupt-map-mask = <f800 0 0 7>;
14310                 interrupt-map = <
14311  
14312 --- a/arch/powerpc/boot/dts/mpc836x_mds.dts
14313 +++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
14314 @@ -20,6 +20,14 @@
14315         #address-cells = <1>;
14316         #size-cells = <1>;
14317  
14318 +       aliases {
14319 +               ethernet0 = &enet0;
14320 +               ethernet1 = &enet1;
14321 +               serial0 = &serial0;
14322 +               serial1 = &serial1;
14323 +               pci0 = &pci0;
14324 +       };
14325 +
14326         cpus {
14327                 #address-cells = <1>;
14328                 #size-cells = <0>;
14329 @@ -64,7 +72,7 @@
14330                 i2c@3000 {
14331                         #address-cells = <1>;
14332                         #size-cells = <0>;
14333 -                       device_type = "i2c";
14334 +                       cell-index = <0>;
14335                         compatible = "fsl-i2c";
14336                         reg = <3000 100>;
14337                         interrupts = <e 8>;
14338 @@ -80,7 +88,7 @@
14339                 i2c@3100 {
14340                         #address-cells = <1>;
14341                         #size-cells = <0>;
14342 -                       device_type = "i2c";
14343 +                       cell-index = <1>;
14344                         compatible = "fsl-i2c";
14345                         reg = <3100 100>;
14346                         interrupts = <f 8>;
14347 @@ -88,7 +96,8 @@
14348                         dfsrr;
14349                 };
14350  
14351 -               serial@4500 {
14352 +               serial0: serial@4500 {
14353 +                       cell-index = <0>;
14354                         device_type = "serial";
14355                         compatible = "ns16550";
14356                         reg = <4500 100>;
14357 @@ -97,7 +106,8 @@
14358                         interrupt-parent = < &ipic >;
14359                 };
14360  
14361 -               serial@4600 {
14362 +               serial1: serial@4600 {
14363 +                       cell-index = <1>;
14364                         device_type = "serial";
14365                         compatible = "ns16550";
14366                         reg = <4600 100>;
14367 @@ -231,7 +241,6 @@
14368                 };
14369  
14370                 usb@6c0 {
14371 -                       device_type = "usb";
14372                         compatible = "qe_udc";
14373                         reg = <6c0 40 8B00 100>;
14374                         interrupts = <b>;
14375 @@ -239,45 +248,35 @@
14376                         mode = "slave";
14377                 };
14378  
14379 -               ucc@2000 {
14380 +               enet0: ucc@2000 {
14381                         device_type = "network";
14382                         compatible = "ucc_geth";
14383                         model = "UCC";
14384 +                       cell-index = <1>;
14385                         device-id = <1>;
14386                         reg = <2000 200>;
14387                         interrupts = <20>;
14388                         interrupt-parent = < &qeic >;
14389 -                       /*
14390 -                        * mac-address is deprecated and will be removed
14391 -                        * in 2.6.25.  Only recent versions of
14392 -                        * U-Boot support local-mac-address, however.
14393 -                        */
14394 -                       mac-address = [ 00 00 00 00 00 00 ];
14395                         local-mac-address = [ 00 00 00 00 00 00 ];
14396 -                       rx-clock = <0>;
14397 -                       tx-clock = <19>;
14398 +                       rx-clock-name = "none";
14399 +                       tx-clock-name = "clk9";
14400                         phy-handle = < &phy0 >;
14401                         phy-connection-type = "rgmii-id";
14402                         pio-handle = < &pio1 >;
14403                 };
14404  
14405 -               ucc@3000 {
14406 +               enet1: ucc@3000 {
14407                         device_type = "network";
14408                         compatible = "ucc_geth";
14409                         model = "UCC";
14410 +                       cell-index = <2>;
14411                         device-id = <2>;
14412                         reg = <3000 200>;
14413                         interrupts = <21>;
14414                         interrupt-parent = < &qeic >;
14415 -                       /*
14416 -                        * mac-address is deprecated and will be removed
14417 -                        * in 2.6.25.  Only recent versions of
14418 -                        * U-Boot support local-mac-address, however.
14419 -                        */
14420 -                       mac-address = [ 00 00 00 00 00 00 ];
14421                         local-mac-address = [ 00 00 00 00 00 00 ];
14422 -                       rx-clock = <0>;
14423 -                       tx-clock = <14>;
14424 +                       rx-clock-name = "none";
14425 +                       tx-clock-name = "clk4";
14426                         phy-handle = < &phy1 >;
14427                         phy-connection-type = "rgmii-id";
14428                         pio-handle = < &pio2 >;
14429 @@ -316,7 +315,8 @@
14430                 };
14431         };
14432  
14433 -       pci@e0008500 {
14434 +       pci0: pci@e0008500 {
14435 +               cell-index = <1>;
14436                 interrupt-map-mask = <f800 0 0 7>;
14437                 interrupt-map = <
14438  
14439 --- /dev/null
14440 +++ b/arch/powerpc/boot/dts/mpc8377_mds.dts
14441 @@ -0,0 +1,279 @@
14442 +/*
14443 + * MPC8377E MDS Device Tree Source
14444 + *
14445 + * Copyright 2007 Freescale Semiconductor Inc.
14446 + *
14447 + * This program is free software; you can redistribute  it and/or modify it
14448 + * under  the terms of  the GNU General  Public License as published by the
14449 + * Free Software Foundation;  either version 2 of the  License, or (at your
14450 + * option) any later version.
14451 + */
14452 +
14453 +/dts-v1/;
14454 +
14455 +/ {
14456 +       model = "fsl,mpc8377emds";
14457 +       compatible = "fsl,mpc8377emds","fsl,mpc837xmds";
14458 +       #address-cells = <1>;
14459 +       #size-cells = <1>;
14460 +
14461 +       aliases {
14462 +               ethernet0 = &enet0;
14463 +               ethernet1 = &enet1;
14464 +               serial0 = &serial0;
14465 +               serial1 = &serial1;
14466 +               pci0 = &pci0;
14467 +       };
14468 +
14469 +       cpus {
14470 +               #address-cells = <1>;
14471 +               #size-cells = <0>;
14472 +
14473 +               PowerPC,8377@0 {
14474 +                       device_type = "cpu";
14475 +                       reg = <0>;
14476 +                       d-cache-line-size = <0x20>;
14477 +                       i-cache-line-size = <0x20>;
14478 +                       d-cache-size = <0x8000>;                // L1, 32K
14479 +                       i-cache-size = <0x8000>;                // L1, 32K
14480 +                       timebase-frequency = <0>;
14481 +                       bus-frequency = <0>;
14482 +                       clock-frequency = <0>;
14483 +               };
14484 +       };
14485 +
14486 +       memory {
14487 +               device_type = "memory";
14488 +               reg = <0x00000000 0x20000000>;  // 512MB at 0
14489 +       };
14490 +
14491 +       soc@e0000000 {
14492 +               #address-cells = <1>;
14493 +               #size-cells = <1>;
14494 +               device_type = "soc";
14495 +               ranges = <0x0 0xe0000000 0x00100000>;
14496 +               reg = <0xe0000000 0x00000200>;
14497 +               bus-frequency = <0>;
14498 +
14499 +               wdt@200 {
14500 +                       compatible = "mpc83xx_wdt";
14501 +                       reg = <0x200 0x100>;
14502 +               };
14503 +
14504 +               i2c@3000 {
14505 +                       #address-cells = <1>;
14506 +                       #size-cells = <0>;
14507 +                       cell-index = <0>;
14508 +                       compatible = "fsl-i2c";
14509 +                       reg = <0x3000 0x100>;
14510 +                       interrupts = <0xe 0x8>;
14511 +                       interrupt-parent = < &ipic >;
14512 +                       dfsrr;
14513 +               };
14514 +
14515 +               i2c@3100 {
14516 +                       #address-cells = <1>;
14517 +                       #size-cells = <0>;
14518 +                       cell-index = <1>;
14519 +                       compatible = "fsl-i2c";
14520 +                       reg = <0x3100 0x100>;
14521 +                       interrupts = <0xf 0x8>;
14522 +                       interrupt-parent = < &ipic >;
14523 +                       dfsrr;
14524 +               };
14525 +
14526 +               spi@7000 {
14527 +                       compatible = "fsl_spi";
14528 +                       reg = <0x7000 0x1000>;
14529 +                       interrupts = <0x10 0x8>;
14530 +                       interrupt-parent = < &ipic >;
14531 +                       mode = "cpu";
14532 +               };
14533 +
14534 +               /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
14535 +               usb@23000 {
14536 +                       compatible = "fsl-usb2-dr";
14537 +                       reg = <0x23000 0x1000>;
14538 +                       #address-cells = <1>;
14539 +                       #size-cells = <0>;
14540 +                       interrupt-parent = < &ipic >;
14541 +                       interrupts = <0x26 0x8>;
14542 +                       phy_type = "utmi_wide";
14543 +               };
14544 +
14545 +               mdio@24520 {
14546 +                       #address-cells = <1>;
14547 +                       #size-cells = <0>;
14548 +                       compatible = "fsl,gianfar-mdio";
14549 +                       reg = <0x24520 0x20>;
14550 +                       phy2: ethernet-phy@2 {
14551 +                               interrupt-parent = < &ipic >;
14552 +                               interrupts = <0x11 0x8>;
14553 +                               reg = <2>;
14554 +                               device_type = "ethernet-phy";
14555 +                       };
14556 +                       phy3: ethernet-phy@3 {
14557 +                               interrupt-parent = < &ipic >;
14558 +                               interrupts = <0x12 0x8>;
14559 +                               reg = <3>;
14560 +                               device_type = "ethernet-phy";
14561 +                       };
14562 +               };
14563 +
14564 +               enet0: ethernet@24000 {
14565 +                       cell-index = <0>;
14566 +                       device_type = "network";
14567 +                       model = "eTSEC";
14568 +                       compatible = "gianfar";
14569 +                       reg = <0x24000 0x1000>;
14570 +                       local-mac-address = [ 00 00 00 00 00 00 ];
14571 +                       interrupts = <0x20 0x8 0x21 0x8 0x22 0x8>;
14572 +                       phy-connection-type = "mii";
14573 +                       interrupt-parent = < &ipic >;
14574 +                       phy-handle = < &phy2 >;
14575 +               };
14576 +
14577 +               enet1: ethernet@25000 {
14578 +                       cell-index = <1>;
14579 +                       device_type = "network";
14580 +                       model = "eTSEC";
14581 +                       compatible = "gianfar";
14582 +                       reg = <0x25000 0x1000>;
14583 +                       local-mac-address = [ 00 00 00 00 00 00 ];
14584 +                       interrupts = <0x23 0x8 0x24 0x8 0x25 0x8>;
14585 +                       phy-connection-type = "mii";
14586 +                       interrupt-parent = < &ipic >;
14587 +                       phy-handle = < &phy3 >;
14588 +               };
14589 +
14590 +               serial0: serial@4500 {
14591 +                       cell-index = <0>;
14592 +                       device_type = "serial";
14593 +                       compatible = "ns16550";
14594 +                       reg = <0x4500 0x100>;
14595 +                       clock-frequency = <0>;
14596 +                       interrupts = <0x9 0x8>;
14597 +                       interrupt-parent = < &ipic >;
14598 +               };
14599 +
14600 +               serial1: serial@4600 {
14601 +                       cell-index = <1>;
14602 +                       device_type = "serial";
14603 +                       compatible = "ns16550";
14604 +                       reg = <0x4600 0x100>;
14605 +                       clock-frequency = <0>;
14606 +                       interrupts = <0xa 0x8>;
14607 +                       interrupt-parent = < &ipic >;
14608 +               };
14609 +
14610 +               crypto@30000 {
14611 +                       model = "SEC3";
14612 +                       compatible = "talitos";
14613 +                       reg = <0x30000 0x10000>;
14614 +                       interrupts = <0xb 0x8>;
14615 +                       interrupt-parent = < &ipic >;
14616 +                       /* Rev. 3.0 geometry */
14617 +                       num-channels = <4>;
14618 +                       channel-fifo-len = <0x18>;
14619 +                       exec-units-mask = <0x000001fe>;
14620 +                       descriptor-types-mask = <0x03ab0ebf>;
14621 +               };
14622 +
14623 +               sdhc@2e000 {
14624 +                       model = "eSDHC";
14625 +                       compatible = "fsl,esdhc";
14626 +                       reg = <0x2e000 0x1000>;
14627 +                       interrupts = <0x2a 0x8>;
14628 +                       interrupt-parent = < &ipic >;
14629 +               };
14630 +
14631 +               sata@18000 {
14632 +                       compatible = "fsl,mpc8379-sata";
14633 +                       reg = <0x18000 0x1000>;
14634 +                       interrupts = <0x2c 0x8>;
14635 +                       interrupt-parent = < &ipic >;
14636 +               };
14637 +
14638 +               sata@19000 {
14639 +                       compatible = "fsl,mpc8379-sata";
14640 +                       reg = <0x19000 0x1000>;
14641 +                       interrupts = <0x2d 0x8>;
14642 +                       interrupt-parent = < &ipic >;
14643 +               };
14644 +
14645 +               /* IPIC
14646 +                * interrupts cell = <intr #, sense>
14647 +                * sense values match linux IORESOURCE_IRQ_* defines:
14648 +                * sense == 8: Level, low assertion
14649 +                * sense == 2: Edge, high-to-low change
14650 +                */
14651 +               ipic: pic@700 {
14652 +                       compatible = "fsl,ipic";
14653 +                       interrupt-controller;
14654 +                       #address-cells = <0>;
14655 +                       #interrupt-cells = <2>;
14656 +                       reg = <0x700 0x100>;
14657 +               };
14658 +       };
14659 +
14660 +       pci0: pci@e0008500 {
14661 +               cell-index = <0>;
14662 +               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
14663 +               interrupt-map = <
14664 +
14665 +                               /* IDSEL 0x11 */
14666 +                                0x8800 0x0 0x0 0x1 &ipic 0x14 0x8
14667 +                                0x8800 0x0 0x0 0x2 &ipic 0x15 0x8
14668 +                                0x8800 0x0 0x0 0x3 &ipic 0x16 0x8
14669 +                                0x8800 0x0 0x0 0x4 &ipic 0x17 0x8
14670 +
14671 +                               /* IDSEL 0x12 */
14672 +                                0x9000 0x0 0x0 0x1 &ipic 0x16 0x8
14673 +                                0x9000 0x0 0x0 0x2 &ipic 0x17 0x8
14674 +                                0x9000 0x0 0x0 0x3 &ipic 0x14 0x8
14675 +                                0x9000 0x0 0x0 0x4 &ipic 0x15 0x8
14676 +
14677 +                               /* IDSEL 0x13 */
14678 +                                0x9800 0x0 0x0 0x1 &ipic 0x17 0x8
14679 +                                0x9800 0x0 0x0 0x2 &ipic 0x14 0x8
14680 +                                0x9800 0x0 0x0 0x3 &ipic 0x15 0x8
14681 +                                0x9800 0x0 0x0 0x4 &ipic 0x16 0x8
14682 +
14683 +                               /* IDSEL 0x15 */
14684 +                                0xa800 0x0 0x0 0x1 &ipic 0x14 0x8
14685 +                                0xa800 0x0 0x0 0x2 &ipic 0x15 0x8
14686 +                                0xa800 0x0 0x0 0x3 &ipic 0x16 0x8
14687 +                                0xa800 0x0 0x0 0x4 &ipic 0x17 0x8
14688 +
14689 +                               /* IDSEL 0x16 */
14690 +                                0xb000 0x0 0x0 0x1 &ipic 0x17 0x8
14691 +                                0xb000 0x0 0x0 0x2 &ipic 0x14 0x8
14692 +                                0xb000 0x0 0x0 0x3 &ipic 0x15 0x8
14693 +                                0xb000 0x0 0x0 0x4 &ipic 0x16 0x8
14694 +
14695 +                               /* IDSEL 0x17 */
14696 +                                0xb800 0x0 0x0 0x1 &ipic 0x16 0x8
14697 +                                0xb800 0x0 0x0 0x2 &ipic 0x17 0x8
14698 +                                0xb800 0x0 0x0 0x3 &ipic 0x14 0x8
14699 +                                0xb800 0x0 0x0 0x4 &ipic 0x15 0x8
14700 +
14701 +                               /* IDSEL 0x18 */
14702 +                                0xc000 0x0 0x0 0x1 &ipic 0x15 0x8
14703 +                                0xc000 0x0 0x0 0x2 &ipic 0x16 0x8
14704 +                                0xc000 0x0 0x0 0x3 &ipic 0x17 0x8
14705 +                                0xc000 0x0 0x0 0x4 &ipic 0x14 0x8>;
14706 +               interrupt-parent = < &ipic >;
14707 +               interrupts = <0x42 0x8>;
14708 +               bus-range = <0 0>;
14709 +               ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
14710 +                         0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
14711 +                         0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
14712 +               clock-frequency = <0>;
14713 +               #interrupt-cells = <1>;
14714 +               #size-cells = <2>;
14715 +               #address-cells = <3>;
14716 +               reg = <0xe0008500 0x100>;
14717 +               compatible = "fsl,mpc8349-pci";
14718 +               device_type = "pci";
14719 +       };
14720 +};
14721 --- /dev/null
14722 +++ b/arch/powerpc/boot/dts/mpc8378_mds.dts
14723 @@ -0,0 +1,265 @@
14724 +/*
14725 + * MPC8378E MDS Device Tree Source
14726 + *
14727 + * Copyright 2007 Freescale Semiconductor Inc.
14728 + *
14729 + * This program is free software; you can redistribute  it and/or modify it
14730 + * under  the terms of  the GNU General  Public License as published by the
14731 + * Free Software Foundation;  either version 2 of the  License, or (at your
14732 + * option) any later version.
14733 + */
14734 +
14735 +/dts-v1/;
14736 +
14737 +/ {
14738 +       model = "fsl,mpc8378emds";
14739 +       compatible = "fsl,mpc8378emds","fsl,mpc837xmds";
14740 +       #address-cells = <1>;
14741 +       #size-cells = <1>;
14742 +
14743 +       aliases {
14744 +               ethernet0 = &enet0;
14745 +               ethernet1 = &enet1;
14746 +               serial0 = &serial0;
14747 +               serial1 = &serial1;
14748 +               pci0 = &pci0;
14749 +       };
14750 +
14751 +       cpus {
14752 +               #address-cells = <1>;
14753 +               #size-cells = <0>;
14754 +
14755 +               PowerPC,8378@0 {
14756 +                       device_type = "cpu";
14757 +                       reg = <0>;
14758 +                       d-cache-line-size = <0x20>;
14759 +                       i-cache-line-size = <0x20>;
14760 +                       d-cache-size = <0x8000>;                // L1, 32K
14761 +                       i-cache-size = <0x8000>;                // L1, 32K
14762 +                       timebase-frequency = <0>;
14763 +                       bus-frequency = <0>;
14764 +                       clock-frequency = <0>;
14765 +               };
14766 +       };
14767 +
14768 +       memory {
14769 +               device_type = "memory";
14770 +               reg = <0x00000000 0x20000000>;  // 512MB at 0
14771 +       };
14772 +
14773 +       soc@e0000000 {
14774 +               #address-cells = <1>;
14775 +               #size-cells = <1>;
14776 +               device_type = "soc";
14777 +               ranges = <0x0 0xe0000000 0x00100000>;
14778 +               reg = <0xe0000000 0x00000200>;
14779 +               bus-frequency = <0>;
14780 +
14781 +               wdt@200 {
14782 +                       compatible = "mpc83xx_wdt";
14783 +                       reg = <0x200 0x100>;
14784 +               };
14785 +
14786 +               i2c@3000 {
14787 +                       #address-cells = <1>;
14788 +                       #size-cells = <0>;
14789 +                       cell-index = <0>;
14790 +                       compatible = "fsl-i2c";
14791 +                       reg = <0x3000 0x100>;
14792 +                       interrupts = <0xe 0x8>;
14793 +                       interrupt-parent = < &ipic >;
14794 +                       dfsrr;
14795 +               };
14796 +
14797 +               i2c@3100 {
14798 +                       #address-cells = <1>;
14799 +                       #size-cells = <0>;
14800 +                       cell-index = <1>;
14801 +                       compatible = "fsl-i2c";
14802 +                       reg = <0x3100 0x100>;
14803 +                       interrupts = <0xf 0x8>;
14804 +                       interrupt-parent = < &ipic >;
14805 +                       dfsrr;
14806 +               };
14807 +
14808 +               spi@7000 {
14809 +                       compatible = "fsl_spi";
14810 +                       reg = <0x7000 0x1000>;
14811 +                       interrupts = <0x10 0x8>;
14812 +                       interrupt-parent = < &ipic >;
14813 +                       mode = "cpu";
14814 +               };
14815 +
14816 +               /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
14817 +               usb@23000 {
14818 +                       compatible = "fsl-usb2-dr";
14819 +                       reg = <0x23000 0x1000>;
14820 +                       #address-cells = <1>;
14821 +                       #size-cells = <0>;
14822 +                       interrupt-parent = < &ipic >;
14823 +                       interrupts = <0x26 0x8>;
14824 +                       phy_type = "utmi_wide";
14825 +               };
14826 +
14827 +               mdio@24520 {
14828 +                       #address-cells = <1>;
14829 +                       #size-cells = <0>;
14830 +                       compatible = "fsl,gianfar-mdio";
14831 +                       reg = <0x24520 0x20>;
14832 +                       phy2: ethernet-phy@2 {
14833 +                               interrupt-parent = < &ipic >;
14834 +                               interrupts = <0x11 0x8>;
14835 +                               reg = <2>;
14836 +                               device_type = "ethernet-phy";
14837 +                       };
14838 +                       phy3: ethernet-phy@3 {
14839 +                               interrupt-parent = < &ipic >;
14840 +                               interrupts = <0x12 0x8>;
14841 +                               reg = <3>;
14842 +                               device_type = "ethernet-phy";
14843 +                       };
14844 +               };
14845 +
14846 +               enet0: ethernet@24000 {
14847 +                       cell-index = <0>;
14848 +                       device_type = "network";
14849 +                       model = "eTSEC";
14850 +                       compatible = "gianfar";
14851 +                       reg = <0x24000 0x1000>;
14852 +                       local-mac-address = [ 00 00 00 00 00 00 ];
14853 +                       interrupts = <0x20 0x8 0x21 0x8 0x22 0x8>;
14854 +                       phy-connection-type = "mii";
14855 +                       interrupt-parent = < &ipic >;
14856 +                       phy-handle = < &phy2 >;
14857 +               };
14858 +
14859 +               enet1: ethernet@25000 {
14860 +                       cell-index = <1>;
14861 +                       device_type = "network";
14862 +                       model = "eTSEC";
14863 +                       compatible = "gianfar";
14864 +                       reg = <0x25000 0x1000>;
14865 +                       local-mac-address = [ 00 00 00 00 00 00 ];
14866 +                       interrupts = <0x23 0x8 0x24 0x8 0x25 0x8>;
14867 +                       phy-connection-type = "mii";
14868 +                       interrupt-parent = < &ipic >;
14869 +                       phy-handle = < &phy3 >;
14870 +               };
14871 +
14872 +               serial0: serial@4500 {
14873 +                       cell-index = <0>;
14874 +                       device_type = "serial";
14875 +                       compatible = "ns16550";
14876 +                       reg = <0x4500 0x100>;
14877 +                       clock-frequency = <0>;
14878 +                       interrupts = <0x9 0x8>;
14879 +                       interrupt-parent = < &ipic >;
14880 +               };
14881 +
14882 +               serial1: serial@4600 {
14883 +                       cell-index = <1>;
14884 +                       device_type = "serial";
14885 +                       compatible = "ns16550";
14886 +                       reg = <0x4600 0x100>;
14887 +                       clock-frequency = <0>;
14888 +                       interrupts = <0xa 0x8>;
14889 +                       interrupt-parent = < &ipic >;
14890 +               };
14891 +
14892 +               crypto@30000 {
14893 +                       model = "SEC3";
14894 +                       compatible = "talitos";
14895 +                       reg = <0x30000 0x10000>;
14896 +                       interrupts = <0xb 0x8>;
14897 +                       interrupt-parent = < &ipic >;
14898 +                       /* Rev. 3.0 geometry */
14899 +                       num-channels = <4>;
14900 +                       channel-fifo-len = <0x18>;
14901 +                       exec-units-mask = <0x000001fe>;
14902 +                       descriptor-types-mask = <0x03ab0ebf>;
14903 +               };
14904 +
14905 +               sdhc@2e000 {
14906 +                       model = "eSDHC";
14907 +                       compatible = "fsl,esdhc";
14908 +                       reg = <0x2e000 0x1000>;
14909 +                       interrupts = <0x2a 0x8>;
14910 +                       interrupt-parent = < &ipic >;
14911 +               };
14912 +
14913 +               /* IPIC
14914 +                * interrupts cell = <intr #, sense>
14915 +                * sense values match linux IORESOURCE_IRQ_* defines:
14916 +                * sense == 8: Level, low assertion
14917 +                * sense == 2: Edge, high-to-low change
14918 +                */
14919 +               ipic: pic@700 {
14920 +                       compatible = "fsl,ipic";
14921 +                       interrupt-controller;
14922 +                       #address-cells = <0>;
14923 +                       #interrupt-cells = <2>;
14924 +                       reg = <0x700 0x100>;
14925 +               };
14926 +       };
14927 +
14928 +       pci0: pci@e0008500 {
14929 +               cell-index = <0>;
14930 +               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
14931 +               interrupt-map = <
14932 +
14933 +                               /* IDSEL 0x11 */
14934 +                                0x8800 0x0 0x0 0x1 &ipic 0x14 0x8
14935 +                                0x8800 0x0 0x0 0x2 &ipic 0x15 0x8
14936 +                                0x8800 0x0 0x0 0x3 &ipic 0x16 0x8
14937 +                                0x8800 0x0 0x0 0x4 &ipic 0x17 0x8
14938 +
14939 +                               /* IDSEL 0x12 */
14940 +                                0x9000 0x0 0x0 0x1 &ipic 0x16 0x8
14941 +                                0x9000 0x0 0x0 0x2 &ipic 0x17 0x8
14942 +                                0x9000 0x0 0x0 0x3 &ipic 0x14 0x8
14943 +                                0x9000 0x0 0x0 0x4 &ipic 0x15 0x8
14944 +
14945 +                               /* IDSEL 0x13 */
14946 +                                0x9800 0x0 0x0 0x1 &ipic 0x17 0x8
14947 +                                0x9800 0x0 0x0 0x2 &ipic 0x14 0x8
14948 +                                0x9800 0x0 0x0 0x3 &ipic 0x15 0x8
14949 +                                0x9800 0x0 0x0 0x4 &ipic 0x16 0x8
14950 +
14951 +                               /* IDSEL 0x15 */
14952 +                                0xa800 0x0 0x0 0x1 &ipic 0x14 0x8
14953 +                                0xa800 0x0 0x0 0x2 &ipic 0x15 0x8
14954 +                                0xa800 0x0 0x0 0x3 &ipic 0x16 0x8
14955 +                                0xa800 0x0 0x0 0x4 &ipic 0x17 0x8
14956 +
14957 +                               /* IDSEL 0x16 */
14958 +                                0xb000 0x0 0x0 0x1 &ipic 0x17 0x8
14959 +                                0xb000 0x0 0x0 0x2 &ipic 0x14 0x8
14960 +                                0xb000 0x0 0x0 0x3 &ipic 0x15 0x8
14961 +                                0xb000 0x0 0x0 0x4 &ipic 0x16 0x8
14962 +
14963 +                               /* IDSEL 0x17 */
14964 +                                0xb800 0x0 0x0 0x1 &ipic 0x16 0x8
14965 +                                0xb800 0x0 0x0 0x2 &ipic 0x17 0x8
14966 +                                0xb800 0x0 0x0 0x3 &ipic 0x14 0x8
14967 +                                0xb800 0x0 0x0 0x4 &ipic 0x15 0x8
14968 +
14969 +                               /* IDSEL 0x18 */
14970 +                                0xc000 0x0 0x0 0x1 &ipic 0x15 0x8
14971 +                                0xc000 0x0 0x0 0x2 &ipic 0x16 0x8
14972 +                                0xc000 0x0 0x0 0x3 &ipic 0x17 0x8
14973 +                                0xc000 0x0 0x0 0x4 &ipic 0x14 0x8>;
14974 +               interrupt-parent = < &ipic >;
14975 +               interrupts = <0x42 0x8>;
14976 +               bus-range = <0 0>;
14977 +               ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
14978 +                         0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
14979 +                         0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
14980 +               clock-frequency = <0>;
14981 +               #interrupt-cells = <1>;
14982 +               #size-cells = <2>;
14983 +               #address-cells = <3>;
14984 +               reg = <0xe0008500 0x100>;
14985 +               compatible = "fsl,mpc8349-pci";
14986 +               device_type = "pci";
14987 +       };
14988 +};
14989 --- /dev/null
14990 +++ b/arch/powerpc/boot/dts/mpc8379_mds.dts
14991 @@ -0,0 +1,293 @@
14992 +/*
14993 + * MPC8379E MDS Device Tree Source
14994 + *
14995 + * Copyright 2007 Freescale Semiconductor Inc.
14996 + *
14997 + * This program is free software; you can redistribute  it and/or modify it
14998 + * under  the terms of  the GNU General  Public License as published by the
14999 + * Free Software Foundation;  either version 2 of the  License, or (at your
15000 + * option) any later version.
15001 + */
15002 +
15003 +/dts-v1/;
15004 +
15005 +/ {
15006 +       model = "fsl,mpc8379emds";
15007 +       compatible = "fsl,mpc8379emds","fsl,mpc837xmds";
15008 +       #address-cells = <1>;
15009 +       #size-cells = <1>;
15010 +
15011 +       aliases {
15012 +               ethernet0 = &enet0;
15013 +               ethernet1 = &enet1;
15014 +               serial0 = &serial0;
15015 +               serial1 = &serial1;
15016 +               pci0 = &pci0;
15017 +       };
15018 +
15019 +       cpus {
15020 +               #address-cells = <1>;
15021 +               #size-cells = <0>;
15022 +
15023 +               PowerPC,8379@0 {
15024 +                       device_type = "cpu";
15025 +                       reg = <0>;
15026 +                       d-cache-line-size = <0x20>;
15027 +                       i-cache-line-size = <0x20>;
15028 +                       d-cache-size = <0x8000>;                // L1, 32K
15029 +                       i-cache-size = <0x8000>;                // L1, 32K
15030 +                       timebase-frequency = <0>;
15031 +                       bus-frequency = <0>;
15032 +                       clock-frequency = <0>;
15033 +               };
15034 +       };
15035 +
15036 +       memory {
15037 +               device_type = "memory";
15038 +               reg = <0x00000000 0x20000000>;  // 512MB at 0
15039 +       };
15040 +
15041 +       soc@e0000000 {
15042 +               #address-cells = <1>;
15043 +               #size-cells = <1>;
15044 +               device_type = "soc";
15045 +               ranges = <0x0 0xe0000000 0x00100000>;
15046 +               reg = <0xe0000000 0x00000200>;
15047 +               bus-frequency = <0>;
15048 +
15049 +               wdt@200 {
15050 +                       compatible = "mpc83xx_wdt";
15051 +                       reg = <0x200 0x100>;
15052 +               };
15053 +
15054 +               i2c@3000 {
15055 +                       #address-cells = <1>;
15056 +                       #size-cells = <0>;
15057 +                       cell-index = <0>;
15058 +                       compatible = "fsl-i2c";
15059 +                       reg = <0x3000 0x100>;
15060 +                       interrupts = <0xe 0x8>;
15061 +                       interrupt-parent = < &ipic >;
15062 +                       dfsrr;
15063 +               };
15064 +
15065 +               i2c@3100 {
15066 +                       #address-cells = <1>;
15067 +                       #size-cells = <0>;
15068 +                       cell-index = <1>;
15069 +                       compatible = "fsl-i2c";
15070 +                       reg = <0x3100 0x100>;
15071 +                       interrupts = <0xf 0x8>;
15072 +                       interrupt-parent = < &ipic >;
15073 +                       dfsrr;
15074 +               };
15075 +
15076 +               spi@7000 {
15077 +                       compatible = "fsl_spi";
15078 +                       reg = <0x7000 0x1000>;
15079 +                       interrupts = <0x10 0x8>;
15080 +                       interrupt-parent = < &ipic >;
15081 +                       mode = "cpu";
15082 +               };
15083 +
15084 +               /* phy type (ULPI, UTMI, UTMI_WIDE, SERIAL) */
15085 +               usb@23000 {
15086 +                       compatible = "fsl-usb2-dr";
15087 +                       reg = <0x23000 0x1000>;
15088 +                       #address-cells = <1>;
15089 +                       #size-cells = <0>;
15090 +                       interrupt-parent = < &ipic >;
15091 +                       interrupts = <0x26 0x8>;
15092 +                       phy_type = "utmi_wide";
15093 +               };
15094 +
15095 +               mdio@24520 {
15096 +                       #address-cells = <1>;
15097 +                       #size-cells = <0>;
15098 +                       compatible = "fsl,gianfar-mdio";
15099 +                       reg = <0x24520 0x20>;
15100 +                       phy2: ethernet-phy@2 {
15101 +                               interrupt-parent = < &ipic >;
15102 +                               interrupts = <0x11 0x8>;
15103 +                               reg = <2>;
15104 +                               device_type = "ethernet-phy";
15105 +                       };
15106 +                       phy3: ethernet-phy@3 {
15107 +                               interrupt-parent = < &ipic >;
15108 +                               interrupts = <0x12 0x8>;
15109 +                               reg = <3>;
15110 +                               device_type = "ethernet-phy";
15111 +                       };
15112 +               };
15113 +
15114 +               enet0: ethernet@24000 {
15115 +                       cell-index = <0>;
15116 +                       device_type = "network";
15117 +                       model = "eTSEC";
15118 +                       compatible = "gianfar";
15119 +                       reg = <0x24000 0x1000>;
15120 +                       local-mac-address = [ 00 00 00 00 00 00 ];
15121 +                       interrupts = <0x20 0x8 0x21 0x8 0x22 0x8>;
15122 +                       phy-connection-type = "mii";
15123 +                       interrupt-parent = < &ipic >;
15124 +                       phy-handle = < &phy2 >;
15125 +               };
15126 +
15127 +               enet1: ethernet@25000 {
15128 +                       cell-index = <1>;
15129 +                       device_type = "network";
15130 +                       model = "eTSEC";
15131 +                       compatible = "gianfar";
15132 +                       reg = <0x25000 0x1000>;
15133 +                       local-mac-address = [ 00 00 00 00 00 00 ];
15134 +                       interrupts = <0x23 0x8 0x24 0x8 0x25 0x8>;
15135 +                       phy-connection-type = "mii";
15136 +                       interrupt-parent = < &ipic >;
15137 +                       phy-handle = < &phy3 >;
15138 +               };
15139 +
15140 +               serial0: serial@4500 {
15141 +                       cell-index = <0>;
15142 +                       device_type = "serial";
15143 +                       compatible = "ns16550";
15144 +                       reg = <0x4500 0x100>;
15145 +                       clock-frequency = <0>;
15146 +                       interrupts = <0x9 0x8>;
15147 +                       interrupt-parent = < &ipic >;
15148 +               };
15149 +
15150 +               serial1: serial@4600 {
15151 +                       cell-index = <1>;
15152 +                       device_type = "serial";
15153 +                       compatible = "ns16550";
15154 +                       reg = <0x4600 0x100>;
15155 +                       clock-frequency = <0>;
15156 +                       interrupts = <0xa 0x8>;
15157 +                       interrupt-parent = < &ipic >;
15158 +               };
15159 +
15160 +               crypto@30000 {
15161 +                       model = "SEC3";
15162 +                       compatible = "talitos";
15163 +                       reg = <0x30000 0x10000>;
15164 +                       interrupts = <0xb 0x8>;
15165 +                       interrupt-parent = < &ipic >;
15166 +                       /* Rev. 3.0 geometry */
15167 +                       num-channels = <4>;
15168 +                       channel-fifo-len = <0x18>;
15169 +                       exec-units-mask = <0x000001fe>;
15170 +                       descriptor-types-mask = <0x03ab0ebf>;
15171 +               };
15172 +
15173 +               sdhc@2e000 {
15174 +                       model = "eSDHC";
15175 +                       compatible = "fsl,esdhc";
15176 +                       reg = <0x2e000 0x1000>;
15177 +                       interrupts = <0x2a 0x8>;
15178 +                       interrupt-parent = < &ipic >;
15179 +               };
15180 +
15181 +               sata@18000 {
15182 +                       compatible = "fsl,mpc8379-sata";
15183 +                       reg = <0x18000 0x1000>;
15184 +                       interrupts = <0x2c 0x8>;
15185 +                       interrupt-parent = < &ipic >;
15186 +               };
15187 +
15188 +               sata@19000 {
15189 +                       compatible = "fsl,mpc8379-sata";
15190 +                       reg = <0x19000 0x1000>;
15191 +                       interrupts = <0x2d 0x8>;
15192 +                       interrupt-parent = < &ipic >;
15193 +               };
15194 +
15195 +               sata@1a000 {
15196 +                       compatible = "fsl,mpc8379-sata";
15197 +                       reg = <0x1a000 0x1000>;
15198 +                       interrupts = <0x2e 0x8>;
15199 +                       interrupt-parent = < &ipic >;
15200 +               };
15201 +
15202 +               sata@1b000 {
15203 +                       compatible = "fsl,mpc8379-sata";
15204 +                       reg = <0x1b000 0x1000>;
15205 +                       interrupts = <0x2f 0x8>;
15206 +                       interrupt-parent = < &ipic >;
15207 +               };
15208 +
15209 +               /* IPIC
15210 +                * interrupts cell = <intr #, sense>
15211 +                * sense values match linux IORESOURCE_IRQ_* defines:
15212 +                * sense == 8: Level, low assertion
15213 +                * sense == 2: Edge, high-to-low change
15214 +                */
15215 +               ipic: pic@700 {
15216 +                       compatible = "fsl,ipic";
15217 +                       interrupt-controller;
15218 +                       #address-cells = <0>;
15219 +                       #interrupt-cells = <2>;
15220 +                       reg = <0x700 0x100>;
15221 +               };
15222 +       };
15223 +
15224 +       pci0: pci@e0008500 {
15225 +               cell-index = <0>;
15226 +               interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
15227 +               interrupt-map = <
15228 +
15229 +                               /* IDSEL 0x11 */
15230 +                                0x8800 0x0 0x0 0x1 &ipic 0x14 0x8
15231 +                                0x8800 0x0 0x0 0x2 &ipic 0x15 0x8
15232 +                                0x8800 0x0 0x0 0x3 &ipic 0x16 0x8
15233 +                                0x8800 0x0 0x0 0x4 &ipic 0x17 0x8
15234 +
15235 +                               /* IDSEL 0x12 */
15236 +                                0x9000 0x0 0x0 0x1 &ipic 0x16 0x8
15237 +                                0x9000 0x0 0x0 0x2 &ipic 0x17 0x8
15238 +                                0x9000 0x0 0x0 0x3 &ipic 0x14 0x8
15239 +                                0x9000 0x0 0x0 0x4 &ipic 0x15 0x8
15240 +
15241 +                               /* IDSEL 0x13 */
15242 +                                0x9800 0x0 0x0 0x1 &ipic 0x17 0x8
15243 +                                0x9800 0x0 0x0 0x2 &ipic 0x14 0x8
15244 +                                0x9800 0x0 0x0 0x3 &ipic 0x15 0x8
15245 +                                0x9800 0x0 0x0 0x4 &ipic 0x16 0x8
15246 +
15247 +                               /* IDSEL 0x15 */
15248 +                                0xa800 0x0 0x0 0x1 &ipic 0x14 0x8
15249 +                                0xa800 0x0 0x0 0x2 &ipic 0x15 0x8
15250 +                                0xa800 0x0 0x0 0x3 &ipic 0x16 0x8
15251 +                                0xa800 0x0 0x0 0x4 &ipic 0x17 0x8
15252 +
15253 +                               /* IDSEL 0x16 */
15254 +                                0xb000 0x0 0x0 0x1 &ipic 0x17 0x8
15255 +                                0xb000 0x0 0x0 0x2 &ipic 0x14 0x8
15256 +                                0xb000 0x0 0x0 0x3 &ipic 0x15 0x8
15257 +                                0xb000 0x0 0x0 0x4 &ipic 0x16 0x8
15258 +
15259 +                               /* IDSEL 0x17 */
15260 +                                0xb800 0x0 0x0 0x1 &ipic 0x16 0x8
15261 +                                0xb800 0x0 0x0 0x2 &ipic 0x17 0x8
15262 +                                0xb800 0x0 0x0 0x3 &ipic 0x14 0x8
15263 +                                0xb800 0x0 0x0 0x4 &ipic 0x15 0x8
15264 +
15265 +                               /* IDSEL 0x18 */
15266 +                                0xc000 0x0 0x0 0x1 &ipic 0x15 0x8
15267 +                                0xc000 0x0 0x0 0x2 &ipic 0x16 0x8
15268 +                                0xc000 0x0 0x0 0x3 &ipic 0x17 0x8
15269 +                                0xc000 0x0 0x0 0x4 &ipic 0x14 0x8>;
15270 +               interrupt-parent = < &ipic >;
15271 +               interrupts = <0x42 0x8>;
15272 +               bus-range = <0 0>;
15273 +               ranges = <0x02000000 0x0 0x90000000 0x90000000 0x0 0x10000000
15274 +                         0x42000000 0x0 0x80000000 0x80000000 0x0 0x10000000
15275 +                         0x01000000 0x0 0x00000000 0xe0300000 0x0 0x00100000>;
15276 +               clock-frequency = <0>;
15277 +               #interrupt-cells = <1>;
15278 +               #size-cells = <2>;
15279 +               #address-cells = <3>;
15280 +               reg = <0xe0008500 0x100>;
15281 +               compatible = "fsl,mpc8349-pci";
15282 +               device_type = "pci";
15283 +       };
15284 +};
15285 --- a/arch/powerpc/boot/dts/mpc8540ads.dts
15286 +++ b/arch/powerpc/boot/dts/mpc8540ads.dts
15287 @@ -16,6 +16,15 @@
15288         #address-cells = <1>;
15289         #size-cells = <1>;
15290  
15291 +       aliases {
15292 +               ethernet0 = &enet0;
15293 +               ethernet1 = &enet1;
15294 +               ethernet2 = &enet2;
15295 +               serial0 = &serial0;
15296 +               serial1 = &serial1;
15297 +               pci0 = &pci0;
15298 +       };
15299 +
15300         cpus {
15301                 #address-cells = <1>;
15302                 #size-cells = <0>;
15303 @@ -63,7 +72,9 @@
15304                 };
15305  
15306                 i2c@3000 {
15307 -                       device_type = "i2c";
15308 +                       #address-cells = <1>;
15309 +                       #size-cells = <0>;
15310 +                       cell-index = <0>;
15311                         compatible = "fsl-i2c";
15312                         reg = <3000 100>;
15313                         interrupts = <2b 2>;
15314 @@ -74,9 +85,9 @@
15315                 mdio@24520 {
15316                         #address-cells = <1>;
15317                         #size-cells = <0>;
15318 -                       device_type = "mdio";
15319 -                       compatible = "gianfar";
15320 +                       compatible = "fsl,gianfar-mdio";
15321                         reg = <24520 20>;
15322 +
15323                         phy0: ethernet-phy@0 {
15324                                 interrupt-parent = <&mpic>;
15325                                 interrupts = <5 1>;
15326 @@ -97,64 +108,44 @@
15327                         };
15328                 };
15329  
15330 -               ethernet@24000 {
15331 -                       #address-cells = <1>;
15332 -                       #size-cells = <0>;
15333 +               enet0: ethernet@24000 {
15334 +                       cell-index = <0>;
15335                         device_type = "network";
15336                         model = "TSEC";
15337                         compatible = "gianfar";
15338                         reg = <24000 1000>;
15339 -                       /*
15340 -                        * address is deprecated and will be removed
15341 -                        * in 2.6.25.  Only recent versions of
15342 -                        * U-Boot support local-mac-address, however.
15343 -                        */
15344 -                       address = [ 00 00 00 00 00 00 ];
15345                         local-mac-address = [ 00 00 00 00 00 00 ];
15346                         interrupts = <1d 2 1e 2 22 2>;
15347                         interrupt-parent = <&mpic>;
15348                         phy-handle = <&phy0>;
15349                 };
15350  
15351 -               ethernet@25000 {
15352 -                       #address-cells = <1>;
15353 -                       #size-cells = <0>;
15354 +               enet1: ethernet@25000 {
15355 +                       cell-index = <1>;
15356                         device_type = "network";
15357                         model = "TSEC";
15358                         compatible = "gianfar";
15359                         reg = <25000 1000>;
15360 -                       /*
15361 -                        * address is deprecated and will be removed
15362 -                        * in 2.6.25.  Only recent versions of
15363 -                        * U-Boot support local-mac-address, however.
15364 -                        */
15365 -                       address = [ 00 00 00 00 00 00 ];
15366                         local-mac-address = [ 00 00 00 00 00 00 ];
15367                         interrupts = <23 2 24 2 28 2>;
15368                         interrupt-parent = <&mpic>;
15369                         phy-handle = <&phy1>;
15370                 };
15371  
15372 -               ethernet@26000 {
15373 -                       #address-cells = <1>;
15374 -                       #size-cells = <0>;
15375 +               enet2: ethernet@26000 {
15376 +                       cell-index = <2>;
15377                         device_type = "network";
15378                         model = "FEC";
15379                         compatible = "gianfar";
15380                         reg = <26000 1000>;
15381 -                       /*
15382 -                        * address is deprecated and will be removed
15383 -                        * in 2.6.25.  Only recent versions of
15384 -                        * U-Boot support local-mac-address, however.
15385 -                        */
15386 -                       address = [ 00 00 00 00 00 00 ];
15387                         local-mac-address = [ 00 00 00 00 00 00 ];
15388                         interrupts = <29 2>;
15389                         interrupt-parent = <&mpic>;
15390                         phy-handle = <&phy3>;
15391                 };
15392  
15393 -               serial@4500 {
15394 +               serial0: serial@4500 {
15395 +                       cell-index = <0>;
15396                         device_type = "serial";
15397                         compatible = "ns16550";
15398                         reg = <4500 100>;       // reg base, size
15399 @@ -163,7 +154,8 @@
15400                         interrupt-parent = <&mpic>;
15401                 };
15402  
15403 -               serial@4600 {
15404 +               serial1: serial@4600 {
15405 +                       cell-index = <1>;
15406                         device_type = "serial";
15407                         compatible = "ns16550";
15408                         reg = <4600 100>;       // reg base, size
15409 @@ -183,7 +175,8 @@
15410                 };
15411         };
15412  
15413 -       pci@e0008000 {
15414 +       pci0: pci@e0008000 {
15415 +               cell-index = <0>;
15416                 interrupt-map-mask = <f800 0 0 7>;
15417                 interrupt-map = <
15418  
15419 --- a/arch/powerpc/boot/dts/mpc8541cds.dts
15420 +++ b/arch/powerpc/boot/dts/mpc8541cds.dts
15421 @@ -16,6 +16,15 @@
15422         #address-cells = <1>;
15423         #size-cells = <1>;
15424  
15425 +       aliases {
15426 +               ethernet0 = &enet0;
15427 +               ethernet1 = &enet1;
15428 +               serial0 = &serial0;
15429 +               serial1 = &serial1;
15430 +               pci0 = &pci0;
15431 +               pci1 = &pci1;
15432 +       };
15433 +
15434         cpus {
15435                 #address-cells = <1>;
15436                 #size-cells = <0>;
15437 @@ -63,7 +72,9 @@
15438                 };
15439  
15440                 i2c@3000 {
15441 -                       device_type = "i2c";
15442 +                       #address-cells = <1>;
15443 +                       #size-cells = <0>;
15444 +                       cell-index = <0>;
15445                         compatible = "fsl-i2c";
15446                         reg = <3000 100>;
15447                         interrupts = <2b 2>;
15448 @@ -74,9 +85,9 @@
15449                 mdio@24520 {
15450                         #address-cells = <1>;
15451                         #size-cells = <0>;
15452 -                       device_type = "mdio";
15453 -                       compatible = "gianfar";
15454 +                       compatible = "fsl,gianfar-mdio";
15455                         reg = <24520 20>;
15456 +
15457                         phy0: ethernet-phy@0 {
15458                                 interrupt-parent = <&mpic>;
15459                                 interrupts = <5 1>;
15460 @@ -91,9 +102,8 @@
15461                         };
15462                 };
15463  
15464 -               ethernet@24000 {
15465 -                       #address-cells = <1>;
15466 -                       #size-cells = <0>;
15467 +               enet0: ethernet@24000 {
15468 +                       cell-index = <0>;
15469                         device_type = "network";
15470                         model = "TSEC";
15471                         compatible = "gianfar";
15472 @@ -104,9 +114,8 @@
15473                         phy-handle = <&phy0>;
15474                 };
15475  
15476 -               ethernet@25000 {
15477 -                       #address-cells = <1>;
15478 -                       #size-cells = <0>;
15479 +               enet1: ethernet@25000 {
15480 +                       cell-index = <1>;
15481                         device_type = "network";
15482                         model = "TSEC";
15483                         compatible = "gianfar";
15484 @@ -117,7 +126,8 @@
15485                         phy-handle = <&phy1>;
15486                 };
15487  
15488 -               serial@4500 {
15489 +               serial0: serial@4500 {
15490 +                       cell-index = <0>;
15491                         device_type = "serial";
15492                         compatible = "ns16550";
15493                         reg = <4500 100>;       // reg base, size
15494 @@ -126,7 +136,8 @@
15495                         interrupt-parent = <&mpic>;
15496                 };
15497  
15498 -               serial@4600 {
15499 +               serial1: serial@4600 {
15500 +                       cell-index = <1>;
15501                         device_type = "serial";
15502                         compatible = "ns16550";
15503                         reg = <4600 100>;       // reg base, size
15504 @@ -183,7 +194,8 @@
15505                 };
15506         };
15507  
15508 -       pci1: pci@e0008000 {
15509 +       pci0: pci@e0008000 {
15510 +               cell-index = <0>;
15511                 interrupt-map-mask = <1f800 0 0 7>;
15512                 interrupt-map = <
15513  
15514 @@ -250,11 +262,12 @@
15515                         #interrupt-cells = <2>;
15516                         compatible = "chrp,iic";
15517                         interrupts = <1>;
15518 -                       interrupt-parent = <&pci1>;
15519 +                       interrupt-parent = <&pci0>;
15520                 };
15521         };
15522  
15523 -       pci@e0009000 {
15524 +       pci1: pci@e0009000 {
15525 +               cell-index = <1>;
15526                 interrupt-map-mask = <f800 0 0 7>;
15527                 interrupt-map = <
15528  
15529 --- a/arch/powerpc/boot/dts/mpc8544ds.dts
15530 +++ b/arch/powerpc/boot/dts/mpc8544ds.dts
15531 @@ -15,6 +15,17 @@
15532         #address-cells = <1>;
15533         #size-cells = <1>;
15534  
15535 +       aliases {
15536 +               ethernet0 = &enet0;
15537 +               ethernet1 = &enet1;
15538 +               serial0 = &serial0;
15539 +               serial1 = &serial1;
15540 +               pci0 = &pci0;
15541 +               pci1 = &pci1;
15542 +               pci2 = &pci2;
15543 +               pci3 = &pci3;
15544 +       };
15545 +
15546         cpus {
15547                 #cpus = <1>;
15548                 #address-cells = <1>;
15549 @@ -64,7 +75,9 @@
15550                 };
15551  
15552                 i2c@3000 {
15553 -                       device_type = "i2c";
15554 +                       #address-cells = <1>;
15555 +                       #size-cells = <0>;
15556 +                       cell-index = <0>;
15557                         compatible = "fsl-i2c";
15558                         reg = <3000 100>;
15559                         interrupts = <2b 2>;
15560 @@ -72,12 +85,23 @@
15561                         dfsrr;
15562                 };
15563  
15564 +               i2c@3100 {
15565 +                       #address-cells = <1>;
15566 +                       #size-cells = <0>;
15567 +                       cell-index = <1>;
15568 +                       compatible = "fsl-i2c";
15569 +                       reg = <3100 100>;
15570 +                       interrupts = <2b 2>;
15571 +                       interrupt-parent = <&mpic>;
15572 +                       dfsrr;
15573 +               };
15574 +
15575                 mdio@24520 {
15576                         #address-cells = <1>;
15577                         #size-cells = <0>;
15578 -                       device_type = "mdio";
15579 -                       compatible = "gianfar";
15580 +                       compatible = "fsl,gianfar-mdio";
15581                         reg = <24520 20>;
15582 +
15583                         phy0: ethernet-phy@0 {
15584                                 interrupt-parent = <&mpic>;
15585                                 interrupts = <a 1>;
15586 @@ -92,9 +116,8 @@
15587                         };
15588                 };
15589  
15590 -               ethernet@24000 {
15591 -                       #address-cells = <1>;
15592 -                       #size-cells = <0>;
15593 +               enet0: ethernet@24000 {
15594 +                       cell-index = <0>;
15595                         device_type = "network";
15596                         model = "TSEC";
15597                         compatible = "gianfar";
15598 @@ -106,9 +129,8 @@
15599                         phy-connection-type = "rgmii-id";
15600                 };
15601  
15602 -               ethernet@26000 {
15603 -                       #address-cells = <1>;
15604 -                       #size-cells = <0>;
15605 +               enet1: ethernet@26000 {
15606 +                       cell-index = <1>;
15607                         device_type = "network";
15608                         model = "TSEC";
15609                         compatible = "gianfar";
15610 @@ -120,7 +142,8 @@
15611                         phy-connection-type = "rgmii-id";
15612                 };
15613  
15614 -               serial@4500 {
15615 +               serial0: serial@4500 {
15616 +                       cell-index = <0>;
15617                         device_type = "serial";
15618                         compatible = "ns16550";
15619                         reg = <4500 100>;
15620 @@ -129,7 +152,8 @@
15621                         interrupt-parent = <&mpic>;
15622                 };
15623  
15624 -               serial@4600 {
15625 +               serial1: serial@4600 {
15626 +                       cell-index = <1>;
15627                         device_type = "serial";
15628                         compatible = "ns16550";
15629                         reg = <4600 100>;
15630 @@ -156,7 +180,8 @@
15631                 };
15632         };
15633  
15634 -       pci@e0008000 {
15635 +       pci0: pci@e0008000 {
15636 +               cell-index = <0>;
15637                 compatible = "fsl,mpc8540-pci";
15638                 device_type = "pci";
15639                 interrupt-map-mask = <f800 0 0 7>;
15640 @@ -187,7 +212,8 @@
15641                 reg = <e0008000 1000>;
15642         };
15643  
15644 -       pcie@e0009000 {
15645 +       pci1: pcie@e0009000 {
15646 +               cell-index = <1>;
15647                 compatible = "fsl,mpc8548-pcie";
15648                 device_type = "pci";
15649                 #interrupt-cells = <1>;
15650 @@ -223,7 +249,8 @@
15651                 };
15652         };
15653  
15654 -       pcie@e000a000 {
15655 +       pci2: pcie@e000a000 {
15656 +               cell-index = <2>;
15657                 compatible = "fsl,mpc8548-pcie";
15658                 device_type = "pci";
15659                 #interrupt-cells = <1>;
15660 @@ -259,7 +286,8 @@
15661                 };
15662         };
15663  
15664 -       pcie@e000b000 {
15665 +       pci3: pcie@e000b000 {
15666 +               cell-index = <3>;
15667                 compatible = "fsl,mpc8548-pcie";
15668                 device_type = "pci";
15669                 #interrupt-cells = <1>;
15670 @@ -276,9 +304,9 @@
15671                 interrupt-map = <
15672                         // IDSEL 0x1c  USB
15673                         e000 0 0 1 &i8259 c 2
15674 -                       e100 0 0 1 &i8259 9 2
15675 -                       e200 0 0 1 &i8259 a 2
15676 -                       e300 0 0 1 &i8259 b 2
15677 +                       e100 0 0 2 &i8259 9 2
15678 +                       e200 0 0 3 &i8259 a 2
15679 +                       e300 0 0 4 &i8259 b 2
15680  
15681                         // IDSEL 0x1d  Audio
15682                         e800 0 0 1 &i8259 6 2
15683 @@ -369,6 +397,5 @@
15684                                 };
15685                         };
15686                 };
15687 -
15688         };
15689  };
15690 --- a/arch/powerpc/boot/dts/mpc8548cds.dts
15691 +++ b/arch/powerpc/boot/dts/mpc8548cds.dts
15692 @@ -16,6 +16,20 @@
15693         #address-cells = <1>;
15694         #size-cells = <1>;
15695  
15696 +       aliases {
15697 +               ethernet0 = &enet0;
15698 +               ethernet1 = &enet1;
15699 +/*
15700 +               ethernet2 = &enet2;
15701 +               ethernet3 = &enet3;
15702 +*/
15703 +               serial0 = &serial0;
15704 +               serial1 = &serial1;
15705 +               pci0 = &pci0;
15706 +               pci1 = &pci1;
15707 +               pci2 = &pci2;
15708 +       };
15709 +
15710         cpus {
15711                 #address-cells = <1>;
15712                 #size-cells = <0>;
15713 @@ -63,7 +77,9 @@
15714                 };
15715  
15716                 i2c@3000 {
15717 -                       device_type = "i2c";
15718 +                       #address-cells = <1>;
15719 +                       #size-cells = <0>;
15720 +                       cell-index = <0>;
15721                         compatible = "fsl-i2c";
15722                         reg = <3000 100>;
15723                         interrupts = <2b 2>;
15724 @@ -71,12 +87,23 @@
15725                         dfsrr;
15726                 };
15727  
15728 +               i2c@3100 {
15729 +                       #address-cells = <1>;
15730 +                       #size-cells = <0>;
15731 +                       cell-index = <1>;
15732 +                       compatible = "fsl-i2c";
15733 +                       reg = <3100 100>;
15734 +                       interrupts = <2b 2>;
15735 +                       interrupt-parent = <&mpic>;
15736 +                       dfsrr;
15737 +               };
15738 +
15739                 mdio@24520 {
15740                         #address-cells = <1>;
15741                         #size-cells = <0>;
15742 -                       device_type = "mdio";
15743 -                       compatible = "gianfar";
15744 +                       compatible = "fsl,gianfar-mdio";
15745                         reg = <24520 20>;
15746 +
15747                         phy0: ethernet-phy@0 {
15748                                 interrupt-parent = <&mpic>;
15749                                 interrupts = <5 1>;
15750 @@ -103,9 +130,8 @@
15751                         };
15752                 };
15753  
15754 -               ethernet@24000 {
15755 -                       #address-cells = <1>;
15756 -                       #size-cells = <0>;
15757 +               enet0: ethernet@24000 {
15758 +                       cell-index = <0>;
15759                         device_type = "network";
15760                         model = "eTSEC";
15761                         compatible = "gianfar";
15762 @@ -116,9 +142,8 @@
15763                         phy-handle = <&phy0>;
15764                 };
15765  
15766 -               ethernet@25000 {
15767 -                       #address-cells = <1>;
15768 -                       #size-cells = <0>;
15769 +               enet1: ethernet@25000 {
15770 +                       cell-index = <1>;
15771                         device_type = "network";
15772                         model = "eTSEC";
15773                         compatible = "gianfar";
15774 @@ -130,9 +155,8 @@
15775                 };
15776  
15777  /* eTSEC 3/4 are currently broken
15778 -               ethernet@26000 {
15779 -                       #address-cells = <1>;
15780 -                       #size-cells = <0>;
15781 +               enet2: ethernet@26000 {
15782 +                       cell-index = <2>;
15783                         device_type = "network";
15784                         model = "eTSEC";
15785                         compatible = "gianfar";
15786 @@ -143,9 +167,8 @@
15787                         phy-handle = <&phy2>;
15788                 };
15789  
15790 -               ethernet@27000 {
15791 -                       #address-cells = <1>;
15792 -                       #size-cells = <0>;
15793 +               enet3: ethernet@27000 {
15794 +                       cell-index = <3>;
15795                         device_type = "network";
15796                         model = "eTSEC";
15797                         compatible = "gianfar";
15798 @@ -157,7 +180,8 @@
15799                 };
15800   */
15801  
15802 -               serial@4500 {
15803 +               serial0: serial@4500 {
15804 +                       cell-index = <0>;
15805                         device_type = "serial";
15806                         compatible = "ns16550";
15807                         reg = <4500 100>;       // reg base, size
15808 @@ -166,7 +190,8 @@
15809                         interrupt-parent = <&mpic>;
15810                 };
15811  
15812 -               serial@4600 {
15813 +               serial1: serial@4600 {
15814 +                       cell-index = <1>;
15815                         device_type = "serial";
15816                         compatible = "ns16550";
15817                         reg = <4600 100>;       // reg base, size
15818 @@ -193,7 +218,8 @@
15819                 };
15820         };
15821  
15822 -       pci@e0008000 {
15823 +       pci0: pci@e0008000 {
15824 +               cell-index = <0>;
15825                 interrupt-map-mask = <f800 0 0 7>;
15826                 interrupt-map = <
15827                         /* IDSEL 0x4 (PCIX Slot 2) */
15828 @@ -342,7 +368,8 @@
15829                 };
15830         };
15831  
15832 -       pci@e0009000 {
15833 +       pci1: pci@e0009000 {
15834 +               cell-index = <1>;
15835                 interrupt-map-mask = <f800 0 0 7>;
15836                 interrupt-map = <
15837  
15838 @@ -366,7 +393,8 @@
15839                 device_type = "pci";
15840         };
15841  
15842 -       pcie@e000a000 {
15843 +       pci2: pcie@e000a000 {
15844 +               cell-index = <2>;
15845                 interrupt-map-mask = <f800 0 0 7>;
15846                 interrupt-map = <
15847  
15848 --- a/arch/powerpc/boot/dts/mpc8555cds.dts
15849 +++ b/arch/powerpc/boot/dts/mpc8555cds.dts
15850 @@ -16,6 +16,15 @@
15851         #address-cells = <1>;
15852         #size-cells = <1>;
15853  
15854 +       aliases {
15855 +               ethernet0 = &enet0;
15856 +               ethernet1 = &enet1;
15857 +               serial0 = &serial0;
15858 +               serial1 = &serial1;
15859 +               pci0 = &pci0;
15860 +               pci1 = &pci1;
15861 +       };
15862 +
15863         cpus {
15864                 #address-cells = <1>;
15865                 #size-cells = <0>;
15866 @@ -63,7 +72,9 @@
15867                 };
15868  
15869                 i2c@3000 {
15870 -                       device_type = "i2c";
15871 +                       #address-cells = <1>;
15872 +                       #size-cells = <0>;
15873 +                       cell-index = <0>;
15874                         compatible = "fsl-i2c";
15875                         reg = <3000 100>;
15876                         interrupts = <2b 2>;
15877 @@ -74,9 +85,9 @@
15878                 mdio@24520 {
15879                         #address-cells = <1>;
15880                         #size-cells = <0>;
15881 -                       device_type = "mdio";
15882 -                       compatible = "gianfar";
15883 +                       compatible = "fsl,gianfar-mdio";
15884                         reg = <24520 20>;
15885 +
15886                         phy0: ethernet-phy@0 {
15887                                 interrupt-parent = <&mpic>;
15888                                 interrupts = <5 1>;
15889 @@ -91,9 +102,8 @@
15890                         };
15891                 };
15892  
15893 -               ethernet@24000 {
15894 -                       #address-cells = <1>;
15895 -                       #size-cells = <0>;
15896 +               enet0: ethernet@24000 {
15897 +                       cell-index = <0>;
15898                         device_type = "network";
15899                         model = "TSEC";
15900                         compatible = "gianfar";
15901 @@ -104,9 +114,8 @@
15902                         phy-handle = <&phy0>;
15903                 };
15904  
15905 -               ethernet@25000 {
15906 -                       #address-cells = <1>;
15907 -                       #size-cells = <0>;
15908 +               enet1: ethernet@25000 {
15909 +                       cell-index = <1>;
15910                         device_type = "network";
15911                         model = "TSEC";
15912                         compatible = "gianfar";
15913 @@ -117,7 +126,8 @@
15914                         phy-handle = <&phy1>;
15915                 };
15916  
15917 -               serial@4500 {
15918 +               serial0: serial@4500 {
15919 +                       cell-index = <0>;
15920                         device_type = "serial";
15921                         compatible = "ns16550";
15922                         reg = <4500 100>;       // reg base, size
15923 @@ -126,7 +136,8 @@
15924                         interrupt-parent = <&mpic>;
15925                 };
15926  
15927 -               serial@4600 {
15928 +               serial1: serial@4600 {
15929 +                       cell-index = <1>;
15930                         device_type = "serial";
15931                         compatible = "ns16550";
15932                         reg = <4600 100>;       // reg base, size
15933 @@ -183,7 +194,8 @@
15934                 };
15935         };
15936  
15937 -       pci1: pci@e0008000 {
15938 +       pci0: pci@e0008000 {
15939 +               cell-index = <0>;
15940                 interrupt-map-mask = <1f800 0 0 7>;
15941                 interrupt-map = <
15942  
15943 @@ -250,11 +262,12 @@
15944                         #interrupt-cells = <2>;
15945                         compatible = "chrp,iic";
15946                         interrupts = <1>;
15947 -                       interrupt-parent = <&pci1>;
15948 +                       interrupt-parent = <&pci0>;
15949                 };
15950         };
15951  
15952 -       pci@e0009000 {
15953 +       pci1: pci@e0009000 {
15954 +               cell-index = <1>;
15955                 interrupt-map-mask = <f800 0 0 7>;
15956                 interrupt-map = <
15957  
15958 --- a/arch/powerpc/boot/dts/mpc8560ads.dts
15959 +++ b/arch/powerpc/boot/dts/mpc8560ads.dts
15960 @@ -16,6 +16,16 @@
15961         #address-cells = <1>;
15962         #size-cells = <1>;
15963  
15964 +       aliases {
15965 +               ethernet0 = &enet0;
15966 +               ethernet1 = &enet1;
15967 +               ethernet2 = &enet2;
15968 +               ethernet3 = &enet3;
15969 +               serial0 = &serial0;
15970 +               serial1 = &serial1;
15971 +               pci0 = &pci0;
15972 +       };
15973 +
15974         cpus {
15975                 #address-cells = <1>;
15976                 #size-cells = <0>;
15977 @@ -63,11 +73,11 @@
15978                 };
15979  
15980                 mdio@24520 {
15981 -                       device_type = "mdio";
15982 -                       compatible = "gianfar";
15983 -                       reg = <24520 20>;
15984                         #address-cells = <1>;
15985                         #size-cells = <0>;
15986 +                       compatible = "fsl,gianfar-mdio";
15987 +                       reg = <24520 20>;
15988 +
15989                         phy0: ethernet-phy@0 {
15990                                 interrupt-parent = <&mpic>;
15991                                 interrupts = <5 1>;
15992 @@ -94,36 +104,24 @@
15993                         };
15994                 };
15995  
15996 -               ethernet@24000 {
15997 +               enet0: ethernet@24000 {
15998 +                       cell-index = <0>;
15999                         device_type = "network";
16000                         model = "TSEC";
16001                         compatible = "gianfar";
16002                         reg = <24000 1000>;
16003 -                       /*
16004 -                        * address is deprecated and will be removed
16005 -                        * in 2.6.25.  Only recent versions of
16006 -                        * U-Boot support local-mac-address, however.
16007 -                        */
16008 -                       address = [ 00 00 00 00 00 00 ];
16009                         local-mac-address = [ 00 00 00 00 00 00 ];
16010                         interrupts = <1d 2 1e 2 22 2>;
16011                         interrupt-parent = <&mpic>;
16012                         phy-handle = <&phy0>;
16013                 };
16014  
16015 -               ethernet@25000 {
16016 -                       #address-cells = <1>;
16017 -                       #size-cells = <0>;
16018 +               enet1: ethernet@25000 {
16019 +                       cell-index = <1>;
16020                         device_type = "network";
16021                         model = "TSEC";
16022                         compatible = "gianfar";
16023                         reg = <25000 1000>;
16024 -                       /*
16025 -                        * address is deprecated and will be removed
16026 -                        * in 2.6.25.  Only recent versions of
16027 -                        * U-Boot support local-mac-address, however.
16028 -                        */
16029 -                       address = [ 00 00 00 00 00 00 ];
16030                         local-mac-address = [ 00 00 00 00 00 00 ];
16031                         interrupts = <23 2 24 2 28 2>;
16032                         interrupt-parent = <&mpic>;
16033 @@ -174,7 +172,7 @@
16034                                 compatible = "fsl,mpc8560-cpm-pic", "fsl,cpm2-pic";
16035                         };
16036  
16037 -                       serial@91a00 {
16038 +                       serial0: serial@91a00 {
16039                                 device_type = "serial";
16040                                 compatible = "fsl,mpc8560-scc-uart",
16041                                              "fsl,cpm2-scc-uart";
16042 @@ -186,7 +184,7 @@
16043                                 interrupt-parent = <&cpmpic>;
16044                         };
16045  
16046 -                       serial@91a20 {
16047 +                       serial1: serial@91a20 {
16048                                 device_type = "serial";
16049                                 compatible = "fsl,mpc8560-scc-uart",
16050                                              "fsl,cpm2-scc-uart";
16051 @@ -198,17 +196,11 @@
16052                                 interrupt-parent = <&cpmpic>;
16053                         };
16054  
16055 -                       ethernet@91320 {
16056 +                       enet2: ethernet@91320 {
16057                                 device_type = "network";
16058                                 compatible = "fsl,mpc8560-fcc-enet",
16059                                              "fsl,cpm2-fcc-enet";
16060                                 reg = <91320 20 88500 100 913b0 1>;
16061 -                               /*
16062 -                                * mac-address is deprecated and will be removed
16063 -                                * in 2.6.25.  Only recent versions of
16064 -                                * U-Boot support local-mac-address, however.
16065 -                                */
16066 -                               mac-address = [ 00 00 00 00 00 00 ];
16067                                 local-mac-address = [ 00 00 00 00 00 00 ];
16068                                 fsl,cpm-command = <16200300>;
16069                                 interrupts = <21 8>;
16070 @@ -216,17 +208,11 @@
16071                                 phy-handle = <&phy2>;
16072                         };
16073  
16074 -                       ethernet@91340 {
16075 +                       enet3: ethernet@91340 {
16076                                 device_type = "network";
16077                                 compatible = "fsl,mpc8560-fcc-enet",
16078                                              "fsl,cpm2-fcc-enet";
16079                                 reg = <91340 20 88600 100 913d0 1>;
16080 -                               /*
16081 -                                * mac-address is deprecated and will be removed
16082 -                                * in 2.6.25.  Only recent versions of
16083 -                                * U-Boot support local-mac-address, however.
16084 -                                */
16085 -                               mac-address = [ 00 00 00 00 00 00 ];
16086                                 local-mac-address = [ 00 00 00 00 00 00 ];
16087                                 fsl,cpm-command = <1a400300>;
16088                                 interrupts = <22 8>;
16089 @@ -236,7 +222,8 @@
16090                 };
16091         };
16092  
16093 -       pci@e0008000 {
16094 +       pci0: pci@e0008000 {
16095 +               cell-index = <0>;
16096                 #interrupt-cells = <1>;
16097                 #size-cells = <2>;
16098                 #address-cells = <3>;
16099 --- a/arch/powerpc/boot/dts/mpc8568mds.dts
16100 +++ b/arch/powerpc/boot/dts/mpc8568mds.dts
16101 @@ -20,6 +20,17 @@
16102         #address-cells = <1>;
16103         #size-cells = <1>;
16104  
16105 +       aliases {
16106 +               ethernet0 = &enet0;
16107 +               ethernet1 = &enet1;
16108 +               ethernet2 = &enet2;
16109 +               ethernet3 = &enet3;
16110 +               serial0 = &serial0;
16111 +               serial1 = &serial1;
16112 +               pci0 = &pci0;
16113 +               pci1 = &pci1;
16114 +       };
16115 +
16116         cpus {
16117                 #address-cells = <1>;
16118                 #size-cells = <0>;
16119 @@ -74,7 +85,7 @@
16120                 i2c@3000 {
16121                         #address-cells = <1>;
16122                         #size-cells = <0>;
16123 -                       device_type = "i2c";
16124 +                       cell-index = <0>;
16125                         compatible = "fsl-i2c";
16126                         reg = <3000 100>;
16127                         interrupts = <2b 2>;
16128 @@ -90,7 +101,7 @@
16129                 i2c@3100 {
16130                         #address-cells = <1>;
16131                         #size-cells = <0>;
16132 -                       device_type = "i2c";
16133 +                       cell-index = <1>;
16134                         compatible = "fsl-i2c";
16135                         reg = <3100 100>;
16136                         interrupts = <2b 2>;
16137 @@ -101,9 +112,9 @@
16138                 mdio@24520 {
16139                         #address-cells = <1>;
16140                         #size-cells = <0>;
16141 -                       device_type = "mdio";
16142 -                       compatible = "gianfar";
16143 +                       compatible = "fsl,gianfar-mdio";
16144                         reg = <24520 20>;
16145 +
16146                         phy0: ethernet-phy@7 {
16147                                 interrupt-parent = <&mpic>;
16148                                 interrupts = <1 1>;
16149 @@ -130,45 +141,32 @@
16150                         };
16151                 };
16152  
16153 -               ethernet@24000 {
16154 -                       #address-cells = <1>;
16155 -                       #size-cells = <0>;
16156 +               enet0: ethernet@24000 {
16157 +                       cell-index = <0>;
16158                         device_type = "network";
16159                         model = "eTSEC";
16160                         compatible = "gianfar";
16161                         reg = <24000 1000>;
16162 -                       /*
16163 -                        * mac-address is deprecated and will be removed
16164 -                        * in 2.6.25.  Only recent versions of
16165 -                        * U-Boot support local-mac-address, however.
16166 -                        */
16167 -                       mac-address = [ 00 00 00 00 00 00 ];
16168                         local-mac-address = [ 00 00 00 00 00 00 ];
16169                         interrupts = <1d 2 1e 2 22 2>;
16170                         interrupt-parent = <&mpic>;
16171                         phy-handle = <&phy2>;
16172                 };
16173  
16174 -               ethernet@25000 {
16175 -                       #address-cells = <1>;
16176 -                       #size-cells = <0>;
16177 +               enet1: ethernet@25000 {
16178 +                       cell-index = <1>;
16179                         device_type = "network";
16180                         model = "eTSEC";
16181                         compatible = "gianfar";
16182                         reg = <25000 1000>;
16183 -                       /*
16184 -                        * mac-address is deprecated and will be removed
16185 -                        * in 2.6.25.  Only recent versions of
16186 -                        * U-Boot support local-mac-address, however.
16187 -                        */
16188 -                       mac-address = [ 00 00 00 00 00 00 ];
16189                         local-mac-address = [ 00 00 00 00 00 00 ];
16190                         interrupts = <23 2 24 2 28 2>;
16191                         interrupt-parent = <&mpic>;
16192                         phy-handle = <&phy3>;
16193                 };
16194  
16195 -               serial@4500 {
16196 +               serial0: serial@4500 {
16197 +                       cell-index = <0>;
16198                         device_type = "serial";
16199                         compatible = "ns16550";
16200                         reg = <4500 100>;
16201 @@ -183,7 +181,8 @@
16202                         fsl,has-rstcr;
16203                 };
16204  
16205 -               serial@4600 {
16206 +               serial1: serial@4600 {
16207 +                       cell-index = <1>;
16208                         device_type = "serial";
16209                         compatible = "ns16550";
16210                         reg = <4600 100>;
16211 @@ -318,45 +317,35 @@
16212                         mode = "cpu";
16213                 };
16214  
16215 -               ucc@2000 {
16216 +               enet2: ucc@2000 {
16217                         device_type = "network";
16218                         compatible = "ucc_geth";
16219                         model = "UCC";
16220 +                       cell-index = <1>;
16221                         device-id = <1>;
16222                         reg = <2000 200>;
16223                         interrupts = <20>;
16224                         interrupt-parent = <&qeic>;
16225 -                       /*
16226 -                        * mac-address is deprecated and will be removed
16227 -                        * in 2.6.25.  Only recent versions of
16228 -                        * U-Boot support local-mac-address, however.
16229 -                        */
16230 -                       mac-address = [ 00 00 00 00 00 00 ];
16231                         local-mac-address = [ 00 00 00 00 00 00 ];
16232 -                       rx-clock = <0>;
16233 -                       tx-clock = <20>;
16234 +                       rx-clock-name = "none";
16235 +                       tx-clock-name = "clk16";
16236                         pio-handle = <&pio1>;
16237                         phy-handle = <&phy0>;
16238                         phy-connection-type = "rgmii-id";
16239                 };
16240  
16241 -               ucc@3000 {
16242 +               enet3: ucc@3000 {
16243                         device_type = "network";
16244                         compatible = "ucc_geth";
16245                         model = "UCC";
16246 +                       cell-index = <2>;
16247                         device-id = <2>;
16248                         reg = <3000 200>;
16249                         interrupts = <21>;
16250                         interrupt-parent = <&qeic>;
16251 -                       /*
16252 -                        * mac-address is deprecated and will be removed
16253 -                        * in 2.6.25.  Only recent versions of
16254 -                        * U-Boot support local-mac-address, however.
16255 -                        */
16256 -                       mac-address = [ 00 00 00 00 00 00 ];
16257                         local-mac-address = [ 00 00 00 00 00 00 ];
16258 -                       rx-clock = <0>;
16259 -                       tx-clock = <20>;
16260 +                       rx-clock-name = "none";
16261 +                       tx-clock-name = "clk16";
16262                         pio-handle = <&pio2>;
16263                         phy-handle = <&phy1>;
16264                         phy-connection-type = "rgmii-id";
16265 @@ -366,7 +355,6 @@
16266                         #address-cells = <1>;
16267                         #size-cells = <0>;
16268                         reg = <2120 18>;
16269 -                       device_type = "mdio";
16270                         compatible = "ucc_geth_phy";
16271  
16272                         /* These are the same PHYs as on
16273 @@ -410,7 +398,8 @@
16274  
16275         };
16276  
16277 -       pci@e0008000 {
16278 +       pci0: pci@e0008000 {
16279 +               cell-index = <0>;
16280                 interrupt-map-mask = <f800 0 0 7>;
16281                 interrupt-map = <
16282                         /* IDSEL 0x12 AD18 */
16283 @@ -440,7 +429,8 @@
16284         };
16285  
16286         /* PCI Express */
16287 -       pcie@e000a000 {
16288 +       pci1: pcie@e000a000 {
16289 +               cell-index = <2>;
16290                 interrupt-map-mask = <f800 0 0 7>;
16291                 interrupt-map = <
16292  
16293 --- a/arch/powerpc/boot/dts/mpc8572ds.dts
16294 +++ b/arch/powerpc/boot/dts/mpc8572ds.dts
16295 @@ -15,6 +15,18 @@
16296         #address-cells = <1>;
16297         #size-cells = <1>;
16298  
16299 +       aliases {
16300 +               ethernet0 = &enet0;
16301 +               ethernet1 = &enet1;
16302 +               ethernet2 = &enet2;
16303 +               ethernet3 = &enet3;
16304 +               serial0 = &serial0;
16305 +               serial1 = &serial1;
16306 +               pci0 = &pci0;
16307 +               pci1 = &pci1;
16308 +               pci2 = &pci2;
16309 +       };
16310 +
16311         cpus {
16312                 #address-cells = <1>;
16313                 #size-cells = <0>;
16314 @@ -69,7 +81,9 @@
16315                 };
16316  
16317                 i2c@3000 {
16318 -                       device_type = "i2c";
16319 +                       #address-cells = <1>;
16320 +                       #size-cells = <0>;
16321 +                       cell-index = <0>;
16322                         compatible = "fsl-i2c";
16323                         reg = <3000 100>;
16324                         interrupts = <2b 2>;
16325 @@ -78,7 +92,9 @@
16326                 };
16327  
16328                 i2c@3100 {
16329 -                       device_type = "i2c";
16330 +                       #address-cells = <1>;
16331 +                       #size-cells = <0>;
16332 +                       cell-index = <1>;
16333                         compatible = "fsl-i2c";
16334                         reg = <3100 100>;
16335                         interrupts = <2b 2>;
16336 @@ -89,9 +105,9 @@
16337                 mdio@24520 {
16338                         #address-cells = <1>;
16339                         #size-cells = <0>;
16340 -                       device_type = "mdio";
16341 -                       compatible = "gianfar";
16342 +                       compatible = "fsl,gianfar-mdio";
16343                         reg = <24520 20>;
16344 +
16345                         phy0: ethernet-phy@0 {
16346                                 interrupt-parent = <&mpic>;
16347                                 interrupts = <a 1>;
16348 @@ -114,9 +130,8 @@
16349                         };
16350                 };
16351  
16352 -               ethernet@24000 {
16353 -                       #address-cells = <1>;
16354 -                       #size-cells = <0>;
16355 +               enet0: ethernet@24000 {
16356 +                       cell-index = <0>;
16357                         device_type = "network";
16358                         model = "eTSEC";
16359                         compatible = "gianfar";
16360 @@ -128,9 +143,8 @@
16361                         phy-connection-type = "rgmii-id";
16362                 };
16363  
16364 -               ethernet@25000 {
16365 -                       #address-cells = <1>;
16366 -                       #size-cells = <0>;
16367 +               enet1: ethernet@25000 {
16368 +                       cell-index = <1>;
16369                         device_type = "network";
16370                         model = "eTSEC";
16371                         compatible = "gianfar";
16372 @@ -142,9 +156,8 @@
16373                         phy-connection-type = "rgmii-id";
16374                 };
16375  
16376 -               ethernet@26000 {
16377 -                       #address-cells = <1>;
16378 -                       #size-cells = <0>;
16379 +               enet2: ethernet@26000 {
16380 +                       cell-index = <2>;
16381                         device_type = "network";
16382                         model = "eTSEC";
16383                         compatible = "gianfar";
16384 @@ -156,9 +169,8 @@
16385                         phy-connection-type = "rgmii-id";
16386                 };
16387  
16388 -               ethernet@27000 {
16389 -                       #address-cells = <1>;
16390 -                       #size-cells = <0>;
16391 +               enet3: ethernet@27000 {
16392 +                       cell-index = <3>;
16393                         device_type = "network";
16394                         model = "eTSEC";
16395                         compatible = "gianfar";
16396 @@ -170,7 +182,8 @@
16397                         phy-connection-type = "rgmii-id";
16398                 };
16399  
16400 -               serial@4500 {
16401 +               serial0: serial@4500 {
16402 +                       cell-index = <0>;
16403                         device_type = "serial";
16404                         compatible = "ns16550";
16405                         reg = <4500 100>;
16406 @@ -179,7 +192,8 @@
16407                         interrupt-parent = <&mpic>;
16408                 };
16409  
16410 -               serial@4600 {
16411 +               serial1: serial@4600 {
16412 +                       cell-index = <1>;
16413                         device_type = "serial";
16414                         compatible = "ns16550";
16415                         reg = <4600 100>;
16416 @@ -206,7 +220,8 @@
16417                 };
16418         };
16419  
16420 -       pcie@ffe08000 {
16421 +       pci0: pcie@ffe08000 {
16422 +               cell-index = <0>;
16423                 compatible = "fsl,mpc8548-pcie";
16424                 device_type = "pci";
16425                 #interrupt-cells = <1>;
16426 @@ -319,9 +334,9 @@
16427  
16428                         // IDSEL 0x1c  USB
16429                         e000 0 0 1 &i8259 c 2
16430 -                       e100 0 0 1 &i8259 9 2
16431 -                       e200 0 0 1 &i8259 a 2
16432 -                       e300 0 0 1 &i8259 b 2
16433 +                       e100 0 0 2 &i8259 9 2
16434 +                       e200 0 0 3 &i8259 a 2
16435 +                       e300 0 0 4 &i8259 b 2
16436  
16437                         // IDSEL 0x1d  Audio
16438                         e800 0 0 1 &i8259 6 2
16439 @@ -415,7 +430,8 @@
16440  
16441         };
16442  
16443 -       pcie@ffe09000 {
16444 +       pci1: pcie@ffe09000 {
16445 +               cell-index = <1>;
16446                 compatible = "fsl,mpc8548-pcie";
16447                 device_type = "pci";
16448                 #interrupt-cells = <1>;
16449 @@ -451,7 +467,8 @@
16450                 };
16451         };
16452  
16453 -       pcie@ffe0a000 {
16454 +       pci2: pcie@ffe0a000 {
16455 +               cell-index = <2>;
16456                 compatible = "fsl,mpc8548-pcie";
16457                 device_type = "pci";
16458                 #interrupt-cells = <1>;
16459 @@ -464,6 +481,7 @@
16460                 clock-frequency = <1fca055>;
16461                 interrupt-parent = <&mpic>;
16462                 interrupts = <1b 2>;
16463 +               interrupt-map-mask = <f800 0 0 7>;
16464                 interrupt-map = <
16465                         /* IDSEL 0x0 */
16466                         0000 0 0 1 &mpic 0 1
16467 --- a/arch/powerpc/boot/dts/mpc8610_hpcd.dts
16468 +++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
16469 @@ -1,7 +1,7 @@
16470  /*
16471   * MPC8610 HPCD Device Tree Source
16472   *
16473 - * Copyright 2007 Freescale Semiconductor Inc.
16474 + * Copyright 2007-2008 Freescale Semiconductor Inc.
16475   *
16476   * This program is free software; you can redistribute  it and/or modify it
16477   * under the terms of the GNU General Public License Version 2 as published
16478 @@ -15,6 +15,13 @@
16479         #address-cells = <1>;
16480         #size-cells = <1>;
16481  
16482 +       aliases {
16483 +               serial0 = &serial0;
16484 +               serial1 = &serial1;
16485 +               pci0 = &pci0;
16486 +               pci1 = &pci1;
16487 +       };
16488 +
16489         cpus {
16490                 #address-cells = <1>;
16491                 #size-cells = <0>;
16492 @@ -42,33 +49,42 @@
16493                 #size-cells = <1>;
16494                 #interrupt-cells = <2>;
16495                 device_type = "soc";
16496 +               compatible = "fsl,mpc8610-immr", "simple-bus";
16497                 ranges = <0 e0000000 00100000>;
16498                 reg = <e0000000 1000>;
16499                 bus-frequency = <0>;
16500  
16501                 i2c@3000 {
16502 -                       device_type = "i2c";
16503 -                       compatible = "fsl-i2c";
16504                         #address-cells = <1>;
16505                         #size-cells = <0>;
16506 +                       cell-index = <0>;
16507 +                       compatible = "fsl-i2c";
16508                         reg = <3000 100>;
16509                         interrupts = <2b 2>;
16510                         interrupt-parent = <&mpic>;
16511                         dfsrr;
16512 +
16513 +                        cs4270:codec@4f {
16514 +                               compatible = "cirrus,cs4270";
16515 +                                reg = <4f>;
16516 +                               /* MCLK source is a stand-alone oscillator */
16517 +                               clock-frequency = <bb8000>;
16518 +                        };
16519                 };
16520  
16521                 i2c@3100 {
16522 -                       device_type = "i2c";
16523 -                       compatible = "fsl-i2c";
16524                         #address-cells = <1>;
16525                         #size-cells = <0>;
16526 +                       cell-index = <1>;
16527 +                       compatible = "fsl-i2c";
16528                         reg = <3100 100>;
16529                         interrupts = <2b 2>;
16530                         interrupt-parent = <&mpic>;
16531                         dfsrr;
16532                 };
16533  
16534 -               serial@4500 {
16535 +               serial0: serial@4500 {
16536 +                       cell-index = <0>;
16537                         device_type = "serial";
16538                         compatible = "ns16550";
16539                         reg = <4500 100>;
16540 @@ -77,7 +93,8 @@
16541                         interrupt-parent = <&mpic>;
16542                 };
16543  
16544 -               serial@4600 {
16545 +               serial1: serial@4600 {
16546 +                       cell-index = <1>;
16547                         device_type = "serial";
16548                         compatible = "ns16550";
16549                         reg = <4600 100>;
16550 @@ -86,7 +103,6 @@
16551                         interrupt-parent = <&mpic>;
16552                 };
16553  
16554 -
16555                 mpic: interrupt-controller@40000 {
16556                         clock-frequency = <0>;
16557                         interrupt-controller;
16558 @@ -103,9 +119,113 @@
16559                         reg = <e0000 1000>;
16560                         fsl,has-rstcr;
16561                 };
16562 +
16563 +               i2s@16000 {
16564 +                       compatible = "fsl,mpc8610-ssi";
16565 +                       cell-index = <0>;
16566 +                       reg = <16000 100>;
16567 +                       interrupt-parent = <&mpic>;
16568 +                       interrupts = <3e 2>;
16569 +                       fsl,mode = "i2s-slave";
16570 +                       codec-handle = <&cs4270>;
16571 +               };
16572 +
16573 +               ssi@16100 {
16574 +                       compatible = "fsl,mpc8610-ssi";
16575 +                       cell-index = <1>;
16576 +                       reg = <16100 100>;
16577 +                       interrupt-parent = <&mpic>;
16578 +                       interrupts = <3f 2>;
16579 +               };
16580 +
16581 +                dma@21300 {
16582 +                        #address-cells = <1>;
16583 +                        #size-cells = <1>;
16584 +                        compatible = "fsl,mpc8610-dma", "fsl,eloplus-dma";
16585 +                        cell-index = <0>;
16586 +                        reg = <21300 4>; /* DMA general status register */
16587 +                        ranges = <0 21100 200>;
16588 +
16589 +                        dma-channel@0 {
16590 +                               compatible = "fsl,mpc8610-dma-channel",
16591 +                                       "fsl,eloplus-dma-channel";
16592 +                               cell-index = <0>;
16593 +                               reg = <0 80>;
16594 +                               interrupt-parent = <&mpic>;
16595 +                               interrupts = <14 2>;
16596 +                        };
16597 +                        dma-channel@1 {
16598 +                               compatible = "fsl,mpc8610-dma-channel",
16599 +                                       "fsl,eloplus-dma-channel";
16600 +                               cell-index = <1>;
16601 +                               reg = <80 80>;
16602 +                               interrupt-parent = <&mpic>;
16603 +                               interrupts = <15 2>;
16604 +                        };
16605 +                        dma-channel@2 {
16606 +                               compatible = "fsl,mpc8610-dma-channel",
16607 +                                       "fsl,eloplus-dma-channel";
16608 +                               cell-index = <2>;
16609 +                               reg = <100 80>;
16610 +                               interrupt-parent = <&mpic>;
16611 +                               interrupts = <16 2>;
16612 +                        };
16613 +                        dma-channel@3 {
16614 +                               compatible = "fsl,mpc8610-dma-channel",
16615 +                                       "fsl,eloplus-dma-channel";
16616 +                               cell-index = <3>;
16617 +                               reg = <180 80>;
16618 +                               interrupt-parent = <&mpic>;
16619 +                               interrupts = <17 2>;
16620 +                        };
16621 +                };
16622 +
16623 +                dma@c300 {
16624 +                        #address-cells = <1>;
16625 +                        #size-cells = <1>;
16626 +                        compatible = "fsl,mpc8610-dma", "fsl,mpc8540-dma";
16627 +                        cell-index = <1>;
16628 +                        reg = <c300 4>; /* DMA general status register */
16629 +                        ranges = <0 c100 200>;
16630 +
16631 +                        dma-channel@0 {
16632 +                               compatible = "fsl,mpc8610-dma-channel",
16633 +                                       "fsl,mpc8540-dma-channel";
16634 +                               cell-index = <0>;
16635 +                               reg = <0 80>;
16636 +                               interrupt-parent = <&mpic>;
16637 +                               interrupts = <3c 2>;
16638 +                        };
16639 +                        dma-channel@1 {
16640 +                               compatible = "fsl,mpc8610-dma-channel",
16641 +                                       "fsl,mpc8540-dma-channel";
16642 +                               cell-index = <1>;
16643 +                               reg = <80 80>;
16644 +                               interrupt-parent = <&mpic>;
16645 +                               interrupts = <3d 2>;
16646 +                        };
16647 +                        dma-channel@2 {
16648 +                               compatible = "fsl,mpc8610-dma-channel",
16649 +                                       "fsl,mpc8540-dma-channel";
16650 +                               cell-index = <2>;
16651 +                               reg = <100 80>;
16652 +                               interrupt-parent = <&mpic>;
16653 +                               interrupts = <3e 2>;
16654 +                        };
16655 +                        dma-channel@3 {
16656 +                               compatible = "fsl,mpc8610-dma-channel",
16657 +                                       "fsl,mpc8540-dma-channel";
16658 +                               cell-index = <3>;
16659 +                               reg = <180 80>;
16660 +                               interrupt-parent = <&mpic>;
16661 +                               interrupts = <3f 2>;
16662 +                        };
16663 +                };
16664 +
16665         };
16666  
16667 -       pci@e0008000 {
16668 +       pci0: pci@e0008000 {
16669 +               cell-index = <0>;
16670                 compatible = "fsl,mpc8610-pci";
16671                 device_type = "pci";
16672                 #interrupt-cells = <1>;
16673 @@ -134,7 +254,8 @@
16674                         >;
16675         };
16676  
16677 -       pcie@e000a000 {
16678 +       pci1: pcie@e000a000 {
16679 +               cell-index = <1>;
16680                 compatible = "fsl,mpc8641-pcie";
16681                 device_type = "pci";
16682                 #interrupt-cells = <1>;
16683 --- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
16684 +++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
16685 @@ -16,6 +16,17 @@
16686         #address-cells = <1>;
16687         #size-cells = <1>;
16688  
16689 +       aliases {
16690 +               ethernet0 = &enet0;
16691 +               ethernet1 = &enet1;
16692 +               ethernet2 = &enet2;
16693 +               ethernet3 = &enet3;
16694 +               serial0 = &serial0;
16695 +               serial1 = &serial1;
16696 +               pci0 = &pci0;
16697 +               pci1 = &pci1;
16698 +       };
16699 +
16700         cpus {
16701                 #address-cells = <1>;
16702                 #size-cells = <0>;
16703 @@ -49,16 +60,60 @@
16704                 reg = <00000000 40000000>;      // 1G at 0x0
16705         };
16706  
16707 +       localbus@f8005000 {
16708 +               #address-cells = <2>;
16709 +               #size-cells = <1>;
16710 +               compatible = "fsl,mpc8641-localbus", "simple-bus";
16711 +               reg = <f8005000 1000>;
16712 +               interrupts = <13 2>;
16713 +               interrupt-parent = <&mpic>;
16714 +
16715 +               ranges = <0 0 ff800000 00800000
16716 +                         1 0 fe000000 01000000
16717 +                         2 0 f8200000 00100000
16718 +                         3 0 f8100000 00100000>;
16719 +
16720 +               flash@0,0 {
16721 +                       compatible = "cfi-flash";
16722 +                       reg = <0 0 00800000>;
16723 +                       bank-width = <2>;
16724 +                       device-width = <2>;
16725 +                       #address-cells = <1>;
16726 +                       #size-cells = <1>;
16727 +                       partition@0 {
16728 +                               label = "kernel";
16729 +                               reg = <00000000 00300000>;
16730 +                       };
16731 +                       partition@300000 {
16732 +                               label = "firmware b";
16733 +                               reg = <00300000 00100000>;
16734 +                               read-only;
16735 +                       };
16736 +                       partition@400000 {
16737 +                               label = "fs";
16738 +                               reg = <00400000 00300000>;
16739 +                       };
16740 +                       partition@700000 {
16741 +                               label = "firmware a";
16742 +                               reg = <00700000 00100000>;
16743 +                               read-only;
16744 +                       };
16745 +               };
16746 +       };
16747 +
16748         soc8641@f8000000 {
16749                 #address-cells = <1>;
16750                 #size-cells = <1>;
16751                 device_type = "soc";
16752 +               compatible = "simple-bus";
16753                 ranges = <00000000 f8000000 00100000>;
16754                 reg = <f8000000 00001000>;      // CCSRBAR
16755                 bus-frequency = <0>;
16756  
16757                 i2c@3000 {
16758 -                       device_type = "i2c";
16759 +                       #address-cells = <1>;
16760 +                       #size-cells = <0>;
16761 +                       cell-index = <0>;
16762                         compatible = "fsl-i2c";
16763                         reg = <3000 100>;
16764                         interrupts = <2b 2>;
16765 @@ -67,7 +122,9 @@
16766                 };
16767  
16768                 i2c@3100 {
16769 -                       device_type = "i2c";
16770 +                       #address-cells = <1>;
16771 +                       #size-cells = <0>;
16772 +                       cell-index = <1>;
16773                         compatible = "fsl-i2c";
16774                         reg = <3100 100>;
16775                         interrupts = <2b 2>;
16776 @@ -78,9 +135,9 @@
16777                 mdio@24520 {
16778                         #address-cells = <1>;
16779                         #size-cells = <0>;
16780 -                       device_type = "mdio";
16781 -                       compatible = "gianfar";
16782 +                       compatible = "fsl,gianfar-mdio";
16783                         reg = <24520 20>;
16784 +
16785                         phy0: ethernet-phy@0 {
16786                                 interrupt-parent = <&mpic>;
16787                                 interrupts = <a 1>;
16788 @@ -107,19 +164,12 @@
16789                         };
16790                 };
16791  
16792 -               ethernet@24000 {
16793 -                       #address-cells = <1>;
16794 -                       #size-cells = <0>;
16795 +               enet0: ethernet@24000 {
16796 +                       cell-index = <0>;
16797                         device_type = "network";
16798                         model = "TSEC";
16799                         compatible = "gianfar";
16800                         reg = <24000 1000>;
16801 -                       /*
16802 -                        * mac-address is deprecated and will be removed
16803 -                        * in 2.6.25.  Only recent versions of
16804 -                        * U-Boot support local-mac-address, however.
16805 -                        */
16806 -                       mac-address = [ 00 00 00 00 00 00 ];
16807                         local-mac-address = [ 00 00 00 00 00 00 ];
16808                         interrupts = <1d 2 1e 2 22 2>;
16809                         interrupt-parent = <&mpic>;
16810 @@ -127,19 +177,12 @@
16811                         phy-connection-type = "rgmii-id";
16812                 };
16813  
16814 -               ethernet@25000 {
16815 -                       #address-cells = <1>;
16816 -                       #size-cells = <0>;
16817 +               enet1: ethernet@25000 {
16818 +                       cell-index = <1>;
16819                         device_type = "network";
16820                         model = "TSEC";
16821                         compatible = "gianfar";
16822                         reg = <25000 1000>;
16823 -                       /*
16824 -                        * mac-address is deprecated and will be removed
16825 -                        * in 2.6.25.  Only recent versions of
16826 -                        * U-Boot support local-mac-address, however.
16827 -                        */
16828 -                       mac-address = [ 00 00 00 00 00 00 ];
16829                         local-mac-address = [ 00 00 00 00 00 00 ];
16830                         interrupts = <23 2 24 2 28 2>;
16831                         interrupt-parent = <&mpic>;
16832 @@ -147,19 +190,12 @@
16833                         phy-connection-type = "rgmii-id";
16834                 };
16835                 
16836 -               ethernet@26000 {
16837 -                       #address-cells = <1>;
16838 -                       #size-cells = <0>;
16839 +               enet2: ethernet@26000 {
16840 +                       cell-index = <2>;
16841                         device_type = "network";
16842                         model = "TSEC";
16843                         compatible = "gianfar";
16844                         reg = <26000 1000>;
16845 -                       /*
16846 -                        * mac-address is deprecated and will be removed
16847 -                        * in 2.6.25.  Only recent versions of
16848 -                        * U-Boot support local-mac-address, however.
16849 -                        */
16850 -                       mac-address = [ 00 00 00 00 00 00 ];
16851                         local-mac-address = [ 00 00 00 00 00 00 ];
16852                         interrupts = <1F 2 20 2 21 2>;
16853                         interrupt-parent = <&mpic>;
16854 @@ -167,26 +203,21 @@
16855                         phy-connection-type = "rgmii-id";
16856                 };
16857  
16858 -               ethernet@27000 {
16859 -                       #address-cells = <1>;
16860 -                       #size-cells = <0>;
16861 +               enet3: ethernet@27000 {
16862 +                       cell-index = <3>;
16863                         device_type = "network";
16864                         model = "TSEC";
16865                         compatible = "gianfar";
16866                         reg = <27000 1000>;
16867 -                       /*
16868 -                        * mac-address is deprecated and will be removed
16869 -                        * in 2.6.25.  Only recent versions of
16870 -                        * U-Boot support local-mac-address, however.
16871 -                        */
16872 -                       mac-address = [ 00 00 00 00 00 00 ];
16873                         local-mac-address = [ 00 00 00 00 00 00 ];
16874                         interrupts = <25 2 26 2 27 2>;
16875                         interrupt-parent = <&mpic>;
16876                         phy-handle = <&phy3>;
16877                         phy-connection-type = "rgmii-id";
16878                 };
16879 -               serial@4500 {
16880 +
16881 +               serial0: serial@4500 {
16882 +                       cell-index = <0>;
16883                         device_type = "serial";
16884                         compatible = "ns16550";
16885                         reg = <4500 100>;
16886 @@ -195,7 +226,8 @@
16887                         interrupt-parent = <&mpic>;
16888                 };
16889  
16890 -               serial@4600 {
16891 +               serial1: serial@4600 {
16892 +                       cell-index = <1>;
16893                         device_type = "serial";
16894                         compatible = "ns16550";
16895                         reg = <4600 100>;
16896 @@ -222,7 +254,8 @@
16897                 };
16898         };
16899  
16900 -       pcie@f8008000 {
16901 +       pci0: pcie@f8008000 {
16902 +               cell-index = <0>;
16903                 compatible = "fsl,mpc8641-pcie";
16904                 device_type = "pci";
16905                 #interrupt-cells = <1>;
16906 @@ -335,9 +368,9 @@
16907  
16908                         // IDSEL 0x1c  USB
16909                         e000 0 0 1 &i8259 c 2
16910 -                       e100 0 0 1 &i8259 9 2
16911 -                       e200 0 0 1 &i8259 a 2
16912 -                       e300 0 0 1 &i8259 b 2
16913 +                       e100 0 0 2 &i8259 9 2
16914 +                       e200 0 0 3 &i8259 a 2
16915 +                       e300 0 0 4 &i8259 b 2
16916  
16917                         // IDSEL 0x1d  Audio
16918                         e800 0 0 1 &i8259 6 2
16919 @@ -430,7 +463,8 @@
16920  
16921         };
16922  
16923 -       pcie@f8009000 {
16924 +       pci1: pcie@f8009000 {
16925 +               cell-index = <1>;
16926                 compatible = "fsl,mpc8641-pcie";
16927                 device_type = "pci";
16928                 #interrupt-cells = <1>;
16929 --- a/arch/powerpc/boot/dts/mpc866ads.dts
16930 +++ b/arch/powerpc/boot/dts/mpc866ads.dts
16931 @@ -12,7 +12,7 @@
16932  
16933  / {
16934         model = "MPC866ADS";
16935 -       compatible = "mpc8xx";
16936 +       compatible = "fsl,mpc866ads";
16937         #address-cells = <1>;
16938         #size-cells = <1>;
16939  
16940 @@ -23,15 +23,15 @@
16941                 PowerPC,866@0 {
16942                         device_type = "cpu";
16943                         reg = <0>;
16944 -                       d-cache-line-size = <20>;       // 32 bytes
16945 -                       i-cache-line-size = <20>;       // 32 bytes
16946 +                       d-cache-line-size = <10>;       // 16 bytes
16947 +                       i-cache-line-size = <10>;       // 16 bytes
16948                         d-cache-size = <2000>;          // L1, 8K
16949                         i-cache-size = <4000>;          // L1, 16K
16950                         timebase-frequency = <0>;
16951                         bus-frequency = <0>;
16952                         clock-frequency = <0>;
16953                         interrupts = <f 2>;     // decrementer interrupt
16954 -                       interrupt-parent = <&Mpc8xx_pic>;
16955 +                       interrupt-parent = <&PIC>;
16956                 };
16957         };
16958  
16959 @@ -40,107 +40,139 @@
16960                 reg = <00000000 800000>;
16961         };
16962  
16963 -       soc866@ff000000 {
16964 +       localbus@ff000100 {
16965 +               compatible = "fsl,mpc866-localbus", "fsl,pq1-localbus";
16966 +               #address-cells = <2>;
16967 +               #size-cells = <1>;
16968 +               reg = <ff000100 40>;
16969 +
16970 +               ranges = <
16971 +                       1 0 ff080000 00008000
16972 +                       5 0 ff0a0000 00008000
16973 +               >;
16974 +
16975 +               board-control@1,0 {
16976 +                       reg = <1 0 20 5 300 4>;
16977 +                       compatible = "fsl,mpc866ads-bcsr";
16978 +               };
16979 +       };
16980 +
16981 +       soc@ff000000 {
16982                 #address-cells = <1>;
16983                 #size-cells = <1>;
16984                 device_type = "soc";
16985                 ranges = <0 ff000000 00100000>;
16986                 reg = <ff000000 00000200>;
16987                 bus-frequency = <0>;
16988 -               mdio@e80 {
16989 -                       device_type = "mdio";
16990 -                       compatible = "fs_enet";
16991 -                       reg = <e80 8>;
16992 +
16993 +               mdio@e00 {
16994 +                       compatible = "fsl,mpc866-fec-mdio", "fsl,pq1-fec-mdio";
16995 +                       reg = <e00 188>;
16996                         #address-cells = <1>;
16997                         #size-cells = <0>;
16998 -                       phy: ethernet-phy@f {
16999 +                       PHY: ethernet-phy@f {
17000                                 reg = <f>;
17001                                 device_type = "ethernet-phy";
17002                         };
17003                 };
17004  
17005 -               fec@e00 {
17006 +               ethernet@e00 {
17007                         device_type = "network";
17008 -                       compatible = "fs_enet";
17009 -                       model = "FEC";
17010 -                       device-id = <1>;
17011 +                       compatible = "fsl,mpc866-fec-enet",
17012 +                                    "fsl,pq1-fec-enet";
17013                         reg = <e00 188>;
17014 -                       mac-address = [ 00 00 0C 00 01 FD ];
17015 +                       local-mac-address = [ 00 00 00 00 00 00 ];
17016                         interrupts = <3 1>;
17017 -                       interrupt-parent = <&Mpc8xx_pic>;
17018 -                       phy-handle = <&Phy>;
17019 +                       interrupt-parent = <&PIC>;
17020 +                       phy-handle = <&PHY>;
17021 +                       linux,network-index = <0>;
17022                 };
17023  
17024 -               mpc8xx_pic: pic@ff000000 {
17025 +               PIC: pic@0 {
17026                         interrupt-controller;
17027 -                       #address-cells = <0>;
17028                         #interrupt-cells = <2>;
17029                         reg = <0 24>;
17030 -                       device_type = "mpc8xx-pic";
17031 -                       compatible = "CPM";
17032 +                       compatible = "fsl,mpc866-pic", "fsl,pq1-pic";
17033                 };
17034  
17035 -               cpm@ff000000 {
17036 +               cpm@9c0 {
17037                         #address-cells = <1>;
17038                         #size-cells = <1>;
17039 -                       device_type = "cpm";
17040 -                       model = "CPM";
17041 -                       ranges = <0 0 4000>;
17042 -                       reg = <860 f0>;
17043 -                       command-proc = <9c0>;
17044 +                       compatible = "fsl,mpc866-cpm", "fsl,cpm1";
17045 +                       ranges;
17046 +                       reg = <9c0 40>;
17047                         brg-frequency = <0>;
17048                         interrupts = <0 2>;     // cpm error interrupt
17049 -                       interrupt-parent = <&Cpm_pic>;
17050 +                       interrupt-parent = <&CPM_PIC>;
17051  
17052 -                       cpm_pic: pic@930 {
17053 +                       muram@2000 {
17054 +                               #address-cells = <1>;
17055 +                               #size-cells = <1>;
17056 +                               ranges = <0 2000 2000>;
17057 +
17058 +                               data@0 {
17059 +                                       compatible = "fsl,cpm-muram-data";
17060 +                                       reg = <0 1c00>;
17061 +                               };
17062 +                       };
17063 +
17064 +                       brg@9f0 {
17065 +                               compatible = "fsl,mpc866-brg",
17066 +                                            "fsl,cpm1-brg",
17067 +                                            "fsl,cpm-brg";
17068 +                               reg = <9f0 10>;
17069 +                               clock-frequency = <0>;
17070 +                       };
17071 +
17072 +                       CPM_PIC: pic@930 {
17073                                 interrupt-controller;
17074                                 #address-cells = <0>;
17075 -                               #interrupt-cells = <2>;
17076 +                               #interrupt-cells = <1>;
17077                                 interrupts = <5 2 0 2>;
17078 -                               interrupt-parent = <&Mpc8xx_pic>;
17079 +                               interrupt-parent = <&PIC>;
17080                                 reg = <930 20>;
17081 -                               device_type = "cpm-pic";
17082 -                               compatible = "CPM";
17083 +                               compatible = "fsl,mpc866-cpm-pic",
17084 +                                            "fsl,cpm1-pic";
17085                         };
17086  
17087 -                       smc@a80 {
17088 +
17089 +                       serial@a80 {
17090                                 device_type = "serial";
17091 -                               compatible = "cpm_uart";
17092 -                               model = "SMC";
17093 -                               device-id = <1>;
17094 +                               compatible = "fsl,mpc866-smc-uart",
17095 +                                            "fsl,cpm1-smc-uart";
17096                                 reg = <a80 10 3e80 40>;
17097 -                               clock-setup = <00ffffff 0>;
17098 -                               rx-clock = <1>;
17099 -                               tx-clock = <1>;
17100 -                               current-speed = <0>;
17101 -                               interrupts = <4 3>;
17102 -                               interrupt-parent = <&Cpm_pic>;
17103 +                               interrupts = <4>;
17104 +                               interrupt-parent = <&CPM_PIC>;
17105 +                               fsl,cpm-brg = <1>;
17106 +                               fsl,cpm-command = <0090>;
17107                         };
17108  
17109 -                       smc@a90 {
17110 +                       serial@a90 {
17111                                 device_type = "serial";
17112 -                               compatible = "cpm_uart";
17113 -                               model = "SMC";
17114 -                               device-id = <2>;
17115 -                               reg = <a90 20 3f80 40>;
17116 -                               clock-setup = <ff00ffff 90000>;
17117 -                               rx-clock = <2>;
17118 -                               tx-clock = <2>;
17119 -                               current-speed = <0>;
17120 -                               interrupts = <3 3>;
17121 -                               interrupt-parent = <&Cpm_pic>;
17122 +                               compatible = "fsl,mpc866-smc-uart",
17123 +                                            "fsl,cpm1-smc-uart";
17124 +                               reg = <a90 10 3f80 40>;
17125 +                               interrupts = <3>;
17126 +                               interrupt-parent = <&CPM_PIC>;
17127 +                               fsl,cpm-brg = <2>;
17128 +                               fsl,cpm-command = <00d0>;
17129                         };
17130  
17131 -                       scc@a00 {
17132 +                       ethernet@a00 {
17133                                 device_type = "network";
17134 -                               compatible = "fs_enet";
17135 -                               model = "SCC";
17136 -                               device-id = <1>;
17137 -                               reg = <a00 18 3c00 80>;
17138 -                               mac-address = [ 00 00 0C 00 03 FD ];
17139 -                               interrupts = <1e 3>;
17140 -                               interrupt-parent = <&Cpm_pic>;
17141 +                               compatible = "fsl,mpc866-scc-enet",
17142 +                                            "fsl,cpm1-scc-enet";
17143 +                               reg = <a00 18 3c00 100>;
17144 +                               local-mac-address = [ 00 00 00 00 00 00 ];
17145 +                               interrupts = <1e>;
17146 +                               interrupt-parent = <&CPM_PIC>;
17147 +                               fsl,cpm-command = <0000>;
17148 +                               linux,network-index = <1>;
17149                         };
17150                 };
17151         };
17152 +
17153 +       chosen {
17154 +               linux,stdout-path = "/soc/cpm/serial@a80";
17155 +       };
17156  };
17157 --- /dev/null
17158 +++ b/arch/powerpc/boot/dts/rainier.dts
17159 @@ -0,0 +1,353 @@
17160 +/*
17161 + * Device Tree Source for AMCC Rainier
17162 + *
17163 + * Based on Sequoia code
17164 + * Copyright (c) 2007 MontaVista Software, Inc.
17165 + *
17166 + * FIXME: Draft only!
17167 + *
17168 + * This file is licensed under the terms of the GNU General Public
17169 + * License version 2.  This program is licensed "as is" without
17170 + * any warranty of any kind, whether express or implied.
17171 + *
17172 + */
17173 +
17174 +/ {
17175 +       #address-cells = <2>;
17176 +       #size-cells = <1>;
17177 +       model = "amcc,rainier";
17178 +       compatible = "amcc,rainier";
17179 +       dcr-parent = <&/cpus/cpu@0>;
17180 +
17181 +       aliases {
17182 +               ethernet0 = &EMAC0;
17183 +               ethernet1 = &EMAC1;
17184 +               serial0 = &UART0;
17185 +               serial1 = &UART1;
17186 +               serial2 = &UART2;
17187 +               serial3 = &UART3;
17188 +       };
17189 +
17190 +       cpus {
17191 +               #address-cells = <1>;
17192 +               #size-cells = <0>;
17193 +
17194 +               cpu@0 {
17195 +                       device_type = "cpu";
17196 +                       model = "PowerPC,440GRx";
17197 +                       reg = <0>;
17198 +                       clock-frequency = <0>; /* Filled in by zImage */
17199 +                       timebase-frequency = <0>; /* Filled in by zImage */
17200 +                       i-cache-line-size = <20>;
17201 +                       d-cache-line-size = <20>;
17202 +                       i-cache-size = <8000>;
17203 +                       d-cache-size = <8000>;
17204 +                       dcr-controller;
17205 +                       dcr-access-method = "native";
17206 +               };
17207 +       };
17208 +
17209 +       memory {
17210 +               device_type = "memory";
17211 +               reg = <0 0 0>; /* Filled in by zImage */
17212 +       };
17213 +
17214 +       UIC0: interrupt-controller0 {
17215 +               compatible = "ibm,uic-440grx","ibm,uic";
17216 +               interrupt-controller;
17217 +               cell-index = <0>;
17218 +               dcr-reg = <0c0 009>;
17219 +               #address-cells = <0>;
17220 +               #size-cells = <0>;
17221 +               #interrupt-cells = <2>;
17222 +       };
17223 +
17224 +       UIC1: interrupt-controller1 {
17225 +               compatible = "ibm,uic-440grx","ibm,uic";
17226 +               interrupt-controller;
17227 +               cell-index = <1>;
17228 +               dcr-reg = <0d0 009>;
17229 +               #address-cells = <0>;
17230 +               #size-cells = <0>;
17231 +               #interrupt-cells = <2>;
17232 +               interrupts = <1e 4 1f 4>; /* cascade */
17233 +               interrupt-parent = <&UIC0>;
17234 +       };
17235 +
17236 +       UIC2: interrupt-controller2 {
17237 +               compatible = "ibm,uic-440grx","ibm,uic";
17238 +               interrupt-controller;
17239 +               cell-index = <2>;
17240 +               dcr-reg = <0e0 009>;
17241 +               #address-cells = <0>;
17242 +               #size-cells = <0>;
17243 +               #interrupt-cells = <2>;
17244 +               interrupts = <1c 4 1d 4>; /* cascade */
17245 +               interrupt-parent = <&UIC0>;
17246 +       };
17247 +
17248 +       SDR0: sdr {
17249 +               compatible = "ibm,sdr-440grx", "ibm,sdr-440ep";
17250 +               dcr-reg = <00e 002>;
17251 +       };
17252 +
17253 +       CPR0: cpr {
17254 +               compatible = "ibm,cpr-440grx", "ibm,cpr-440ep";
17255 +               dcr-reg = <00c 002>;
17256 +       };
17257 +
17258 +       plb {
17259 +               compatible = "ibm,plb-440grx", "ibm,plb4";
17260 +               #address-cells = <2>;
17261 +               #size-cells = <1>;
17262 +               ranges;
17263 +               clock-frequency = <0>; /* Filled in by zImage */
17264 +
17265 +               SDRAM0: sdram {
17266 +                       compatible = "ibm,sdram-440grx", "ibm,sdram-44x-ddr2denali";
17267 +                       dcr-reg = <010 2>;
17268 +               };
17269 +
17270 +               DMA0: dma {
17271 +                       compatible = "ibm,dma-440grx", "ibm,dma-4xx";
17272 +                       dcr-reg = <100 027>;
17273 +               };
17274 +
17275 +               MAL0: mcmal {
17276 +                       compatible = "ibm,mcmal-440grx", "ibm,mcmal2";
17277 +                       dcr-reg = <180 62>;
17278 +                       num-tx-chans = <2>;
17279 +                       num-rx-chans = <2>;
17280 +                       interrupt-parent = <&MAL0>;
17281 +                       interrupts = <0 1 2 3 4>;
17282 +                       #interrupt-cells = <1>;
17283 +                       #address-cells = <0>;
17284 +                       #size-cells = <0>;
17285 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
17286 +                                       /*RXEOB*/ 1 &UIC0 b 4
17287 +                                       /*SERR*/  2 &UIC1 0 4
17288 +                                       /*TXDE*/  3 &UIC1 1 4
17289 +                                       /*RXDE*/  4 &UIC1 2 4>;
17290 +                       interrupt-map-mask = <ffffffff>;
17291 +               };
17292 +
17293 +               POB0: opb {
17294 +                       compatible = "ibm,opb-440grx", "ibm,opb";
17295 +                       #address-cells = <1>;
17296 +                       #size-cells = <1>;
17297 +                       ranges = <00000000 1 00000000 80000000
17298 +                                 80000000 1 80000000 80000000>;
17299 +                       interrupt-parent = <&UIC1>;
17300 +                       interrupts = <7 4>;
17301 +                       clock-frequency = <0>; /* Filled in by zImage */
17302 +
17303 +                       EBC0: ebc {
17304 +                               compatible = "ibm,ebc-440grx", "ibm,ebc";
17305 +                               dcr-reg = <012 2>;
17306 +                               #address-cells = <2>;
17307 +                               #size-cells = <1>;
17308 +                               clock-frequency = <0>; /* Filled in by zImage */
17309 +                               interrupts = <5 1>;
17310 +                               interrupt-parent = <&UIC1>;
17311 +
17312 +                               nor_flash@0,0 {
17313 +                                       compatible = "amd,s29gl256n", "cfi-flash";
17314 +                                       bank-width = <2>;
17315 +                                       reg = <0 000000 4000000>;
17316 +                                       #address-cells = <1>;
17317 +                                       #size-cells = <1>;
17318 +                                       partition@0 {
17319 +                                               label = "Kernel";
17320 +                                               reg = <0 180000>;
17321 +                                       };
17322 +                                       partition@180000 {
17323 +                                               label = "ramdisk";
17324 +                                               reg = <180000 200000>;
17325 +                                       };
17326 +                                       partition@380000 {
17327 +                                               label = "file system";
17328 +                                               reg = <380000 3aa0000>;
17329 +                                       };
17330 +                                       partition@3e20000 {
17331 +                                               label = "kozio";
17332 +                                               reg = <3e20000 140000>;
17333 +                                       };
17334 +                                       partition@3f60000 {
17335 +                                               label = "env";
17336 +                                               reg = <3f60000 40000>;
17337 +                                       };
17338 +                                       partition@3fa0000 {
17339 +                                               label = "u-boot";
17340 +                                               reg = <3fa0000 60000>;
17341 +                                       };
17342 +                               };
17343 +
17344 +                       };
17345 +
17346 +                       UART0: serial@ef600300 {
17347 +                               device_type = "serial";
17348 +                               compatible = "ns16550";
17349 +                               reg = <ef600300 8>;
17350 +                               virtual-reg = <ef600300>;
17351 +                               clock-frequency = <0>; /* Filled in by zImage */
17352 +                               current-speed = <1c200>;
17353 +                               interrupt-parent = <&UIC0>;
17354 +                               interrupts = <0 4>;
17355 +                       };
17356 +
17357 +                       UART1: serial@ef600400 {
17358 +                               device_type = "serial";
17359 +                               compatible = "ns16550";
17360 +                               reg = <ef600400 8>;
17361 +                               virtual-reg = <ef600400>;
17362 +                               clock-frequency = <0>;
17363 +                               current-speed = <0>;
17364 +                               interrupt-parent = <&UIC0>;
17365 +                               interrupts = <1 4>;
17366 +                       };
17367 +
17368 +                       UART2: serial@ef600500 {
17369 +                               device_type = "serial";
17370 +                               compatible = "ns16550";
17371 +                               reg = <ef600500 8>;
17372 +                               virtual-reg = <ef600500>;
17373 +                               clock-frequency = <0>;
17374 +                               current-speed = <0>;
17375 +                               interrupt-parent = <&UIC1>;
17376 +                               interrupts = <3 4>;
17377 +                       };
17378 +
17379 +                       UART3: serial@ef600600 {
17380 +                               device_type = "serial";
17381 +                               compatible = "ns16550";
17382 +                               reg = <ef600600 8>;
17383 +                               virtual-reg = <ef600600>;
17384 +                               clock-frequency = <0>;
17385 +                               current-speed = <0>;
17386 +                               interrupt-parent = <&UIC1>;
17387 +                               interrupts = <4 4>;
17388 +                       };
17389 +
17390 +                       IIC0: i2c@ef600700 {
17391 +                               device_type = "i2c";
17392 +                               compatible = "ibm,iic-440grx", "ibm,iic";
17393 +                               reg = <ef600700 14>;
17394 +                               interrupt-parent = <&UIC0>;
17395 +                               interrupts = <2 4>;
17396 +                       };
17397 +
17398 +                       IIC1: i2c@ef600800 {
17399 +                               device_type = "i2c";
17400 +                               compatible = "ibm,iic-440grx", "ibm,iic";
17401 +                               reg = <ef600800 14>;
17402 +                               interrupt-parent = <&UIC0>;
17403 +                               interrupts = <7 4>;
17404 +                       };
17405 +
17406 +                       ZMII0: emac-zmii@ef600d00 {
17407 +                               device_type = "zmii-interface";
17408 +                               compatible = "ibm,zmii-440grx", "ibm,zmii";
17409 +                               reg = <ef600d00 c>;
17410 +                       };
17411 +
17412 +                       RGMII0: emac-rgmii@ef601000 {
17413 +                               device_type = "rgmii-interface";
17414 +                               compatible = "ibm,rgmii-440grx", "ibm,rgmii";
17415 +                               reg = <ef601000 8>;
17416 +                               has-mdio;
17417 +                       };
17418 +
17419 +                       EMAC0: ethernet@ef600e00 {
17420 +                               linux,network-index = <0>;
17421 +                               device_type = "network";
17422 +                               compatible = "ibm,emac-440grx", "ibm,emac-440epx", "ibm,emac4";
17423 +                               interrupt-parent = <&EMAC0>;
17424 +                               interrupts = <0 1>;
17425 +                               #interrupt-cells = <1>;
17426 +                               #address-cells = <0>;
17427 +                               #size-cells = <0>;
17428 +                               interrupt-map = </*Status*/ 0 &UIC0 18 4
17429 +                                               /*Wake*/  1 &UIC1 1d 4>;
17430 +                               reg = <ef600e00 70>;
17431 +                               local-mac-address = [000000000000];
17432 +                               mal-device = <&MAL0>;
17433 +                               mal-tx-channel = <0>;
17434 +                               mal-rx-channel = <0>;
17435 +                               cell-index = <0>;
17436 +                               max-frame-size = <5dc>;
17437 +                               rx-fifo-size = <1000>;
17438 +                               tx-fifo-size = <800>;
17439 +                               phy-mode = "rgmii";
17440 +                               phy-map = <00000000>;
17441 +                               zmii-device = <&ZMII0>;
17442 +                               zmii-channel = <0>;
17443 +                               rgmii-device = <&RGMII0>;
17444 +                               rgmii-channel = <0>;
17445 +                               has-inverted-stacr-oc;
17446 +                               has-new-stacr-staopc;
17447 +                       };
17448 +
17449 +                       EMAC1: ethernet@ef600f00 {
17450 +                               linux,network-index = <1>;
17451 +                               device_type = "network";
17452 +                               compatible = "ibm,emac-440grx", "ibm,emac-440epx", "ibm,emac4";
17453 +                               interrupt-parent = <&EMAC1>;
17454 +                               interrupts = <0 1>;
17455 +                               #interrupt-cells = <1>;
17456 +                               #address-cells = <0>;
17457 +                               #size-cells = <0>;
17458 +                               interrupt-map = </*Status*/ 0 &UIC0 19 4
17459 +                                               /*Wake*/  1 &UIC1 1f 4>;
17460 +                               reg = <ef600f00 70>;
17461 +                               local-mac-address = [000000000000];
17462 +                               mal-device = <&MAL0>;
17463 +                               mal-tx-channel = <1>;
17464 +                               mal-rx-channel = <1>;
17465 +                               cell-index = <1>;
17466 +                               max-frame-size = <5dc>;
17467 +                               rx-fifo-size = <1000>;
17468 +                               tx-fifo-size = <800>;
17469 +                               phy-mode = "rgmii";
17470 +                               phy-map = <00000000>;
17471 +                               zmii-device = <&ZMII0>;
17472 +                               zmii-channel = <1>;
17473 +                               rgmii-device = <&RGMII0>;
17474 +                               rgmii-channel = <1>;
17475 +                               has-inverted-stacr-oc;
17476 +                               has-new-stacr-staopc;
17477 +                       };
17478 +               };
17479 +
17480 +               PCI0: pci@1ec000000 {
17481 +                       device_type = "pci";
17482 +                       #interrupt-cells = <1>;
17483 +                       #size-cells = <2>;
17484 +                       #address-cells = <3>;
17485 +                       compatible = "ibm,plb440grx-pci", "ibm,plb-pci";
17486 +                       primary;
17487 +                       reg = <1 eec00000 8     /* Config space access */
17488 +                              1 eed00000 4     /* IACK */
17489 +                              1 eed00000 4     /* Special cycle */
17490 +                              1 ef400000 40>;  /* Internal registers */
17491 +
17492 +                       /* Outbound ranges, one memory and one IO,
17493 +                        * later cannot be changed. Chip supports a second
17494 +                        * IO range but we don't use it for now
17495 +                        */
17496 +                       ranges = <02000000 0 80000000 1 80000000 0 10000000
17497 +                               01000000 0 00000000 1 e8000000 0 00100000>;
17498 +
17499 +                       /* Inbound 2GB range starting at 0 */
17500 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
17501 +
17502 +                       /* All PCI interrupts are routed to IRQ 67 */
17503 +                       interrupt-map-mask = <0000 0 0 0>;
17504 +                       interrupt-map = < 0000 0 0 0 &UIC2 3 8 >;
17505 +               };
17506 +       };
17507 +
17508 +       chosen {
17509 +               linux,stdout-path = "/plb/opb/serial@ef600300";
17510 +               bootargs = "console=ttyS0,115200";
17511 +       };
17512 +};
17513 --- a/arch/powerpc/boot/dts/sequoia.dts
17514 +++ b/arch/powerpc/boot/dts/sequoia.dts
17515 @@ -17,14 +17,24 @@
17516         #size-cells = <1>;
17517         model = "amcc,sequoia";
17518         compatible = "amcc,sequoia";
17519 -       dcr-parent = <&/cpus/PowerPC,440EPx@0>;
17520 +       dcr-parent = <&/cpus/cpu@0>;
17521 +
17522 +       aliases {
17523 +               ethernet0 = &EMAC0;
17524 +               ethernet1 = &EMAC1;
17525 +               serial0 = &UART0;
17526 +               serial1 = &UART1;
17527 +               serial2 = &UART2;
17528 +               serial3 = &UART3;
17529 +       };
17530  
17531         cpus {
17532                 #address-cells = <1>;
17533                 #size-cells = <0>;
17534  
17535 -               PowerPC,440EPx@0 {
17536 +               cpu@0 {
17537                         device_type = "cpu";
17538 +                       model = "PowerPC,440EPx";
17539                         reg = <0>;
17540                         clock-frequency = <0>; /* Filled in by zImage */
17541                         timebase-frequency = <0>; /* Filled in by zImage */
17542 @@ -94,7 +104,6 @@
17543                 clock-frequency = <0>; /* Filled in by zImage */
17544  
17545                 SDRAM0: sdram {
17546 -                       device_type = "memory-controller";
17547                         compatible = "ibm,sdram-440epx", "ibm,sdram-44x-ddr2denali";
17548                         dcr-reg = <010 2>;
17549                 };
17550 @@ -122,6 +131,13 @@
17551                         interrupt-map-mask = <ffffffff>;
17552                 };
17553  
17554 +               USB1: usb@e0000400 {
17555 +                       compatible = "ohci-be";
17556 +                       reg = <0 e0000400 60>;
17557 +                       interrupt-parent = <&UIC0>;
17558 +                       interrupts = <15 8>;
17559 +               };
17560 +
17561                 POB0: opb {
17562                         compatible = "ibm,opb-440epx", "ibm,opb";
17563                         #address-cells = <1>;
17564 @@ -308,6 +324,33 @@
17565                                 has-new-stacr-staopc;
17566                         };
17567                 };
17568 +
17569 +               PCI0: pci@1ec000000 {
17570 +                       device_type = "pci";
17571 +                       #interrupt-cells = <1>;
17572 +                       #size-cells = <2>;
17573 +                       #address-cells = <3>;
17574 +                       compatible = "ibm,plb440epx-pci", "ibm,plb-pci";
17575 +                       primary;
17576 +                       reg = <1 eec00000 8     /* Config space access */
17577 +                              1 eed00000 4     /* IACK */
17578 +                              1 eed00000 4     /* Special cycle */
17579 +                              1 ef400000 40>;  /* Internal registers */
17580 +
17581 +                       /* Outbound ranges, one memory and one IO,
17582 +                        * later cannot be changed. Chip supports a second
17583 +                        * IO range but we don't use it for now
17584 +                        */
17585 +                       ranges = <02000000 0 80000000 1 80000000 0 10000000
17586 +                               01000000 0 00000000 1 e8000000 0 00100000>;
17587 +
17588 +                       /* Inbound 2GB range starting at 0 */
17589 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
17590 +
17591 +                       /* All PCI interrupts are routed to IRQ 67 */
17592 +                       interrupt-map-mask = <0000 0 0 0>;
17593 +                       interrupt-map = < 0000 0 0 0 &UIC2 3 8 >;
17594 +               };
17595         };
17596  
17597         chosen {
17598 --- /dev/null
17599 +++ b/arch/powerpc/boot/dts/storcenter.dts
17600 @@ -0,0 +1,138 @@
17601 +/*
17602 + * Device Tree Source for IOMEGA StorCenter
17603 + *
17604 + * Copyright 2007 Oyvind Repvik
17605 + * Copyright 2007 Jon Loeliger
17606 + *
17607 + * Based on the Kurobox DTS by G. Liakhovetski <g.liakhovetski@gmx.de>
17608 + *
17609 + * This file is licensed under the terms of the GNU General Public
17610 + * License version 2.  This program is licensed "as is" without any
17611 + * warranty of any kind, whether express or implied.
17612 + */
17613 +
17614 +/ {
17615 +       model = "StorCenter";
17616 +       compatible = "storcenter";
17617 +       #address-cells = <1>;
17618 +       #size-cells = <1>;
17619 +
17620 +       aliases {
17621 +               serial0 = &serial0;
17622 +               serial1 = &serial1;
17623 +               pci0 = &pci0;
17624 +       };
17625 +
17626 +       cpus {
17627 +               #address-cells = <1>;
17628 +               #size-cells = <0>;
17629 +
17630 +               PowerPC,8241@0 {
17631 +                       device_type = "cpu";
17632 +                       reg = <0>;
17633 +                       clock-frequency = <d# 200000000>;       /* Hz */
17634 +                       timebase-frequency = <d# 25000000>;     /* Hz */
17635 +                       bus-frequency = <0>;    /* from bootwrapper */
17636 +                       i-cache-line-size = <d# 32>;    /* bytes */
17637 +                       d-cache-line-size = <d# 32>;    /* bytes */
17638 +                       i-cache-size = <4000>;
17639 +                       d-cache-size = <4000>;
17640 +               };
17641 +       };
17642 +
17643 +       memory {
17644 +               device_type = "memory";
17645 +               reg = <00000000 04000000>;      /* 64MB @ 0x0 */
17646 +       };
17647 +
17648 +       soc@fc000000 {
17649 +               #address-cells = <1>;
17650 +               #size-cells = <1>;
17651 +               device_type = "soc";
17652 +               compatible = "fsl,mpc8241", "mpc10x";
17653 +               store-gathering = <0>; /* 0 == off, !0 == on */
17654 +               ranges = <0 fc000000 100000>;
17655 +               reg = <fc000000 100000>;        /* EUMB */
17656 +               bus-frequency = <0>;            /* fixed by loader */
17657 +
17658 +               i2c@3000 {
17659 +                       #address-cells = <1>;
17660 +                       #size-cells = <0>;
17661 +                       compatible = "fsl-i2c";
17662 +                       reg = <3000 100>;
17663 +                       interrupts = <5 2>;
17664 +                       interrupt-parent = <&mpic>;
17665 +
17666 +                       rtc@68 {
17667 +                               compatible = "dallas,ds1337";
17668 +                               reg = <68>;
17669 +                       };
17670 +               };
17671 +
17672 +               serial0: serial@4500 {
17673 +                       cell-index = <0>;
17674 +                       device_type = "serial";
17675 +                       compatible = "ns16550";
17676 +                       reg = <4500 20>;
17677 +                       clock-frequency = <d# 97553800>; /* Hz */
17678 +                       current-speed = <d# 115200>;
17679 +                       interrupts = <9 2>;
17680 +                       interrupt-parent = <&mpic>;
17681 +               };
17682 +
17683 +               serial1: serial@4600 {
17684 +                       cell-index = <1>;
17685 +                       device_type = "serial";
17686 +                       compatible = "ns16550";
17687 +                       reg = <4600 20>;
17688 +                       clock-frequency = <d# 97553800>; /* Hz */
17689 +                       current-speed = <d# 9600>;
17690 +                       interrupts = <a 2>;
17691 +                       interrupt-parent = <&mpic>;
17692 +               };
17693 +
17694 +               mpic: interrupt-controller@40000 {
17695 +                       #interrupt-cells = <2>;
17696 +                       device_type = "open-pic";
17697 +                       compatible = "chrp,open-pic";
17698 +                       interrupt-controller;
17699 +                       reg = <40000 40000>;
17700 +               };
17701 +
17702 +       };
17703 +
17704 +       pci0: pci@fe800000 {
17705 +               #address-cells = <3>;
17706 +               #size-cells = <2>;
17707 +               #interrupt-cells = <1>;
17708 +               device_type = "pci";
17709 +               compatible = "mpc10x-pci";
17710 +               reg = <fe800000 1000>;
17711 +               ranges = <01000000 0        0 fe000000 0 00c00000
17712 +                         02000000 0 80000000 80000000 0 70000000>;
17713 +               bus-range = <0 ff>;
17714 +               clock-frequency = <d# 97553800>; /* Hz */
17715 +               interrupt-parent = <&mpic>;
17716 +               interrupt-map-mask = <f800 0 0 7>;
17717 +               interrupt-map = <
17718 +                       /* IDSEL 13 - IDE */
17719 +                       6800 0 0 1 &mpic 0 1
17720 +                       6800 0 0 2 &mpic 0 1
17721 +                       6800 0 0 3 &mpic 0 1
17722 +                       /* IDSEL 14 - USB */
17723 +                       7000 0 0 1 &mpic 0 1
17724 +                       7000 0 0 2 &mpic 0 1
17725 +                       7000 0 0 3 &mpic 0 1
17726 +                       7000 0 0 4 &mpic 0 1
17727 +                       /* IDSEL 15 - ETH */
17728 +                       7800 0 0 1 &mpic 0 1
17729 +                       7800 0 0 2 &mpic 0 1
17730 +                       7800 0 0 3 &mpic 0 1
17731 +                       7800 0 0 4 &mpic 0 1
17732 +               >;
17733 +       };
17734 +
17735 +       chosen {
17736 +               linux,stdout-path = "/soc/serial@4500";
17737 +       };
17738 +};
17739 --- /dev/null
17740 +++ b/arch/powerpc/boot/dts/taishan.dts
17741 @@ -0,0 +1,383 @@
17742 +/*
17743 + * Device Tree Source for IBM/AMCC Taishan
17744 + *
17745 + * Copyright 2007 IBM Corp.
17746 + * Hugh Blemings <hugh@au.ibm.com> based off code by
17747 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>, David Gibson <dwg@au1.ibm.com>
17748 + *
17749 + * This file is licensed under the terms of the GNU General Public
17750 + * License version 2.  This program is licensed "as is" without
17751 + * any warranty of any kind, whether express or implied.
17752 + */
17753 +
17754 +/ {
17755 +       #address-cells = <2>;
17756 +       #size-cells = <1>;
17757 +       model = "amcc,taishan";
17758 +       compatible = "amcc,taishan";
17759 +       dcr-parent = <&/cpus/cpu@0>;
17760 +
17761 +       aliases {
17762 +               ethernet0 = &EMAC2;
17763 +               ethernet1 = &EMAC3;
17764 +               serial0 = &UART0;
17765 +               serial1 = &UART1;
17766 +       };
17767 +
17768 +       cpus {
17769 +               #address-cells = <1>;
17770 +               #size-cells = <0>;
17771 +
17772 +               cpu@0 {
17773 +                       device_type = "cpu";
17774 +                       model = "PowerPC,440GX";
17775 +                       reg = <0>;
17776 +                       clock-frequency = <2FAF0800>; // 800MHz
17777 +                       timebase-frequency = <0>; // Filled in by zImage
17778 +                       i-cache-line-size = <32>;
17779 +                       d-cache-line-size = <32>;
17780 +                       i-cache-size = <8000>; /* 32 kB */
17781 +                       d-cache-size = <8000>; /* 32 kB */
17782 +                       dcr-controller;
17783 +                       dcr-access-method = "native";
17784 +               };
17785 +       };
17786 +
17787 +       memory {
17788 +               device_type = "memory";
17789 +               reg = <0 0 0>; // Filled in by zImage
17790 +       };
17791 +
17792 +
17793 +       UICB0: interrupt-controller-base {
17794 +               compatible = "ibm,uic-440gx", "ibm,uic";
17795 +               interrupt-controller;
17796 +               cell-index = <3>;
17797 +               dcr-reg = <200 009>;
17798 +               #address-cells = <0>;
17799 +               #size-cells = <0>;
17800 +               #interrupt-cells = <2>;
17801 +       };
17802 +
17803 +
17804 +       UIC0: interrupt-controller0 {
17805 +               compatible = "ibm,uic-440gx", "ibm,uic";
17806 +               interrupt-controller;
17807 +               cell-index = <0>;
17808 +               dcr-reg = <0c0 009>;
17809 +               #address-cells = <0>;
17810 +               #size-cells = <0>;
17811 +               #interrupt-cells = <2>;
17812 +               interrupts = <01 4 00 4>; /* cascade - first non-critical */
17813 +               interrupt-parent = <&UICB0>;
17814 +
17815 +       };
17816 +
17817 +       UIC1: interrupt-controller1 {
17818 +               compatible = "ibm,uic-440gx", "ibm,uic";
17819 +               interrupt-controller;
17820 +               cell-index = <1>;
17821 +               dcr-reg = <0d0 009>;
17822 +               #address-cells = <0>;
17823 +               #size-cells = <0>;
17824 +               #interrupt-cells = <2>;
17825 +               interrupts = <03 4 02 4>; /* cascade */
17826 +               interrupt-parent = <&UICB0>;
17827 +       };
17828 +
17829 +       UIC2: interrupt-controller2 {
17830 +               compatible = "ibm,uic-440gx", "ibm,uic";
17831 +               interrupt-controller;
17832 +               cell-index = <2>; /* was 1 */
17833 +               dcr-reg = <210 009>;
17834 +               #address-cells = <0>;
17835 +               #size-cells = <0>;
17836 +               #interrupt-cells = <2>;
17837 +               interrupts = <05 4 04 4>; /* cascade */
17838 +               interrupt-parent = <&UICB0>;
17839 +       };
17840 +
17841 +
17842 +       CPC0: cpc {
17843 +               compatible = "ibm,cpc-440gp";
17844 +               dcr-reg = <0b0 003 0e0 010>;
17845 +               // FIXME: anything else?
17846 +       };
17847 +
17848 +       plb {
17849 +               compatible = "ibm,plb-440gx", "ibm,plb4";
17850 +               #address-cells = <2>;
17851 +               #size-cells = <1>;
17852 +               ranges;
17853 +               clock-frequency = <9896800>; // 160MHz
17854 +
17855 +               SDRAM0: memory-controller {
17856 +                       compatible = "ibm,sdram-440gp";
17857 +                       dcr-reg = <010 2>;
17858 +                       // FIXME: anything else?
17859 +               };
17860 +
17861 +               SRAM0: sram {
17862 +                       compatible = "ibm,sram-440gp";
17863 +                       dcr-reg = <020 8 00a 1>;
17864 +               };
17865 +
17866 +               DMA0: dma {
17867 +                       // FIXME: ???
17868 +                       compatible = "ibm,dma-440gp";
17869 +                       dcr-reg = <100 027>;
17870 +               };
17871 +
17872 +               MAL0: mcmal {
17873 +                       compatible = "ibm,mcmal-440gx", "ibm,mcmal2";
17874 +                       dcr-reg = <180 62>;
17875 +                       num-tx-chans = <4>;
17876 +                       num-rx-chans = <4>;
17877 +                       interrupt-parent = <&MAL0>;
17878 +                       interrupts = <0 1 2 3 4>;
17879 +                       #interrupt-cells = <1>;
17880 +                       #address-cells = <0>;
17881 +                       #size-cells = <0>;
17882 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
17883 +                                        /*RXEOB*/ 1 &UIC0 b 4
17884 +                                        /*SERR*/  2 &UIC1 0 4
17885 +                                        /*TXDE*/  3 &UIC1 1 4
17886 +                                        /*RXDE*/  4 &UIC1 2 4>;
17887 +                       interrupt-map-mask = <ffffffff>;
17888 +               };
17889 +
17890 +               POB0: opb {
17891 +                       compatible = "ibm,opb-440gx", "ibm,opb";
17892 +                       #address-cells = <1>;
17893 +                       #size-cells = <1>;
17894 +                       /* Wish there was a nicer way of specifying a full 32-bit
17895 +                          range */
17896 +                       ranges = <00000000 1 00000000 80000000
17897 +                                 80000000 1 80000000 80000000>;
17898 +                       dcr-reg = <090 00b>;
17899 +                       interrupt-parent = <&UIC1>;
17900 +                       interrupts = <7 4>;
17901 +                       clock-frequency = <4C4B400>; // 80MHz
17902 +
17903 +
17904 +                       EBC0: ebc {
17905 +                               compatible = "ibm,ebc-440gx", "ibm,ebc";
17906 +                               dcr-reg = <012 2>;
17907 +                               #address-cells = <2>;
17908 +                               #size-cells = <1>;
17909 +                               clock-frequency = <4C4B400>; // 80MHz
17910 +
17911 +                               /* ranges property is supplied by zImage
17912 +                                * based on firmware's configuration of the
17913 +                                * EBC bridge */
17914 +
17915 +                               interrupts = <5 4>;
17916 +                               interrupt-parent = <&UIC1>;
17917 +
17918 +                               /* TODO: Add other EBC devices */
17919 +                       };
17920 +
17921 +
17922 +
17923 +                       UART0: serial@40000200 {
17924 +                               device_type = "serial";
17925 +                               compatible = "ns16550";
17926 +                               reg = <40000200 8>;
17927 +                               virtual-reg = <e0000200>;
17928 +                               clock-frequency = <A8C000>;
17929 +                               current-speed = <1C200>; /* 115200 */
17930 +                               interrupt-parent = <&UIC0>;
17931 +                               interrupts = <0 4>;
17932 +                       };
17933 +
17934 +                       UART1: serial@40000300 {
17935 +                               device_type = "serial";
17936 +                               compatible = "ns16550";
17937 +                               reg = <40000300 8>;
17938 +                               virtual-reg = <e0000300>;
17939 +                               clock-frequency = <A8C000>;
17940 +                               current-speed = <1C200>; /* 115200 */
17941 +                               interrupt-parent = <&UIC0>;
17942 +                               interrupts = <1 4>;
17943 +                       };
17944 +
17945 +                       IIC0: i2c@40000400 {
17946 +                               /* FIXME */
17947 +                               device_type = "i2c";
17948 +                               compatible = "ibm,iic-440gp", "ibm,iic";
17949 +                               reg = <40000400 14>;
17950 +                               interrupt-parent = <&UIC0>;
17951 +                               interrupts = <2 4>;
17952 +                       };
17953 +                       IIC1: i2c@40000500 {
17954 +                               /* FIXME */
17955 +                               device_type = "i2c";
17956 +                               compatible = "ibm,iic-440gp", "ibm,iic";
17957 +                               reg = <40000500 14>;
17958 +                               interrupt-parent = <&UIC0>;
17959 +                               interrupts = <3 4>;
17960 +                       };
17961 +
17962 +                       GPIO0: gpio@40000700 {
17963 +                               /* FIXME */
17964 +                               compatible = "ibm,gpio-440gp";
17965 +                               reg = <40000700 20>;
17966 +                       };
17967 +
17968 +                       ZMII0: emac-zmii@40000780 {
17969 +                               device_type = "zgmii-interface";
17970 +                               compatible = "ibm,zmii-440gx", "ibm,zmii";
17971 +                               reg = <40000780 c>;
17972 +                       };
17973 +
17974 +                       RGMII0: emac-rgmii@40000790 {
17975 +                               device_type = "rgmii-interface";
17976 +                               compatible = "ibm,rgmii";
17977 +                               reg = <40000790 8>;
17978 +                       };
17979 +
17980 +
17981 +                       EMAC0: ethernet@40000800 {
17982 +                               unused = <1>;
17983 +                               linux,network-index = <2>;
17984 +                               device_type = "network";
17985 +                               compatible = "ibm,emac-440gx", "ibm,emac4";
17986 +                               interrupt-parent = <&UIC1>;
17987 +                               interrupts = <1c 4 1d 4>;
17988 +                               reg = <40000800 70>;
17989 +                               local-mac-address = [000000000000]; // Filled in by zImage
17990 +                               mal-device = <&MAL0>;
17991 +                               mal-tx-channel = <0>;
17992 +                               mal-rx-channel = <0>;
17993 +                               cell-index = <0>;
17994 +                               max-frame-size = <5dc>;
17995 +                               rx-fifo-size = <1000>;
17996 +                               tx-fifo-size = <800>;
17997 +                               phy-mode = "rmii";
17998 +                               phy-map = <00000001>;
17999 +                               zmii-device = <&ZMII0>;
18000 +                               zmii-channel = <0>;
18001 +                       };
18002 +                       EMAC1: ethernet@40000900 {
18003 +                               unused = <1>;
18004 +                               linux,network-index = <3>;
18005 +                               device_type = "network";
18006 +                               compatible = "ibm,emac-440gx", "ibm,emac4";
18007 +                               interrupt-parent = <&UIC1>;
18008 +                               interrupts = <1e 4 1f 4>;
18009 +                               reg = <40000900 70>;
18010 +                               local-mac-address = [000000000000]; // Filled in by zImage
18011 +                               mal-device = <&MAL0>;
18012 +                               mal-tx-channel = <1>;
18013 +                               mal-rx-channel = <1>;
18014 +                               cell-index = <1>;
18015 +                               max-frame-size = <5dc>;
18016 +                               rx-fifo-size = <1000>;
18017 +                               tx-fifo-size = <800>;
18018 +                               phy-mode = "rmii";
18019 +                               phy-map = <00000001>;
18020 +                               zmii-device = <&ZMII0>;
18021 +                               zmii-channel = <1>;
18022 +                       };
18023 +
18024 +                       EMAC2: ethernet@40000c00 {
18025 +                               linux,network-index = <0>;
18026 +                               device_type = "network";
18027 +                               compatible = "ibm,emac-440gx", "ibm,emac4";
18028 +                               interrupt-parent = <&UIC2>;
18029 +                               interrupts = <0 4 1 4>;
18030 +                               reg = <40000c00 70>;
18031 +                               local-mac-address = [000000000000]; // Filled in by zImage
18032 +                               mal-device = <&MAL0>;
18033 +                               mal-tx-channel = <2>;
18034 +                               mal-rx-channel = <2>;
18035 +                               cell-index = <2>;
18036 +                               max-frame-size = <5dc>;
18037 +                               rx-fifo-size = <1000>;
18038 +                               tx-fifo-size = <800>;
18039 +                               phy-mode = "rgmii";
18040 +                               phy-map = <00000001>;
18041 +                               rgmii-device = <&RGMII0>;
18042 +                               rgmii-channel = <0>;
18043 +                               zmii-device = <&ZMII0>;
18044 +                               zmii-channel = <2>;
18045 +                       };
18046 +
18047 +                       EMAC3: ethernet@40000e00 {
18048 +                               linux,network-index = <1>;
18049 +                               device_type = "network";
18050 +                               compatible = "ibm,emac-440gx", "ibm,emac4";
18051 +                               interrupt-parent = <&UIC2>;
18052 +                               interrupts = <2 4 3 4>;
18053 +                               reg = <40000e00 70>;
18054 +                               local-mac-address = [000000000000]; // Filled in by zImage
18055 +                               mal-device = <&MAL0>;
18056 +                               mal-tx-channel = <3>;
18057 +                               mal-rx-channel = <3>;
18058 +                               cell-index = <3>;
18059 +                               max-frame-size = <5dc>;
18060 +                               rx-fifo-size = <1000>;
18061 +                               tx-fifo-size = <800>;
18062 +                               phy-mode = "rgmii";
18063 +                               phy-map = <00000003>;
18064 +                               rgmii-device = <&RGMII0>;
18065 +                               rgmii-channel = <1>;
18066 +                               zmii-device = <&ZMII0>;
18067 +                               zmii-channel = <3>;
18068 +                       };
18069 +
18070 +
18071 +                       GPT0: gpt@40000a00 {
18072 +                               /* FIXME */
18073 +                               reg = <40000a00 d4>;
18074 +                               interrupt-parent = <&UIC0>;
18075 +                               interrupts = <12 4 13 4 14 4 15 4 16 4>;
18076 +                       };
18077 +
18078 +               };
18079 +
18080 +               PCIX0: pci@20ec00000 {
18081 +                       device_type = "pci";
18082 +                       #interrupt-cells = <1>;
18083 +                       #size-cells = <2>;
18084 +                       #address-cells = <3>;
18085 +                       compatible = "ibm,plb440gp-pcix", "ibm,plb-pcix";
18086 +                       primary;
18087 +                       large-inbound-windows;
18088 +                       enable-msi-hole;
18089 +                       reg = <2 0ec00000   8   /* Config space access */
18090 +                              0 0 0            /* no IACK cycles */
18091 +                              2 0ed00000   4   /* Special cycles */
18092 +                              2 0ec80000 100   /* Internal registers */
18093 +                              2 0ec80100  fc>; /* Internal messaging registers */
18094 +
18095 +                       /* Outbound ranges, one memory and one IO,
18096 +                        * later cannot be changed
18097 +                        */
18098 +                       ranges = <02000000 0 80000000 00000003 80000000 0 80000000
18099 +                                 01000000 0 00000000 00000002 08000000 0 00010000>;
18100 +
18101 +                       /* Inbound 2GB range starting at 0 */
18102 +                       dma-ranges = <42000000 0 0 0 0 0 80000000>;
18103 +
18104 +                       interrupt-map-mask = <f800 0 0 7>;
18105 +                       interrupt-map = <
18106 +                               /* IDSEL 1 */
18107 +                               0800 0 0 1 &UIC0 17 8
18108 +                               0800 0 0 2 &UIC0 18 8
18109 +                               0800 0 0 3 &UIC0 19 8
18110 +                               0800 0 0 4 &UIC0 1a 8
18111 +
18112 +                               /* IDSEL 2 */
18113 +                               1000 0 0 1 &UIC0 18 8
18114 +                               1000 0 0 2 &UIC0 19 8
18115 +                               1000 0 0 3 &UIC0 1a 8
18116 +                               1000 0 0 4 &UIC0 17 8
18117 +                       >;
18118 +               };
18119 +       };
18120 +
18121 +       chosen {
18122 +               linux,stdout-path = "/plb/opb/serial@40000300";
18123 +       };
18124 +};
18125 --- /dev/null
18126 +++ b/arch/powerpc/boot/dts/tqm5200.dts
18127 @@ -0,0 +1,184 @@
18128 +/*
18129 + * TQM5200 board Device Tree Source
18130 + *
18131 + * Copyright (C) 2007 Semihalf
18132 + * Marian Balakowicz <m8@semihalf.com>
18133 + *
18134 + * This program is free software; you can redistribute  it and/or modify it
18135 + * under  the terms of  the GNU General  Public License as published by the
18136 + * Free Software Foundation;  either version 2 of the  License, or (at your
18137 + * option) any later version.
18138 + */
18139 +
18140 +/*
18141 + * WARNING: Do not depend on this tree layout remaining static just yet.
18142 + * The MPC5200 device tree conventions are still in flux
18143 + * Keep an eye on the linuxppc-dev mailing list for more details
18144 + */
18145 +
18146 +/ {
18147 +       model = "tqc,tqm5200";
18148 +       compatible = "tqc,tqm5200";
18149 +       #address-cells = <1>;
18150 +       #size-cells = <1>;
18151 +
18152 +       cpus {
18153 +               #address-cells = <1>;
18154 +               #size-cells = <0>;
18155 +
18156 +               PowerPC,5200@0 {
18157 +                       device_type = "cpu";
18158 +                       reg = <0>;
18159 +                       d-cache-line-size = <20>;
18160 +                       i-cache-line-size = <20>;
18161 +                       d-cache-size = <4000>;          // L1, 16K
18162 +                       i-cache-size = <4000>;          // L1, 16K
18163 +                       timebase-frequency = <0>;       // from bootloader
18164 +                       bus-frequency = <0>;            // from bootloader
18165 +                       clock-frequency = <0>;          // from bootloader
18166 +               };
18167 +       };
18168 +
18169 +       memory {
18170 +               device_type = "memory";
18171 +               reg = <00000000 04000000>;      // 64MB
18172 +       };
18173 +
18174 +       soc5200@f0000000 {
18175 +               model = "fsl,mpc5200";
18176 +               compatible = "fsl,mpc5200";
18177 +               revision = "";                  // from bootloader
18178 +               device_type = "soc";
18179 +               ranges = <0 f0000000 0000c000>;
18180 +               reg = <f0000000 00000100>;
18181 +               bus-frequency = <0>;            // from bootloader
18182 +               system-frequency = <0>;         // from bootloader
18183 +
18184 +               cdm@200 {
18185 +                       compatible = "mpc5200-cdm";
18186 +                       reg = <200 38>;
18187 +               };
18188 +
18189 +               mpc5200_pic: pic@500 {
18190 +                       // 5200 interrupts are encoded into two levels;
18191 +                       interrupt-controller;
18192 +                       #interrupt-cells = <3>;
18193 +                       compatible = "mpc5200-pic";
18194 +                       reg = <500 80>;
18195 +               };
18196 +
18197 +               gpt@600 {       // General Purpose Timer
18198 +                       compatible = "fsl,mpc5200-gpt";
18199 +                       reg = <600 10>;
18200 +                       interrupts = <1 9 0>;
18201 +                       interrupt-parent = <&mpc5200_pic>;
18202 +                       fsl,has-wdt;
18203 +               };
18204 +
18205 +               gpio@b00 {
18206 +                       compatible = "mpc5200-gpio";
18207 +                       reg = <b00 40>;
18208 +                       interrupts = <1 7 0>;
18209 +                       interrupt-parent = <&mpc5200_pic>;
18210 +               };
18211 +
18212 +               usb@1000 {
18213 +                       compatible = "mpc5200-ohci","ohci-be";
18214 +                       reg = <1000 ff>;
18215 +                       interrupts = <2 6 0>;
18216 +                       interrupt-parent = <&mpc5200_pic>;
18217 +               };
18218 +
18219 +               dma-controller@1200 {
18220 +                       compatible = "mpc5200-bestcomm";
18221 +                       reg = <1200 80>;
18222 +                       interrupts = <3 0 0  3 1 0  3 2 0  3 3 0
18223 +                                     3 4 0  3 5 0  3 6 0  3 7 0
18224 +                                     3 8 0  3 9 0  3 a 0  3 b 0
18225 +                                     3 c 0  3 d 0  3 e 0  3 f 0>;
18226 +                       interrupt-parent = <&mpc5200_pic>;
18227 +               };
18228 +
18229 +               xlb@1f00 {
18230 +                       compatible = "mpc5200-xlb";
18231 +                       reg = <1f00 100>;
18232 +               };
18233 +
18234 +               serial@2000 {           // PSC1
18235 +                       device_type = "serial";
18236 +                       compatible = "mpc5200-psc-uart";
18237 +                       port-number = <0>;  // Logical port assignment
18238 +                       reg = <2000 100>;
18239 +                       interrupts = <2 1 0>;
18240 +                       interrupt-parent = <&mpc5200_pic>;
18241 +               };
18242 +
18243 +               serial@2200 {           // PSC2
18244 +                       device_type = "serial";
18245 +                       compatible = "mpc5200-psc-uart";
18246 +                       port-number = <1>;  // Logical port assignment
18247 +                       reg = <2200 100>;
18248 +                       interrupts = <2 2 0>;
18249 +                       interrupt-parent = <&mpc5200_pic>;
18250 +               };
18251 +
18252 +               serial@2400 {           // PSC3
18253 +                       device_type = "serial";
18254 +                       compatible = "mpc5200-psc-uart";
18255 +                       port-number = <2>;  // Logical port assignment
18256 +                       reg = <2400 100>;
18257 +                       interrupts = <2 3 0>;
18258 +                       interrupt-parent = <&mpc5200_pic>;
18259 +               };
18260 +
18261 +               ethernet@3000 {
18262 +                       device_type = "network";
18263 +                       compatible = "mpc5200-fec";
18264 +                       reg = <3000 800>;
18265 +                       local-mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by U-Boot */
18266 +                       interrupts = <2 5 0>;
18267 +                       interrupt-parent = <&mpc5200_pic>;
18268 +               };
18269 +
18270 +               ata@3a00 {
18271 +                       compatible = "mpc5200-ata";
18272 +                       reg = <3a00 100>;
18273 +                       interrupts = <2 7 0>;
18274 +                       interrupt-parent = <&mpc5200_pic>;
18275 +               };
18276 +
18277 +               i2c@3d40 {
18278 +                       compatible = "mpc5200-i2c","fsl-i2c";
18279 +                       reg = <3d40 40>;
18280 +                       interrupts = <2 10 0>;
18281 +                       interrupt-parent = <&mpc5200_pic>;
18282 +                       fsl5200-clocking;
18283 +               };
18284 +
18285 +               sram@8000 {
18286 +                       compatible = "mpc5200-sram";
18287 +                       reg = <8000 4000>;
18288 +               };
18289 +       };
18290 +
18291 +       pci@f0000d00 {
18292 +               #interrupt-cells = <1>;
18293 +               #size-cells = <2>;
18294 +               #address-cells = <3>;
18295 +               device_type = "pci";
18296 +               compatible = "fsl,mpc5200-pci";
18297 +               reg = <f0000d00 100>;
18298 +               interrupt-map-mask = <f800 0 0 7>;
18299 +               interrupt-map = <c000 0 0 1 &mpc5200_pic 0 0 3
18300 +                                c000 0 0 2 &mpc5200_pic 0 0 3
18301 +                                c000 0 0 3 &mpc5200_pic 0 0 3
18302 +                                c000 0 0 4 &mpc5200_pic 0 0 3>;
18303 +               clock-frequency = <0>; // From boot loader
18304 +               interrupts = <2 8 0 2 9 0 2 a 0>;
18305 +               interrupt-parent = <&mpc5200_pic>;
18306 +               bus-range = <0 0>;
18307 +               ranges = <42000000 0 80000000 80000000 0 10000000
18308 +                         02000000 0 90000000 90000000 0 10000000
18309 +                         01000000 0 00000000 a0000000 0 01000000>;
18310 +       };
18311 +};
18312 --- a/arch/powerpc/boot/dts/walnut.dts
18313 +++ b/arch/powerpc/boot/dts/walnut.dts
18314 @@ -14,14 +14,21 @@
18315         #size-cells = <1>;
18316         model = "ibm,walnut";
18317         compatible = "ibm,walnut";
18318 -       dcr-parent = <&/cpus/PowerPC,405GP@0>;
18319 +       dcr-parent = <&/cpus/cpu@0>;
18320 +
18321 +       aliases {
18322 +               ethernet0 = &EMAC;
18323 +               serial0 = &UART0;
18324 +               serial1 = &UART1;
18325 +       };
18326  
18327         cpus {
18328                 #address-cells = <1>;
18329                 #size-cells = <0>;
18330  
18331 -               PowerPC,405GP@0 {
18332 +               cpu@0 {
18333                         device_type = "cpu";
18334 +                       model = "PowerPC,405GP";
18335                         reg = <0>;
18336                         clock-frequency = <bebc200>; /* Filled in by zImage */
18337                         timebase-frequency = <0>; /* Filled in by zImage */
18338 @@ -168,9 +175,10 @@
18339                                 };
18340                         };
18341  
18342 -                       ds1743@1,0 {
18343 +                       nvram@1,0 {
18344                                 /* NVRAM and RTC */
18345 -                               compatible = "ds1743";
18346 +                               compatible = "ds1743-nvram";
18347 +                               #bytes = <2000>;
18348                                 reg = <1 0 2000>;
18349                         };
18350  
18351 @@ -190,6 +198,45 @@
18352                                 virtual-reg = <f0300005>;
18353                         };
18354                 };
18355 +
18356 +               PCI0: pci@ec000000 {
18357 +                       device_type = "pci";
18358 +                       #interrupt-cells = <1>;
18359 +                       #size-cells = <2>;
18360 +                       #address-cells = <3>;
18361 +                       compatible = "ibm,plb405gp-pci", "ibm,plb-pci";
18362 +                       primary;
18363 +                       reg = <eec00000 8       /* Config space access */
18364 +                              eed80000 4       /* IACK */
18365 +                              eed80000 4       /* Special cycle */
18366 +                              ef480000 40>;    /* Internal registers */
18367 +
18368 +                       /* Outbound ranges, one memory and one IO,
18369 +                        * later cannot be changed. Chip supports a second
18370 +                        * IO range but we don't use it for now
18371 +                        */
18372 +                       ranges = <02000000 0 80000000 80000000 0 20000000
18373 +                                 01000000 0 00000000 e8000000 0 00010000>;
18374 +
18375 +                       /* Inbound 2GB range starting at 0 */
18376 +                       dma-ranges = <42000000 0 0 0 0 80000000>;
18377 +
18378 +                       /* Walnut has all 4 IRQ pins tied together per slot */
18379 +                       interrupt-map-mask = <f800 0 0 0>;
18380 +                       interrupt-map = <
18381 +                               /* IDSEL 1 */
18382 +                               0800 0 0 0 &UIC0 1c 8
18383 +
18384 +                               /* IDSEL 2 */
18385 +                               1000 0 0 0 &UIC0 1d 8
18386 +
18387 +                               /* IDSEL 3 */
18388 +                               1800 0 0 0 &UIC0 1e 8
18389 +
18390 +                               /* IDSEL 4 */
18391 +                               2000 0 0 0 &UIC0 1f 8
18392 +                       >;
18393 +               };
18394         };
18395  
18396         chosen {
18397 --- /dev/null
18398 +++ b/arch/powerpc/boot/dts/warp.dts
18399 @@ -0,0 +1,239 @@
18400 +/*
18401 + * Device Tree Source for PIKA Warp
18402 + *
18403 + * Copyright (c) 2008 PIKA Technologies
18404 + *   Sean MacLennan <smaclennan@pikatech.com>
18405 + *
18406 + * This file is licensed under the terms of the GNU General Public
18407 + * License version 2.  This program is licensed "as is" without
18408 + * any warranty of any kind, whether express or implied.
18409 + */
18410 +
18411 +/ {
18412 +       #address-cells = <2>;
18413 +       #size-cells = <1>;
18414 +       model = "pika,warp";
18415 +       compatible = "pika,warp";
18416 +       dcr-parent = <&/cpus/cpu@0>;
18417 +
18418 +       aliases {
18419 +               ethernet0 = &EMAC0;
18420 +               serial0 = &UART0;
18421 +       };
18422 +
18423 +       cpus {
18424 +               #address-cells = <1>;
18425 +               #size-cells = <0>;
18426 +
18427 +               cpu@0 {
18428 +                       device_type = "cpu";
18429 +                       model = "PowerPC,440EP";
18430 +                       reg = <0>;
18431 +                       clock-frequency = <0>; /* Filled in by zImage */
18432 +                       timebase-frequency = <0>; /* Filled in by zImage */
18433 +                       i-cache-line-size = <20>;
18434 +                       d-cache-line-size = <20>;
18435 +                       i-cache-size = <8000>;
18436 +                       d-cache-size = <8000>;
18437 +                       dcr-controller;
18438 +                       dcr-access-method = "native";
18439 +               };
18440 +       };
18441 +
18442 +       memory {
18443 +               device_type = "memory";
18444 +               reg = <0 0 0>; /* Filled in by zImage */
18445 +       };
18446 +
18447 +       UIC0: interrupt-controller0 {
18448 +               compatible = "ibm,uic-440ep","ibm,uic";
18449 +               interrupt-controller;
18450 +               cell-index = <0>;
18451 +               dcr-reg = <0c0 009>;
18452 +               #address-cells = <0>;
18453 +               #size-cells = <0>;
18454 +               #interrupt-cells = <2>;
18455 +       };
18456 +
18457 +       UIC1: interrupt-controller1 {
18458 +               compatible = "ibm,uic-440ep","ibm,uic";
18459 +               interrupt-controller;
18460 +               cell-index = <1>;
18461 +               dcr-reg = <0d0 009>;
18462 +               #address-cells = <0>;
18463 +               #size-cells = <0>;
18464 +               #interrupt-cells = <2>;
18465 +               interrupts = <1e 4 1f 4>; /* cascade */
18466 +               interrupt-parent = <&UIC0>;
18467 +       };
18468 +
18469 +       SDR0: sdr {
18470 +               compatible = "ibm,sdr-440ep";
18471 +               dcr-reg = <00e 002>;
18472 +       };
18473 +
18474 +       CPR0: cpr {
18475 +               compatible = "ibm,cpr-440ep";
18476 +               dcr-reg = <00c 002>;
18477 +       };
18478 +
18479 +       plb {
18480 +               compatible = "ibm,plb-440ep", "ibm,plb-440gp", "ibm,plb4";
18481 +               #address-cells = <2>;
18482 +               #size-cells = <1>;
18483 +               ranges;
18484 +               clock-frequency = <0>; /* Filled in by zImage */
18485 +
18486 +               SDRAM0: sdram {
18487 +                       compatible = "ibm,sdram-440ep", "ibm,sdram-405gp";
18488 +                       dcr-reg = <010 2>;
18489 +               };
18490 +
18491 +               DMA0: dma {
18492 +                       compatible = "ibm,dma-440ep", "ibm,dma-440gp";
18493 +                       dcr-reg = <100 027>;
18494 +               };
18495 +
18496 +               MAL0: mcmal {
18497 +                       compatible = "ibm,mcmal-440ep", "ibm,mcmal-440gp", "ibm,mcmal";
18498 +                       dcr-reg = <180 62>;
18499 +                       num-tx-chans = <4>;
18500 +                       num-rx-chans = <2>;
18501 +                       interrupt-parent = <&MAL0>;
18502 +                       interrupts = <0 1 2 3 4>;
18503 +                       #interrupt-cells = <1>;
18504 +                       #address-cells = <0>;
18505 +                       #size-cells = <0>;
18506 +                       interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
18507 +                                       /*RXEOB*/ 1 &UIC0 b 4
18508 +                                       /*SERR*/  2 &UIC1 0 4
18509 +                                       /*TXDE*/  3 &UIC1 1 4
18510 +                                       /*RXDE*/  4 &UIC1 2 4>;
18511 +               };
18512 +
18513 +               POB0: opb {
18514 +                       compatible = "ibm,opb-440ep", "ibm,opb-440gp", "ibm,opb";
18515 +                       #address-cells = <1>;
18516 +                       #size-cells = <1>;
18517 +                       ranges = <00000000 0 00000000 80000000
18518 +                                 80000000 0 80000000 80000000>;
18519 +                       interrupt-parent = <&UIC1>;
18520 +                       interrupts = <7 4>;
18521 +                       clock-frequency = <0>; /* Filled in by zImage */
18522 +
18523 +                       EBC0: ebc {
18524 +                               compatible = "ibm,ebc-440ep", "ibm,ebc-440gp", "ibm,ebc";
18525 +                               dcr-reg = <012 2>;
18526 +                               #address-cells = <2>;
18527 +                               #size-cells = <1>;
18528 +                               clock-frequency = <0>; /* Filled in by zImage */
18529 +                               interrupts = <5 1>;
18530 +                               interrupt-parent = <&UIC1>;
18531 +
18532 +                               fpga@2,0 {
18533 +                                       compatible = "pika,fpga";
18534 +                                       reg = <2 0 2200>;
18535 +                                       interrupts = <18 8>;
18536 +                                       interrupt-parent = <&UIC0>;
18537 +                               };
18538 +
18539 +                               nor_flash@0,0 {
18540 +                                       compatible = "amd,s29gl512n", "cfi-flash";
18541 +                                       bank-width = <2>;
18542 +                                       reg = <0 0 4000000>;
18543 +                                       #address-cells = <1>;
18544 +                                       #size-cells = <1>;
18545 +                                       partition@0 {
18546 +                                               label = "kernel";
18547 +                                               reg = <0 180000>;
18548 +                                       };
18549 +                                       partition@180000 {
18550 +                                               label = "root";
18551 +                                               reg = <180000 3480000>;
18552 +                                       };
18553 +                                       partition@3600000 {
18554 +                                               label = "user";
18555 +                                               reg = <3600000 900000>;
18556 +                                       };
18557 +                                       partition@3f00000 {
18558 +                                               label = "fpga";
18559 +                                               reg = <3f00000 40000>;
18560 +                                       };
18561 +                                       partition@3f40000 {
18562 +                                               label = "env";
18563 +                                               reg = <3f40000 40000>;
18564 +                                       };
18565 +                                       partition@3f80000 {
18566 +                                               label = "u-boot";
18567 +                                               reg = <3f80000 80000>;
18568 +                                       };
18569 +                               };
18570 +                       };
18571 +
18572 +                       UART0: serial@ef600300 {
18573 +                               device_type = "serial";
18574 +                               compatible = "ns16550";
18575 +                               reg = <ef600300 8>;
18576 +                               virtual-reg = <ef600300>;
18577 +                               clock-frequency = <0>; /* Filled in by zImage */
18578 +                               current-speed = <1c200>;
18579 +                               interrupt-parent = <&UIC0>;
18580 +                               interrupts = <0 4>;
18581 +                       };
18582 +
18583 +                       IIC0: i2c@ef600700 {
18584 +                               compatible = "ibm,iic-440ep", "ibm,iic-440gp", "ibm,iic";
18585 +                               reg = <ef600700 14>;
18586 +                               interrupt-parent = <&UIC0>;
18587 +                               interrupts = <2 4>;
18588 +                       };
18589 +
18590 +                       GPIO0: gpio@ef600b00 {
18591 +                               compatible = "ibm,gpio-440ep";
18592 +                               reg = <ef600b00 48>;
18593 +                       };
18594 +
18595 +                       GPIO1: gpio@ef600c00 {
18596 +                               compatible = "ibm,gpio-440ep";
18597 +                               reg = <ef600c00 48>;
18598 +                       };
18599 +
18600 +                       ZMII0: emac-zmii@ef600d00 {
18601 +                               compatible = "ibm,zmii-440ep", "ibm,zmii-440gp", "ibm,zmii";
18602 +                               reg = <ef600d00 c>;
18603 +                       };
18604 +
18605 +                       EMAC0: ethernet@ef600e00 {
18606 +                               linux,network-index = <0>;
18607 +                               device_type = "network";
18608 +                               compatible = "ibm,emac-440ep", "ibm,emac-440gp", "ibm,emac";
18609 +                               interrupt-parent = <&UIC1>;
18610 +                               interrupts = <1c 4 1d 4>;
18611 +                               reg = <ef600e00 70>;
18612 +                               local-mac-address = [000000000000];
18613 +                               mal-device = <&MAL0>;
18614 +                               mal-tx-channel = <0 1>;
18615 +                               mal-rx-channel = <0>;
18616 +                               cell-index = <0>;
18617 +                               max-frame-size = <5dc>;
18618 +                               rx-fifo-size = <1000>;
18619 +                               tx-fifo-size = <800>;
18620 +                               phy-mode = "rmii";
18621 +                               phy-map = <00000000>;
18622 +                               zmii-device = <&ZMII0>;
18623 +                               zmii-channel = <0>;
18624 +                       };
18625 +
18626 +                       usb@ef601000 {
18627 +                               compatible = "ohci-be";
18628 +                               reg = <ef601000 80>;
18629 +                               interrupts = <8 1 9 1>;
18630 +                               interrupt-parent = < &UIC1 >;
18631 +                       };
18632 +               };
18633 +       };
18634 +
18635 +       chosen {
18636 +               linux,stdout-path = "/plb/opb/serial@ef600300";
18637 +       };
18638 +};
18639 --- a/arch/powerpc/boot/ebony.c
18640 +++ b/arch/powerpc/boot/ebony.c
18641 @@ -31,66 +31,6 @@
18642  
18643  static u8 *ebony_mac0, *ebony_mac1;
18644  
18645 -/* Calculate 440GP clocks */
18646 -void ibm440gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
18647 -{
18648 -       u32 sys0 = mfdcr(DCRN_CPC0_SYS0);
18649 -       u32 cr0 = mfdcr(DCRN_CPC0_CR0);
18650 -       u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
18651 -       u32 opdv = CPC0_SYS0_OPDV(sys0);
18652 -       u32 epdv = CPC0_SYS0_EPDV(sys0);
18653 -
18654 -       if (sys0 & CPC0_SYS0_BYPASS) {
18655 -               /* Bypass system PLL */
18656 -               cpu = plb = sysclk;
18657 -       } else {
18658 -               if (sys0 & CPC0_SYS0_EXTSL)
18659 -                       /* PerClk */
18660 -                       m = CPC0_SYS0_FWDVB(sys0) * opdv * epdv;
18661 -               else
18662 -                       /* CPU clock */
18663 -                       m = CPC0_SYS0_FBDV(sys0) * CPC0_SYS0_FWDVA(sys0);
18664 -               cpu = sysclk * m / CPC0_SYS0_FWDVA(sys0);
18665 -               plb = sysclk * m / CPC0_SYS0_FWDVB(sys0);
18666 -       }
18667 -
18668 -       opb = plb / opdv;
18669 -       ebc = opb / epdv;
18670 -
18671 -       /* FIXME: Check if this is for all 440GP, or just Ebony */
18672 -       if ((mfpvr() & 0xf0000fff) == 0x40000440)
18673 -               /* Rev. B 440GP, use external system clock */
18674 -               tb = sysclk;
18675 -       else
18676 -               /* Rev. C 440GP, errata force us to use internal clock */
18677 -               tb = cpu;
18678 -
18679 -       if (cr0 & CPC0_CR0_U0EC)
18680 -               /* External UART clock */
18681 -               uart0 = ser_clk;
18682 -       else
18683 -               /* Internal UART clock */
18684 -               uart0 = plb / CPC0_CR0_UDIV(cr0);
18685 -
18686 -       if (cr0 & CPC0_CR0_U1EC)
18687 -               /* External UART clock */
18688 -               uart1 = ser_clk;
18689 -       else
18690 -               /* Internal UART clock */
18691 -               uart1 = plb / CPC0_CR0_UDIV(cr0);
18692 -
18693 -       printf("PPC440GP: SysClk = %dMHz (%x)\n\r",
18694 -              (sysclk + 500000) / 1000000, sysclk);
18695 -
18696 -       dt_fixup_cpu_clocks(cpu, tb, 0);
18697 -
18698 -       dt_fixup_clock("/plb", plb);
18699 -       dt_fixup_clock("/plb/opb", opb);
18700 -       dt_fixup_clock("/plb/opb/ebc", ebc);
18701 -       dt_fixup_clock("/plb/opb/serial@40000200", uart0);
18702 -       dt_fixup_clock("/plb/opb/serial@40000300", uart1);
18703 -}
18704 -
18705  #define EBONY_FPGA_PATH                "/plb/opb/ebc/fpga"
18706  #define        EBONY_FPGA_FLASH_SEL    0x01
18707  #define EBONY_SMALL_FLASH_PATH "/plb/opb/ebc/small-flash"
18708 @@ -134,7 +74,7 @@
18709         unsigned long sysclk = 33000000;
18710  
18711         ibm440gp_fixup_clocks(sysclk, 6 * 1843200);
18712 -       ibm4xx_fixup_memsize();
18713 +       ibm4xx_sdram_fixup_memsize();
18714         dt_fixup_mac_addresses(ebony_mac0, ebony_mac1);
18715         ibm4xx_fixup_ebc_ranges("/plb/opb/ebc");
18716         ebony_flashsel_fixup();
18717 @@ -146,6 +86,6 @@
18718         platform_ops.exit = ibm44x_dbcr_reset;
18719         ebony_mac0 = mac0;
18720         ebony_mac1 = mac1;
18721 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
18722 +       fdt_init(_dtb_start);
18723         serial_console_init();
18724  }
18725 --- /dev/null
18726 +++ b/arch/powerpc/boot/ep405.c
18727 @@ -0,0 +1,74 @@
18728 +/*
18729 + * Embedded Planet EP405 with PlanetCore firmware
18730 + *
18731 + * (c) Benjamin Herrenschmidt <benh@kernel.crashing.org>, IBM Corp,\
18732 + *
18733 + * Based on ep88xc.c by
18734 + *
18735 + * Scott Wood <scottwood@freescale.com>
18736 + *
18737 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
18738 + *
18739 + * This program is free software; you can redistribute it and/or modify it
18740 + * under the terms of the GNU General Public License version 2 as published
18741 + * by the Free Software Foundation.
18742 + */
18743 +
18744 +#include "ops.h"
18745 +#include "stdio.h"
18746 +#include "planetcore.h"
18747 +#include "dcr.h"
18748 +#include "4xx.h"
18749 +#include "io.h"
18750 +
18751 +static char *table;
18752 +static u64 mem_size;
18753 +
18754 +static void platform_fixups(void)
18755 +{
18756 +       u64 val;
18757 +       void *nvrtc;
18758 +
18759 +       dt_fixup_memory(0, mem_size);
18760 +       planetcore_set_mac_addrs(table);
18761 +
18762 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_CRYSTAL_HZ, &val)) {
18763 +               printf("No PlanetCore crystal frequency key.\r\n");
18764 +               return;
18765 +       }
18766 +       ibm405gp_fixup_clocks(val, 0xa8c000);
18767 +       ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
18768 +       ibm4xx_fixup_ebc_ranges("/plb/ebc");
18769 +
18770 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_KB_NVRAM, &val)) {
18771 +               printf("No PlanetCore NVRAM size key.\r\n");
18772 +               return;
18773 +       }
18774 +       nvrtc = finddevice("/plb/ebc/nvrtc@4,200000");
18775 +       if (nvrtc != NULL) {
18776 +               u32 reg[3] = { 4, 0x200000, 0};
18777 +               getprop(nvrtc, "reg", reg, 3);
18778 +               reg[2] = (val << 10) & 0xffffffff;
18779 +               setprop(nvrtc, "reg", reg, 3);
18780 +       }
18781 +}
18782 +
18783 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
18784 +                  unsigned long r6, unsigned long r7)
18785 +{
18786 +       table = (char *)r3;
18787 +       planetcore_prepare_table(table);
18788 +
18789 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_MB_RAM, &mem_size))
18790 +               return;
18791 +
18792 +       mem_size *= 1024 * 1024;
18793 +       simple_alloc_init(_end, mem_size - (unsigned long)_end, 32, 64);
18794 +
18795 +       fdt_init(_dtb_start);
18796 +
18797 +       planetcore_set_stdout_path(table);
18798 +
18799 +       serial_console_init();
18800 +       platform_ops.fixups = platform_fixups;
18801 +}
18802 --- /dev/null
18803 +++ b/arch/powerpc/boot/ep8248e.c
18804 @@ -0,0 +1,55 @@
18805 +/*
18806 + * Embedded Planet EP8248E with PlanetCore firmware
18807 + *
18808 + * Author: Scott Wood <scottwood@freescale.com>
18809 + *
18810 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
18811 + *
18812 + * This program is free software; you can redistribute it and/or modify it
18813 + * under the terms of the GNU General Public License version 2 as published
18814 + * by the Free Software Foundation.
18815 + */
18816 +
18817 +#include "ops.h"
18818 +#include "stdio.h"
18819 +#include "planetcore.h"
18820 +#include "pq2.h"
18821 +
18822 +static char *table;
18823 +static u64 mem_size;
18824 +
18825 +#include <io.h>
18826 +
18827 +static void platform_fixups(void)
18828 +{
18829 +       u64 val;
18830 +
18831 +       dt_fixup_memory(0, mem_size);
18832 +       planetcore_set_mac_addrs(table);
18833 +
18834 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_CRYSTAL_HZ, &val)) {
18835 +               printf("No PlanetCore crystal frequency key.\r\n");
18836 +               return;
18837 +       }
18838 +
18839 +       pq2_fixup_clocks(val);
18840 +}
18841 +
18842 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
18843 +                   unsigned long r6, unsigned long r7)
18844 +{
18845 +       table = (char *)r3;
18846 +       planetcore_prepare_table(table);
18847 +
18848 +       if (!planetcore_get_decimal(table, PLANETCORE_KEY_MB_RAM, &mem_size))
18849 +               return;
18850 +
18851 +       mem_size *= 1024 * 1024;
18852 +       simple_alloc_init(_end, mem_size - (unsigned long)_end, 32, 64);
18853 +
18854 +       fdt_init(_dtb_start);
18855 +
18856 +       planetcore_set_stdout_path(table);
18857 +       serial_console_init();
18858 +       platform_ops.fixups = platform_fixups;
18859 +}
18860 --- a/arch/powerpc/boot/ep88xc.c
18861 +++ b/arch/powerpc/boot/ep88xc.c
18862 @@ -45,7 +45,7 @@
18863         mem_size *= 1024 * 1024;
18864         simple_alloc_init(_end, mem_size - (unsigned long)_end, 32, 64);
18865  
18866 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
18867 +       fdt_init(_dtb_start);
18868  
18869         planetcore_set_stdout_path(table);
18870  
18871 --- a/arch/powerpc/boot/flatdevtree.c
18872 +++ /dev/null
18873 @@ -1,1036 +0,0 @@
18874 -/*
18875 - * This program is free software; you can redistribute it and/or modify
18876 - * it under the terms of the GNU General Public License as published by
18877 - * the Free Software Foundation; either version 2 of the License, or
18878 - * (at your option) any later version.
18879 - *
18880 - * This program is distributed in the hope that it will be useful,
18881 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
18882 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18883 - * GNU General Public License for more details.
18884 - *
18885 - * You should have received a copy of the GNU General Public License
18886 - * along with this program; if not, write to the Free Software
18887 - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18888 - *
18889 - * Copyright Pantelis Antoniou 2006
18890 - * Copyright (C) IBM Corporation 2006
18891 - *
18892 - * Authors: Pantelis Antoniou <pantelis@embeddedalley.com>
18893 - *         Hollis Blanchard <hollisb@us.ibm.com>
18894 - *         Mark A. Greer <mgreer@mvista.com>
18895 - *         Paul Mackerras <paulus@samba.org>
18896 - */
18897 -
18898 -#include <string.h>
18899 -#include <stddef.h>
18900 -#include "flatdevtree.h"
18901 -#include "flatdevtree_env.h"
18902 -
18903 -#define _ALIGN(x, al)  (((x) + (al) - 1) & ~((al) - 1))
18904 -
18905 -static char *ft_root_node(struct ft_cxt *cxt)
18906 -{
18907 -       return cxt->rgn[FT_STRUCT].start;
18908 -}
18909 -
18910 -/* Routines for keeping node ptrs returned by ft_find_device current */
18911 -/* First entry not used b/c it would return 0 and be taken as NULL/error */
18912 -static void *ft_get_phandle(struct ft_cxt *cxt, char *node)
18913 -{
18914 -       unsigned int i;
18915 -
18916 -       if (!node)
18917 -               return NULL;
18918 -
18919 -       for (i = 1; i < cxt->nodes_used; i++)   /* already there? */
18920 -               if (cxt->node_tbl[i] == node)
18921 -                       return (void *)i;
18922 -
18923 -       if (cxt->nodes_used < cxt->node_max) {
18924 -               cxt->node_tbl[cxt->nodes_used] = node;
18925 -               return (void *)cxt->nodes_used++;
18926 -       }
18927 -
18928 -       return NULL;
18929 -}
18930 -
18931 -static char *ft_node_ph2node(struct ft_cxt *cxt, const void *phandle)
18932 -{
18933 -       unsigned int i = (unsigned int)phandle;
18934 -
18935 -       if (i < cxt->nodes_used)
18936 -               return cxt->node_tbl[i];
18937 -       return NULL;
18938 -}
18939 -
18940 -static void ft_node_update_before(struct ft_cxt *cxt, char *addr, int shift)
18941 -{
18942 -       unsigned int i;
18943 -
18944 -       if (shift == 0)
18945 -               return;
18946 -
18947 -       for (i = 1; i < cxt->nodes_used; i++)
18948 -               if (cxt->node_tbl[i] < addr)
18949 -                       cxt->node_tbl[i] += shift;
18950 -}
18951 -
18952 -static void ft_node_update_after(struct ft_cxt *cxt, char *addr, int shift)
18953 -{
18954 -       unsigned int i;
18955 -
18956 -       if (shift == 0)
18957 -               return;
18958 -
18959 -       for (i = 1; i < cxt->nodes_used; i++)
18960 -               if (cxt->node_tbl[i] >= addr)
18961 -                       cxt->node_tbl[i] += shift;
18962 -}
18963 -
18964 -/* Struct used to return info from ft_next() */
18965 -struct ft_atom {
18966 -       u32 tag;
18967 -       const char *name;
18968 -       void *data;
18969 -       u32 size;
18970 -};
18971 -
18972 -/* Set ptrs to current one's info; return addr of next one */
18973 -static char *ft_next(struct ft_cxt *cxt, char *p, struct ft_atom *ret)
18974 -{
18975 -       u32 sz;
18976 -
18977 -       if (p >= cxt->rgn[FT_STRUCT].start + cxt->rgn[FT_STRUCT].size)
18978 -               return NULL;
18979 -
18980 -       ret->tag = be32_to_cpu(*(u32 *) p);
18981 -       p += 4;
18982 -
18983 -       switch (ret->tag) {     /* Tag */
18984 -       case OF_DT_BEGIN_NODE:
18985 -               ret->name = p;
18986 -               ret->data = (void *)(p - 4);    /* start of node */
18987 -               p += _ALIGN(strlen(p) + 1, 4);
18988 -               break;
18989 -       case OF_DT_PROP:
18990 -               ret->size = sz = be32_to_cpu(*(u32 *) p);
18991 -               ret->name = cxt->str_anchor + be32_to_cpu(*(u32 *) (p + 4));
18992 -               ret->data = (void *)(p + 8);
18993 -               p += 8 + _ALIGN(sz, 4);
18994 -               break;
18995 -       case OF_DT_END_NODE:
18996 -       case OF_DT_NOP:
18997 -               break;
18998 -       case OF_DT_END:
18999 -       default:
19000 -               p = NULL;
19001 -               break;
19002 -       }
19003 -
19004 -       return p;
19005 -}
19006 -
19007 -#define HDR_SIZE       _ALIGN(sizeof(struct boot_param_header), 8)
19008 -#define EXPAND_INCR    1024    /* alloc this much extra when expanding */
19009 -
19010 -/* Copy the tree to a newly-allocated region and put things in order */
19011 -static int ft_reorder(struct ft_cxt *cxt, int nextra)
19012 -{
19013 -       unsigned long tot;
19014 -       enum ft_rgn_id r;
19015 -       char *p, *pend;
19016 -       int stroff;
19017 -
19018 -       tot = HDR_SIZE + EXPAND_INCR;
19019 -       for (r = FT_RSVMAP; r <= FT_STRINGS; ++r)
19020 -               tot += cxt->rgn[r].size;
19021 -       if (nextra > 0)
19022 -               tot += nextra;
19023 -       tot = _ALIGN(tot, 8);
19024 -
19025 -       if (!cxt->realloc)
19026 -               return 0;
19027 -       p = cxt->realloc(NULL, tot);
19028 -       if (!p)
19029 -               return 0;
19030 -
19031 -       memcpy(p, cxt->bph, sizeof(struct boot_param_header));
19032 -       /* offsets get fixed up later */
19033 -
19034 -       cxt->bph = (struct boot_param_header *)p;
19035 -       cxt->max_size = tot;
19036 -       pend = p + tot;
19037 -       p += HDR_SIZE;
19038 -
19039 -       memcpy(p, cxt->rgn[FT_RSVMAP].start, cxt->rgn[FT_RSVMAP].size);
19040 -       cxt->rgn[FT_RSVMAP].start = p;
19041 -       p += cxt->rgn[FT_RSVMAP].size;
19042 -
19043 -       memcpy(p, cxt->rgn[FT_STRUCT].start, cxt->rgn[FT_STRUCT].size);
19044 -       ft_node_update_after(cxt, cxt->rgn[FT_STRUCT].start,
19045 -                       p - cxt->rgn[FT_STRUCT].start);
19046 -       cxt->p += p - cxt->rgn[FT_STRUCT].start;
19047 -       cxt->rgn[FT_STRUCT].start = p;
19048 -
19049 -       p = pend - cxt->rgn[FT_STRINGS].size;
19050 -       memcpy(p, cxt->rgn[FT_STRINGS].start, cxt->rgn[FT_STRINGS].size);
19051 -       stroff = cxt->str_anchor - cxt->rgn[FT_STRINGS].start;
19052 -       cxt->rgn[FT_STRINGS].start = p;
19053 -       cxt->str_anchor = p + stroff;
19054 -
19055 -       cxt->isordered = 1;
19056 -       return 1;
19057 -}
19058 -
19059 -static inline char *prev_end(struct ft_cxt *cxt, enum ft_rgn_id r)
19060 -{
19061 -       if (r > FT_RSVMAP)
19062 -               return cxt->rgn[r - 1].start + cxt->rgn[r - 1].size;
19063 -       return (char *)cxt->bph + HDR_SIZE;
19064 -}
19065 -
19066 -static inline char *next_start(struct ft_cxt *cxt, enum ft_rgn_id r)
19067 -{
19068 -       if (r < FT_STRINGS)
19069 -               return cxt->rgn[r + 1].start;
19070 -       return (char *)cxt->bph + cxt->max_size;
19071 -}
19072 -
19073 -/*
19074 - * See if we can expand region rgn by nextra bytes by using up
19075 - * free space after or before the region.
19076 - */
19077 -static int ft_shuffle(struct ft_cxt *cxt, char **pp, enum ft_rgn_id rgn,
19078 -               int nextra)
19079 -{
19080 -       char *p = *pp;
19081 -       char *rgn_start, *rgn_end;
19082 -
19083 -       rgn_start = cxt->rgn[rgn].start;
19084 -       rgn_end = rgn_start + cxt->rgn[rgn].size;
19085 -       if (nextra <= 0 || rgn_end + nextra <= next_start(cxt, rgn)) {
19086 -               /* move following stuff */
19087 -               if (p < rgn_end) {
19088 -                       if (nextra < 0)
19089 -                               memmove(p, p - nextra, rgn_end - p + nextra);
19090 -                       else
19091 -                               memmove(p + nextra, p, rgn_end - p);
19092 -                       if (rgn == FT_STRUCT)
19093 -                               ft_node_update_after(cxt, p, nextra);
19094 -               }
19095 -               cxt->rgn[rgn].size += nextra;
19096 -               if (rgn == FT_STRINGS)
19097 -                       /* assumes strings only added at beginning */
19098 -                       cxt->str_anchor += nextra;
19099 -               return 1;
19100 -       }
19101 -       if (prev_end(cxt, rgn) <= rgn_start - nextra) {
19102 -               /* move preceding stuff */
19103 -               if (p > rgn_start) {
19104 -                       memmove(rgn_start - nextra, rgn_start, p - rgn_start);
19105 -                       if (rgn == FT_STRUCT)
19106 -                               ft_node_update_before(cxt, p, -nextra);
19107 -               }
19108 -               *pp -= nextra;
19109 -               cxt->rgn[rgn].start -= nextra;
19110 -               cxt->rgn[rgn].size += nextra;
19111 -               return 1;
19112 -       }
19113 -       return 0;
19114 -}
19115 -
19116 -static int ft_make_space(struct ft_cxt *cxt, char **pp, enum ft_rgn_id rgn,
19117 -                        int nextra)
19118 -{
19119 -       unsigned long size, ssize, tot;
19120 -       char *str, *next;
19121 -       enum ft_rgn_id r;
19122 -
19123 -       if (!cxt->isordered) {
19124 -               unsigned long rgn_off = *pp - cxt->rgn[rgn].start;
19125 -
19126 -               if (!ft_reorder(cxt, nextra))
19127 -                       return 0;
19128 -
19129 -               *pp = cxt->rgn[rgn].start + rgn_off;
19130 -       }
19131 -       if (ft_shuffle(cxt, pp, rgn, nextra))
19132 -               return 1;
19133 -
19134 -       /* See if there is space after the strings section */
19135 -       ssize = cxt->rgn[FT_STRINGS].size;
19136 -       if (cxt->rgn[FT_STRINGS].start + ssize
19137 -                       < (char *)cxt->bph + cxt->max_size) {
19138 -               /* move strings up as far as possible */
19139 -               str = (char *)cxt->bph + cxt->max_size - ssize;
19140 -               cxt->str_anchor += str - cxt->rgn[FT_STRINGS].start;
19141 -               memmove(str, cxt->rgn[FT_STRINGS].start, ssize);
19142 -               cxt->rgn[FT_STRINGS].start = str;
19143 -               /* enough space now? */
19144 -               if (rgn >= FT_STRUCT && ft_shuffle(cxt, pp, rgn, nextra))
19145 -                       return 1;
19146 -       }
19147 -
19148 -       /* how much total free space is there following this region? */
19149 -       tot = 0;
19150 -       for (r = rgn; r < FT_STRINGS; ++r) {
19151 -               char *r_end = cxt->rgn[r].start + cxt->rgn[r].size;
19152 -               tot += next_start(cxt, rgn) - r_end;
19153 -       }
19154 -
19155 -       /* cast is to shut gcc up; we know nextra >= 0 */
19156 -       if (tot < (unsigned int)nextra) {
19157 -               /* have to reallocate */
19158 -               char *newp, *new_start;
19159 -               int shift;
19160 -
19161 -               if (!cxt->realloc)
19162 -                       return 0;
19163 -               size = _ALIGN(cxt->max_size + (nextra - tot) + EXPAND_INCR, 8);
19164 -               newp = cxt->realloc(cxt->bph, size);
19165 -               if (!newp)
19166 -                       return 0;
19167 -               cxt->max_size = size;
19168 -               shift = newp - (char *)cxt->bph;
19169 -
19170 -               if (shift) { /* realloc can return same addr */
19171 -                       cxt->bph = (struct boot_param_header *)newp;
19172 -                       ft_node_update_after(cxt, cxt->rgn[FT_STRUCT].start,
19173 -                                       shift);
19174 -                       for (r = FT_RSVMAP; r <= FT_STRINGS; ++r) {
19175 -                               new_start = cxt->rgn[r].start + shift;
19176 -                               cxt->rgn[r].start = new_start;
19177 -                       }
19178 -                       *pp += shift;
19179 -                       cxt->str_anchor += shift;
19180 -               }
19181 -
19182 -               /* move strings up to the end */
19183 -               str = newp + size - ssize;
19184 -               cxt->str_anchor += str - cxt->rgn[FT_STRINGS].start;
19185 -               memmove(str, cxt->rgn[FT_STRINGS].start, ssize);
19186 -               cxt->rgn[FT_STRINGS].start = str;
19187 -
19188 -               if (ft_shuffle(cxt, pp, rgn, nextra))
19189 -                       return 1;
19190 -       }
19191 -
19192 -       /* must be FT_RSVMAP and we need to move FT_STRUCT up */
19193 -       if (rgn == FT_RSVMAP) {
19194 -               next = cxt->rgn[FT_RSVMAP].start + cxt->rgn[FT_RSVMAP].size
19195 -                       + nextra;
19196 -               ssize = cxt->rgn[FT_STRUCT].size;
19197 -               if (next + ssize >= cxt->rgn[FT_STRINGS].start)
19198 -                       return 0;       /* "can't happen" */
19199 -               memmove(next, cxt->rgn[FT_STRUCT].start, ssize);
19200 -               ft_node_update_after(cxt, cxt->rgn[FT_STRUCT].start, nextra);
19201 -               cxt->rgn[FT_STRUCT].start = next;
19202 -
19203 -               if (ft_shuffle(cxt, pp, rgn, nextra))
19204 -                       return 1;
19205 -       }
19206 -
19207 -       return 0;               /* "can't happen" */
19208 -}
19209 -
19210 -static void ft_put_word(struct ft_cxt *cxt, u32 v)
19211 -{
19212 -       *(u32 *) cxt->p = cpu_to_be32(v);
19213 -       cxt->p += 4;
19214 -}
19215 -
19216 -static void ft_put_bin(struct ft_cxt *cxt, const void *data, unsigned int sz)
19217 -{
19218 -       unsigned long sza = _ALIGN(sz, 4);
19219 -
19220 -       /* zero out the alignment gap if necessary */
19221 -       if (sz < sza)
19222 -               *(u32 *) (cxt->p + sza - 4) = 0;
19223 -
19224 -       /* copy in the data */
19225 -       memcpy(cxt->p, data, sz);
19226 -
19227 -       cxt->p += sza;
19228 -}
19229 -
19230 -char *ft_begin_node(struct ft_cxt *cxt, const char *name)
19231 -{
19232 -       unsigned long nlen = strlen(name) + 1;
19233 -       unsigned long len = 8 + _ALIGN(nlen, 4);
19234 -       char *ret;
19235 -
19236 -       if (!ft_make_space(cxt, &cxt->p, FT_STRUCT, len))
19237 -               return NULL;
19238 -
19239 -       ret = cxt->p;
19240 -
19241 -       ft_put_word(cxt, OF_DT_BEGIN_NODE);
19242 -       ft_put_bin(cxt, name, strlen(name) + 1);
19243 -
19244 -       return ret;
19245 -}
19246 -
19247 -void ft_end_node(struct ft_cxt *cxt)
19248 -{
19249 -       ft_put_word(cxt, OF_DT_END_NODE);
19250 -}
19251 -
19252 -void ft_nop(struct ft_cxt *cxt)
19253 -{
19254 -       if (ft_make_space(cxt, &cxt->p, FT_STRUCT, 4))
19255 -               ft_put_word(cxt, OF_DT_NOP);
19256 -}
19257 -
19258 -#define NO_STRING      0x7fffffff
19259 -
19260 -static int lookup_string(struct ft_cxt *cxt, const char *name)
19261 -{
19262 -       char *p, *end;
19263 -
19264 -       p = cxt->rgn[FT_STRINGS].start;
19265 -       end = p + cxt->rgn[FT_STRINGS].size;
19266 -       while (p < end) {
19267 -               if (strcmp(p, (char *)name) == 0)
19268 -                       return p - cxt->str_anchor;
19269 -               p += strlen(p) + 1;
19270 -       }
19271 -
19272 -       return NO_STRING;
19273 -}
19274 -
19275 -/* lookup string and insert if not found */
19276 -static int map_string(struct ft_cxt *cxt, const char *name)
19277 -{
19278 -       int off;
19279 -       char *p;
19280 -
19281 -       off = lookup_string(cxt, name);
19282 -       if (off != NO_STRING)
19283 -               return off;
19284 -       p = cxt->rgn[FT_STRINGS].start;
19285 -       if (!ft_make_space(cxt, &p, FT_STRINGS, strlen(name) + 1))
19286 -               return NO_STRING;
19287 -       strcpy(p, name);
19288 -       return p - cxt->str_anchor;
19289 -}
19290 -
19291 -int ft_prop(struct ft_cxt *cxt, const char *name, const void *data,
19292 -               unsigned int sz)
19293 -{
19294 -       int off, len;
19295 -
19296 -       off = map_string(cxt, name);
19297 -       if (off == NO_STRING)
19298 -               return -1;
19299 -
19300 -       len = 12 + _ALIGN(sz, 4);
19301 -       if (!ft_make_space(cxt, &cxt->p, FT_STRUCT, len))
19302 -               return -1;
19303 -
19304 -       ft_put_word(cxt, OF_DT_PROP);
19305 -       ft_put_word(cxt, sz);
19306 -       ft_put_word(cxt, off);
19307 -       ft_put_bin(cxt, data, sz);
19308 -       return 0;
19309 -}
19310 -
19311 -int ft_prop_str(struct ft_cxt *cxt, const char *name, const char *str)
19312 -{
19313 -       return ft_prop(cxt, name, str, strlen(str) + 1);
19314 -}
19315 -
19316 -int ft_prop_int(struct ft_cxt *cxt, const char *name, unsigned int val)
19317 -{
19318 -       u32 v = cpu_to_be32((u32) val);
19319 -
19320 -       return ft_prop(cxt, name, &v, 4);
19321 -}
19322 -
19323 -/* Calculate the size of the reserved map */
19324 -static unsigned long rsvmap_size(struct ft_cxt *cxt)
19325 -{
19326 -       struct ft_reserve *res;
19327 -
19328 -       res = (struct ft_reserve *)cxt->rgn[FT_RSVMAP].start;
19329 -       while (res->start || res->len)
19330 -               ++res;
19331 -       return (char *)(res + 1) - cxt->rgn[FT_RSVMAP].start;
19332 -}
19333 -
19334 -/* Calculate the size of the struct region by stepping through it */
19335 -static unsigned long struct_size(struct ft_cxt *cxt)
19336 -{
19337 -       char *p = cxt->rgn[FT_STRUCT].start;
19338 -       char *next;
19339 -       struct ft_atom atom;
19340 -
19341 -       /* make check in ft_next happy */
19342 -       if (cxt->rgn[FT_STRUCT].size == 0)
19343 -               cxt->rgn[FT_STRUCT].size = 0xfffffffful - (unsigned long)p;
19344 -
19345 -       while ((next = ft_next(cxt, p, &atom)) != NULL)
19346 -               p = next;
19347 -       return p + 4 - cxt->rgn[FT_STRUCT].start;
19348 -}
19349 -
19350 -/* add `adj' on to all string offset values in the struct area */
19351 -static void adjust_string_offsets(struct ft_cxt *cxt, int adj)
19352 -{
19353 -       char *p = cxt->rgn[FT_STRUCT].start;
19354 -       char *next;
19355 -       struct ft_atom atom;
19356 -       int off;
19357 -
19358 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19359 -               if (atom.tag == OF_DT_PROP) {
19360 -                       off = be32_to_cpu(*(u32 *) (p + 8));
19361 -                       *(u32 *) (p + 8) = cpu_to_be32(off + adj);
19362 -               }
19363 -               p = next;
19364 -       }
19365 -}
19366 -
19367 -/* start construction of the flat OF tree from scratch */
19368 -void ft_begin(struct ft_cxt *cxt, void *blob, unsigned int max_size,
19369 -               void *(*realloc_fn) (void *, unsigned long))
19370 -{
19371 -       struct boot_param_header *bph = blob;
19372 -       char *p;
19373 -       struct ft_reserve *pres;
19374 -
19375 -       /* clear the cxt */
19376 -       memset(cxt, 0, sizeof(*cxt));
19377 -
19378 -       cxt->bph = bph;
19379 -       cxt->max_size = max_size;
19380 -       cxt->realloc = realloc_fn;
19381 -       cxt->isordered = 1;
19382 -
19383 -       /* zero everything in the header area */
19384 -       memset(bph, 0, sizeof(*bph));
19385 -
19386 -       bph->magic = cpu_to_be32(OF_DT_HEADER);
19387 -       bph->version = cpu_to_be32(0x10);
19388 -       bph->last_comp_version = cpu_to_be32(0x10);
19389 -
19390 -       /* start pointers */
19391 -       cxt->rgn[FT_RSVMAP].start = p = blob + HDR_SIZE;
19392 -       cxt->rgn[FT_RSVMAP].size = sizeof(struct ft_reserve);
19393 -       pres = (struct ft_reserve *)p;
19394 -       cxt->rgn[FT_STRUCT].start = p += sizeof(struct ft_reserve);
19395 -       cxt->rgn[FT_STRUCT].size = 4;
19396 -       cxt->rgn[FT_STRINGS].start = blob + max_size;
19397 -       cxt->rgn[FT_STRINGS].size = 0;
19398 -
19399 -       /* init rsvmap and struct */
19400 -       pres->start = 0;
19401 -       pres->len = 0;
19402 -       *(u32 *) p = cpu_to_be32(OF_DT_END);
19403 -
19404 -       cxt->str_anchor = blob;
19405 -}
19406 -
19407 -/* open up an existing blob to be examined or modified */
19408 -int ft_open(struct ft_cxt *cxt, void *blob, unsigned int max_size,
19409 -               unsigned int max_find_device,
19410 -               void *(*realloc_fn) (void *, unsigned long))
19411 -{
19412 -       struct boot_param_header *bph = blob;
19413 -
19414 -       /* can't cope with version < 16 */
19415 -       if (be32_to_cpu(bph->version) < 16)
19416 -               return -1;
19417 -
19418 -       /* clear the cxt */
19419 -       memset(cxt, 0, sizeof(*cxt));
19420 -
19421 -       /* alloc node_tbl to track node ptrs returned by ft_find_device */
19422 -       ++max_find_device;
19423 -       cxt->node_tbl = realloc_fn(NULL, max_find_device * sizeof(char *));
19424 -       if (!cxt->node_tbl)
19425 -               return -1;
19426 -       memset(cxt->node_tbl, 0, max_find_device * sizeof(char *));
19427 -       cxt->node_max = max_find_device;
19428 -       cxt->nodes_used = 1;    /* don't use idx 0 b/c looks like NULL */
19429 -
19430 -       cxt->bph = bph;
19431 -       cxt->max_size = max_size;
19432 -       cxt->realloc = realloc_fn;
19433 -
19434 -       cxt->rgn[FT_RSVMAP].start = blob + be32_to_cpu(bph->off_mem_rsvmap);
19435 -       cxt->rgn[FT_RSVMAP].size = rsvmap_size(cxt);
19436 -       cxt->rgn[FT_STRUCT].start = blob + be32_to_cpu(bph->off_dt_struct);
19437 -       cxt->rgn[FT_STRUCT].size = struct_size(cxt);
19438 -       cxt->rgn[FT_STRINGS].start = blob + be32_to_cpu(bph->off_dt_strings);
19439 -       cxt->rgn[FT_STRINGS].size = be32_to_cpu(bph->dt_strings_size);
19440 -
19441 -       cxt->p = cxt->rgn[FT_STRUCT].start;
19442 -       cxt->str_anchor = cxt->rgn[FT_STRINGS].start;
19443 -
19444 -       return 0;
19445 -}
19446 -
19447 -/* add a reserver physical area to the rsvmap */
19448 -int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size)
19449 -{
19450 -       char *p;
19451 -       struct ft_reserve *pres;
19452 -
19453 -       p = cxt->rgn[FT_RSVMAP].start + cxt->rgn[FT_RSVMAP].size
19454 -               - sizeof(struct ft_reserve);
19455 -       if (!ft_make_space(cxt, &p, FT_RSVMAP, sizeof(struct ft_reserve)))
19456 -               return -1;
19457 -
19458 -       pres = (struct ft_reserve *)p;
19459 -       pres->start = cpu_to_be64(physaddr);
19460 -       pres->len = cpu_to_be64(size);
19461 -
19462 -       return 0;
19463 -}
19464 -
19465 -void ft_begin_tree(struct ft_cxt *cxt)
19466 -{
19467 -       cxt->p = ft_root_node(cxt);
19468 -}
19469 -
19470 -void ft_end_tree(struct ft_cxt *cxt)
19471 -{
19472 -       struct boot_param_header *bph = cxt->bph;
19473 -       char *p, *oldstr, *str, *endp;
19474 -       unsigned long ssize;
19475 -       int adj;
19476 -
19477 -       if (!cxt->isordered)
19478 -               return;         /* we haven't touched anything */
19479 -
19480 -       /* adjust string offsets */
19481 -       oldstr = cxt->rgn[FT_STRINGS].start;
19482 -       adj = cxt->str_anchor - oldstr;
19483 -       if (adj)
19484 -               adjust_string_offsets(cxt, adj);
19485 -
19486 -       /* make strings end on 8-byte boundary */
19487 -       ssize = cxt->rgn[FT_STRINGS].size;
19488 -       endp = (char *)_ALIGN((unsigned long)cxt->rgn[FT_STRUCT].start
19489 -                       + cxt->rgn[FT_STRUCT].size + ssize, 8);
19490 -       str = endp - ssize;
19491 -
19492 -       /* move strings down to end of structs */
19493 -       memmove(str, oldstr, ssize);
19494 -       cxt->str_anchor = str;
19495 -       cxt->rgn[FT_STRINGS].start = str;
19496 -
19497 -       /* fill in header fields */
19498 -       p = (char *)bph;
19499 -       bph->totalsize = cpu_to_be32(endp - p);
19500 -       bph->off_mem_rsvmap = cpu_to_be32(cxt->rgn[FT_RSVMAP].start - p);
19501 -       bph->off_dt_struct = cpu_to_be32(cxt->rgn[FT_STRUCT].start - p);
19502 -       bph->off_dt_strings = cpu_to_be32(cxt->rgn[FT_STRINGS].start - p);
19503 -       bph->dt_strings_size = cpu_to_be32(ssize);
19504 -}
19505 -
19506 -void *ft_find_device(struct ft_cxt *cxt, const void *top, const char *srch_path)
19507 -{
19508 -       char *node;
19509 -
19510 -       if (top) {
19511 -               node = ft_node_ph2node(cxt, top);
19512 -               if (node == NULL)
19513 -                       return NULL;
19514 -       } else {
19515 -               node = ft_root_node(cxt);
19516 -       }
19517 -
19518 -       node = ft_find_descendent(cxt, node, srch_path);
19519 -       return ft_get_phandle(cxt, node);
19520 -}
19521 -
19522 -void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path)
19523 -{
19524 -       struct ft_atom atom;
19525 -       char *p;
19526 -       const char *cp, *q;
19527 -       int cl;
19528 -       int depth = -1;
19529 -       int dmatch = 0;
19530 -       const char *path_comp[FT_MAX_DEPTH];
19531 -
19532 -       cp = srch_path;
19533 -       cl = 0;
19534 -       p = top;
19535 -
19536 -       while ((p = ft_next(cxt, p, &atom)) != NULL) {
19537 -               switch (atom.tag) {
19538 -               case OF_DT_BEGIN_NODE:
19539 -                       ++depth;
19540 -                       if (depth != dmatch)
19541 -                               break;
19542 -                       cxt->genealogy[depth] = atom.data;
19543 -                       cxt->genealogy[depth + 1] = NULL;
19544 -                       if (depth && !(strncmp(atom.name, cp, cl) == 0
19545 -                                       && (atom.name[cl] == '/'
19546 -                                               || atom.name[cl] == '\0'
19547 -                                               || atom.name[cl] == '@')))
19548 -                               break;
19549 -                       path_comp[dmatch] = cp;
19550 -                       /* it matches so far, advance to next path component */
19551 -                       cp += cl;
19552 -                       /* skip slashes */
19553 -                       while (*cp == '/')
19554 -                               ++cp;
19555 -                       /* we're done if this is the end of the string */
19556 -                       if (*cp == 0)
19557 -                               return atom.data;
19558 -                       /* look for end of this component */
19559 -                       q = strchr(cp, '/');
19560 -                       if (q)
19561 -                               cl = q - cp;
19562 -                       else
19563 -                               cl = strlen(cp);
19564 -                       ++dmatch;
19565 -                       break;
19566 -               case OF_DT_END_NODE:
19567 -                       if (depth == 0)
19568 -                               return NULL;
19569 -                       if (dmatch > depth) {
19570 -                               --dmatch;
19571 -                               cl = cp - path_comp[dmatch] - 1;
19572 -                               cp = path_comp[dmatch];
19573 -                               while (cl > 0 && cp[cl - 1] == '/')
19574 -                                       --cl;
19575 -                       }
19576 -                       --depth;
19577 -                       break;
19578 -               }
19579 -       }
19580 -       return NULL;
19581 -}
19582 -
19583 -void *__ft_get_parent(struct ft_cxt *cxt, void *node)
19584 -{
19585 -       int d;
19586 -       struct ft_atom atom;
19587 -       char *p;
19588 -
19589 -       for (d = 0; cxt->genealogy[d] != NULL; ++d)
19590 -               if (cxt->genealogy[d] == node)
19591 -                       return d > 0 ? cxt->genealogy[d - 1] : NULL;
19592 -
19593 -       /* have to do it the hard way... */
19594 -       p = ft_root_node(cxt);
19595 -       d = 0;
19596 -       while ((p = ft_next(cxt, p, &atom)) != NULL) {
19597 -               switch (atom.tag) {
19598 -               case OF_DT_BEGIN_NODE:
19599 -                       cxt->genealogy[d] = atom.data;
19600 -                       if (node == atom.data) {
19601 -                               /* found it */
19602 -                               cxt->genealogy[d + 1] = NULL;
19603 -                               return d > 0 ? cxt->genealogy[d - 1] : NULL;
19604 -                       }
19605 -                       ++d;
19606 -                       break;
19607 -               case OF_DT_END_NODE:
19608 -                       --d;
19609 -                       break;
19610 -               }
19611 -       }
19612 -       return NULL;
19613 -}
19614 -
19615 -void *ft_get_parent(struct ft_cxt *cxt, const void *phandle)
19616 -{
19617 -       void *node = ft_node_ph2node(cxt, phandle);
19618 -       if (node == NULL)
19619 -               return NULL;
19620 -
19621 -       node = __ft_get_parent(cxt, node);
19622 -       return ft_get_phandle(cxt, node);
19623 -}
19624 -
19625 -static const void *__ft_get_prop(struct ft_cxt *cxt, void *node,
19626 -                                 const char *propname, unsigned int *len)
19627 -{
19628 -       struct ft_atom atom;
19629 -       int depth = 0;
19630 -
19631 -       while ((node = ft_next(cxt, node, &atom)) != NULL) {
19632 -               switch (atom.tag) {
19633 -               case OF_DT_BEGIN_NODE:
19634 -                       ++depth;
19635 -                       break;
19636 -
19637 -               case OF_DT_PROP:
19638 -                       if (depth != 1 || strcmp(atom.name, propname))
19639 -                               break;
19640 -
19641 -                       if (len)
19642 -                               *len = atom.size;
19643 -
19644 -                       return atom.data;
19645 -
19646 -               case OF_DT_END_NODE:
19647 -                       if (--depth <= 0)
19648 -                               return NULL;
19649 -               }
19650 -       }
19651 -
19652 -       return NULL;
19653 -}
19654 -
19655 -int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
19656 -               void *buf, const unsigned int buflen)
19657 -{
19658 -       const void *data;
19659 -       unsigned int size;
19660 -
19661 -       void *node = ft_node_ph2node(cxt, phandle);
19662 -       if (!node)
19663 -               return -1;
19664 -
19665 -       data = __ft_get_prop(cxt, node, propname, &size);
19666 -       if (data) {
19667 -               unsigned int clipped_size = min(size, buflen);
19668 -               memcpy(buf, data, clipped_size);
19669 -               return size;
19670 -       }
19671 -
19672 -       return -1;
19673 -}
19674 -
19675 -void *__ft_find_node_by_prop_value(struct ft_cxt *cxt, void *prev,
19676 -                                   const char *propname, const char *propval,
19677 -                                   unsigned int proplen)
19678 -{
19679 -       struct ft_atom atom;
19680 -       char *p = ft_root_node(cxt);
19681 -       char *next;
19682 -       int past_prev = prev ? 0 : 1;
19683 -       int depth = -1;
19684 -
19685 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19686 -               const void *data;
19687 -               unsigned int size;
19688 -
19689 -               switch (atom.tag) {
19690 -               case OF_DT_BEGIN_NODE:
19691 -                       depth++;
19692 -
19693 -                       if (prev == p) {
19694 -                               past_prev = 1;
19695 -                               break;
19696 -                       }
19697 -
19698 -                       if (!past_prev || depth < 1)
19699 -                               break;
19700 -
19701 -                       data = __ft_get_prop(cxt, p, propname, &size);
19702 -                       if (!data || size != proplen)
19703 -                               break;
19704 -                       if (memcmp(data, propval, size))
19705 -                               break;
19706 -
19707 -                       return p;
19708 -
19709 -               case OF_DT_END_NODE:
19710 -                       if (depth-- == 0)
19711 -                               return NULL;
19712 -
19713 -                       break;
19714 -               }
19715 -
19716 -               p = next;
19717 -       }
19718 -
19719 -       return NULL;
19720 -}
19721 -
19722 -void *ft_find_node_by_prop_value(struct ft_cxt *cxt, const void *prev,
19723 -                                 const char *propname, const char *propval,
19724 -                                 int proplen)
19725 -{
19726 -       void *node = NULL;
19727 -
19728 -       if (prev) {
19729 -               node = ft_node_ph2node(cxt, prev);
19730 -
19731 -               if (!node)
19732 -                       return NULL;
19733 -       }
19734 -
19735 -       node = __ft_find_node_by_prop_value(cxt, node, propname,
19736 -                                           propval, proplen);
19737 -       return ft_get_phandle(cxt, node);
19738 -}
19739 -
19740 -int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
19741 -               const void *buf, const unsigned int buflen)
19742 -{
19743 -       struct ft_atom atom;
19744 -       void *node;
19745 -       char *p, *next;
19746 -       int nextra;
19747 -
19748 -       node = ft_node_ph2node(cxt, phandle);
19749 -       if (node == NULL)
19750 -               return -1;
19751 -
19752 -       next = ft_next(cxt, node, &atom);
19753 -       if (atom.tag != OF_DT_BEGIN_NODE)
19754 -               /* phandle didn't point to a node */
19755 -               return -1;
19756 -       p = next;
19757 -
19758 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19759 -               switch (atom.tag) {
19760 -               case OF_DT_BEGIN_NODE: /* properties must go before subnodes */
19761 -               case OF_DT_END_NODE:
19762 -                       /* haven't found the property, insert here */
19763 -                       cxt->p = p;
19764 -                       return ft_prop(cxt, propname, buf, buflen);
19765 -               case OF_DT_PROP:
19766 -                       if (strcmp(atom.name, propname))
19767 -                               break;
19768 -                       /* found an existing property, overwrite it */
19769 -                       nextra = _ALIGN(buflen, 4) - _ALIGN(atom.size, 4);
19770 -                       cxt->p = atom.data;
19771 -                       if (nextra && !ft_make_space(cxt, &cxt->p, FT_STRUCT,
19772 -                                               nextra))
19773 -                               return -1;
19774 -                       *(u32 *) (cxt->p - 8) = cpu_to_be32(buflen);
19775 -                       ft_put_bin(cxt, buf, buflen);
19776 -                       return 0;
19777 -               }
19778 -               p = next;
19779 -       }
19780 -       return -1;
19781 -}
19782 -
19783 -int ft_del_prop(struct ft_cxt *cxt, const void *phandle, const char *propname)
19784 -{
19785 -       struct ft_atom atom;
19786 -       void *node;
19787 -       char *p, *next;
19788 -       int size;
19789 -
19790 -       node = ft_node_ph2node(cxt, phandle);
19791 -       if (node == NULL)
19792 -               return -1;
19793 -
19794 -       p = node;
19795 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19796 -               switch (atom.tag) {
19797 -               case OF_DT_BEGIN_NODE:
19798 -               case OF_DT_END_NODE:
19799 -                       return -1;
19800 -               case OF_DT_PROP:
19801 -                       if (strcmp(atom.name, propname))
19802 -                               break;
19803 -                       /* found the property, remove it */
19804 -                       size = 12 + -_ALIGN(atom.size, 4);
19805 -                       cxt->p = p;
19806 -                       if (!ft_make_space(cxt, &cxt->p, FT_STRUCT, -size))
19807 -                               return -1;
19808 -                       return 0;
19809 -               }
19810 -               p = next;
19811 -       }
19812 -       return -1;
19813 -}
19814 -
19815 -void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name)
19816 -{
19817 -       struct ft_atom atom;
19818 -       char *p, *next, *ret;
19819 -       int depth = 0;
19820 -
19821 -       if (parent) {
19822 -               p = ft_node_ph2node(cxt, parent);
19823 -               if (!p)
19824 -                       return NULL;
19825 -       } else {
19826 -               p = ft_root_node(cxt);
19827 -       }
19828 -
19829 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19830 -               switch (atom.tag) {
19831 -               case OF_DT_BEGIN_NODE:
19832 -                       ++depth;
19833 -                       if (depth == 1 && strcmp(atom.name, name) == 0)
19834 -                               /* duplicate node name, return error */
19835 -                               return NULL;
19836 -                       break;
19837 -               case OF_DT_END_NODE:
19838 -                       --depth;
19839 -                       if (depth > 0)
19840 -                               break;
19841 -                       /* end of node, insert here */
19842 -                       cxt->p = p;
19843 -                       ret = ft_begin_node(cxt, name);
19844 -                       ft_end_node(cxt);
19845 -                       return ft_get_phandle(cxt, ret);
19846 -               }
19847 -               p = next;
19848 -       }
19849 -       return NULL;
19850 -}
19851 -
19852 -/* Returns the start of the path within the provided buffer, or NULL on
19853 - * error.
19854 - */
19855 -char *ft_get_path(struct ft_cxt *cxt, const void *phandle,
19856 -                  char *buf, int len)
19857 -{
19858 -       const char *path_comp[FT_MAX_DEPTH];
19859 -       struct ft_atom atom;
19860 -       char *p, *next, *pos;
19861 -       int depth = 0, i;
19862 -       void *node;
19863 -
19864 -       node = ft_node_ph2node(cxt, phandle);
19865 -       if (node == NULL)
19866 -               return NULL;
19867 -
19868 -       p = ft_root_node(cxt);
19869 -
19870 -       while ((next = ft_next(cxt, p, &atom)) != NULL) {
19871 -               switch (atom.tag) {
19872 -               case OF_DT_BEGIN_NODE:
19873 -                       path_comp[depth++] = atom.name;
19874 -                       if (p == node)
19875 -                               goto found;
19876 -
19877 -                       break;
19878 -
19879 -               case OF_DT_END_NODE:
19880 -                       if (--depth == 0)
19881 -                               return NULL;
19882 -               }
19883 -
19884 -               p = next;
19885 -       }
19886 -
19887 -found:
19888 -       pos = buf;
19889 -       for (i = 1; i < depth; i++) {
19890 -               int this_len;
19891 -
19892 -               if (len <= 1)
19893 -                       return NULL;
19894 -
19895 -               *pos++ = '/';
19896 -               len--;
19897 -
19898 -               strncpy(pos, path_comp[i], len);
19899 -
19900 -               if (pos[len - 1] != 0)
19901 -                       return NULL;
19902 -
19903 -               this_len = strlen(pos);
19904 -               len -= this_len;
19905 -               pos += this_len;
19906 -       }
19907 -
19908 -       return buf;
19909 -}
19910 --- a/arch/powerpc/boot/flatdevtree.h
19911 +++ /dev/null
19912 @@ -1,113 +0,0 @@
19913 -/*
19914 - * This program is free software; you can redistribute it and/or modify
19915 - * it under the terms of the GNU General Public License as published by
19916 - * the Free Software Foundation; either version 2 of the License, or
19917 - * (at your option) any later version.
19918 - *
19919 - * This program is distributed in the hope that it will be useful,
19920 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
19921 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19922 - * GNU General Public License for more details.
19923 - *
19924 - * You should have received a copy of the GNU General Public License
19925 - * along with this program; if not, write to the Free Software
19926 - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19927 - */
19928 -
19929 -#ifndef FLATDEVTREE_H
19930 -#define FLATDEVTREE_H
19931 -
19932 -#include "flatdevtree_env.h"
19933 -
19934 -/* Definitions used by the flattened device tree */
19935 -#define OF_DT_HEADER            0xd00dfeed      /* marker */
19936 -#define OF_DT_BEGIN_NODE        0x1     /* Start of node, full name */
19937 -#define OF_DT_END_NODE          0x2     /* End node */
19938 -#define OF_DT_PROP              0x3     /* Property: name off, size, content */
19939 -#define OF_DT_NOP               0x4     /* nop */
19940 -#define OF_DT_END               0x9
19941 -
19942 -#define OF_DT_VERSION           0x10
19943 -
19944 -struct boot_param_header {
19945 -       u32 magic;              /* magic word OF_DT_HEADER */
19946 -       u32 totalsize;          /* total size of DT block */
19947 -       u32 off_dt_struct;      /* offset to structure */
19948 -       u32 off_dt_strings;     /* offset to strings */
19949 -       u32 off_mem_rsvmap;     /* offset to memory reserve map */
19950 -       u32 version;            /* format version */
19951 -       u32 last_comp_version;  /* last compatible version */
19952 -       /* version 2 fields below */
19953 -       u32 boot_cpuid_phys;    /* Physical CPU id we're booting on */
19954 -       /* version 3 fields below */
19955 -       u32 dt_strings_size;    /* size of the DT strings block */
19956 -};
19957 -
19958 -struct ft_reserve {
19959 -       u64 start;
19960 -       u64 len;
19961 -};
19962 -
19963 -struct ft_region {
19964 -       char *start;
19965 -       unsigned long size;
19966 -};
19967 -
19968 -enum ft_rgn_id {
19969 -       FT_RSVMAP,
19970 -       FT_STRUCT,
19971 -       FT_STRINGS,
19972 -       FT_N_REGION
19973 -};
19974 -
19975 -#define FT_MAX_DEPTH   50
19976 -
19977 -struct ft_cxt {
19978 -       struct boot_param_header *bph;
19979 -       int max_size;           /* maximum size of tree */
19980 -       int isordered;          /* everything in standard order */
19981 -       void *(*realloc)(void *, unsigned long);
19982 -       char *str_anchor;
19983 -       char *p;                /* current insertion point in structs */
19984 -       struct ft_region rgn[FT_N_REGION];
19985 -       void *genealogy[FT_MAX_DEPTH+1];
19986 -       char **node_tbl;
19987 -       unsigned int node_max;
19988 -       unsigned int nodes_used;
19989 -};
19990 -
19991 -char *ft_begin_node(struct ft_cxt *cxt, const char *name);
19992 -void ft_end_node(struct ft_cxt *cxt);
19993 -
19994 -void ft_begin_tree(struct ft_cxt *cxt);
19995 -void ft_end_tree(struct ft_cxt *cxt);
19996 -
19997 -void ft_nop(struct ft_cxt *cxt);
19998 -int ft_prop(struct ft_cxt *cxt, const char *name,
19999 -           const void *data, unsigned int sz);
20000 -int ft_prop_str(struct ft_cxt *cxt, const char *name, const char *str);
20001 -int ft_prop_int(struct ft_cxt *cxt, const char *name, unsigned int val);
20002 -void ft_begin(struct ft_cxt *cxt, void *blob, unsigned int max_size,
20003 -             void *(*realloc_fn)(void *, unsigned long));
20004 -int ft_open(struct ft_cxt *cxt, void *blob, unsigned int max_size,
20005 -               unsigned int max_find_device,
20006 -               void *(*realloc_fn)(void *, unsigned long));
20007 -int ft_add_rsvmap(struct ft_cxt *cxt, u64 physaddr, u64 size);
20008 -
20009 -void ft_dump_blob(const void *bphp);
20010 -void ft_merge_blob(struct ft_cxt *cxt, void *blob);
20011 -void *ft_find_device(struct ft_cxt *cxt, const void *top,
20012 -                     const char *srch_path);
20013 -void *ft_find_descendent(struct ft_cxt *cxt, void *top, const char *srch_path);
20014 -int ft_get_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
20015 -               void *buf, const unsigned int buflen);
20016 -int ft_set_prop(struct ft_cxt *cxt, const void *phandle, const char *propname,
20017 -               const void *buf, const unsigned int buflen);
20018 -void *ft_get_parent(struct ft_cxt *cxt, const void *phandle);
20019 -void *ft_find_node_by_prop_value(struct ft_cxt *cxt, const void *prev,
20020 -                                 const char *propname, const char *propval,
20021 -                                 int proplen);
20022 -void *ft_create_node(struct ft_cxt *cxt, const void *parent, const char *name);
20023 -char *ft_get_path(struct ft_cxt *cxt, const void *phandle, char *buf, int len);
20024 -
20025 -#endif /* FLATDEVTREE_H */
20026 --- a/arch/powerpc/boot/flatdevtree_misc.c
20027 +++ /dev/null
20028 @@ -1,79 +0,0 @@
20029 -/*
20030 - * This file does the necessary interface mapping between the bootwrapper
20031 - * device tree operations and the interface provided by shared source
20032 - * files flatdevicetree.[ch].
20033 - *
20034 - * Author: Mark A. Greer <mgreer@mvista.com>
20035 - *
20036 - * 2006 (c) MontaVista Software, Inc.  This file is licensed under
20037 - * the terms of the GNU General Public License version 2.  This program
20038 - * is licensed "as is" without any warranty of any kind, whether express
20039 - * or implied.
20040 - */
20041 -#include <stddef.h>
20042 -#include "flatdevtree.h"
20043 -#include "ops.h"
20044 -
20045 -static struct ft_cxt cxt;
20046 -
20047 -static void *fdtm_finddevice(const char *name)
20048 -{
20049 -       return ft_find_device(&cxt, NULL, name);
20050 -}
20051 -
20052 -static int fdtm_getprop(const void *phandle, const char *propname,
20053 -                        void *buf, const int buflen)
20054 -{
20055 -       return ft_get_prop(&cxt, phandle, propname, buf, buflen);
20056 -}
20057 -
20058 -static int fdtm_setprop(const void *phandle, const char *propname,
20059 -                        const void *buf, const int buflen)
20060 -{
20061 -       return ft_set_prop(&cxt, phandle, propname, buf, buflen);
20062 -}
20063 -
20064 -static void *fdtm_get_parent(const void *phandle)
20065 -{
20066 -       return ft_get_parent(&cxt, phandle);
20067 -}
20068 -
20069 -static void *fdtm_create_node(const void *phandle, const char *name)
20070 -{
20071 -       return ft_create_node(&cxt, phandle, name);
20072 -}
20073 -
20074 -static void *fdtm_find_node_by_prop_value(const void *prev,
20075 -                                          const char *propname,
20076 -                                          const char *propval,
20077 -                                          int proplen)
20078 -{
20079 -       return ft_find_node_by_prop_value(&cxt, prev, propname,
20080 -                                         propval, proplen);
20081 -}
20082 -
20083 -static unsigned long fdtm_finalize(void)
20084 -{
20085 -       ft_end_tree(&cxt);
20086 -       return (unsigned long)cxt.bph;
20087 -}
20088 -
20089 -static char *fdtm_get_path(const void *phandle, char *buf, int len)
20090 -{
20091 -       return ft_get_path(&cxt, phandle, buf, len);
20092 -}
20093 -
20094 -int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device)
20095 -{
20096 -       dt_ops.finddevice = fdtm_finddevice;
20097 -       dt_ops.getprop = fdtm_getprop;
20098 -       dt_ops.setprop = fdtm_setprop;
20099 -       dt_ops.get_parent = fdtm_get_parent;
20100 -       dt_ops.create_node = fdtm_create_node;
20101 -       dt_ops.find_node_by_prop_value = fdtm_find_node_by_prop_value;
20102 -       dt_ops.finalize = fdtm_finalize;
20103 -       dt_ops.get_path = fdtm_get_path;
20104 -
20105 -       return ft_open(&cxt, dt_blob, max_size, max_find_device,
20106 -                       platform_ops.realloc);
20107 -}
20108 --- a/arch/powerpc/boot/holly.c
20109 +++ b/arch/powerpc/boot/holly.c
20110 @@ -28,6 +28,6 @@
20111         u32 heapsize = 0x8000000 - (u32)_end; /* 128M */
20112  
20113         simple_alloc_init(_end, heapsize, 32, 64);
20114 -       ft_init(_dtb_start, 0, 4);
20115 +       fdt_init(_dtb_start);
20116         serial_console_init();
20117  }
20118 --- /dev/null
20119 +++ b/arch/powerpc/boot/libfdt/Makefile.libfdt
20120 @@ -0,0 +1,14 @@
20121 +# Makefile.libfdt
20122 +#
20123 +# This is not a complete Makefile of itself.  Instead, it is designed to
20124 +# be easily embeddable into other systems of Makefiles.
20125 +#
20126 +LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
20127 +LIBFDT_INCLUDES = fdt.h libfdt.h
20128 +LIBFDT_EXTRA = libfdt_internal.h
20129 +LIBFDT_LIB = libfdt/libfdt.a
20130 +
20131 +LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o)
20132 +
20133 +$(LIBFDT_objdir)/$(LIBFDT_LIB): $(addprefix $(LIBFDT_objdir)/,$(LIBFDT_OBJS))
20134 +
20135 --- /dev/null
20136 +++ b/arch/powerpc/boot/libfdt/fdt.c
20137 @@ -0,0 +1,156 @@
20138 +/*
20139 + * libfdt - Flat Device Tree manipulation
20140 + * Copyright (C) 2006 David Gibson, IBM Corporation.
20141 + *
20142 + * libfdt is dual licensed: you can use it either under the terms of
20143 + * the GPL, or the BSD license, at your option.
20144 + *
20145 + *  a) This library is free software; you can redistribute it and/or
20146 + *     modify it under the terms of the GNU General Public License as
20147 + *     published by the Free Software Foundation; either version 2 of the
20148 + *     License, or (at your option) any later version.
20149 + *
20150 + *     This library is distributed in the hope that it will be useful,
20151 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
20152 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20153 + *     GNU General Public License for more details.
20154 + *
20155 + *     You should have received a copy of the GNU General Public
20156 + *     License along with this library; if not, write to the Free
20157 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20158 + *     MA 02110-1301 USA
20159 + *
20160 + * Alternatively,
20161 + *
20162 + *  b) Redistribution and use in source and binary forms, with or
20163 + *     without modification, are permitted provided that the following
20164 + *     conditions are met:
20165 + *
20166 + *     1. Redistributions of source code must retain the above
20167 + *        copyright notice, this list of conditions and the following
20168 + *        disclaimer.
20169 + *     2. Redistributions in binary form must reproduce the above
20170 + *        copyright notice, this list of conditions and the following
20171 + *        disclaimer in the documentation and/or other materials
20172 + *        provided with the distribution.
20173 + *
20174 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
20175 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20176 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20177 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20178 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20179 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20180 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20181 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20182 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20183 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20184 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20185 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
20186 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20187 + */
20188 +#include "libfdt_env.h"
20189 +
20190 +#include <fdt.h>
20191 +#include <libfdt.h>
20192 +
20193 +#include "libfdt_internal.h"
20194 +
20195 +int fdt_check_header(const void *fdt)
20196 +{
20197 +       if (fdt_magic(fdt) == FDT_MAGIC) {
20198 +               /* Complete tree */
20199 +               if (fdt_version(fdt) < FDT_FIRST_SUPPORTED_VERSION)
20200 +                       return -FDT_ERR_BADVERSION;
20201 +               if (fdt_last_comp_version(fdt) > FDT_LAST_SUPPORTED_VERSION)
20202 +                       return -FDT_ERR_BADVERSION;
20203 +       } else if (fdt_magic(fdt) == SW_MAGIC) {
20204 +               /* Unfinished sequential-write blob */
20205 +               if (fdt_size_dt_struct(fdt) == 0)
20206 +                       return -FDT_ERR_BADSTATE;
20207 +       } else {
20208 +               return -FDT_ERR_BADMAGIC;
20209 +       }
20210 +
20211 +       return 0;
20212 +}
20213 +
20214 +const void *fdt_offset_ptr(const void *fdt, int offset, int len)
20215 +{
20216 +       const void *p;
20217 +
20218 +       if (fdt_version(fdt) >= 0x11)
20219 +               if (((offset + len) < offset)
20220 +                   || ((offset + len) > fdt_size_dt_struct(fdt)))
20221 +                       return NULL;
20222 +
20223 +       p = _fdt_offset_ptr(fdt, offset);
20224 +
20225 +       if (p + len < p)
20226 +               return NULL;
20227 +       return p;
20228 +}
20229 +
20230 +uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset)
20231 +{
20232 +       const uint32_t *tagp, *lenp;
20233 +       uint32_t tag;
20234 +       const char *p;
20235 +
20236 +       if (offset % FDT_TAGSIZE)
20237 +               return -1;
20238 +
20239 +       tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
20240 +       if (! tagp)
20241 +               return FDT_END; /* premature end */
20242 +       tag = fdt32_to_cpu(*tagp);
20243 +       offset += FDT_TAGSIZE;
20244 +
20245 +       switch (tag) {
20246 +       case FDT_BEGIN_NODE:
20247 +               /* skip name */
20248 +               do {
20249 +                       p = fdt_offset_ptr(fdt, offset++, 1);
20250 +               } while (p && (*p != '\0'));
20251 +               if (! p)
20252 +                       return FDT_END;
20253 +               break;
20254 +       case FDT_PROP:
20255 +               lenp = fdt_offset_ptr(fdt, offset, sizeof(*lenp));
20256 +               if (! lenp)
20257 +                       return FDT_END;
20258 +               /* skip name offset, length and value */
20259 +               offset += 2*FDT_TAGSIZE + fdt32_to_cpu(*lenp);
20260 +               break;
20261 +       }
20262 +
20263 +       if (nextoffset)
20264 +               *nextoffset = ALIGN(offset, FDT_TAGSIZE);
20265 +
20266 +       return tag;
20267 +}
20268 +
20269 +const char *_fdt_find_string(const char *strtab, int tabsize, const char *s)
20270 +{
20271 +       int len = strlen(s) + 1;
20272 +       const char *last = strtab + tabsize - len;
20273 +       const char *p;
20274 +
20275 +       for (p = strtab; p <= last; p++)
20276 +               if (memeq(p, s, len))
20277 +                       return p;
20278 +       return NULL;
20279 +}
20280 +
20281 +int fdt_move(const void *fdt, void *buf, int bufsize)
20282 +{
20283 +       int err = fdt_check_header(fdt);
20284 +
20285 +       if (err)
20286 +               return err;
20287 +
20288 +       if (fdt_totalsize(fdt) > bufsize)
20289 +               return -FDT_ERR_NOSPACE;
20290 +
20291 +       memmove(buf, fdt, fdt_totalsize(fdt));
20292 +       return 0;
20293 +}
20294 --- /dev/null
20295 +++ b/arch/powerpc/boot/libfdt/fdt.h
20296 @@ -0,0 +1,60 @@
20297 +#ifndef _FDT_H
20298 +#define _FDT_H
20299 +
20300 +#ifndef __ASSEMBLY__
20301 +
20302 +struct fdt_header {
20303 +       uint32_t magic;                  /* magic word FDT_MAGIC */
20304 +       uint32_t totalsize;              /* total size of DT block */
20305 +       uint32_t off_dt_struct;          /* offset to structure */
20306 +       uint32_t off_dt_strings;         /* offset to strings */
20307 +       uint32_t off_mem_rsvmap;         /* offset to memory reserve map */
20308 +       uint32_t version;                /* format version */
20309 +       uint32_t last_comp_version;      /* last compatible version */
20310 +
20311 +       /* version 2 fields below */
20312 +       uint32_t boot_cpuid_phys;        /* Which physical CPU id we're
20313 +                                           booting on */
20314 +       /* version 3 fields below */
20315 +       uint32_t size_dt_strings;        /* size of the strings block */
20316 +
20317 +       /* version 17 fields below */
20318 +       uint32_t size_dt_struct;         /* size of the structure block */
20319 +};
20320 +
20321 +struct fdt_reserve_entry {
20322 +       uint64_t address;
20323 +       uint64_t size;
20324 +};
20325 +
20326 +struct fdt_node_header {
20327 +       uint32_t tag;
20328 +       char name[0];
20329 +};
20330 +
20331 +struct fdt_property {
20332 +       uint32_t tag;
20333 +       uint32_t len;
20334 +       uint32_t nameoff;
20335 +       char data[0];
20336 +};
20337 +
20338 +#endif /* !__ASSEMBLY */
20339 +
20340 +#define FDT_MAGIC      0xd00dfeed      /* 4: version, 4: total size */
20341 +#define FDT_TAGSIZE    sizeof(uint32_t)
20342 +
20343 +#define FDT_BEGIN_NODE 0x1             /* Start node: full name */
20344 +#define FDT_END_NODE   0x2             /* End node */
20345 +#define FDT_PROP       0x3             /* Property: name off,
20346 +                                          size, content */
20347 +#define FDT_NOP                0x4             /* nop */
20348 +#define FDT_END                0x9
20349 +
20350 +#define FDT_V1_SIZE    (7*sizeof(uint32_t))
20351 +#define FDT_V2_SIZE    (FDT_V1_SIZE + sizeof(uint32_t))
20352 +#define FDT_V3_SIZE    (FDT_V2_SIZE + sizeof(uint32_t))
20353 +#define FDT_V16_SIZE   FDT_V3_SIZE
20354 +#define FDT_V17_SIZE   (FDT_V16_SIZE + sizeof(uint32_t))
20355 +
20356 +#endif /* _FDT_H */
20357 --- /dev/null
20358 +++ b/arch/powerpc/boot/libfdt/fdt_ro.c
20359 @@ -0,0 +1,583 @@
20360 +/*
20361 + * libfdt - Flat Device Tree manipulation
20362 + * Copyright (C) 2006 David Gibson, IBM Corporation.
20363 + *
20364 + * libfdt is dual licensed: you can use it either under the terms of
20365 + * the GPL, or the BSD license, at your option.
20366 + *
20367 + *  a) This library is free software; you can redistribute it and/or
20368 + *     modify it under the terms of the GNU General Public License as
20369 + *     published by the Free Software Foundation; either version 2 of the
20370 + *     License, or (at your option) any later version.
20371 + *
20372 + *     This library is distributed in the hope that it will be useful,
20373 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
20374 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20375 + *     GNU General Public License for more details.
20376 + *
20377 + *     You should have received a copy of the GNU General Public
20378 + *     License along with this library; if not, write to the Free
20379 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20380 + *     MA 02110-1301 USA
20381 + *
20382 + * Alternatively,
20383 + *
20384 + *  b) Redistribution and use in source and binary forms, with or
20385 + *     without modification, are permitted provided that the following
20386 + *     conditions are met:
20387 + *
20388 + *     1. Redistributions of source code must retain the above
20389 + *        copyright notice, this list of conditions and the following
20390 + *        disclaimer.
20391 + *     2. Redistributions in binary form must reproduce the above
20392 + *        copyright notice, this list of conditions and the following
20393 + *        disclaimer in the documentation and/or other materials
20394 + *        provided with the distribution.
20395 + *
20396 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
20397 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20398 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20399 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20400 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20401 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20402 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20403 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20404 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20405 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20406 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20407 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
20408 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20409 + */
20410 +#include "libfdt_env.h"
20411 +
20412 +#include <fdt.h>
20413 +#include <libfdt.h>
20414 +
20415 +#include "libfdt_internal.h"
20416 +
20417 +#define CHECK_HEADER(fdt) \
20418 +       { \
20419 +               int err; \
20420 +               if ((err = fdt_check_header(fdt)) != 0) \
20421 +                       return err; \
20422 +       }
20423 +
20424 +static int nodename_eq(const void *fdt, int offset,
20425 +                      const char *s, int len)
20426 +{
20427 +       const char *p = fdt_offset_ptr(fdt, offset, len+1);
20428 +
20429 +       if (! p)
20430 +               /* short match */
20431 +               return 0;
20432 +
20433 +       if (memcmp(p, s, len) != 0)
20434 +               return 0;
20435 +
20436 +       if (p[len] == '\0')
20437 +               return 1;
20438 +       else if (!memchr(s, '@', len) && (p[len] == '@'))
20439 +               return 1;
20440 +       else
20441 +               return 0;
20442 +}
20443 +
20444 +const char *fdt_string(const void *fdt, int stroffset)
20445 +{
20446 +       return (char *)fdt + fdt_off_dt_strings(fdt) + stroffset;
20447 +}
20448 +
20449 +int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size)
20450 +{
20451 +       CHECK_HEADER(fdt);
20452 +       *address = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->address);
20453 +       *size = fdt64_to_cpu(_fdt_mem_rsv(fdt, n)->size);
20454 +       return 0;
20455 +}
20456 +
20457 +int fdt_num_mem_rsv(const void *fdt)
20458 +{
20459 +       int i = 0;
20460 +
20461 +       while (fdt64_to_cpu(_fdt_mem_rsv(fdt, i)->size) != 0)
20462 +               i++;
20463 +       return i;
20464 +}
20465 +
20466 +int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
20467 +                              const char *name, int namelen)
20468 +{
20469 +       int level = 0;
20470 +       uint32_t tag;
20471 +       int offset, nextoffset;
20472 +
20473 +       CHECK_HEADER(fdt);
20474 +
20475 +       tag = fdt_next_tag(fdt, parentoffset, &nextoffset);
20476 +       if (tag != FDT_BEGIN_NODE)
20477 +               return -FDT_ERR_BADOFFSET;
20478 +
20479 +       do {
20480 +               offset = nextoffset;
20481 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20482 +
20483 +               switch (tag) {
20484 +               case FDT_END:
20485 +                       return -FDT_ERR_TRUNCATED;
20486 +
20487 +               case FDT_BEGIN_NODE:
20488 +                       level++;
20489 +                       if (level != 1)
20490 +                               continue;
20491 +                       if (nodename_eq(fdt, offset+FDT_TAGSIZE, name, namelen))
20492 +                               /* Found it! */
20493 +                               return offset;
20494 +                       break;
20495 +
20496 +               case FDT_END_NODE:
20497 +                       level--;
20498 +                       break;
20499 +
20500 +               case FDT_PROP:
20501 +               case FDT_NOP:
20502 +                       break;
20503 +
20504 +               default:
20505 +                       return -FDT_ERR_BADSTRUCTURE;
20506 +               }
20507 +       } while (level >= 0);
20508 +
20509 +       return -FDT_ERR_NOTFOUND;
20510 +}
20511 +
20512 +int fdt_subnode_offset(const void *fdt, int parentoffset,
20513 +                      const char *name)
20514 +{
20515 +       return fdt_subnode_offset_namelen(fdt, parentoffset, name, strlen(name));
20516 +}
20517 +
20518 +int fdt_path_offset(const void *fdt, const char *path)
20519 +{
20520 +       const char *end = path + strlen(path);
20521 +       const char *p = path;
20522 +       int offset = 0;
20523 +
20524 +       CHECK_HEADER(fdt);
20525 +
20526 +       if (*path != '/')
20527 +               return -FDT_ERR_BADPATH;
20528 +
20529 +       while (*p) {
20530 +               const char *q;
20531 +
20532 +               while (*p == '/')
20533 +                       p++;
20534 +               if (! *p)
20535 +                       return offset;
20536 +               q = strchr(p, '/');
20537 +               if (! q)
20538 +                       q = end;
20539 +
20540 +               offset = fdt_subnode_offset_namelen(fdt, offset, p, q-p);
20541 +               if (offset < 0)
20542 +                       return offset;
20543 +
20544 +               p = q;
20545 +       }
20546 +
20547 +       return offset;
20548 +}
20549 +
20550 +const char *fdt_get_name(const void *fdt, int nodeoffset, int *len)
20551 +{
20552 +       const struct fdt_node_header *nh;
20553 +       int err;
20554 +
20555 +       if ((err = fdt_check_header(fdt)) != 0)
20556 +               goto fail;
20557 +
20558 +       err = -FDT_ERR_BADOFFSET;
20559 +       nh = fdt_offset_ptr(fdt, nodeoffset, sizeof(*nh));
20560 +       if (!nh || (fdt32_to_cpu(nh->tag) != FDT_BEGIN_NODE))
20561 +               goto fail;
20562 +
20563 +       if (len)
20564 +               *len = strlen(nh->name);
20565 +
20566 +       return nh->name;
20567 +
20568 + fail:
20569 +       if (len)
20570 +               *len = err;
20571 +       return NULL;
20572 +}
20573 +
20574 +const struct fdt_property *fdt_get_property(const void *fdt,
20575 +                                           int nodeoffset,
20576 +                                           const char *name, int *lenp)
20577 +{
20578 +       uint32_t tag;
20579 +       const struct fdt_property *prop;
20580 +       int namestroff;
20581 +       int offset, nextoffset;
20582 +       int err;
20583 +
20584 +       if ((err = fdt_check_header(fdt)) != 0)
20585 +               goto fail;
20586 +
20587 +       err = -FDT_ERR_BADOFFSET;
20588 +       if (nodeoffset % FDT_TAGSIZE)
20589 +               goto fail;
20590 +
20591 +       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
20592 +       if (tag != FDT_BEGIN_NODE)
20593 +               goto fail;
20594 +
20595 +       do {
20596 +               offset = nextoffset;
20597 +
20598 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20599 +               switch (tag) {
20600 +               case FDT_END:
20601 +                       err = -FDT_ERR_TRUNCATED;
20602 +                       goto fail;
20603 +
20604 +               case FDT_BEGIN_NODE:
20605 +               case FDT_END_NODE:
20606 +               case FDT_NOP:
20607 +                       break;
20608 +
20609 +               case FDT_PROP:
20610 +                       err = -FDT_ERR_BADSTRUCTURE;
20611 +                       prop = fdt_offset_ptr(fdt, offset, sizeof(*prop));
20612 +                       if (! prop)
20613 +                               goto fail;
20614 +                       namestroff = fdt32_to_cpu(prop->nameoff);
20615 +                       if (streq(fdt_string(fdt, namestroff), name)) {
20616 +                               /* Found it! */
20617 +                               int len = fdt32_to_cpu(prop->len);
20618 +                               prop = fdt_offset_ptr(fdt, offset,
20619 +                                                     sizeof(*prop)+len);
20620 +                               if (! prop)
20621 +                                       goto fail;
20622 +
20623 +                               if (lenp)
20624 +                                       *lenp = len;
20625 +
20626 +                               return prop;
20627 +                       }
20628 +                       break;
20629 +
20630 +               default:
20631 +                       err = -FDT_ERR_BADSTRUCTURE;
20632 +                       goto fail;
20633 +               }
20634 +       } while ((tag != FDT_BEGIN_NODE) && (tag != FDT_END_NODE));
20635 +
20636 +       err = -FDT_ERR_NOTFOUND;
20637 + fail:
20638 +       if (lenp)
20639 +               *lenp = err;
20640 +       return NULL;
20641 +}
20642 +
20643 +const void *fdt_getprop(const void *fdt, int nodeoffset,
20644 +                 const char *name, int *lenp)
20645 +{
20646 +       const struct fdt_property *prop;
20647 +
20648 +       prop = fdt_get_property(fdt, nodeoffset, name, lenp);
20649 +       if (! prop)
20650 +               return NULL;
20651 +
20652 +       return prop->data;
20653 +}
20654 +
20655 +uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
20656 +{
20657 +       const uint32_t *php;
20658 +       int len;
20659 +
20660 +       php = fdt_getprop(fdt, nodeoffset, "linux,phandle", &len);
20661 +       if (!php || (len != sizeof(*php)))
20662 +               return 0;
20663 +
20664 +       return fdt32_to_cpu(*php);
20665 +}
20666 +
20667 +int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen)
20668 +{
20669 +       uint32_t tag;
20670 +       int p = 0, overflow = 0;
20671 +       int offset, nextoffset, namelen;
20672 +       const char *name;
20673 +
20674 +       CHECK_HEADER(fdt);
20675 +
20676 +       tag = fdt_next_tag(fdt, 0, &nextoffset);
20677 +       if (tag != FDT_BEGIN_NODE)
20678 +               return -FDT_ERR_BADSTRUCTURE;
20679 +
20680 +       if (buflen < 2)
20681 +               return -FDT_ERR_NOSPACE;
20682 +       buf[0] = '/';
20683 +       p = 1;
20684 +
20685 +       while (nextoffset <= nodeoffset) {
20686 +               offset = nextoffset;
20687 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20688 +               switch (tag) {
20689 +               case FDT_END:
20690 +                       return -FDT_ERR_BADOFFSET;
20691 +
20692 +               case FDT_BEGIN_NODE:
20693 +                       name = fdt_get_name(fdt, offset, &namelen);
20694 +                       if (!name)
20695 +                               return namelen;
20696 +                       if (overflow || ((p + namelen + 1) > buflen)) {
20697 +                               overflow++;
20698 +                               break;
20699 +                       }
20700 +                       memcpy(buf + p, name, namelen);
20701 +                       p += namelen;
20702 +                       buf[p++] = '/';
20703 +                       break;
20704 +
20705 +               case FDT_END_NODE:
20706 +                       if (overflow) {
20707 +                               overflow--;
20708 +                               break;
20709 +                       }
20710 +                       do {
20711 +                               p--;
20712 +                       } while  (buf[p-1] != '/');
20713 +                       break;
20714 +
20715 +               case FDT_PROP:
20716 +               case FDT_NOP:
20717 +                       break;
20718 +
20719 +               default:
20720 +                       return -FDT_ERR_BADSTRUCTURE;
20721 +               }
20722 +       }
20723 +
20724 +       if (overflow)
20725 +               return -FDT_ERR_NOSPACE;
20726 +
20727 +       if (p > 1) /* special case so that root path is "/", not "" */
20728 +               p--;
20729 +       buf[p] = '\0';
20730 +       return p;
20731 +}
20732 +
20733 +int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
20734 +                                int supernodedepth, int *nodedepth)
20735 +{
20736 +       int level = -1;
20737 +       uint32_t tag;
20738 +       int offset, nextoffset = 0;
20739 +       int supernodeoffset = -FDT_ERR_INTERNAL;
20740 +
20741 +       CHECK_HEADER(fdt);
20742 +
20743 +       if (supernodedepth < 0)
20744 +               return -FDT_ERR_NOTFOUND;
20745 +
20746 +       do {
20747 +               offset = nextoffset;
20748 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20749 +               switch (tag) {
20750 +               case FDT_END:
20751 +                       return -FDT_ERR_BADOFFSET;
20752 +
20753 +               case FDT_BEGIN_NODE:
20754 +                       level++;
20755 +                       if (level == supernodedepth)
20756 +                               supernodeoffset = offset;
20757 +                       break;
20758 +
20759 +               case FDT_END_NODE:
20760 +                       level--;
20761 +                       break;
20762 +
20763 +               case FDT_PROP:
20764 +               case FDT_NOP:
20765 +                       break;
20766 +
20767 +               default:
20768 +                       return -FDT_ERR_BADSTRUCTURE;
20769 +               }
20770 +       } while (offset < nodeoffset);
20771 +
20772 +       if (nodedepth)
20773 +               *nodedepth = level;
20774 +
20775 +       if (supernodedepth > level)
20776 +               return -FDT_ERR_NOTFOUND;
20777 +       return supernodeoffset;
20778 +}
20779 +
20780 +int fdt_node_depth(const void *fdt, int nodeoffset)
20781 +{
20782 +       int nodedepth;
20783 +       int err;
20784 +
20785 +       err = fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, &nodedepth);
20786 +       if (err)
20787 +               return (err < 0) ? err : -FDT_ERR_INTERNAL;
20788 +       return nodedepth;
20789 +}
20790 +
20791 +int fdt_parent_offset(const void *fdt, int nodeoffset)
20792 +{
20793 +       int nodedepth = fdt_node_depth(fdt, nodeoffset);
20794 +
20795 +       if (nodedepth < 0)
20796 +               return nodedepth;
20797 +       return fdt_supernode_atdepth_offset(fdt, nodeoffset,
20798 +                                           nodedepth - 1, NULL);
20799 +}
20800 +
20801 +int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
20802 +                                 const char *propname,
20803 +                                 const void *propval, int proplen)
20804 +{
20805 +       uint32_t tag;
20806 +       int offset, nextoffset;
20807 +       const void *val;
20808 +       int len;
20809 +
20810 +       CHECK_HEADER(fdt);
20811 +
20812 +       if (startoffset >= 0) {
20813 +               tag = fdt_next_tag(fdt, startoffset, &nextoffset);
20814 +               if (tag != FDT_BEGIN_NODE)
20815 +                       return -FDT_ERR_BADOFFSET;
20816 +       } else {
20817 +               nextoffset = 0;
20818 +       }
20819 +
20820 +       /* FIXME: The algorithm here is pretty horrible: we scan each
20821 +        * property of a node in fdt_getprop(), then if that didn't
20822 +        * find what we want, we scan over them again making our way
20823 +        * to the next node.  Still it's the easiest to implement
20824 +        * approach; performance can come later. */
20825 +       do {
20826 +               offset = nextoffset;
20827 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20828 +
20829 +               switch (tag) {
20830 +               case FDT_BEGIN_NODE:
20831 +                       val = fdt_getprop(fdt, offset, propname, &len);
20832 +                       if (val
20833 +                           && (len == proplen)
20834 +                           && (memcmp(val, propval, len) == 0))
20835 +                               return offset;
20836 +                       break;
20837 +
20838 +               case FDT_PROP:
20839 +               case FDT_END:
20840 +               case FDT_END_NODE:
20841 +               case FDT_NOP:
20842 +                       break;
20843 +
20844 +               default:
20845 +                       return -FDT_ERR_BADSTRUCTURE;
20846 +               }
20847 +       } while (tag != FDT_END);
20848 +
20849 +       return -FDT_ERR_NOTFOUND;
20850 +}
20851 +
20852 +int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)
20853 +{
20854 +       if ((phandle == 0) || (phandle == -1))
20855 +               return -FDT_ERR_BADPHANDLE;
20856 +       phandle = cpu_to_fdt32(phandle);
20857 +       return fdt_node_offset_by_prop_value(fdt, -1, "linux,phandle",
20858 +                                            &phandle, sizeof(phandle));
20859 +}
20860 +
20861 +int _stringlist_contains(const void *strlist, int listlen, const char *str)
20862 +{
20863 +       int len = strlen(str);
20864 +       const void *p;
20865 +
20866 +       while (listlen >= len) {
20867 +               if (memcmp(str, strlist, len+1) == 0)
20868 +                       return 1;
20869 +               p = memchr(strlist, '\0', listlen);
20870 +               if (!p)
20871 +                       return 0; /* malformed strlist.. */
20872 +               listlen -= (p-strlist) + 1;
20873 +               strlist = p + 1;
20874 +       }
20875 +       return 0;
20876 +}
20877 +
20878 +int fdt_node_check_compatible(const void *fdt, int nodeoffset,
20879 +                             const char *compatible)
20880 +{
20881 +       const void *prop;
20882 +       int len;
20883 +
20884 +       prop = fdt_getprop(fdt, nodeoffset, "compatible", &len);
20885 +       if (!prop)
20886 +               return len;
20887 +       if (_stringlist_contains(prop, len, compatible))
20888 +               return 0;
20889 +       else
20890 +               return 1;
20891 +}
20892 +
20893 +int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
20894 +                                 const char *compatible)
20895 +{
20896 +       uint32_t tag;
20897 +       int offset, nextoffset;
20898 +       int err;
20899 +
20900 +       CHECK_HEADER(fdt);
20901 +
20902 +       if (startoffset >= 0) {
20903 +               tag = fdt_next_tag(fdt, startoffset, &nextoffset);
20904 +               if (tag != FDT_BEGIN_NODE)
20905 +                       return -FDT_ERR_BADOFFSET;
20906 +       } else {
20907 +               nextoffset = 0;
20908 +       }
20909 +
20910 +       /* FIXME: The algorithm here is pretty horrible: we scan each
20911 +        * property of a node in fdt_node_check_compatible(), then if
20912 +        * that didn't find what we want, we scan over them again
20913 +        * making our way to the next node.  Still it's the easiest to
20914 +        * implement approach; performance can come later. */
20915 +       do {
20916 +               offset = nextoffset;
20917 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
20918 +
20919 +               switch (tag) {
20920 +               case FDT_BEGIN_NODE:
20921 +                       err = fdt_node_check_compatible(fdt, offset,
20922 +                                                       compatible);
20923 +                       if ((err < 0)
20924 +                           && (err != -FDT_ERR_NOTFOUND))
20925 +                               return err;
20926 +                       else if (err == 0)
20927 +                               return offset;
20928 +                       break;
20929 +
20930 +               case FDT_PROP:
20931 +               case FDT_END:
20932 +               case FDT_END_NODE:
20933 +               case FDT_NOP:
20934 +                       break;
20935 +
20936 +               default:
20937 +                       return -FDT_ERR_BADSTRUCTURE;
20938 +               }
20939 +       } while (tag != FDT_END);
20940 +
20941 +       return -FDT_ERR_NOTFOUND;
20942 +}
20943 --- /dev/null
20944 +++ b/arch/powerpc/boot/libfdt/fdt_rw.c
20945 @@ -0,0 +1,447 @@
20946 +/*
20947 + * libfdt - Flat Device Tree manipulation
20948 + * Copyright (C) 2006 David Gibson, IBM Corporation.
20949 + *
20950 + * libfdt is dual licensed: you can use it either under the terms of
20951 + * the GPL, or the BSD license, at your option.
20952 + *
20953 + *  a) This library is free software; you can redistribute it and/or
20954 + *     modify it under the terms of the GNU General Public License as
20955 + *     published by the Free Software Foundation; either version 2 of the
20956 + *     License, or (at your option) any later version.
20957 + *
20958 + *     This library is distributed in the hope that it will be useful,
20959 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
20960 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20961 + *     GNU General Public License for more details.
20962 + *
20963 + *     You should have received a copy of the GNU General Public
20964 + *     License along with this library; if not, write to the Free
20965 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20966 + *     MA 02110-1301 USA
20967 + *
20968 + * Alternatively,
20969 + *
20970 + *  b) Redistribution and use in source and binary forms, with or
20971 + *     without modification, are permitted provided that the following
20972 + *     conditions are met:
20973 + *
20974 + *     1. Redistributions of source code must retain the above
20975 + *        copyright notice, this list of conditions and the following
20976 + *        disclaimer.
20977 + *     2. Redistributions in binary form must reproduce the above
20978 + *        copyright notice, this list of conditions and the following
20979 + *        disclaimer in the documentation and/or other materials
20980 + *        provided with the distribution.
20981 + *
20982 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
20983 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20984 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20985 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20986 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20987 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20988 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20989 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20990 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20991 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20992 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
20993 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
20994 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20995 + */
20996 +#include "libfdt_env.h"
20997 +
20998 +#include <fdt.h>
20999 +#include <libfdt.h>
21000 +
21001 +#include "libfdt_internal.h"
21002 +
21003 +static int _blocks_misordered(const void *fdt,
21004 +                             int mem_rsv_size, int struct_size)
21005 +{
21006 +       return (fdt_off_mem_rsvmap(fdt) < ALIGN(sizeof(struct fdt_header), 8))
21007 +               || (fdt_off_dt_struct(fdt) <
21008 +                   (fdt_off_mem_rsvmap(fdt) + mem_rsv_size))
21009 +               || (fdt_off_dt_strings(fdt) <
21010 +                   (fdt_off_dt_struct(fdt) + struct_size))
21011 +               || (fdt_totalsize(fdt) <
21012 +                   (fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt)));
21013 +}
21014 +
21015 +static int rw_check_header(void *fdt)
21016 +{
21017 +       int err;
21018 +
21019 +       if ((err = fdt_check_header(fdt)))
21020 +               return err;
21021 +       if (fdt_version(fdt) < 17)
21022 +               return -FDT_ERR_BADVERSION;
21023 +       if (_blocks_misordered(fdt, sizeof(struct fdt_reserve_entry),
21024 +                              fdt_size_dt_struct(fdt)))
21025 +               return -FDT_ERR_BADLAYOUT;
21026 +       if (fdt_version(fdt) > 17)
21027 +               fdt_set_version(fdt, 17);
21028 +
21029 +       return 0;
21030 +}
21031 +
21032 +#define RW_CHECK_HEADER(fdt) \
21033 +       { \
21034 +               int err; \
21035 +               if ((err = rw_check_header(fdt)) != 0) \
21036 +                       return err; \
21037 +       }
21038 +
21039 +static inline int _blob_data_size(void *fdt)
21040 +{
21041 +       return fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
21042 +}
21043 +
21044 +static int _blob_splice(void *fdt, void *p, int oldlen, int newlen)
21045 +{
21046 +       void *end = fdt + _blob_data_size(fdt);
21047 +
21048 +       if (((p + oldlen) < p) || ((p + oldlen) > end))
21049 +               return -FDT_ERR_BADOFFSET;
21050 +       if ((end - oldlen + newlen) > (fdt + fdt_totalsize(fdt)))
21051 +               return -FDT_ERR_NOSPACE;
21052 +       memmove(p + newlen, p + oldlen, end - p - oldlen);
21053 +       return 0;
21054 +}
21055 +
21056 +static int _blob_splice_mem_rsv(void *fdt, struct fdt_reserve_entry *p,
21057 +                               int oldn, int newn)
21058 +{
21059 +       int delta = (newn - oldn) * sizeof(*p);
21060 +       int err;
21061 +       err = _blob_splice(fdt, p, oldn * sizeof(*p), newn * sizeof(*p));
21062 +       if (err)
21063 +               return err;
21064 +       fdt_set_off_dt_struct(fdt, fdt_off_dt_struct(fdt) + delta);
21065 +       fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
21066 +       return 0;
21067 +}
21068 +
21069 +static int _blob_splice_struct(void *fdt, void *p,
21070 +                              int oldlen, int newlen)
21071 +{
21072 +       int delta = newlen - oldlen;
21073 +       int err;
21074 +
21075 +       if ((err = _blob_splice(fdt, p, oldlen, newlen)))
21076 +               return err;
21077 +
21078 +       fdt_set_size_dt_struct(fdt, fdt_size_dt_struct(fdt) + delta);
21079 +       fdt_set_off_dt_strings(fdt, fdt_off_dt_strings(fdt) + delta);
21080 +       return 0;
21081 +}
21082 +
21083 +static int _blob_splice_string(void *fdt, int newlen)
21084 +{
21085 +       void *p = fdt + fdt_off_dt_strings(fdt) + fdt_size_dt_strings(fdt);
21086 +       int err;
21087 +
21088 +       if ((err = _blob_splice(fdt, p, 0, newlen)))
21089 +               return err;
21090 +
21091 +       fdt_set_size_dt_strings(fdt, fdt_size_dt_strings(fdt) + newlen);
21092 +       return 0;
21093 +}
21094 +
21095 +static int _find_add_string(void *fdt, const char *s)
21096 +{
21097 +       char *strtab = (char *)fdt + fdt_off_dt_strings(fdt);
21098 +       const char *p;
21099 +       char *new;
21100 +       int len = strlen(s) + 1;
21101 +       int err;
21102 +
21103 +       p = _fdt_find_string(strtab, fdt_size_dt_strings(fdt), s);
21104 +       if (p)
21105 +               /* found it */
21106 +               return (p - strtab);
21107 +
21108 +       new = strtab + fdt_size_dt_strings(fdt);
21109 +       err = _blob_splice_string(fdt, len);
21110 +       if (err)
21111 +               return err;
21112 +
21113 +       memcpy(new, s, len);
21114 +       return (new - strtab);
21115 +}
21116 +
21117 +int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size)
21118 +{
21119 +       struct fdt_reserve_entry *re;
21120 +       int err;
21121 +
21122 +       if ((err = rw_check_header(fdt)))
21123 +               return err;
21124 +
21125 +       re = _fdt_mem_rsv_w(fdt, fdt_num_mem_rsv(fdt));
21126 +       err = _blob_splice_mem_rsv(fdt, re, 0, 1);
21127 +       if (err)
21128 +               return err;
21129 +
21130 +       re->address = cpu_to_fdt64(address);
21131 +       re->size = cpu_to_fdt64(size);
21132 +       return 0;
21133 +}
21134 +
21135 +int fdt_del_mem_rsv(void *fdt, int n)
21136 +{
21137 +       struct fdt_reserve_entry *re = _fdt_mem_rsv_w(fdt, n);
21138 +       int err;
21139 +
21140 +       if ((err = rw_check_header(fdt)))
21141 +               return err;
21142 +       if (n >= fdt_num_mem_rsv(fdt))
21143 +               return -FDT_ERR_NOTFOUND;
21144 +
21145 +       err = _blob_splice_mem_rsv(fdt, re, 1, 0);
21146 +       if (err)
21147 +               return err;
21148 +       return 0;
21149 +}
21150 +
21151 +static int _resize_property(void *fdt, int nodeoffset, const char *name, int len,
21152 +                           struct fdt_property **prop)
21153 +{
21154 +       int oldlen;
21155 +       int err;
21156 +
21157 +       *prop = fdt_get_property_w(fdt, nodeoffset, name, &oldlen);
21158 +       if (! (*prop))
21159 +               return oldlen;
21160 +
21161 +       if ((err = _blob_splice_struct(fdt, (*prop)->data,
21162 +                                      ALIGN(oldlen, FDT_TAGSIZE),
21163 +                                      ALIGN(len, FDT_TAGSIZE))))
21164 +               return err;
21165 +
21166 +       (*prop)->len = cpu_to_fdt32(len);
21167 +       return 0;
21168 +}
21169 +
21170 +static int _add_property(void *fdt, int nodeoffset, const char *name, int len,
21171 +                        struct fdt_property **prop)
21172 +{
21173 +       uint32_t tag;
21174 +       int proplen;
21175 +       int nextoffset;
21176 +       int namestroff;
21177 +       int err;
21178 +
21179 +       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
21180 +       if (tag != FDT_BEGIN_NODE)
21181 +               return -FDT_ERR_BADOFFSET;
21182 +
21183 +       namestroff = _find_add_string(fdt, name);
21184 +       if (namestroff < 0)
21185 +               return namestroff;
21186 +
21187 +       *prop = _fdt_offset_ptr_w(fdt, nextoffset);
21188 +       proplen = sizeof(**prop) + ALIGN(len, FDT_TAGSIZE);
21189 +
21190 +       err = _blob_splice_struct(fdt, *prop, 0, proplen);
21191 +       if (err)
21192 +               return err;
21193 +
21194 +       (*prop)->tag = cpu_to_fdt32(FDT_PROP);
21195 +       (*prop)->nameoff = cpu_to_fdt32(namestroff);
21196 +       (*prop)->len = cpu_to_fdt32(len);
21197 +       return 0;
21198 +}
21199 +
21200 +int fdt_setprop(void *fdt, int nodeoffset, const char *name,
21201 +               const void *val, int len)
21202 +{
21203 +       struct fdt_property *prop;
21204 +       int err;
21205 +
21206 +       if ((err = rw_check_header(fdt)))
21207 +               return err;
21208 +
21209 +       err = _resize_property(fdt, nodeoffset, name, len, &prop);
21210 +       if (err == -FDT_ERR_NOTFOUND)
21211 +               err = _add_property(fdt, nodeoffset, name, len, &prop);
21212 +       if (err)
21213 +               return err;
21214 +
21215 +       memcpy(prop->data, val, len);
21216 +       return 0;
21217 +}
21218 +
21219 +int fdt_delprop(void *fdt, int nodeoffset, const char *name)
21220 +{
21221 +       struct fdt_property *prop;
21222 +       int len, proplen;
21223 +
21224 +       RW_CHECK_HEADER(fdt);
21225 +
21226 +       prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
21227 +       if (! prop)
21228 +               return len;
21229 +
21230 +       proplen = sizeof(*prop) + ALIGN(len, FDT_TAGSIZE);
21231 +       return _blob_splice_struct(fdt, prop, proplen, 0);
21232 +}
21233 +
21234 +int fdt_add_subnode_namelen(void *fdt, int parentoffset,
21235 +                           const char *name, int namelen)
21236 +{
21237 +       struct fdt_node_header *nh;
21238 +       int offset, nextoffset;
21239 +       int nodelen;
21240 +       int err;
21241 +       uint32_t tag;
21242 +       uint32_t *endtag;
21243 +
21244 +       RW_CHECK_HEADER(fdt);
21245 +
21246 +       offset = fdt_subnode_offset_namelen(fdt, parentoffset, name, namelen);
21247 +       if (offset >= 0)
21248 +               return -FDT_ERR_EXISTS;
21249 +       else if (offset != -FDT_ERR_NOTFOUND)
21250 +               return offset;
21251 +
21252 +       /* Try to place the new node after the parent's properties */
21253 +       fdt_next_tag(fdt, parentoffset, &nextoffset); /* skip the BEGIN_NODE */
21254 +       do {
21255 +               offset = nextoffset;
21256 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
21257 +       } while (tag == FDT_PROP);
21258 +
21259 +       nh = _fdt_offset_ptr_w(fdt, offset);
21260 +       nodelen = sizeof(*nh) + ALIGN(namelen+1, FDT_TAGSIZE) + FDT_TAGSIZE;
21261 +
21262 +       err = _blob_splice_struct(fdt, nh, 0, nodelen);
21263 +       if (err)
21264 +               return err;
21265 +
21266 +       nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
21267 +       memset(nh->name, 0, ALIGN(namelen+1, FDT_TAGSIZE));
21268 +       memcpy(nh->name, name, namelen);
21269 +       endtag = (uint32_t *)((void *)nh + nodelen - FDT_TAGSIZE);
21270 +       *endtag = cpu_to_fdt32(FDT_END_NODE);
21271 +
21272 +       return offset;
21273 +}
21274 +
21275 +int fdt_add_subnode(void *fdt, int parentoffset, const char *name)
21276 +{
21277 +       return fdt_add_subnode_namelen(fdt, parentoffset, name, strlen(name));
21278 +}
21279 +
21280 +int fdt_del_node(void *fdt, int nodeoffset)
21281 +{
21282 +       int endoffset;
21283 +
21284 +       RW_CHECK_HEADER(fdt);
21285 +
21286 +       endoffset = _fdt_node_end_offset(fdt, nodeoffset);
21287 +       if (endoffset < 0)
21288 +               return endoffset;
21289 +
21290 +       return _blob_splice_struct(fdt, _fdt_offset_ptr_w(fdt, nodeoffset),
21291 +                                  endoffset - nodeoffset, 0);
21292 +}
21293 +
21294 +static void _packblocks(const void *fdt, void *buf,
21295 +                      int mem_rsv_size, int struct_size)
21296 +{
21297 +       int mem_rsv_off, struct_off, strings_off;
21298 +
21299 +       mem_rsv_off = ALIGN(sizeof(struct fdt_header), 8);
21300 +       struct_off = mem_rsv_off + mem_rsv_size;
21301 +       strings_off = struct_off + struct_size;
21302 +
21303 +       memmove(buf + mem_rsv_off, fdt + fdt_off_mem_rsvmap(fdt), mem_rsv_size);
21304 +       fdt_set_off_mem_rsvmap(buf, mem_rsv_off);
21305 +
21306 +       memmove(buf + struct_off, fdt + fdt_off_dt_struct(fdt), struct_size);
21307 +       fdt_set_off_dt_struct(buf, struct_off);
21308 +       fdt_set_size_dt_struct(buf, struct_size);
21309 +
21310 +       memmove(buf + strings_off, fdt + fdt_off_dt_strings(fdt),
21311 +               fdt_size_dt_strings(fdt));
21312 +       fdt_set_off_dt_strings(buf, strings_off);
21313 +       fdt_set_size_dt_strings(buf, fdt_size_dt_strings(fdt));
21314 +}
21315 +
21316 +int fdt_open_into(const void *fdt, void *buf, int bufsize)
21317 +{
21318 +       int err;
21319 +       int mem_rsv_size, struct_size;
21320 +       int newsize;
21321 +       void *tmp;
21322 +
21323 +       err = fdt_check_header(fdt);
21324 +       if (err)
21325 +               return err;
21326 +
21327 +       mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
21328 +               * sizeof(struct fdt_reserve_entry);
21329 +
21330 +       if (fdt_version(fdt) >= 17) {
21331 +               struct_size = fdt_size_dt_struct(fdt);
21332 +       } else {
21333 +               struct_size = 0;
21334 +               while (fdt_next_tag(fdt, struct_size, &struct_size) != FDT_END)
21335 +                       ;
21336 +       }
21337 +
21338 +       if (!_blocks_misordered(fdt, mem_rsv_size, struct_size)) {
21339 +               /* no further work necessary */
21340 +               err = fdt_move(fdt, buf, bufsize);
21341 +               if (err)
21342 +                       return err;
21343 +               fdt_set_version(buf, 17);
21344 +               fdt_set_size_dt_struct(buf, struct_size);
21345 +               fdt_set_totalsize(buf, bufsize);
21346 +               return 0;
21347 +       }
21348 +
21349 +       /* Need to reorder */
21350 +       newsize = ALIGN(sizeof(struct fdt_header), 8) + mem_rsv_size
21351 +               + struct_size + fdt_size_dt_strings(fdt);
21352 +
21353 +       if (bufsize < newsize)
21354 +               return -FDT_ERR_NOSPACE;
21355 +
21356 +       if (((buf + newsize) <= fdt)
21357 +           || (buf >= (fdt + fdt_totalsize(fdt)))) {
21358 +               tmp = buf;
21359 +       } else {
21360 +               tmp = (void *)fdt + fdt_totalsize(fdt);
21361 +               if ((tmp + newsize) > (buf + bufsize))
21362 +                       return -FDT_ERR_NOSPACE;
21363 +       }
21364 +
21365 +       _packblocks(fdt, tmp, mem_rsv_size, struct_size);
21366 +       memmove(buf, tmp, newsize);
21367 +
21368 +       fdt_set_magic(buf, FDT_MAGIC);
21369 +       fdt_set_totalsize(buf, bufsize);
21370 +       fdt_set_version(buf, 17);
21371 +       fdt_set_last_comp_version(buf, 16);
21372 +       fdt_set_boot_cpuid_phys(buf, fdt_boot_cpuid_phys(fdt));
21373 +
21374 +       return 0;
21375 +}
21376 +
21377 +int fdt_pack(void *fdt)
21378 +{
21379 +       int mem_rsv_size;
21380 +       int err;
21381 +
21382 +       err = rw_check_header(fdt);
21383 +       if (err)
21384 +               return err;
21385 +
21386 +       mem_rsv_size = (fdt_num_mem_rsv(fdt)+1)
21387 +               * sizeof(struct fdt_reserve_entry);
21388 +       _packblocks(fdt, fdt, mem_rsv_size, fdt_size_dt_struct(fdt));
21389 +       fdt_set_totalsize(fdt, _blob_data_size(fdt));
21390 +
21391 +       return 0;
21392 +}
21393 --- /dev/null
21394 +++ b/arch/powerpc/boot/libfdt/fdt_strerror.c
21395 @@ -0,0 +1,96 @@
21396 +/*
21397 + * libfdt - Flat Device Tree manipulation
21398 + * Copyright (C) 2006 David Gibson, IBM Corporation.
21399 + *
21400 + * libfdt is dual licensed: you can use it either under the terms of
21401 + * the GPL, or the BSD license, at your option.
21402 + *
21403 + *  a) This library is free software; you can redistribute it and/or
21404 + *     modify it under the terms of the GNU General Public License as
21405 + *     published by the Free Software Foundation; either version 2 of the
21406 + *     License, or (at your option) any later version.
21407 + *
21408 + *     This library is distributed in the hope that it will be useful,
21409 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21410 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21411 + *     GNU General Public License for more details.
21412 + *
21413 + *     You should have received a copy of the GNU General Public
21414 + *     License along with this library; if not, write to the Free
21415 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21416 + *     MA 02110-1301 USA
21417 + *
21418 + * Alternatively,
21419 + *
21420 + *  b) Redistribution and use in source and binary forms, with or
21421 + *     without modification, are permitted provided that the following
21422 + *     conditions are met:
21423 + *
21424 + *     1. Redistributions of source code must retain the above
21425 + *        copyright notice, this list of conditions and the following
21426 + *        disclaimer.
21427 + *     2. Redistributions in binary form must reproduce the above
21428 + *        copyright notice, this list of conditions and the following
21429 + *        disclaimer in the documentation and/or other materials
21430 + *        provided with the distribution.
21431 + *
21432 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21433 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21434 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21435 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21436 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21437 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21438 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21439 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21440 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21441 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21442 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21443 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
21444 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21445 + */
21446 +#include "libfdt_env.h"
21447 +
21448 +#include <fdt.h>
21449 +#include <libfdt.h>
21450 +
21451 +#include "libfdt_internal.h"
21452 +
21453 +struct errtabent {
21454 +       const char *str;
21455 +};
21456 +
21457 +#define ERRTABENT(val) \
21458 +       [(val)] = { .str = #val, }
21459 +
21460 +static struct errtabent errtable[] = {
21461 +       ERRTABENT(FDT_ERR_NOTFOUND),
21462 +       ERRTABENT(FDT_ERR_EXISTS),
21463 +       ERRTABENT(FDT_ERR_NOSPACE),
21464 +
21465 +       ERRTABENT(FDT_ERR_BADOFFSET),
21466 +       ERRTABENT(FDT_ERR_BADPATH),
21467 +       ERRTABENT(FDT_ERR_BADSTATE),
21468 +
21469 +       ERRTABENT(FDT_ERR_TRUNCATED),
21470 +       ERRTABENT(FDT_ERR_BADMAGIC),
21471 +       ERRTABENT(FDT_ERR_BADVERSION),
21472 +       ERRTABENT(FDT_ERR_BADSTRUCTURE),
21473 +       ERRTABENT(FDT_ERR_BADLAYOUT),
21474 +};
21475 +#define ERRTABSIZE     (sizeof(errtable) / sizeof(errtable[0]))
21476 +
21477 +const char *fdt_strerror(int errval)
21478 +{
21479 +       if (errval > 0)
21480 +               return "<valid offset/length>";
21481 +       else if (errval == 0)
21482 +               return "<no error>";
21483 +       else if (errval > -ERRTABSIZE) {
21484 +               const char *s = errtable[-errval].str;
21485 +
21486 +               if (s)
21487 +                       return s;
21488 +       }
21489 +
21490 +       return "<unknown error>";
21491 +}
21492 --- /dev/null
21493 +++ b/arch/powerpc/boot/libfdt/fdt_sw.c
21494 @@ -0,0 +1,258 @@
21495 +/*
21496 + * libfdt - Flat Device Tree manipulation
21497 + * Copyright (C) 2006 David Gibson, IBM Corporation.
21498 + *
21499 + * libfdt is dual licensed: you can use it either under the terms of
21500 + * the GPL, or the BSD license, at your option.
21501 + *
21502 + *  a) This library is free software; you can redistribute it and/or
21503 + *     modify it under the terms of the GNU General Public License as
21504 + *     published by the Free Software Foundation; either version 2 of the
21505 + *     License, or (at your option) any later version.
21506 + *
21507 + *     This library is distributed in the hope that it will be useful,
21508 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21509 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21510 + *     GNU General Public License for more details.
21511 + *
21512 + *     You should have received a copy of the GNU General Public
21513 + *     License along with this library; if not, write to the Free
21514 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21515 + *     MA 02110-1301 USA
21516 + *
21517 + * Alternatively,
21518 + *
21519 + *  b) Redistribution and use in source and binary forms, with or
21520 + *     without modification, are permitted provided that the following
21521 + *     conditions are met:
21522 + *
21523 + *     1. Redistributions of source code must retain the above
21524 + *        copyright notice, this list of conditions and the following
21525 + *        disclaimer.
21526 + *     2. Redistributions in binary form must reproduce the above
21527 + *        copyright notice, this list of conditions and the following
21528 + *        disclaimer in the documentation and/or other materials
21529 + *        provided with the distribution.
21530 + *
21531 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21532 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21533 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21534 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21535 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21536 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21537 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21538 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21539 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21540 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21541 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21542 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
21543 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21544 + */
21545 +#include "libfdt_env.h"
21546 +
21547 +#include <fdt.h>
21548 +#include <libfdt.h>
21549 +
21550 +#include "libfdt_internal.h"
21551 +
21552 +static int check_header_sw(void *fdt)
21553 +{
21554 +       if (fdt_magic(fdt) != SW_MAGIC)
21555 +               return -FDT_ERR_BADMAGIC;
21556 +       return 0;
21557 +}
21558 +
21559 +static void *grab_space(void *fdt, int len)
21560 +{
21561 +       int offset = fdt_size_dt_struct(fdt);
21562 +       int spaceleft;
21563 +
21564 +       spaceleft = fdt_totalsize(fdt) - fdt_off_dt_struct(fdt)
21565 +               - fdt_size_dt_strings(fdt);
21566 +
21567 +       if ((offset + len < offset) || (offset + len > spaceleft))
21568 +               return NULL;
21569 +
21570 +       fdt_set_size_dt_struct(fdt, offset + len);
21571 +       return fdt_offset_ptr_w(fdt, offset, len);
21572 +}
21573 +
21574 +int fdt_create(void *buf, int bufsize)
21575 +{
21576 +       void *fdt = buf;
21577 +
21578 +       if (bufsize < sizeof(struct fdt_header))
21579 +               return -FDT_ERR_NOSPACE;
21580 +
21581 +       memset(buf, 0, bufsize);
21582 +
21583 +       fdt_set_magic(fdt, SW_MAGIC);
21584 +       fdt_set_version(fdt, FDT_LAST_SUPPORTED_VERSION);
21585 +       fdt_set_last_comp_version(fdt, FDT_FIRST_SUPPORTED_VERSION);
21586 +       fdt_set_totalsize(fdt,  bufsize);
21587 +
21588 +       fdt_set_off_mem_rsvmap(fdt, ALIGN(sizeof(struct fdt_header),
21589 +                                         sizeof(struct fdt_reserve_entry)));
21590 +       fdt_set_off_dt_struct(fdt, fdt_off_mem_rsvmap(fdt));
21591 +       fdt_set_off_dt_strings(fdt, bufsize);
21592 +
21593 +       return 0;
21594 +}
21595 +
21596 +int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size)
21597 +{
21598 +       struct fdt_reserve_entry *re;
21599 +       int err = check_header_sw(fdt);
21600 +       int offset;
21601 +
21602 +       if (err)
21603 +               return err;
21604 +       if (fdt_size_dt_struct(fdt))
21605 +               return -FDT_ERR_BADSTATE;
21606 +
21607 +       offset = fdt_off_dt_struct(fdt);
21608 +       if ((offset + sizeof(*re)) > fdt_totalsize(fdt))
21609 +               return -FDT_ERR_NOSPACE;
21610 +
21611 +       re = (struct fdt_reserve_entry *)(fdt + offset);
21612 +       re->address = cpu_to_fdt64(addr);
21613 +       re->size = cpu_to_fdt64(size);
21614 +
21615 +       fdt_set_off_dt_struct(fdt, offset + sizeof(*re));
21616 +
21617 +       return 0;
21618 +}
21619 +
21620 +int fdt_finish_reservemap(void *fdt)
21621 +{
21622 +       return fdt_add_reservemap_entry(fdt, 0, 0);
21623 +}
21624 +
21625 +int fdt_begin_node(void *fdt, const char *name)
21626 +{
21627 +       struct fdt_node_header *nh;
21628 +       int err = check_header_sw(fdt);
21629 +       int namelen = strlen(name) + 1;
21630 +
21631 +       if (err)
21632 +               return err;
21633 +
21634 +       nh = grab_space(fdt, sizeof(*nh) + ALIGN(namelen, FDT_TAGSIZE));
21635 +       if (! nh)
21636 +               return -FDT_ERR_NOSPACE;
21637 +
21638 +       nh->tag = cpu_to_fdt32(FDT_BEGIN_NODE);
21639 +       memcpy(nh->name, name, namelen);
21640 +       return 0;
21641 +}
21642 +
21643 +int fdt_end_node(void *fdt)
21644 +{
21645 +       uint32_t *en;
21646 +       int err = check_header_sw(fdt);
21647 +
21648 +       if (err)
21649 +               return err;
21650 +
21651 +       en = grab_space(fdt, FDT_TAGSIZE);
21652 +       if (! en)
21653 +               return -FDT_ERR_NOSPACE;
21654 +
21655 +       *en = cpu_to_fdt32(FDT_END_NODE);
21656 +       return 0;
21657 +}
21658 +
21659 +static int find_add_string(void *fdt, const char *s)
21660 +{
21661 +       char *strtab = (char *)fdt + fdt_totalsize(fdt);
21662 +       const char *p;
21663 +       int strtabsize = fdt_size_dt_strings(fdt);
21664 +       int len = strlen(s) + 1;
21665 +       int struct_top, offset;
21666 +
21667 +       p = _fdt_find_string(strtab - strtabsize, strtabsize, s);
21668 +       if (p)
21669 +               return p - strtab;
21670 +
21671 +       /* Add it */
21672 +       offset = -strtabsize - len;
21673 +       struct_top = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
21674 +       if (fdt_totalsize(fdt) + offset < struct_top)
21675 +               return 0; /* no more room :( */
21676 +
21677 +       memcpy(strtab + offset, s, len);
21678 +       fdt_set_size_dt_strings(fdt, strtabsize + len);
21679 +       return offset;
21680 +}
21681 +
21682 +int fdt_property(void *fdt, const char *name, const void *val, int len)
21683 +{
21684 +       struct fdt_property *prop;
21685 +       int err = check_header_sw(fdt);
21686 +       int nameoff;
21687 +
21688 +       if (err)
21689 +               return err;
21690 +
21691 +       nameoff = find_add_string(fdt, name);
21692 +       if (nameoff == 0)
21693 +               return -FDT_ERR_NOSPACE;
21694 +
21695 +       prop = grab_space(fdt, sizeof(*prop) + ALIGN(len, FDT_TAGSIZE));
21696 +       if (! prop)
21697 +               return -FDT_ERR_NOSPACE;
21698 +
21699 +       prop->tag = cpu_to_fdt32(FDT_PROP);
21700 +       prop->nameoff = cpu_to_fdt32(nameoff);
21701 +       prop->len = cpu_to_fdt32(len);
21702 +       memcpy(prop->data, val, len);
21703 +       return 0;
21704 +}
21705 +
21706 +int fdt_finish(void *fdt)
21707 +{
21708 +       int err = check_header_sw(fdt);
21709 +       char *p = (char *)fdt;
21710 +       uint32_t *end;
21711 +       int oldstroffset, newstroffset;
21712 +       uint32_t tag;
21713 +       int offset, nextoffset;
21714 +
21715 +       if (err)
21716 +               return err;
21717 +
21718 +       /* Add terminator */
21719 +       end = grab_space(fdt, sizeof(*end));
21720 +       if (! end)
21721 +               return -FDT_ERR_NOSPACE;
21722 +       *end = cpu_to_fdt32(FDT_END);
21723 +
21724 +       /* Relocate the string table */
21725 +       oldstroffset = fdt_totalsize(fdt) - fdt_size_dt_strings(fdt);
21726 +       newstroffset = fdt_off_dt_struct(fdt) + fdt_size_dt_struct(fdt);
21727 +       memmove(p + newstroffset, p + oldstroffset, fdt_size_dt_strings(fdt));
21728 +       fdt_set_off_dt_strings(fdt, newstroffset);
21729 +
21730 +       /* Walk the structure, correcting string offsets */
21731 +       offset = 0;
21732 +       while ((tag = fdt_next_tag(fdt, offset, &nextoffset)) != FDT_END) {
21733 +               if (tag == FDT_PROP) {
21734 +                       struct fdt_property *prop =
21735 +                               fdt_offset_ptr_w(fdt, offset, sizeof(*prop));
21736 +                       int nameoff;
21737 +
21738 +                       if (! prop)
21739 +                               return -FDT_ERR_BADSTRUCTURE;
21740 +
21741 +                       nameoff = fdt32_to_cpu(prop->nameoff);
21742 +                       nameoff += fdt_size_dt_strings(fdt);
21743 +                       prop->nameoff = cpu_to_fdt32(nameoff);
21744 +               }
21745 +               offset = nextoffset;
21746 +       }
21747 +
21748 +       /* Finally, adjust the header */
21749 +       fdt_set_totalsize(fdt, newstroffset + fdt_size_dt_strings(fdt));
21750 +       fdt_set_magic(fdt, FDT_MAGIC);
21751 +       return 0;
21752 +}
21753 --- /dev/null
21754 +++ b/arch/powerpc/boot/libfdt/fdt_wip.c
21755 @@ -0,0 +1,144 @@
21756 +/*
21757 + * libfdt - Flat Device Tree manipulation
21758 + * Copyright (C) 2006 David Gibson, IBM Corporation.
21759 + *
21760 + * libfdt is dual licensed: you can use it either under the terms of
21761 + * the GPL, or the BSD license, at your option.
21762 + *
21763 + *  a) This library is free software; you can redistribute it and/or
21764 + *     modify it under the terms of the GNU General Public License as
21765 + *     published by the Free Software Foundation; either version 2 of the
21766 + *     License, or (at your option) any later version.
21767 + *
21768 + *     This library is distributed in the hope that it will be useful,
21769 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21770 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21771 + *     GNU General Public License for more details.
21772 + *
21773 + *     You should have received a copy of the GNU General Public
21774 + *     License along with this library; if not, write to the Free
21775 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21776 + *     MA 02110-1301 USA
21777 + *
21778 + * Alternatively,
21779 + *
21780 + *  b) Redistribution and use in source and binary forms, with or
21781 + *     without modification, are permitted provided that the following
21782 + *     conditions are met:
21783 + *
21784 + *     1. Redistributions of source code must retain the above
21785 + *        copyright notice, this list of conditions and the following
21786 + *        disclaimer.
21787 + *     2. Redistributions in binary form must reproduce the above
21788 + *        copyright notice, this list of conditions and the following
21789 + *        disclaimer in the documentation and/or other materials
21790 + *        provided with the distribution.
21791 + *
21792 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21793 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21794 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21795 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21796 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21797 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21798 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21799 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21800 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21801 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21802 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21803 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
21804 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21805 + */
21806 +#include "libfdt_env.h"
21807 +
21808 +#include <fdt.h>
21809 +#include <libfdt.h>
21810 +
21811 +#include "libfdt_internal.h"
21812 +
21813 +int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
21814 +                       const void *val, int len)
21815 +{
21816 +       void *propval;
21817 +       int proplen;
21818 +
21819 +       propval = fdt_getprop_w(fdt, nodeoffset, name, &proplen);
21820 +       if (! propval)
21821 +               return proplen;
21822 +
21823 +       if (proplen != len)
21824 +               return -FDT_ERR_NOSPACE;
21825 +
21826 +       memcpy(propval, val, len);
21827 +       return 0;
21828 +}
21829 +
21830 +static void nop_region(void *start, int len)
21831 +{
21832 +       uint32_t *p;
21833 +
21834 +       for (p = start; (void *)p < (start + len); p++)
21835 +               *p = cpu_to_fdt32(FDT_NOP);
21836 +}
21837 +
21838 +int fdt_nop_property(void *fdt, int nodeoffset, const char *name)
21839 +{
21840 +       struct fdt_property *prop;
21841 +       int len;
21842 +
21843 +       prop = fdt_get_property_w(fdt, nodeoffset, name, &len);
21844 +       if (! prop)
21845 +               return len;
21846 +
21847 +       nop_region(prop, len + sizeof(*prop));
21848 +
21849 +       return 0;
21850 +}
21851 +
21852 +int _fdt_node_end_offset(void *fdt, int nodeoffset)
21853 +{
21854 +       int level = 0;
21855 +       uint32_t tag;
21856 +       int offset, nextoffset;
21857 +
21858 +       tag = fdt_next_tag(fdt, nodeoffset, &nextoffset);
21859 +       if (tag != FDT_BEGIN_NODE)
21860 +               return -FDT_ERR_BADOFFSET;
21861 +       do {
21862 +               offset = nextoffset;
21863 +               tag = fdt_next_tag(fdt, offset, &nextoffset);
21864 +
21865 +               switch (tag) {
21866 +               case FDT_END:
21867 +                       return offset;
21868 +
21869 +               case FDT_BEGIN_NODE:
21870 +                       level++;
21871 +                       break;
21872 +
21873 +               case FDT_END_NODE:
21874 +                       level--;
21875 +                       break;
21876 +
21877 +               case FDT_PROP:
21878 +               case FDT_NOP:
21879 +                       break;
21880 +
21881 +               default:
21882 +                       return -FDT_ERR_BADSTRUCTURE;
21883 +               }
21884 +       } while (level >= 0);
21885 +
21886 +       return nextoffset;
21887 +}
21888 +
21889 +int fdt_nop_node(void *fdt, int nodeoffset)
21890 +{
21891 +       int endoffset;
21892 +
21893 +       endoffset = _fdt_node_end_offset(fdt, nodeoffset);
21894 +       if (endoffset < 0)
21895 +               return endoffset;
21896 +
21897 +       nop_region(fdt_offset_ptr_w(fdt, nodeoffset, 0), endoffset - nodeoffset);
21898 +       return 0;
21899 +}
21900 --- /dev/null
21901 +++ b/arch/powerpc/boot/libfdt/libfdt.h
21902 @@ -0,0 +1,721 @@
21903 +#ifndef _LIBFDT_H
21904 +#define _LIBFDT_H
21905 +/*
21906 + * libfdt - Flat Device Tree manipulation
21907 + * Copyright (C) 2006 David Gibson, IBM Corporation.
21908 + *
21909 + * libfdt is dual licensed: you can use it either under the terms of
21910 + * the GPL, or the BSD license, at your option.
21911 + *
21912 + *  a) This library is free software; you can redistribute it and/or
21913 + *     modify it under the terms of the GNU General Public License as
21914 + *     published by the Free Software Foundation; either version 2 of the
21915 + *     License, or (at your option) any later version.
21916 + *
21917 + *     This library is distributed in the hope that it will be useful,
21918 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
21919 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21920 + *     GNU General Public License for more details.
21921 + *
21922 + *     You should have received a copy of the GNU General Public
21923 + *     License along with this library; if not, write to the Free
21924 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
21925 + *     MA 02110-1301 USA
21926 + *
21927 + * Alternatively,
21928 + *
21929 + *  b) Redistribution and use in source and binary forms, with or
21930 + *     without modification, are permitted provided that the following
21931 + *     conditions are met:
21932 + *
21933 + *     1. Redistributions of source code must retain the above
21934 + *        copyright notice, this list of conditions and the following
21935 + *        disclaimer.
21936 + *     2. Redistributions in binary form must reproduce the above
21937 + *        copyright notice, this list of conditions and the following
21938 + *        disclaimer in the documentation and/or other materials
21939 + *        provided with the distribution.
21940 + *
21941 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21942 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
21943 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21944 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21945 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21946 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21947 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21948 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21949 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21950 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21951 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
21952 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
21953 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21954 + */
21955 +
21956 +#include <libfdt_env.h>
21957 +#include <fdt.h>
21958 +
21959 +#define FDT_FIRST_SUPPORTED_VERSION    0x10
21960 +#define FDT_LAST_SUPPORTED_VERSION     0x11
21961 +
21962 +/* Error codes: informative error codes */
21963 +#define FDT_ERR_NOTFOUND       1
21964 +       /* FDT_ERR_NOTFOUND: The requested node or property does not exist */
21965 +#define FDT_ERR_EXISTS         2
21966 +       /* FDT_ERR_EXISTS: Attemped to create a node or property which
21967 +        * already exists */
21968 +#define FDT_ERR_NOSPACE                3
21969 +       /* FDT_ERR_NOSPACE: Operation needed to expand the device
21970 +        * tree, but its buffer did not have sufficient space to
21971 +        * contain the expanded tree. Use fdt_open_into() to move the
21972 +        * device tree to a buffer with more space. */
21973 +
21974 +/* Error codes: codes for bad parameters */
21975 +#define FDT_ERR_BADOFFSET      4
21976 +       /* FDT_ERR_BADOFFSET: Function was passed a structure block
21977 +        * offset which is out-of-bounds, or which points to an
21978 +        * unsuitable part of the structure for the operation. */
21979 +#define FDT_ERR_BADPATH                5
21980 +       /* FDT_ERR_BADPATH: Function was passed a badly formatted path
21981 +        * (e.g. missing a leading / for a function which requires an
21982 +        * absolute path) */
21983 +#define FDT_ERR_BADPHANDLE     6
21984 +       /* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle
21985 +        * value.  phandle values of 0 and -1 are not permitted. */
21986 +#define FDT_ERR_BADSTATE       7
21987 +       /* FDT_ERR_BADSTATE: Function was passed an incomplete device
21988 +        * tree created by the sequential-write functions, which is
21989 +        * not sufficiently complete for the requested operation. */
21990 +
21991 +/* Error codes: codes for bad device tree blobs */
21992 +#define FDT_ERR_TRUNCATED      8
21993 +       /* FDT_ERR_TRUNCATED: Structure block of the given device tree
21994 +        * ends without an FDT_END tag. */
21995 +#define FDT_ERR_BADMAGIC       9
21996 +       /* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
21997 +        * device tree at all - it is missing the flattened device
21998 +        * tree magic number. */
21999 +#define FDT_ERR_BADVERSION     10
22000 +       /* FDT_ERR_BADVERSION: Given device tree has a version which
22001 +        * can't be handled by the requested operation.  For
22002 +        * read-write functions, this may mean that fdt_open_into() is
22003 +        * required to convert the tree to the expected version. */
22004 +#define FDT_ERR_BADSTRUCTURE   11
22005 +       /* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
22006 +        * structure block or other serious error (e.g. misnested
22007 +        * nodes, or subnodes preceding properties). */
22008 +#define FDT_ERR_BADLAYOUT      12
22009 +       /* FDT_ERR_BADLAYOUT: For read-write functions, the given
22010 +        * device tree has it's sub-blocks in an order that the
22011 +        * function can't handle (memory reserve map, then structure,
22012 +        * then strings).  Use fdt_open_into() to reorganize the tree
22013 +        * into a form suitable for the read-write operations. */
22014 +
22015 +/* "Can't happen" error indicating a bug in libfdt */
22016 +#define FDT_ERR_INTERNAL       13
22017 +       /* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
22018 +        * Should never be returned, if it is, it indicates a bug in
22019 +        * libfdt itself. */
22020 +
22021 +#define FDT_ERR_MAX            13
22022 +
22023 +/**********************************************************************/
22024 +/* Low-level functions (you probably don't need these)                */
22025 +/**********************************************************************/
22026 +
22027 +const void *fdt_offset_ptr(const void *fdt, int offset, int checklen);
22028 +static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
22029 +{
22030 +       return (void *)fdt_offset_ptr(fdt, offset, checklen);
22031 +}
22032 +
22033 +uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
22034 +
22035 +/**********************************************************************/
22036 +/* General functions                                                  */
22037 +/**********************************************************************/
22038 +
22039 +#define fdt_get_header(fdt, field) \
22040 +       (fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
22041 +#define fdt_magic(fdt)                         (fdt_get_header(fdt, magic))
22042 +#define fdt_totalsize(fdt)             (fdt_get_header(fdt, totalsize))
22043 +#define fdt_off_dt_struct(fdt)         (fdt_get_header(fdt, off_dt_struct))
22044 +#define fdt_off_dt_strings(fdt)                (fdt_get_header(fdt, off_dt_strings))
22045 +#define fdt_off_mem_rsvmap(fdt)                (fdt_get_header(fdt, off_mem_rsvmap))
22046 +#define fdt_version(fdt)               (fdt_get_header(fdt, version))
22047 +#define fdt_last_comp_version(fdt)     (fdt_get_header(fdt, last_comp_version))
22048 +#define fdt_boot_cpuid_phys(fdt)       (fdt_get_header(fdt, boot_cpuid_phys))
22049 +#define fdt_size_dt_strings(fdt)       (fdt_get_header(fdt, size_dt_strings))
22050 +#define fdt_size_dt_struct(fdt)                (fdt_get_header(fdt, size_dt_struct))
22051 +
22052 +#define __fdt_set_hdr(name) \
22053 +       static inline void fdt_set_##name(void *fdt, uint32_t val) \
22054 +       { \
22055 +               struct fdt_header *fdth = fdt; \
22056 +               fdth->name = cpu_to_fdt32(val); \
22057 +       }
22058 +__fdt_set_hdr(magic);
22059 +__fdt_set_hdr(totalsize);
22060 +__fdt_set_hdr(off_dt_struct);
22061 +__fdt_set_hdr(off_dt_strings);
22062 +__fdt_set_hdr(off_mem_rsvmap);
22063 +__fdt_set_hdr(version);
22064 +__fdt_set_hdr(last_comp_version);
22065 +__fdt_set_hdr(boot_cpuid_phys);
22066 +__fdt_set_hdr(size_dt_strings);
22067 +__fdt_set_hdr(size_dt_struct);
22068 +#undef __fdt_set_hdr
22069 +
22070 +/**
22071 + * fdt_check_header - sanity check a device tree or possible device tree
22072 + * @fdt: pointer to data which might be a flattened device tree
22073 + *
22074 + * fdt_check_header() checks that the given buffer contains what
22075 + * appears to be a flattened device tree with sane information in its
22076 + * header.
22077 + *
22078 + * returns:
22079 + *     0, if the buffer appears to contain a valid device tree
22080 + *     -FDT_ERR_BADMAGIC,
22081 + *     -FDT_ERR_BADVERSION,
22082 + *     -FDT_ERR_BADSTATE, standard meanings, as above
22083 + */
22084 +int fdt_check_header(const void *fdt);
22085 +
22086 +/**
22087 + * fdt_move - move a device tree around in memory
22088 + * @fdt: pointer to the device tree to move
22089 + * @buf: pointer to memory where the device is to be moved
22090 + * @bufsize: size of the memory space at buf
22091 + *
22092 + * fdt_move() relocates, if possible, the device tree blob located at
22093 + * fdt to the buffer at buf of size bufsize.  The buffer may overlap
22094 + * with the existing device tree blob at fdt.  Therefore,
22095 + *     fdt_move(fdt, fdt, fdt_totalsize(fdt))
22096 + * should always succeed.
22097 + *
22098 + * returns:
22099 + *     0, on success
22100 + *     -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
22101 + *     -FDT_ERR_BADMAGIC,
22102 + *     -FDT_ERR_BADVERSION,
22103 + *     -FDT_ERR_BADSTATE, standard meanings
22104 + */
22105 +int fdt_move(const void *fdt, void *buf, int bufsize);
22106 +
22107 +/**********************************************************************/
22108 +/* Read-only functions                                                */
22109 +/**********************************************************************/
22110 +
22111 +/**
22112 + * fdt_string - retreive a string from the strings block of a device tree
22113 + * @fdt: pointer to the device tree blob
22114 + * @stroffset: offset of the string within the strings block (native endian)
22115 + *
22116 + * fdt_string() retrieves a pointer to a single string from the
22117 + * strings block of the device tree blob at fdt.
22118 + *
22119 + * returns:
22120 + *     a pointer to the string, on success
22121 + *     NULL, if stroffset is out of bounds
22122 + */
22123 +const char *fdt_string(const void *fdt, int stroffset);
22124 +
22125 +/**
22126 + * fdt_num_mem_rsv - retreive the number of memory reserve map entries
22127 + * @fdt: pointer to the device tree blob
22128 + *
22129 + * Returns the number of entries in the device tree blob's memory
22130 + * reservation map.  This does not include the terminating 0,0 entry
22131 + * or any other (0,0) entries reserved for expansion.
22132 + *
22133 + * returns:
22134 + *     the number of entries
22135 + */
22136 +int fdt_num_mem_rsv(const void *fdt);
22137 +
22138 +/**
22139 + * fdt_get_mem_rsv - retreive one memory reserve map entry
22140 + * @fdt: pointer to the device tree blob
22141 + * @address, @size: pointers to 64-bit variables
22142 + *
22143 + * On success, *address and *size will contain the address and size of
22144 + * the n-th reserve map entry from the device tree blob, in
22145 + * native-endian format.
22146 + *
22147 + * returns:
22148 + *     0, on success
22149 + *     -FDT_ERR_BADMAGIC,
22150 + *     -FDT_ERR_BADVERSION,
22151 + *     -FDT_ERR_BADSTATE, standard meanings
22152 + */
22153 +int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
22154 +
22155 +/**
22156 + * fdt_subnode_offset_namelen - find a subnode based on substring
22157 + * @fdt: pointer to the device tree blob
22158 + * @parentoffset: structure block offset of a node
22159 + * @name: name of the subnode to locate
22160 + * @namelen: number of characters of name to consider
22161 + *
22162 + * Identical to fdt_subnode_offset(), but only examine the first
22163 + * namelen characters of name for matching the subnode name.  This is
22164 + * useful for finding subnodes based on a portion of a larger string,
22165 + * such as a full path.
22166 + */
22167 +int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
22168 +                              const char *name, int namelen);
22169 +/**
22170 + * fdt_subnode_offset - find a subnode of a given node
22171 + * @fdt: pointer to the device tree blob
22172 + * @parentoffset: structure block offset of a node
22173 + * @name: name of the subnode to locate
22174 + *
22175 + * fdt_subnode_offset() finds a subnode of the node at structure block
22176 + * offset parentoffset with the given name.  name may include a unit
22177 + * address, in which case fdt_subnode_offset() will find the subnode
22178 + * with that unit address, or the unit address may be omitted, in
22179 + * which case fdt_subnode_offset() will find an arbitrary subnode
22180 + * whose name excluding unit address matches the given name.
22181 + *
22182 + * returns:
22183 + *     structure block offset of the requested subnode (>=0), on success
22184 + *     -FDT_ERR_NOTFOUND, if the requested subnode does not exist
22185 + *     -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
22186 + *      -FDT_ERR_BADMAGIC,
22187 + *     -FDT_ERR_BADVERSION,
22188 + *     -FDT_ERR_BADSTATE,
22189 + *     -FDT_ERR_BADSTRUCTURE,
22190 + *     -FDT_ERR_TRUNCATED, standard meanings.
22191 + */
22192 +int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
22193 +
22194 +/**
22195 + * fdt_path_offset - find a tree node by its full path
22196 + * @fdt: pointer to the device tree blob
22197 + * @path: full path of the node to locate
22198 + *
22199 + * fdt_path_offset() finds a node of a given path in the device tree.
22200 + * Each path component may omit the unit address portion, but the
22201 + * results of this are undefined if any such path component is
22202 + * ambiguous (that is if there are multiple nodes at the relevant
22203 + * level matching the given component, differentiated only by unit
22204 + * address).
22205 + *
22206 + * returns:
22207 + *     structure block offset of the node with the requested path (>=0), on success
22208 + *     -FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
22209 + *     -FDT_ERR_NOTFOUND, if the requested node does not exist
22210 + *      -FDT_ERR_BADMAGIC,
22211 + *     -FDT_ERR_BADVERSION,
22212 + *     -FDT_ERR_BADSTATE,
22213 + *     -FDT_ERR_BADSTRUCTURE,
22214 + *     -FDT_ERR_TRUNCATED, standard meanings.
22215 + */
22216 +int fdt_path_offset(const void *fdt, const char *path);
22217 +
22218 +/**
22219 + * fdt_get_name - retreive the name of a given node
22220 + * @fdt: pointer to the device tree blob
22221 + * @nodeoffset: structure block offset of the starting node
22222 + * @lenp: pointer to an integer variable (will be overwritten) or NULL
22223 + *
22224 + * fdt_get_name() retrieves the name (including unit address) of the
22225 + * device tree node at structure block offset nodeoffset.  If lenp is
22226 + * non-NULL, the length of this name is also returned, in the integer
22227 + * pointed to by lenp.
22228 + *
22229 + * returns:
22230 + *     pointer to the node's name, on success
22231 + *             If lenp is non-NULL, *lenp contains the length of that name (>=0)
22232 + *     NULL, on error
22233 + *             if lenp is non-NULL *lenp contains an error code (<0):
22234 + *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
22235 + *             -FDT_ERR_BADMAGIC,
22236 + *             -FDT_ERR_BADVERSION,
22237 + *             -FDT_ERR_BADSTATE, standard meanings
22238 + */
22239 +const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
22240 +
22241 +/**
22242 + * fdt_get_property - find a given property in a given node
22243 + * @fdt: pointer to the device tree blob
22244 + * @nodeoffset: offset of the node whose property to find
22245 + * @name: name of the property to find
22246 + * @lenp: pointer to an integer variable (will be overwritten) or NULL
22247 + *
22248 + * fdt_get_property() retrieves a pointer to the fdt_property
22249 + * structure within the device tree blob corresponding to the property
22250 + * named 'name' of the node at offset nodeoffset.  If lenp is
22251 + * non-NULL, the length of the property value also returned, in the
22252 + * integer pointed to by lenp.
22253 + *
22254 + * returns:
22255 + *     pointer to the structure representing the property
22256 + *             if lenp is non-NULL, *lenp contains the length of the property
22257 + *             value (>=0)
22258 + *     NULL, on error
22259 + *             if lenp is non-NULL, *lenp contains an error code (<0):
22260 + *             -FDT_ERR_NOTFOUND, node does not have named property
22261 + *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
22262 + *             -FDT_ERR_BADMAGIC,
22263 + *             -FDT_ERR_BADVERSION,
22264 + *             -FDT_ERR_BADSTATE,
22265 + *             -FDT_ERR_BADSTRUCTURE,
22266 + *             -FDT_ERR_TRUNCATED, standard meanings
22267 + */
22268 +const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
22269 +                                           const char *name, int *lenp);
22270 +static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
22271 +                                                     const char *name,
22272 +                                                     int *lenp)
22273 +{
22274 +       return (struct fdt_property *)fdt_get_property(fdt, nodeoffset,
22275 +                                                      name, lenp);
22276 +}
22277 +
22278 +/**
22279 + * fdt_getprop - retrieve the value of a given property
22280 + * @fdt: pointer to the device tree blob
22281 + * @nodeoffset: offset of the node whose property to find
22282 + * @name: name of the property to find
22283 + * @lenp: pointer to an integer variable (will be overwritten) or NULL
22284 + *
22285 + * fdt_getprop() retrieves a pointer to the value of the property
22286 + * named 'name' of the node at offset nodeoffset (this will be a
22287 + * pointer to within the device blob itself, not a copy of the value).
22288 + * If lenp is non-NULL, the length of the property value also
22289 + * returned, in the integer pointed to by lenp.
22290 + *
22291 + * returns:
22292 + *     pointer to the property's value
22293 + *             if lenp is non-NULL, *lenp contains the length of the property
22294 + *             value (>=0)
22295 + *     NULL, on error
22296 + *             if lenp is non-NULL, *lenp contains an error code (<0):
22297 + *             -FDT_ERR_NOTFOUND, node does not have named property
22298 + *             -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
22299 + *             -FDT_ERR_BADMAGIC,
22300 + *             -FDT_ERR_BADVERSION,
22301 + *             -FDT_ERR_BADSTATE,
22302 + *             -FDT_ERR_BADSTRUCTURE,
22303 + *             -FDT_ERR_TRUNCATED, standard meanings
22304 + */
22305 +const void *fdt_getprop(const void *fdt, int nodeoffset,
22306 +                       const char *name, int *lenp);
22307 +static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
22308 +                                 const char *name, int *lenp)
22309 +{
22310 +       return (void *)fdt_getprop(fdt, nodeoffset, name, lenp);
22311 +}
22312 +
22313 +/**
22314 + * fdt_get_phandle - retreive the phandle of a given node
22315 + * @fdt: pointer to the device tree blob
22316 + * @nodeoffset: structure block offset of the node
22317 + *
22318 + * fdt_get_phandle() retrieves the phandle of the device tree node at
22319 + * structure block offset nodeoffset.
22320 + *
22321 + * returns:
22322 + *     the phandle of the node at nodeoffset, on succes (!= 0, != -1)
22323 + *     0, if the node has no phandle, or another error occurs
22324 + */
22325 +uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
22326 +
22327 +/**
22328 + * fdt_get_path - determine the full path of a node
22329 + * @fdt: pointer to the device tree blob
22330 + * @nodeoffset: offset of the node whose path to find
22331 + * @buf: character buffer to contain the returned path (will be overwritten)
22332 + * @buflen: size of the character buffer at buf
22333 + *
22334 + * fdt_get_path() computes the full path of the node at offset
22335 + * nodeoffset, and records that path in the buffer at buf.
22336 + *
22337 + * NOTE: This function is expensive, as it must scan the device tree
22338 + * structure from the start to nodeoffset.
22339 + *
22340 + * returns:
22341 + *     0, on success
22342 + *             buf contains the absolute path of the node at
22343 + *             nodeoffset, as a NUL-terminated string.
22344 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22345 + *     -FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
22346 + *             characters and will not fit in the given buffer.
22347 + *     -FDT_ERR_BADMAGIC,
22348 + *     -FDT_ERR_BADVERSION,
22349 + *     -FDT_ERR_BADSTATE,
22350 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22351 + */
22352 +int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
22353 +
22354 +/**
22355 + * fdt_supernode_atdepth_offset - find a specific ancestor of a node
22356 + * @fdt: pointer to the device tree blob
22357 + * @nodeoffset: offset of the node whose parent to find
22358 + * @supernodedepth: depth of the ancestor to find
22359 + * @nodedepth: pointer to an integer variable (will be overwritten) or NULL
22360 + *
22361 + * fdt_supernode_atdepth_offset() finds an ancestor of the given node
22362 + * at a specific depth from the root (where the root itself has depth
22363 + * 0, its immediate subnodes depth 1 and so forth).  So
22364 + *     fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
22365 + * will always return 0, the offset of the root node.  If the node at
22366 + * nodeoffset has depth D, then:
22367 + *     fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
22368 + * will return nodeoffset itself.
22369 + *
22370 + * NOTE: This function is expensive, as it must scan the device tree
22371 + * structure from the start to nodeoffset.
22372 + *
22373 + * returns:
22374 +
22375 + *     structure block offset of the node at node offset's ancestor
22376 + *             of depth supernodedepth (>=0), on success
22377 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22378 +*      -FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of nodeoffset
22379 + *     -FDT_ERR_BADMAGIC,
22380 + *     -FDT_ERR_BADVERSION,
22381 + *     -FDT_ERR_BADSTATE,
22382 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22383 + */
22384 +int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
22385 +                                int supernodedepth, int *nodedepth);
22386 +
22387 +/**
22388 + * fdt_node_depth - find the depth of a given node
22389 + * @fdt: pointer to the device tree blob
22390 + * @nodeoffset: offset of the node whose parent to find
22391 + *
22392 + * fdt_node_depth() finds the depth of a given node.  The root node
22393 + * has depth 0, its immediate subnodes depth 1 and so forth.
22394 + *
22395 + * NOTE: This function is expensive, as it must scan the device tree
22396 + * structure from the start to nodeoffset.
22397 + *
22398 + * returns:
22399 + *     depth of the node at nodeoffset (>=0), on success
22400 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22401 + *     -FDT_ERR_BADMAGIC,
22402 + *     -FDT_ERR_BADVERSION,
22403 + *     -FDT_ERR_BADSTATE,
22404 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22405 + */
22406 +int fdt_node_depth(const void *fdt, int nodeoffset);
22407 +
22408 +/**
22409 + * fdt_parent_offset - find the parent of a given node
22410 + * @fdt: pointer to the device tree blob
22411 + * @nodeoffset: offset of the node whose parent to find
22412 + *
22413 + * fdt_parent_offset() locates the parent node of a given node (that
22414 + * is, it finds the offset of the node which contains the node at
22415 + * nodeoffset as a subnode).
22416 + *
22417 + * NOTE: This function is expensive, as it must scan the device tree
22418 + * structure from the start to nodeoffset, *twice*.
22419 + *
22420 + * returns:
22421 + *     stucture block offset of the parent of the node at nodeoffset
22422 + *             (>=0), on success
22423 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22424 + *     -FDT_ERR_BADMAGIC,
22425 + *     -FDT_ERR_BADVERSION,
22426 + *     -FDT_ERR_BADSTATE,
22427 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22428 + */
22429 +int fdt_parent_offset(const void *fdt, int nodeoffset);
22430 +
22431 +/**
22432 + * fdt_node_offset_by_prop_value - find nodes with a given property value
22433 + * @fdt: pointer to the device tree blob
22434 + * @startoffset: only find nodes after this offset
22435 + * @propname: property name to check
22436 + * @propval: property value to search for
22437 + * @proplen: length of the value in propval
22438 + *
22439 + * fdt_node_offset_by_prop_value() returns the offset of the first
22440 + * node after startoffset, which has a property named propname whose
22441 + * value is of length proplen and has value equal to propval; or if
22442 + * startoffset is -1, the very first such node in the tree.
22443 + *
22444 + * To iterate through all nodes matching the criterion, the following
22445 + * idiom can be used:
22446 + *     offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
22447 + *                                            propval, proplen);
22448 + *     while (offset != -FDT_ERR_NOTFOUND) {
22449 + *             // other code here
22450 + *             offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
22451 + *                                                    propval, proplen);
22452 + *     }
22453 + *
22454 + * Note the -1 in the first call to the function, if 0 is used here
22455 + * instead, the function will never locate the root node, even if it
22456 + * matches the criterion.
22457 + *
22458 + * returns:
22459 + *     structure block offset of the located node (>= 0, >startoffset),
22460 + *              on success
22461 + *     -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
22462 + *             tree after startoffset
22463 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22464 + *     -FDT_ERR_BADMAGIC,
22465 + *     -FDT_ERR_BADVERSION,
22466 + *     -FDT_ERR_BADSTATE,
22467 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22468 + */
22469 +int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
22470 +                                 const char *propname,
22471 +                                 const void *propval, int proplen);
22472 +
22473 +/**
22474 + * fdt_node_offset_by_phandle - find the node with a given phandle
22475 + * @fdt: pointer to the device tree blob
22476 + * @phandle: phandle value
22477 + *
22478 + * fdt_node_offset_by_prop_value() returns the offset of the node
22479 + * which has the given phandle value.  If there is more than one node
22480 + * in the tree with the given phandle (an invalid tree), results are
22481 + * undefined.
22482 + *
22483 + * returns:
22484 + *     structure block offset of the located node (>= 0), on success
22485 + *     -FDT_ERR_NOTFOUND, no node with that phandle exists
22486 + *     -FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
22487 + *     -FDT_ERR_BADMAGIC,
22488 + *     -FDT_ERR_BADVERSION,
22489 + *     -FDT_ERR_BADSTATE,
22490 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22491 + */
22492 +int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
22493 +
22494 +/**
22495 + * fdt_node_check_compatible: check a node's compatible property
22496 + * @fdt: pointer to the device tree blob
22497 + * @nodeoffset: offset of a tree node
22498 + * @compatible: string to match against
22499 + *
22500 + *
22501 + * fdt_node_check_compatible() returns 0 if the given node contains a
22502 + * 'compatible' property with the given string as one of its elements,
22503 + * it returns non-zero otherwise, or on error.
22504 + *
22505 + * returns:
22506 + *     0, if the node has a 'compatible' property listing the given string
22507 + *     1, if the node has a 'compatible' property, but it does not list
22508 + *             the given string
22509 + *     -FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
22510 + *     -FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
22511 + *     -FDT_ERR_BADMAGIC,
22512 + *     -FDT_ERR_BADVERSION,
22513 + *     -FDT_ERR_BADSTATE,
22514 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22515 + */
22516 +int fdt_node_check_compatible(const void *fdt, int nodeoffset,
22517 +                             const char *compatible);
22518 +
22519 +/**
22520 + * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
22521 + * @fdt: pointer to the device tree blob
22522 + * @startoffset: only find nodes after this offset
22523 + * @compatible: 'compatible' string to match against
22524 + *
22525 + * fdt_node_offset_by_compatible() returns the offset of the first
22526 + * node after startoffset, which has a 'compatible' property which
22527 + * lists the given compatible string; or if startoffset is -1, the
22528 + * very first such node in the tree.
22529 + *
22530 + * To iterate through all nodes matching the criterion, the following
22531 + * idiom can be used:
22532 + *     offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
22533 + *     while (offset != -FDT_ERR_NOTFOUND) {
22534 + *             // other code here
22535 + *             offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
22536 + *     }
22537 + *
22538 + * Note the -1 in the first call to the function, if 0 is used here
22539 + * instead, the function will never locate the root node, even if it
22540 + * matches the criterion.
22541 + *
22542 + * returns:
22543 + *     structure block offset of the located node (>= 0, >startoffset),
22544 + *              on success
22545 + *     -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
22546 + *             tree after startoffset
22547 + *     -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
22548 + *     -FDT_ERR_BADMAGIC,
22549 + *     -FDT_ERR_BADVERSION,
22550 + *     -FDT_ERR_BADSTATE,
22551 + *     -FDT_ERR_BADSTRUCTURE, standard meanings
22552 + */
22553 +int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
22554 +                                 const char *compatible);
22555 +
22556 +/**********************************************************************/
22557 +/* Write-in-place functions                                           */
22558 +/**********************************************************************/
22559 +
22560 +int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
22561 +                       const void *val, int len);
22562 +static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
22563 +                                          const char *name, uint32_t val)
22564 +{
22565 +       val = cpu_to_fdt32(val);
22566 +       return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
22567 +}
22568 +
22569 +int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
22570 +int fdt_nop_node(void *fdt, int nodeoffset);
22571 +
22572 +/**********************************************************************/
22573 +/* Sequential write functions                                         */
22574 +/**********************************************************************/
22575 +
22576 +int fdt_create(void *buf, int bufsize);
22577 +int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
22578 +int fdt_finish_reservemap(void *fdt);
22579 +int fdt_begin_node(void *fdt, const char *name);
22580 +int fdt_property(void *fdt, const char *name, const void *val, int len);
22581 +static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
22582 +{
22583 +       val = cpu_to_fdt32(val);
22584 +       return fdt_property(fdt, name, &val, sizeof(val));
22585 +}
22586 +#define fdt_property_string(fdt, name, str) \
22587 +       fdt_property(fdt, name, str, strlen(str)+1)
22588 +int fdt_end_node(void *fdt);
22589 +int fdt_finish(void *fdt);
22590 +
22591 +/**********************************************************************/
22592 +/* Read-write functions                                               */
22593 +/**********************************************************************/
22594 +
22595 +int fdt_open_into(const void *fdt, void *buf, int bufsize);
22596 +int fdt_pack(void *fdt);
22597 +
22598 +int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
22599 +int fdt_del_mem_rsv(void *fdt, int n);
22600 +
22601 +int fdt_setprop(void *fdt, int nodeoffset, const char *name,
22602 +               const void *val, int len);
22603 +static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
22604 +                                  uint32_t val)
22605 +{
22606 +       val = cpu_to_fdt32(val);
22607 +       return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
22608 +}
22609 +#define fdt_setprop_string(fdt, nodeoffset, name, str) \
22610 +       fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
22611 +int fdt_delprop(void *fdt, int nodeoffset, const char *name);
22612 +int fdt_add_subnode_namelen(void *fdt, int parentoffset,
22613 +                           const char *name, int namelen);
22614 +int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
22615 +int fdt_del_node(void *fdt, int nodeoffset);
22616 +
22617 +/**********************************************************************/
22618 +/* Debugging / informational functions                                */
22619 +/**********************************************************************/
22620 +
22621 +const char *fdt_strerror(int errval);
22622 +
22623 +#endif /* _LIBFDT_H */
22624 --- /dev/null
22625 +++ b/arch/powerpc/boot/libfdt/libfdt_internal.h
22626 @@ -0,0 +1,89 @@
22627 +#ifndef _LIBFDT_INTERNAL_H
22628 +#define _LIBFDT_INTERNAL_H
22629 +/*
22630 + * libfdt - Flat Device Tree manipulation
22631 + * Copyright (C) 2006 David Gibson, IBM Corporation.
22632 + *
22633 + * libfdt is dual licensed: you can use it either under the terms of
22634 + * the GPL, or the BSD license, at your option.
22635 + *
22636 + *  a) This library is free software; you can redistribute it and/or
22637 + *     modify it under the terms of the GNU General Public License as
22638 + *     published by the Free Software Foundation; either version 2 of the
22639 + *     License, or (at your option) any later version.
22640 + *
22641 + *     This library is distributed in the hope that it will be useful,
22642 + *     but WITHOUT ANY WARRANTY; without even the implied warranty of
22643 + *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22644 + *     GNU General Public License for more details.
22645 + *
22646 + *     You should have received a copy of the GNU General Public
22647 + *     License along with this library; if not, write to the Free
22648 + *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
22649 + *     MA 02110-1301 USA
22650 + *
22651 + * Alternatively,
22652 + *
22653 + *  b) Redistribution and use in source and binary forms, with or
22654 + *     without modification, are permitted provided that the following
22655 + *     conditions are met:
22656 + *
22657 + *     1. Redistributions of source code must retain the above
22658 + *        copyright notice, this list of conditions and the following
22659 + *        disclaimer.
22660 + *     2. Redistributions in binary form must reproduce the above
22661 + *        copyright notice, this list of conditions and the following
22662 + *        disclaimer in the documentation and/or other materials
22663 + *        provided with the distribution.
22664 + *
22665 + *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
22666 + *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22667 + *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22668 + *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22669 + *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22670 + *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22671 + *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22672 + *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22673 + *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22674 + *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22675 + *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22676 + *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
22677 + *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22678 + */
22679 +#include <fdt.h>
22680 +
22681 +#define ALIGN(x, a)    (((x) + (a) - 1) & ~((a) - 1))
22682 +#define PALIGN(p, a)   ((void *)ALIGN((unsigned long)(p), (a)))
22683 +
22684 +#define memeq(p, q, n) (memcmp((p), (q), (n)) == 0)
22685 +#define streq(p, q)    (strcmp((p), (q)) == 0)
22686 +
22687 +uint32_t _fdt_next_tag(const void *fdt, int startoffset, int *nextoffset);
22688 +const char *_fdt_find_string(const char *strtab, int tabsize, const char *s);
22689 +int _fdt_node_end_offset(void *fdt, int nodeoffset);
22690 +
22691 +static inline const void *_fdt_offset_ptr(const void *fdt, int offset)
22692 +{
22693 +       return fdt + fdt_off_dt_struct(fdt) + offset;
22694 +}
22695 +
22696 +static inline void *_fdt_offset_ptr_w(void *fdt, int offset)
22697 +{
22698 +       return (void *)_fdt_offset_ptr(fdt, offset);
22699 +}
22700 +
22701 +static inline const struct fdt_reserve_entry *_fdt_mem_rsv(const void *fdt, int n)
22702 +{
22703 +       const struct fdt_reserve_entry *rsv_table =
22704 +               fdt + fdt_off_mem_rsvmap(fdt);
22705 +
22706 +       return rsv_table + n;
22707 +}
22708 +static inline struct fdt_reserve_entry *_fdt_mem_rsv_w(void *fdt, int n)
22709 +{
22710 +       return (void *)_fdt_mem_rsv(fdt, n);
22711 +}
22712 +
22713 +#define SW_MAGIC               (~FDT_MAGIC)
22714 +
22715 +#endif /* _LIBFDT_INTERNAL_H */
22716 --- /dev/null
22717 +++ b/arch/powerpc/boot/libfdt-wrapper.c
22718 @@ -0,0 +1,184 @@
22719 +/*
22720 + * This file does the necessary interface mapping between the bootwrapper
22721 + * device tree operations and the interface provided by shared source
22722 + * files flatdevicetree.[ch].
22723 + *
22724 + * Copyright 2007 David Gibson, IBM Corporation.
22725 + *
22726 + * This library is free software; you can redistribute it and/or
22727 + * modify it under the terms of the GNU General Public License as
22728 + * published by the Free Software Foundation; either version 2 of the
22729 + * License, or (at your option) any later version.
22730 + *
22731 + * This library is distributed in the hope that it will be useful, but
22732 + * WITHOUT ANY WARRANTY; without even the implied warranty of
22733 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22734 + * General Public License for more details.
22735 + *
22736 + * You should have received a copy of the GNU General Public License
22737 + * along with this library; if not, write to the Free Software
22738 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22739 + * 02110-1301 USA
22740 + */
22741 +
22742 +#include <stddef.h>
22743 +#include <stdio.h>
22744 +#include <page.h>
22745 +#include <libfdt.h>
22746 +#include "ops.h"
22747 +
22748 +#define DEBUG  0
22749 +#define BAD_ERROR(err) (((err) < 0) \
22750 +                        && ((err) != -FDT_ERR_NOTFOUND) \
22751 +                        && ((err) != -FDT_ERR_EXISTS))
22752 +
22753 +#define check_err(err) \
22754 +       ({ \
22755 +               if (BAD_ERROR(err) || ((err < 0) && DEBUG)) \
22756 +                       printf("%s():%d  %s\n\r", __FUNCTION__, __LINE__, \
22757 +                              fdt_strerror(err)); \
22758 +               if (BAD_ERROR(err)) \
22759 +                       exit(); \
22760 +               (err < 0) ? -1 : 0; \
22761 +       })
22762 +
22763 +#define offset_devp(off)       \
22764 +       ({ \
22765 +               int _offset = (off); \
22766 +               check_err(_offset) ? NULL : (void *)(_offset+1); \
22767 +       })
22768 +
22769 +#define devp_offset_find(devp) (((int)(devp))-1)
22770 +#define devp_offset(devp)      (devp ? ((int)(devp))-1 : 0)
22771 +
22772 +static void *fdt;
22773 +static void *buf; /* = NULL */
22774 +
22775 +#define EXPAND_GRANULARITY     1024
22776 +
22777 +static void expand_buf(int minexpand)
22778 +{
22779 +       int size = fdt_totalsize(fdt);
22780 +       int rc;
22781 +
22782 +       size = _ALIGN(size + minexpand, EXPAND_GRANULARITY);
22783 +       buf = platform_ops.realloc(buf, size);
22784 +       if (!buf)
22785 +               fatal("Couldn't find %d bytes to expand device tree\n\r", size);
22786 +       rc = fdt_open_into(fdt, buf, size);
22787 +       if (rc != 0)
22788 +               fatal("Couldn't expand fdt into new buffer: %s\n\r",
22789 +                     fdt_strerror(rc));
22790 +
22791 +       fdt = buf;
22792 +}
22793 +
22794 +static void *fdt_wrapper_finddevice(const char *path)
22795 +{
22796 +       return offset_devp(fdt_path_offset(fdt, path));
22797 +}
22798 +
22799 +static int fdt_wrapper_getprop(const void *devp, const char *name,
22800 +                              void *buf, const int buflen)
22801 +{
22802 +       const void *p;
22803 +       int len;
22804 +
22805 +       p = fdt_getprop(fdt, devp_offset(devp), name, &len);
22806 +       if (!p)
22807 +               return check_err(len);
22808 +       memcpy(buf, p, min(len, buflen));
22809 +       return len;
22810 +}
22811 +
22812 +static int fdt_wrapper_setprop(const void *devp, const char *name,
22813 +                              const void *buf, const int len)
22814 +{
22815 +       int rc;
22816 +
22817 +       rc = fdt_setprop(fdt, devp_offset(devp), name, buf, len);
22818 +       if (rc == -FDT_ERR_NOSPACE) {
22819 +               expand_buf(len + 16);
22820 +               rc = fdt_setprop(fdt, devp_offset(devp), name, buf, len);
22821 +       }
22822 +
22823 +       return check_err(rc);
22824 +}
22825 +
22826 +static void *fdt_wrapper_get_parent(const void *devp)
22827 +{
22828 +       return offset_devp(fdt_parent_offset(fdt, devp_offset(devp)));
22829 +}
22830 +
22831 +static void *fdt_wrapper_create_node(const void *devp, const char *name)
22832 +{
22833 +       int offset;
22834 +
22835 +       offset = fdt_add_subnode(fdt, devp_offset(devp), name);
22836 +       if (offset == -FDT_ERR_NOSPACE) {
22837 +               expand_buf(strlen(name) + 16);
22838 +               offset = fdt_add_subnode(fdt, devp_offset(devp), name);
22839 +       }
22840 +
22841 +       return offset_devp(offset);
22842 +}
22843 +
22844 +static void *fdt_wrapper_find_node_by_prop_value(const void *prev,
22845 +                                                const char *name,
22846 +                                                const char *val,
22847 +                                                int len)
22848 +{
22849 +       int offset = fdt_node_offset_by_prop_value(fdt, devp_offset_find(prev),
22850 +                                                  name, val, len);
22851 +       return offset_devp(offset);
22852 +}
22853 +
22854 +static char *fdt_wrapper_get_path(const void *devp, char *buf, int len)
22855 +{
22856 +       int rc;
22857 +
22858 +       rc = fdt_get_path(fdt, devp_offset(devp), buf, len);
22859 +       if (check_err(rc))
22860 +               return NULL;
22861 +       return buf;
22862 +}
22863 +
22864 +static unsigned long fdt_wrapper_finalize(void)
22865 +{
22866 +       int rc;
22867 +
22868 +       rc = fdt_pack(fdt);
22869 +       if (rc != 0)
22870 +               fatal("Couldn't pack flat tree: %s\n\r",
22871 +                     fdt_strerror(rc));
22872 +       return (unsigned long)fdt;
22873 +}
22874 +
22875 +void fdt_init(void *blob)
22876 +{
22877 +       int err;
22878 +
22879 +       dt_ops.finddevice = fdt_wrapper_finddevice;
22880 +       dt_ops.getprop = fdt_wrapper_getprop;
22881 +       dt_ops.setprop = fdt_wrapper_setprop;
22882 +       dt_ops.get_parent = fdt_wrapper_get_parent;
22883 +       dt_ops.create_node = fdt_wrapper_create_node;
22884 +       dt_ops.find_node_by_prop_value = fdt_wrapper_find_node_by_prop_value;
22885 +       dt_ops.get_path = fdt_wrapper_get_path;
22886 +       dt_ops.finalize = fdt_wrapper_finalize;
22887 +
22888 +       /* Make sure the dt blob is the right version and so forth */
22889 +       fdt = blob;
22890 +       err = fdt_open_into(fdt, fdt, fdt_totalsize(blob));
22891 +       if (err == -FDT_ERR_NOSPACE) {
22892 +               int bufsize = fdt_totalsize(fdt) + 4;
22893 +               buf = malloc(bufsize);
22894 +               err = fdt_open_into(fdt, buf, bufsize);
22895 +       }
22896 +
22897 +       if (err != 0)
22898 +               fatal("fdt_init(): %s\n\r", fdt_strerror(err));
22899 +
22900 +       if (buf)
22901 +               fdt = buf;
22902 +}
22903 --- /dev/null
22904 +++ b/arch/powerpc/boot/libfdt_env.h
22905 @@ -0,0 +1,17 @@
22906 +#ifndef _ARCH_POWERPC_BOOT_LIBFDT_ENV_H
22907 +#define _ARCH_POWERPC_BOOT_LIBFDT_ENV_H
22908 +
22909 +#include <types.h>
22910 +#include <string.h>
22911 +
22912 +typedef u32 uint32_t;
22913 +typedef u64 uint64_t;
22914 +
22915 +#define fdt16_to_cpu(x)                (x)
22916 +#define cpu_to_fdt16(x)                (x)
22917 +#define fdt32_to_cpu(x)                (x)
22918 +#define cpu_to_fdt32(x)                (x)
22919 +#define fdt64_to_cpu(x)                (x)
22920 +#define cpu_to_fdt64(x)                (x)
22921 +
22922 +#endif /* _ARCH_POWERPC_BOOT_LIBFDT_ENV_H */
22923 --- a/arch/powerpc/boot/main.c
22924 +++ b/arch/powerpc/boot/main.c
22925 @@ -16,7 +16,6 @@
22926  #include "stdio.h"
22927  #include "ops.h"
22928  #include "gunzip_util.h"
22929 -#include "flatdevtree.h"
22930  #include "reg.h"
22931  
22932  static struct gunzip_state gzstate;
22933 --- a/arch/powerpc/boot/ops.h
22934 +++ b/arch/powerpc/boot/ops.h
22935 @@ -79,7 +79,7 @@
22936  extern struct loader_info loader_info;
22937  
22938  void start(void);
22939 -int ft_init(void *dt_blob, unsigned int max_size, unsigned int max_find_device);
22940 +void fdt_init(void *blob);
22941  int serial_console_init(void);
22942  int ns16550_console_init(void *devp, struct serial_console_data *scdp);
22943  int mpsc_console_init(void *devp, struct serial_console_data *scdp);
22944 @@ -159,9 +159,23 @@
22945         return find_node_by_prop_value_str(prev, "device_type", type);
22946  }
22947  
22948 +static inline void *find_node_by_alias(const char *alias)
22949 +{
22950 +       void *devp = finddevice("/aliases");
22951 +
22952 +       if (devp) {
22953 +               char path[MAX_PATH_LEN];
22954 +               if (getprop(devp, alias, path, MAX_PATH_LEN) > 0)
22955 +                       return finddevice(path);
22956 +       }
22957 +
22958 +       return NULL;
22959 +}
22960 +
22961  void dt_fixup_memory(u64 start, u64 size);
22962  void dt_fixup_cpu_clocks(u32 cpufreq, u32 tbfreq, u32 busfreq);
22963  void dt_fixup_clock(const char *path, u32 freq);
22964 +void dt_fixup_mac_address_by_alias(const char *alias, const u8 *addr);
22965  void dt_fixup_mac_address(u32 index, const u8 *addr);
22966  void __dt_fixup_mac_addresses(u32 startindex, ...);
22967  #define dt_fixup_mac_addresses(...) \
22968 --- a/arch/powerpc/boot/prpmc2800.c
22969 +++ b/arch/powerpc/boot/prpmc2800.c
22970 @@ -547,8 +547,7 @@
22971         if (!dtb)
22972                 exit();
22973         memmove(dtb, _dtb_start, dt_size);
22974 -       if (ft_init(dtb, dt_size, 16))
22975 -               exit();
22976 +       fdt_init(dtb);
22977  
22978         bridge_base = mv64x60_get_bridge_base();
22979  
22980 --- a/arch/powerpc/boot/ps3.c
22981 +++ b/arch/powerpc/boot/ps3.c
22982 @@ -131,7 +131,7 @@
22983         printf("\n-- PS3 bootwrapper --\n");
22984  
22985         simple_alloc_init(_end, heapsize, 32, 64);
22986 -       ft_init(_dtb_start, 0, 4);
22987 +       fdt_init(_dtb_start);
22988  
22989         chosen = finddevice("/chosen");
22990  
22991 --- /dev/null
22992 +++ b/arch/powerpc/boot/redboot-8xx.c
22993 @@ -0,0 +1,58 @@
22994 +/*
22995 + * RedBoot firmware support
22996 + *
22997 + * Author: Scott Wood <scottwood@freescale.com>
22998 + *
22999 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
23000 + *
23001 + * This program is free software; you can redistribute it and/or modify it
23002 + * under the terms of the GNU General Public License version 2 as published
23003 + * by the Free Software Foundation.
23004 + */
23005 +
23006 +#include "ops.h"
23007 +#include "stdio.h"
23008 +#include "redboot.h"
23009 +#include "fsl-soc.h"
23010 +#include "io.h"
23011 +
23012 +static bd_t bd;
23013 +BSS_STACK(4096);
23014 +
23015 +#define MHZ(x) ((x + 500000) / 1000000)
23016 +
23017 +static void platform_fixups(void)
23018 +{
23019 +       void *node;
23020 +
23021 +       dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
23022 +       dt_fixup_mac_addresses(bd.bi_enetaddr);
23023 +       dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 16, bd.bi_busfreq);
23024 +
23025 +       node = finddevice("/soc/cpm/brg");
23026 +       if (node) {
23027 +               printf("BRG clock-frequency <- 0x%x (%dMHz)\r\n",
23028 +                      bd.bi_busfreq, MHZ(bd.bi_busfreq));
23029 +               setprop(node, "clock-frequency",  &bd.bi_busfreq, 4);
23030 +       }
23031 +}
23032 +
23033 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
23034 +                   unsigned long r6, unsigned long r7)
23035 +{
23036 +       memcpy(&bd, (char *)r3, sizeof(bd));
23037 +
23038 +       if (bd.bi_tag != 0x42444944)
23039 +               return;
23040 +
23041 +       simple_alloc_init(_end,
23042 +                         bd.bi_memstart + bd.bi_memsize - (unsigned long)_end,
23043 +                         32, 64);
23044 +
23045 +       fdt_init(_dtb_start);
23046 +       serial_console_init();
23047 +       platform_ops.fixups = platform_fixups;
23048 +
23049 +       loader_info.cmdline = (char *)bd.bi_cmdline;
23050 +       loader_info.cmdline_len = strlen((char *)bd.bi_cmdline);
23051 +}
23052 --- /dev/null
23053 +++ b/arch/powerpc/boot/redboot.h
23054 @@ -0,0 +1,56 @@
23055 +#ifndef _PPC_REDBOOT_H
23056 +#define _PPC_REDBOOT_H
23057 +
23058 +//=========================================================================
23059 +// include/asm-ppc/redboot.h
23060 +//   Copyright (c) 2002, 2003 Gary Thomas (<gary@mlbassoc.com>
23061 +//   Copyright (c) 1997 Dan Malek (dmalek@jlc.net)
23062 +
23063 +//
23064 +// Board specific details, as provided by RedBoot
23065 +//
23066 +
23067 +/* A Board Information structure that is given to a program when
23068 + * RedBoot starts it up.  Note: not all fields make sense for all
23069 + * architectures and it's up to the platform specific code to fill
23070 + * in the details.
23071 + */
23072 +typedef struct bd_info {
23073 +    unsigned int   bi_tag;        /* Should be 0x42444944 "BDID" */
23074 +    unsigned int   bi_size;       /* Size of this structure */
23075 +    unsigned int   bi_revision;   /* revision of this structure */
23076 +    unsigned int   bi_bdate;      /* bootstrap date, i.e. 0x19971106 */
23077 +    unsigned int   bi_memstart;   /* Memory start address */
23078 +    unsigned int   bi_memsize;    /* Memory (end) size in bytes */
23079 +    unsigned int   bi_intfreq;    /* Internal Freq, in Hz */
23080 +    unsigned int   bi_busfreq;    /* Bus Freq, in Hz */
23081 +    unsigned int   bi_cpmfreq;    /* CPM Freq, in Hz */
23082 +    unsigned int   bi_brgfreq;    /* BRG Freq, in Hz */
23083 +    unsigned int   bi_vco;        /* VCO Out from PLL */
23084 +    unsigned int   bi_pci_freq;   /* PCI Freq, in Hz */
23085 +    unsigned int   bi_baudrate;   /* Default console baud rate */
23086 +    unsigned int   bi_immr;       /* IMMR when called from boot rom */
23087 +    unsigned char  bi_enetaddr[6];
23088 +    unsigned int   bi_flashbase;  /* Physical address of FLASH memory */
23089 +    unsigned int   bi_flashsize;  /* Length of FLASH memory */
23090 +    int            bi_flashwidth; /* Width (8,16,32,64) */
23091 +    unsigned char *bi_cmdline;    /* Pointer to command line */
23092 +    unsigned char  bi_esa[3][6];  /* Ethernet station addresses */
23093 +    unsigned int   bi_ramdisk_begin, bi_ramdisk_end;
23094 +    struct {                      /* Information about [main] video screen */
23095 +        short x_res;              /*   Horizontal resolution in pixels */
23096 +        short y_res;              /*   Vertical resolution in pixels */
23097 +        short bpp;                /*   Bits/pixel */
23098 +        short mode;               /*   Type of pixels (packed, indexed) */
23099 +        unsigned long fb;         /*   Pointer to frame buffer (pixel) memory */
23100 +    } bi_video;
23101 +    void         (*bi_cputc)(char);   /* Write a character to the RedBoot console */
23102 +    char         (*bi_cgetc)(void);   /* Read a character from the RedBoot console */
23103 +    int          (*bi_ctstc)(void);   /* Test for input on the RedBoot console */
23104 +} bd_t;
23105 +
23106 +#define BI_REV 0x0102    /* Version 1.02 */
23107 +
23108 +#define bi_pci_busfreq bi_pci_freq
23109 +#define bi_immr_base   bi_immr
23110 +#endif
23111 --- a/arch/powerpc/boot/reg.h
23112 +++ b/arch/powerpc/boot/reg.h
23113 @@ -16,6 +16,14 @@
23114         return pvr;
23115  }
23116  
23117 +#define __stringify_1(x)       #x
23118 +#define __stringify(x)         __stringify_1(x)
23119 +
23120 +#define mfspr(rn)      ({unsigned long rval; \
23121 +                       asm volatile("mfspr %0," __stringify(rn) \
23122 +                               : "=r" (rval)); rval; })
23123 +#define mtspr(rn, v)   asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v))
23124 +
23125  register void *__stack_pointer asm("r1");
23126  #define get_sp()       (__stack_pointer)
23127  
23128 --- a/arch/powerpc/boot/serial.c
23129 +++ b/arch/powerpc/boot/serial.c
23130 @@ -128,7 +128,8 @@
23131                 rc = cpm_console_init(devp, &serial_cd);
23132         else if (dt_is_compatible(devp, "mpc5200-psc-uart"))
23133                 rc = mpc5200_psc_console_init(devp, &serial_cd);
23134 -       else if (dt_is_compatible(devp, "xilinx,uartlite"))
23135 +       else if (dt_is_compatible(devp, "xlnx,opb-uartlite-1.00.b") ||
23136 +                dt_is_compatible(devp, "xlnx,xps-uartlite-1.00.a"))
23137                 rc = uartlite_console_init(devp, &serial_cd);
23138  
23139         /* Add other serial console driver calls here */
23140 --- a/arch/powerpc/boot/treeboot-walnut.c
23141 +++ b/arch/powerpc/boot/treeboot-walnut.c
23142 @@ -20,55 +20,6 @@
23143  
23144  BSS_STACK(4096);
23145  
23146 -void ibm405gp_fixup_clocks(unsigned int sysclk, unsigned int ser_clk)
23147 -{
23148 -       u32 pllmr = mfdcr(DCRN_CPC0_PLLMR);
23149 -       u32 cpc0_cr0 = mfdcr(DCRN_405_CPC0_CR0);
23150 -       u32 cpc0_cr1 = mfdcr(DCRN_405_CPC0_CR1);
23151 -       u32 cpu, plb, opb, ebc, tb, uart0, uart1, m;
23152 -       u32 fwdv, fbdv, cbdv, opdv, epdv, udiv;
23153 -
23154 -       fwdv = (8 - ((pllmr & 0xe0000000) >> 29));
23155 -       fbdv = (pllmr & 0x1e000000) >> 25;
23156 -       cbdv = ((pllmr & 0x00060000) >> 17) + 1;
23157 -       opdv = ((pllmr & 0x00018000) >> 15) + 1;
23158 -       epdv = ((pllmr & 0x00001800) >> 13) + 2;
23159 -       udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1;
23160 -
23161 -       m = fwdv * fbdv * cbdv;
23162 -
23163 -       cpu = sysclk * m / fwdv;
23164 -       plb = cpu / cbdv;
23165 -       opb = plb / opdv;
23166 -       ebc = plb / epdv;
23167 -
23168 -       if (cpc0_cr0 & 0x80) {
23169 -               /* uart0 uses the external clock */
23170 -               uart0 = ser_clk;
23171 -       } else {
23172 -               uart0 = cpu / udiv;
23173 -       }
23174 -
23175 -       if (cpc0_cr0 & 0x40) {
23176 -               /* uart1 uses the external clock */
23177 -               uart1 = ser_clk;
23178 -       } else {
23179 -               uart1 = cpu / udiv;
23180 -       }
23181 -
23182 -       /* setup the timebase clock to tick at the cpu frequency */
23183 -       cpc0_cr1 = cpc0_cr1 & ~0x00800000;
23184 -       mtdcr(DCRN_405_CPC0_CR1, cpc0_cr1);
23185 -       tb = cpu;
23186 -
23187 -       dt_fixup_cpu_clocks(cpu, tb, 0);
23188 -       dt_fixup_clock("/plb", plb);
23189 -       dt_fixup_clock("/plb/opb", opb);
23190 -       dt_fixup_clock("/plb/ebc", ebc);
23191 -       dt_fixup_clock("/plb/opb/serial@ef600300", uart0);
23192 -       dt_fixup_clock("/plb/opb/serial@ef600400", uart1);
23193 -}
23194 -
23195  static void walnut_flashsel_fixup(void)
23196  {
23197         void *devp, *sram;
23198 @@ -112,7 +63,7 @@
23199  #define WALNUT_OPENBIOS_MAC_OFF 0xfffffe0b
23200  static void walnut_fixups(void)
23201  {
23202 -       ibm4xx_fixup_memsize();
23203 +       ibm4xx_sdram_fixup_memsize();
23204         ibm405gp_fixup_clocks(33330000, 0xa8c000);
23205         ibm4xx_quiesce_eth((u32 *)0xef600800, NULL);
23206         ibm4xx_fixup_ebc_ranges("/plb/ebc");
23207 @@ -128,6 +79,6 @@
23208         simple_alloc_init(_end, avail_ram, 32, 32);
23209         platform_ops.fixups = walnut_fixups;
23210         platform_ops.exit = ibm40x_dbcr_reset;
23211 -       ft_init(_dtb_start, _dtb_end - _dtb_start, 32);
23212 +       fdt_init(_dtb_start);
23213         serial_console_init();
23214  }
23215 --- a/arch/powerpc/boot/wrapper
23216 +++ b/arch/powerpc/boot/wrapper
23217 @@ -45,6 +45,7 @@
23218  
23219  # directory for object and other files used by this script
23220  object=arch/powerpc/boot
23221 +objbin=$object
23222  
23223  # directory for working files
23224  tmpdir=.
23225 @@ -95,6 +96,7 @@
23226         shift
23227         [ "$#" -gt 0 ] || usage
23228         object="$1"
23229 +       objbin="$1"
23230         ;;
23231      -W)
23232         shift
23233 @@ -116,10 +118,13 @@
23234  done
23235  
23236  if [ -n "$dts" ]; then
23237 +    if [ ! -r "$dts" -a -r "$object/dts/$dts" ]; then
23238 +       dts="$object/dts/$dts"
23239 +    fi
23240      if [ -z "$dtb" ]; then
23241         dtb="$platform.dtb"
23242      fi
23243 -    dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts"
23244 +    $object/dtc -O dtb -o "$dtb" -b 0 "$dts"
23245  fi
23246  
23247  if [ -z "$kernel" ]; then
23248 @@ -163,7 +168,7 @@
23249      ksection=.kernel:vmlinux.bin
23250      isection=.kernel:initrd
23251      ;;
23252 -ep88xc)
23253 +ep88xc|ep405|redboot*|ep8248e)
23254      platformo="$object/fixed-head.o $object/$platform.o"
23255      binary=y
23256      ;;
23257 @@ -246,11 +251,11 @@
23258  # post-processing needed for some platforms
23259  case "$platform" in
23260  pseries|chrp)
23261 -    $object/addnote "$ofile"
23262 +    $objbin/addnote "$ofile"
23263      ;;
23264  coff)
23265      ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile"
23266 -    $object/hack-coff "$ofile"
23267 +    $objbin/hack-coff "$ofile"
23268      ;;
23269  cuboot*)
23270      gzip -f -9 "$ofile"
23271 @@ -259,7 +264,7 @@
23272      ;;
23273  treeboot*)
23274      mv "$ofile" "$ofile.elf"
23275 -    $object/mktree "$ofile.elf" "$ofile" "$base" "$entry"
23276 +    $objbin/mktree "$ofile.elf" "$ofile" "$base" "$entry"
23277      if [ -z "$cacheit" ]; then
23278         rm -f "$ofile.elf"
23279      fi
23280 @@ -287,8 +292,6 @@
23281      overlay_dest="256"
23282      overlay_size="256"
23283  
23284 -    rm -f "$object/otheros.bld"
23285 -
23286      ${CROSS}objcopy -O binary "$ofile" "$ofile.bin"
23287  
23288      dd if="$ofile.bin" of="$ofile.bin" conv=notrunc   \
23289 @@ -299,6 +302,8 @@
23290          skip=$system_reset_overlay seek=$overlay_dest \
23291          count=$overlay_size bs=1
23292  
23293 -    gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld"
23294 +    odir="$(dirname "$ofile.bin")"
23295 +    rm -f "$odir/otheros.bld"
23296 +    gzip --force -9 --stdout "$ofile.bin" > "$odir/otheros.bld"
23297      ;;
23298  esac
23299 --- /dev/null
23300 +++ b/arch/powerpc/configs/adder875-redboot_defconfig
23301 @@ -0,0 +1,798 @@
23302 +#
23303 +# Automatically generated make config: don't edit
23304 +# Linux kernel version: 2.6.24-rc6
23305 +# Thu Jan 17 16:17:38 2008
23306 +#
23307 +# CONFIG_PPC64 is not set
23308 +
23309 +#
23310 +# Processor support
23311 +#
23312 +# CONFIG_6xx is not set
23313 +# CONFIG_PPC_85xx is not set
23314 +CONFIG_PPC_8xx=y
23315 +# CONFIG_40x is not set
23316 +# CONFIG_44x is not set
23317 +# CONFIG_E200 is not set
23318 +CONFIG_8xx=y
23319 +# CONFIG_PPC_MM_SLICES is not set
23320 +CONFIG_NOT_COHERENT_CACHE=y
23321 +CONFIG_PPC32=y
23322 +CONFIG_WORD_SIZE=32
23323 +CONFIG_PPC_MERGE=y
23324 +CONFIG_MMU=y
23325 +CONFIG_GENERIC_CMOS_UPDATE=y
23326 +CONFIG_GENERIC_TIME=y
23327 +CONFIG_GENERIC_TIME_VSYSCALL=y
23328 +CONFIG_GENERIC_CLOCKEVENTS=y
23329 +CONFIG_GENERIC_HARDIRQS=y
23330 +CONFIG_IRQ_PER_CPU=y
23331 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
23332 +CONFIG_ARCH_HAS_ILOG2_U32=y
23333 +CONFIG_GENERIC_HWEIGHT=y
23334 +CONFIG_GENERIC_CALIBRATE_DELAY=y
23335 +CONFIG_GENERIC_FIND_NEXT_BIT=y
23336 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
23337 +CONFIG_PPC=y
23338 +CONFIG_EARLY_PRINTK=y
23339 +CONFIG_GENERIC_NVRAM=y
23340 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
23341 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
23342 +CONFIG_PPC_OF=y
23343 +CONFIG_OF=y
23344 +# CONFIG_PPC_UDBG_16550 is not set
23345 +# CONFIG_GENERIC_TBSYNC is not set
23346 +CONFIG_AUDIT_ARCH=y
23347 +CONFIG_GENERIC_BUG=y
23348 +# CONFIG_DEFAULT_UIMAGE is not set
23349 +CONFIG_REDBOOT=y
23350 +# CONFIG_PPC_DCR_NATIVE is not set
23351 +# CONFIG_PPC_DCR_MMIO is not set
23352 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
23353 +
23354 +#
23355 +# General setup
23356 +#
23357 +CONFIG_EXPERIMENTAL=y
23358 +CONFIG_BROKEN_ON_SMP=y
23359 +CONFIG_INIT_ENV_ARG_LIMIT=32
23360 +CONFIG_LOCALVERSION=""
23361 +CONFIG_LOCALVERSION_AUTO=y
23362 +# CONFIG_SWAP is not set
23363 +CONFIG_SYSVIPC=y
23364 +CONFIG_SYSVIPC_SYSCTL=y
23365 +# CONFIG_POSIX_MQUEUE is not set
23366 +# CONFIG_BSD_PROCESS_ACCT is not set
23367 +# CONFIG_TASKSTATS is not set
23368 +# CONFIG_USER_NS is not set
23369 +# CONFIG_PID_NS is not set
23370 +# CONFIG_AUDIT is not set
23371 +# CONFIG_IKCONFIG is not set
23372 +CONFIG_LOG_BUF_SHIFT=14
23373 +# CONFIG_CGROUPS is not set
23374 +CONFIG_FAIR_GROUP_SCHED=y
23375 +CONFIG_FAIR_USER_SCHED=y
23376 +# CONFIG_FAIR_CGROUP_SCHED is not set
23377 +CONFIG_SYSFS_DEPRECATED=y
23378 +# CONFIG_RELAY is not set
23379 +# CONFIG_BLK_DEV_INITRD is not set
23380 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
23381 +CONFIG_SYSCTL=y
23382 +CONFIG_EMBEDDED=y
23383 +# CONFIG_SYSCTL_SYSCALL is not set
23384 +CONFIG_KALLSYMS=y
23385 +# CONFIG_KALLSYMS_ALL is not set
23386 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
23387 +CONFIG_HOTPLUG=y
23388 +CONFIG_PRINTK=y
23389 +CONFIG_BUG=y
23390 +# CONFIG_ELF_CORE is not set
23391 +# CONFIG_BASE_FULL is not set
23392 +# CONFIG_FUTEX is not set
23393 +CONFIG_ANON_INODES=y
23394 +CONFIG_EPOLL=y
23395 +CONFIG_SIGNALFD=y
23396 +CONFIG_EVENTFD=y
23397 +CONFIG_SHMEM=y
23398 +# CONFIG_VM_EVENT_COUNTERS is not set
23399 +CONFIG_SLUB_DEBUG=y
23400 +# CONFIG_SLAB is not set
23401 +CONFIG_SLUB=y
23402 +# CONFIG_SLOB is not set
23403 +# CONFIG_TINY_SHMEM is not set
23404 +CONFIG_BASE_SMALL=1
23405 +# CONFIG_MODULES is not set
23406 +CONFIG_BLOCK=y
23407 +# CONFIG_LBD is not set
23408 +# CONFIG_BLK_DEV_IO_TRACE is not set
23409 +# CONFIG_LSF is not set
23410 +# CONFIG_BLK_DEV_BSG is not set
23411 +
23412 +#
23413 +# IO Schedulers
23414 +#
23415 +CONFIG_IOSCHED_NOOP=y
23416 +# CONFIG_IOSCHED_AS is not set
23417 +CONFIG_IOSCHED_DEADLINE=y
23418 +# CONFIG_IOSCHED_CFQ is not set
23419 +# CONFIG_DEFAULT_AS is not set
23420 +CONFIG_DEFAULT_DEADLINE=y
23421 +# CONFIG_DEFAULT_CFQ is not set
23422 +# CONFIG_DEFAULT_NOOP is not set
23423 +CONFIG_DEFAULT_IOSCHED="deadline"
23424 +
23425 +#
23426 +# Platform support
23427 +#
23428 +# CONFIG_PPC_MPC52xx is not set
23429 +# CONFIG_PPC_MPC5200 is not set
23430 +# CONFIG_PPC_CELL is not set
23431 +# CONFIG_PPC_CELL_NATIVE is not set
23432 +CONFIG_CPM1=y
23433 +# CONFIG_MPC8XXFADS is not set
23434 +# CONFIG_MPC86XADS is not set
23435 +# CONFIG_MPC885ADS is not set
23436 +# CONFIG_PPC_EP88XC is not set
23437 +CONFIG_PPC_ADDER875=y
23438 +
23439 +#
23440 +# MPC8xx CPM Options
23441 +#
23442 +
23443 +#
23444 +# Generic MPC8xx Options
23445 +#
23446 +CONFIG_8xx_COPYBACK=y
23447 +# CONFIG_8xx_CPU6 is not set
23448 +CONFIG_8xx_CPU15=y
23449 +CONFIG_NO_UCODE_PATCH=y
23450 +# CONFIG_USB_SOF_UCODE_PATCH is not set
23451 +# CONFIG_I2C_SPI_UCODE_PATCH is not set
23452 +# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
23453 +# CONFIG_PQ2ADS is not set
23454 +# CONFIG_MPIC is not set
23455 +# CONFIG_MPIC_WEIRD is not set
23456 +# CONFIG_PPC_I8259 is not set
23457 +# CONFIG_PPC_RTAS is not set
23458 +# CONFIG_MMIO_NVRAM is not set
23459 +# CONFIG_PPC_MPC106 is not set
23460 +# CONFIG_PPC_970_NAP is not set
23461 +# CONFIG_PPC_INDIRECT_IO is not set
23462 +# CONFIG_GENERIC_IOMAP is not set
23463 +# CONFIG_CPU_FREQ is not set
23464 +# CONFIG_CPM2 is not set
23465 +CONFIG_PPC_CPM_NEW_BINDING=y
23466 +# CONFIG_FSL_ULI1575 is not set
23467 +CONFIG_CPM=y
23468 +
23469 +#
23470 +# Kernel options
23471 +#
23472 +# CONFIG_HIGHMEM is not set
23473 +# CONFIG_TICK_ONESHOT is not set
23474 +# CONFIG_NO_HZ is not set
23475 +# CONFIG_HIGH_RES_TIMERS is not set
23476 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
23477 +# CONFIG_HZ_100 is not set
23478 +# CONFIG_HZ_250 is not set
23479 +# CONFIG_HZ_300 is not set
23480 +CONFIG_HZ_1000=y
23481 +CONFIG_HZ=1000
23482 +CONFIG_PREEMPT_NONE=y
23483 +# CONFIG_PREEMPT_VOLUNTARY is not set
23484 +# CONFIG_PREEMPT is not set
23485 +CONFIG_BINFMT_ELF=y
23486 +# CONFIG_BINFMT_MISC is not set
23487 +# CONFIG_MATH_EMULATION is not set
23488 +# CONFIG_8XX_MINIMAL_FPEMU is not set
23489 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
23490 +CONFIG_ARCH_FLATMEM_ENABLE=y
23491 +CONFIG_ARCH_POPULATES_NODE_MAP=y
23492 +CONFIG_SELECT_MEMORY_MODEL=y
23493 +CONFIG_FLATMEM_MANUAL=y
23494 +# CONFIG_DISCONTIGMEM_MANUAL is not set
23495 +# CONFIG_SPARSEMEM_MANUAL is not set
23496 +CONFIG_FLATMEM=y
23497 +CONFIG_FLAT_NODE_MEM_MAP=y
23498 +# CONFIG_SPARSEMEM_STATIC is not set
23499 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
23500 +CONFIG_SPLIT_PTLOCK_CPUS=4
23501 +# CONFIG_RESOURCES_64BIT is not set
23502 +CONFIG_ZONE_DMA_FLAG=1
23503 +CONFIG_BOUNCE=y
23504 +CONFIG_VIRT_TO_BUS=y
23505 +# CONFIG_PROC_DEVICETREE is not set
23506 +# CONFIG_CMDLINE_BOOL is not set
23507 +# CONFIG_PM is not set
23508 +CONFIG_SUSPEND_UP_POSSIBLE=y
23509 +CONFIG_HIBERNATION_UP_POSSIBLE=y
23510 +# CONFIG_SECCOMP is not set
23511 +CONFIG_WANT_DEVICE_TREE=y
23512 +CONFIG_DEVICE_TREE="adder875-redboot.dts"
23513 +CONFIG_ISA_DMA_API=y
23514 +
23515 +#
23516 +# Bus options
23517 +#
23518 +CONFIG_ZONE_DMA=y
23519 +CONFIG_FSL_SOC=y
23520 +# CONFIG_PCI is not set
23521 +# CONFIG_PCI_DOMAINS is not set
23522 +# CONFIG_PCI_SYSCALL is not set
23523 +# CONFIG_PCI_QSPAN is not set
23524 +# CONFIG_ARCH_SUPPORTS_MSI is not set
23525 +# CONFIG_PCCARD is not set
23526 +
23527 +#
23528 +# Advanced setup
23529 +#
23530 +# CONFIG_ADVANCED_OPTIONS is not set
23531 +
23532 +#
23533 +# Default settings for advanced configuration options are used
23534 +#
23535 +CONFIG_HIGHMEM_START=0xfe000000
23536 +CONFIG_LOWMEM_SIZE=0x30000000
23537 +CONFIG_KERNEL_START=0xc0000000
23538 +CONFIG_TASK_SIZE=0x80000000
23539 +CONFIG_CONSISTENT_START=0xfd000000
23540 +CONFIG_CONSISTENT_SIZE=0x00200000
23541 +CONFIG_BOOT_LOAD=0x00400000
23542 +
23543 +#
23544 +# Networking
23545 +#
23546 +CONFIG_NET=y
23547 +
23548 +#
23549 +# Networking options
23550 +#
23551 +CONFIG_PACKET=y
23552 +# CONFIG_PACKET_MMAP is not set
23553 +CONFIG_UNIX=y
23554 +# CONFIG_NET_KEY is not set
23555 +CONFIG_INET=y
23556 +CONFIG_IP_MULTICAST=y
23557 +# CONFIG_IP_ADVANCED_ROUTER is not set
23558 +CONFIG_IP_FIB_HASH=y
23559 +CONFIG_IP_PNP=y
23560 +# CONFIG_IP_PNP_DHCP is not set
23561 +# CONFIG_IP_PNP_BOOTP is not set
23562 +# CONFIG_IP_PNP_RARP is not set
23563 +# CONFIG_NET_IPIP is not set
23564 +# CONFIG_NET_IPGRE is not set
23565 +# CONFIG_IP_MROUTE is not set
23566 +# CONFIG_ARPD is not set
23567 +CONFIG_SYN_COOKIES=y
23568 +# CONFIG_INET_AH is not set
23569 +# CONFIG_INET_ESP is not set
23570 +# CONFIG_INET_IPCOMP is not set
23571 +# CONFIG_INET_XFRM_TUNNEL is not set
23572 +# CONFIG_INET_TUNNEL is not set
23573 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
23574 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
23575 +# CONFIG_INET_XFRM_MODE_BEET is not set
23576 +# CONFIG_INET_LRO is not set
23577 +CONFIG_INET_DIAG=y
23578 +CONFIG_INET_TCP_DIAG=y
23579 +# CONFIG_TCP_CONG_ADVANCED is not set
23580 +CONFIG_TCP_CONG_CUBIC=y
23581 +CONFIG_DEFAULT_TCP_CONG="cubic"
23582 +# CONFIG_TCP_MD5SIG is not set
23583 +# CONFIG_IPV6 is not set
23584 +# CONFIG_INET6_XFRM_TUNNEL is not set
23585 +# CONFIG_INET6_TUNNEL is not set
23586 +# CONFIG_NETWORK_SECMARK is not set
23587 +# CONFIG_NETFILTER is not set
23588 +# CONFIG_IP_DCCP is not set
23589 +# CONFIG_IP_SCTP is not set
23590 +# CONFIG_TIPC is not set
23591 +# CONFIG_ATM is not set
23592 +# CONFIG_BRIDGE is not set
23593 +# CONFIG_VLAN_8021Q is not set
23594 +# CONFIG_DECNET is not set
23595 +# CONFIG_LLC2 is not set
23596 +# CONFIG_IPX is not set
23597 +# CONFIG_ATALK is not set
23598 +# CONFIG_X25 is not set
23599 +# CONFIG_LAPB is not set
23600 +# CONFIG_ECONET is not set
23601 +# CONFIG_WAN_ROUTER is not set
23602 +# CONFIG_NET_SCHED is not set
23603 +
23604 +#
23605 +# Network testing
23606 +#
23607 +# CONFIG_NET_PKTGEN is not set
23608 +# CONFIG_HAMRADIO is not set
23609 +# CONFIG_IRDA is not set
23610 +# CONFIG_BT is not set
23611 +# CONFIG_AF_RXRPC is not set
23612 +
23613 +#
23614 +# Wireless
23615 +#
23616 +# CONFIG_CFG80211 is not set
23617 +# CONFIG_WIRELESS_EXT is not set
23618 +# CONFIG_MAC80211 is not set
23619 +# CONFIG_IEEE80211 is not set
23620 +# CONFIG_RFKILL is not set
23621 +# CONFIG_NET_9P is not set
23622 +
23623 +#
23624 +# Device Drivers
23625 +#
23626 +
23627 +#
23628 +# Generic Driver Options
23629 +#
23630 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
23631 +CONFIG_STANDALONE=y
23632 +CONFIG_PREVENT_FIRMWARE_BUILD=y
23633 +# CONFIG_FW_LOADER is not set
23634 +# CONFIG_DEBUG_DRIVER is not set
23635 +# CONFIG_DEBUG_DEVRES is not set
23636 +# CONFIG_SYS_HYPERVISOR is not set
23637 +# CONFIG_CONNECTOR is not set
23638 +CONFIG_MTD=y
23639 +# CONFIG_MTD_DEBUG is not set
23640 +# CONFIG_MTD_CONCAT is not set
23641 +# CONFIG_MTD_PARTITIONS is not set
23642 +
23643 +#
23644 +# User Modules And Translation Layers
23645 +#
23646 +CONFIG_MTD_CHAR=y
23647 +CONFIG_MTD_BLKDEVS=y
23648 +CONFIG_MTD_BLOCK=y
23649 +# CONFIG_FTL is not set
23650 +# CONFIG_NFTL is not set
23651 +# CONFIG_INFTL is not set
23652 +# CONFIG_RFD_FTL is not set
23653 +# CONFIG_SSFDC is not set
23654 +# CONFIG_MTD_OOPS is not set
23655 +
23656 +#
23657 +# RAM/ROM/Flash chip drivers
23658 +#
23659 +CONFIG_MTD_CFI=y
23660 +# CONFIG_MTD_JEDECPROBE is not set
23661 +CONFIG_MTD_GEN_PROBE=y
23662 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
23663 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
23664 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
23665 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
23666 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
23667 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
23668 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
23669 +CONFIG_MTD_CFI_I1=y
23670 +CONFIG_MTD_CFI_I2=y
23671 +# CONFIG_MTD_CFI_I4 is not set
23672 +# CONFIG_MTD_CFI_I8 is not set
23673 +# CONFIG_MTD_CFI_INTELEXT is not set
23674 +CONFIG_MTD_CFI_AMDSTD=y
23675 +# CONFIG_MTD_CFI_STAA is not set
23676 +CONFIG_MTD_CFI_UTIL=y
23677 +# CONFIG_MTD_RAM is not set
23678 +# CONFIG_MTD_ROM is not set
23679 +# CONFIG_MTD_ABSENT is not set
23680 +
23681 +#
23682 +# Mapping drivers for chip access
23683 +#
23684 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
23685 +# CONFIG_MTD_PHYSMAP is not set
23686 +CONFIG_MTD_PHYSMAP_OF=y
23687 +# CONFIG_MTD_CFI_FLAGADM is not set
23688 +# CONFIG_MTD_PLATRAM is not set
23689 +
23690 +#
23691 +# Self-contained MTD device drivers
23692 +#
23693 +# CONFIG_MTD_SLRAM is not set
23694 +# CONFIG_MTD_PHRAM is not set
23695 +# CONFIG_MTD_MTDRAM is not set
23696 +# CONFIG_MTD_BLOCK2MTD is not set
23697 +
23698 +#
23699 +# Disk-On-Chip Device Drivers
23700 +#
23701 +# CONFIG_MTD_DOC2000 is not set
23702 +# CONFIG_MTD_DOC2001 is not set
23703 +# CONFIG_MTD_DOC2001PLUS is not set
23704 +# CONFIG_MTD_NAND is not set
23705 +# CONFIG_MTD_ONENAND is not set
23706 +
23707 +#
23708 +# UBI - Unsorted block images
23709 +#
23710 +# CONFIG_MTD_UBI is not set
23711 +CONFIG_OF_DEVICE=y
23712 +# CONFIG_PARPORT is not set
23713 +# CONFIG_BLK_DEV is not set
23714 +# CONFIG_MISC_DEVICES is not set
23715 +# CONFIG_IDE is not set
23716 +
23717 +#
23718 +# SCSI device support
23719 +#
23720 +# CONFIG_RAID_ATTRS is not set
23721 +# CONFIG_SCSI is not set
23722 +# CONFIG_SCSI_DMA is not set
23723 +# CONFIG_SCSI_NETLINK is not set
23724 +# CONFIG_ATA is not set
23725 +# CONFIG_MD is not set
23726 +# CONFIG_MACINTOSH_DRIVERS is not set
23727 +CONFIG_NETDEVICES=y
23728 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
23729 +# CONFIG_DUMMY is not set
23730 +# CONFIG_BONDING is not set
23731 +# CONFIG_MACVLAN is not set
23732 +# CONFIG_EQUALIZER is not set
23733 +# CONFIG_TUN is not set
23734 +# CONFIG_VETH is not set
23735 +CONFIG_PHYLIB=y
23736 +
23737 +#
23738 +# MII PHY device drivers
23739 +#
23740 +# CONFIG_MARVELL_PHY is not set
23741 +CONFIG_DAVICOM_PHY=y
23742 +# CONFIG_QSEMI_PHY is not set
23743 +# CONFIG_LXT_PHY is not set
23744 +# CONFIG_CICADA_PHY is not set
23745 +# CONFIG_VITESSE_PHY is not set
23746 +# CONFIG_SMSC_PHY is not set
23747 +# CONFIG_BROADCOM_PHY is not set
23748 +# CONFIG_ICPLUS_PHY is not set
23749 +# CONFIG_FIXED_PHY is not set
23750 +# CONFIG_MDIO_BITBANG is not set
23751 +CONFIG_NET_ETHERNET=y
23752 +CONFIG_MII=y
23753 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
23754 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
23755 +# CONFIG_IBM_NEW_EMAC_TAH is not set
23756 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
23757 +# CONFIG_B44 is not set
23758 +CONFIG_FS_ENET=y
23759 +# CONFIG_FS_ENET_HAS_SCC is not set
23760 +CONFIG_FS_ENET_HAS_FEC=y
23761 +CONFIG_FS_ENET_MDIO_FEC=y
23762 +# CONFIG_NETDEV_1000 is not set
23763 +# CONFIG_NETDEV_10000 is not set
23764 +
23765 +#
23766 +# Wireless LAN
23767 +#
23768 +# CONFIG_WLAN_PRE80211 is not set
23769 +# CONFIG_WLAN_80211 is not set
23770 +# CONFIG_WAN is not set
23771 +# CONFIG_PPP is not set
23772 +# CONFIG_SLIP is not set
23773 +# CONFIG_SHAPER is not set
23774 +# CONFIG_NETCONSOLE is not set
23775 +# CONFIG_NETPOLL is not set
23776 +# CONFIG_NET_POLL_CONTROLLER is not set
23777 +# CONFIG_ISDN is not set
23778 +# CONFIG_PHONE is not set
23779 +
23780 +#
23781 +# Input device support
23782 +#
23783 +CONFIG_INPUT=y
23784 +# CONFIG_INPUT_FF_MEMLESS is not set
23785 +# CONFIG_INPUT_POLLDEV is not set
23786 +
23787 +#
23788 +# Userland interfaces
23789 +#
23790 +CONFIG_INPUT_MOUSEDEV=y
23791 +CONFIG_INPUT_MOUSEDEV_PSAUX=y
23792 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
23793 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
23794 +# CONFIG_INPUT_JOYDEV is not set
23795 +# CONFIG_INPUT_EVDEV is not set
23796 +# CONFIG_INPUT_EVBUG is not set
23797 +
23798 +#
23799 +# Input Device Drivers
23800 +#
23801 +CONFIG_INPUT_KEYBOARD=y
23802 +CONFIG_KEYBOARD_ATKBD=y
23803 +# CONFIG_KEYBOARD_SUNKBD is not set
23804 +# CONFIG_KEYBOARD_LKKBD is not set
23805 +# CONFIG_KEYBOARD_XTKBD is not set
23806 +# CONFIG_KEYBOARD_NEWTON is not set
23807 +# CONFIG_KEYBOARD_STOWAWAY is not set
23808 +CONFIG_INPUT_MOUSE=y
23809 +CONFIG_MOUSE_PS2=y
23810 +CONFIG_MOUSE_PS2_ALPS=y
23811 +CONFIG_MOUSE_PS2_LOGIPS2PP=y
23812 +CONFIG_MOUSE_PS2_SYNAPTICS=y
23813 +CONFIG_MOUSE_PS2_LIFEBOOK=y
23814 +CONFIG_MOUSE_PS2_TRACKPOINT=y
23815 +# CONFIG_MOUSE_PS2_TOUCHKIT is not set
23816 +# CONFIG_MOUSE_SERIAL is not set
23817 +# CONFIG_MOUSE_VSXXXAA is not set
23818 +# CONFIG_INPUT_JOYSTICK is not set
23819 +# CONFIG_INPUT_TABLET is not set
23820 +# CONFIG_INPUT_TOUCHSCREEN is not set
23821 +# CONFIG_INPUT_MISC is not set
23822 +
23823 +#
23824 +# Hardware I/O ports
23825 +#
23826 +CONFIG_SERIO=y
23827 +CONFIG_SERIO_I8042=y
23828 +CONFIG_SERIO_SERPORT=y
23829 +CONFIG_SERIO_LIBPS2=y
23830 +# CONFIG_SERIO_RAW is not set
23831 +# CONFIG_GAMEPORT is not set
23832 +
23833 +#
23834 +# Character devices
23835 +#
23836 +# CONFIG_VT is not set
23837 +# CONFIG_SERIAL_NONSTANDARD is not set
23838 +
23839 +#
23840 +# Serial drivers
23841 +#
23842 +# CONFIG_SERIAL_8250 is not set
23843 +
23844 +#
23845 +# Non-8250 serial port support
23846 +#
23847 +# CONFIG_SERIAL_UARTLITE is not set
23848 +CONFIG_SERIAL_CORE=y
23849 +CONFIG_SERIAL_CORE_CONSOLE=y
23850 +CONFIG_SERIAL_CPM=y
23851 +CONFIG_SERIAL_CPM_CONSOLE=y
23852 +# CONFIG_SERIAL_CPM_SCC1 is not set
23853 +# CONFIG_SERIAL_CPM_SCC2 is not set
23854 +# CONFIG_SERIAL_CPM_SCC3 is not set
23855 +# CONFIG_SERIAL_CPM_SCC4 is not set
23856 +CONFIG_SERIAL_CPM_SMC1=y
23857 +CONFIG_SERIAL_CPM_SMC2=y
23858 +CONFIG_UNIX98_PTYS=y
23859 +# CONFIG_LEGACY_PTYS is not set
23860 +# CONFIG_IPMI_HANDLER is not set
23861 +CONFIG_HW_RANDOM=y
23862 +# CONFIG_NVRAM is not set
23863 +CONFIG_GEN_RTC=y
23864 +# CONFIG_GEN_RTC_X is not set
23865 +# CONFIG_R3964 is not set
23866 +# CONFIG_RAW_DRIVER is not set
23867 +# CONFIG_TCG_TPM is not set
23868 +# CONFIG_I2C is not set
23869 +
23870 +#
23871 +# SPI support
23872 +#
23873 +# CONFIG_SPI is not set
23874 +# CONFIG_SPI_MASTER is not set
23875 +# CONFIG_W1 is not set
23876 +# CONFIG_POWER_SUPPLY is not set
23877 +# CONFIG_HWMON is not set
23878 +# CONFIG_WATCHDOG is not set
23879 +
23880 +#
23881 +# Sonics Silicon Backplane
23882 +#
23883 +CONFIG_SSB_POSSIBLE=y
23884 +# CONFIG_SSB is not set
23885 +
23886 +#
23887 +# Multifunction device drivers
23888 +#
23889 +# CONFIG_MFD_SM501 is not set
23890 +
23891 +#
23892 +# Multimedia devices
23893 +#
23894 +# CONFIG_VIDEO_DEV is not set
23895 +# CONFIG_DVB_CORE is not set
23896 +CONFIG_DAB=y
23897 +
23898 +#
23899 +# Graphics support
23900 +#
23901 +# CONFIG_VGASTATE is not set
23902 +CONFIG_VIDEO_OUTPUT_CONTROL=y
23903 +# CONFIG_FB is not set
23904 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
23905 +
23906 +#
23907 +# Display device support
23908 +#
23909 +# CONFIG_DISPLAY_SUPPORT is not set
23910 +
23911 +#
23912 +# Sound
23913 +#
23914 +# CONFIG_SOUND is not set
23915 +# CONFIG_HID_SUPPORT is not set
23916 +# CONFIG_USB_SUPPORT is not set
23917 +# CONFIG_MMC is not set
23918 +# CONFIG_NEW_LEDS is not set
23919 +# CONFIG_EDAC is not set
23920 +# CONFIG_RTC_CLASS is not set
23921 +
23922 +#
23923 +# Userspace I/O
23924 +#
23925 +# CONFIG_UIO is not set
23926 +
23927 +#
23928 +# File systems
23929 +#
23930 +# CONFIG_EXT2_FS is not set
23931 +# CONFIG_EXT3_FS is not set
23932 +# CONFIG_EXT4DEV_FS is not set
23933 +# CONFIG_REISERFS_FS is not set
23934 +# CONFIG_JFS_FS is not set
23935 +# CONFIG_FS_POSIX_ACL is not set
23936 +# CONFIG_XFS_FS is not set
23937 +# CONFIG_GFS2_FS is not set
23938 +# CONFIG_OCFS2_FS is not set
23939 +# CONFIG_MINIX_FS is not set
23940 +# CONFIG_ROMFS_FS is not set
23941 +# CONFIG_INOTIFY is not set
23942 +# CONFIG_QUOTA is not set
23943 +# CONFIG_DNOTIFY is not set
23944 +# CONFIG_AUTOFS_FS is not set
23945 +# CONFIG_AUTOFS4_FS is not set
23946 +# CONFIG_FUSE_FS is not set
23947 +
23948 +#
23949 +# CD-ROM/DVD Filesystems
23950 +#
23951 +# CONFIG_ISO9660_FS is not set
23952 +# CONFIG_UDF_FS is not set
23953 +
23954 +#
23955 +# DOS/FAT/NT Filesystems
23956 +#
23957 +# CONFIG_MSDOS_FS is not set
23958 +# CONFIG_VFAT_FS is not set
23959 +# CONFIG_NTFS_FS is not set
23960 +
23961 +#
23962 +# Pseudo filesystems
23963 +#
23964 +CONFIG_PROC_FS=y
23965 +# CONFIG_PROC_KCORE is not set
23966 +CONFIG_PROC_SYSCTL=y
23967 +CONFIG_SYSFS=y
23968 +CONFIG_TMPFS=y
23969 +# CONFIG_TMPFS_POSIX_ACL is not set
23970 +# CONFIG_HUGETLB_PAGE is not set
23971 +# CONFIG_CONFIGFS_FS is not set
23972 +
23973 +#
23974 +# Miscellaneous filesystems
23975 +#
23976 +# CONFIG_ADFS_FS is not set
23977 +# CONFIG_AFFS_FS is not set
23978 +# CONFIG_HFS_FS is not set
23979 +# CONFIG_HFSPLUS_FS is not set
23980 +# CONFIG_BEFS_FS is not set
23981 +# CONFIG_BFS_FS is not set
23982 +# CONFIG_EFS_FS is not set
23983 +# CONFIG_JFFS2_FS is not set
23984 +CONFIG_CRAMFS=y
23985 +# CONFIG_VXFS_FS is not set
23986 +# CONFIG_HPFS_FS is not set
23987 +# CONFIG_QNX4FS_FS is not set
23988 +# CONFIG_SYSV_FS is not set
23989 +# CONFIG_UFS_FS is not set
23990 +CONFIG_NETWORK_FILESYSTEMS=y
23991 +CONFIG_NFS_FS=y
23992 +CONFIG_NFS_V3=y
23993 +# CONFIG_NFS_V3_ACL is not set
23994 +# CONFIG_NFS_V4 is not set
23995 +# CONFIG_NFS_DIRECTIO is not set
23996 +# CONFIG_NFSD is not set
23997 +CONFIG_ROOT_NFS=y
23998 +CONFIG_LOCKD=y
23999 +CONFIG_LOCKD_V4=y
24000 +CONFIG_NFS_COMMON=y
24001 +CONFIG_SUNRPC=y
24002 +# CONFIG_SUNRPC_BIND34 is not set
24003 +# CONFIG_RPCSEC_GSS_KRB5 is not set
24004 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
24005 +# CONFIG_SMB_FS is not set
24006 +# CONFIG_CIFS is not set
24007 +# CONFIG_NCP_FS is not set
24008 +# CONFIG_CODA_FS is not set
24009 +# CONFIG_AFS_FS is not set
24010 +
24011 +#
24012 +# Partition Types
24013 +#
24014 +CONFIG_PARTITION_ADVANCED=y
24015 +# CONFIG_ACORN_PARTITION is not set
24016 +# CONFIG_OSF_PARTITION is not set
24017 +# CONFIG_AMIGA_PARTITION is not set
24018 +# CONFIG_ATARI_PARTITION is not set
24019 +# CONFIG_MAC_PARTITION is not set
24020 +CONFIG_MSDOS_PARTITION=y
24021 +# CONFIG_BSD_DISKLABEL is not set
24022 +# CONFIG_MINIX_SUBPARTITION is not set
24023 +# CONFIG_SOLARIS_X86_PARTITION is not set
24024 +# CONFIG_UNIXWARE_DISKLABEL is not set
24025 +# CONFIG_LDM_PARTITION is not set
24026 +# CONFIG_SGI_PARTITION is not set
24027 +# CONFIG_ULTRIX_PARTITION is not set
24028 +# CONFIG_SUN_PARTITION is not set
24029 +# CONFIG_KARMA_PARTITION is not set
24030 +# CONFIG_EFI_PARTITION is not set
24031 +# CONFIG_SYSV68_PARTITION is not set
24032 +# CONFIG_NLS is not set
24033 +# CONFIG_DLM is not set
24034 +# CONFIG_UCC_SLOW is not set
24035 +
24036 +#
24037 +# Library routines
24038 +#
24039 +# CONFIG_CRC_CCITT is not set
24040 +# CONFIG_CRC16 is not set
24041 +# CONFIG_CRC_ITU_T is not set
24042 +# CONFIG_CRC32 is not set
24043 +# CONFIG_CRC7 is not set
24044 +# CONFIG_LIBCRC32C is not set
24045 +CONFIG_ZLIB_INFLATE=y
24046 +CONFIG_HAS_IOMEM=y
24047 +CONFIG_HAS_IOPORT=y
24048 +CONFIG_HAS_DMA=y
24049 +CONFIG_INSTRUMENTATION=y
24050 +# CONFIG_PROFILING is not set
24051 +# CONFIG_MARKERS is not set
24052 +
24053 +#
24054 +# Kernel hacking
24055 +#
24056 +# CONFIG_PRINTK_TIME is not set
24057 +CONFIG_ENABLE_WARN_DEPRECATED=y
24058 +CONFIG_ENABLE_MUST_CHECK=y
24059 +CONFIG_MAGIC_SYSRQ=y
24060 +# CONFIG_UNUSED_SYMBOLS is not set
24061 +# CONFIG_DEBUG_FS is not set
24062 +# CONFIG_HEADERS_CHECK is not set
24063 +CONFIG_DEBUG_KERNEL=y
24064 +# CONFIG_DEBUG_SHIRQ is not set
24065 +CONFIG_DETECT_SOFTLOCKUP=y
24066 +CONFIG_SCHED_DEBUG=y
24067 +# CONFIG_SCHEDSTATS is not set
24068 +# CONFIG_TIMER_STATS is not set
24069 +# CONFIG_SLUB_DEBUG_ON is not set
24070 +# CONFIG_DEBUG_SPINLOCK is not set
24071 +# CONFIG_DEBUG_MUTEXES is not set
24072 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
24073 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
24074 +# CONFIG_DEBUG_KOBJECT is not set
24075 +CONFIG_DEBUG_BUGVERBOSE=y
24076 +CONFIG_DEBUG_INFO=y
24077 +# CONFIG_DEBUG_VM is not set
24078 +# CONFIG_DEBUG_LIST is not set
24079 +# CONFIG_DEBUG_SG is not set
24080 +CONFIG_FORCED_INLINING=y
24081 +# CONFIG_BOOT_PRINTK_DELAY is not set
24082 +# CONFIG_FAULT_INJECTION is not set
24083 +# CONFIG_SAMPLES is not set
24084 +# CONFIG_DEBUG_STACKOVERFLOW is not set
24085 +# CONFIG_DEBUG_STACK_USAGE is not set
24086 +# CONFIG_DEBUG_PAGEALLOC is not set
24087 +# CONFIG_DEBUGGER is not set
24088 +# CONFIG_BDI_SWITCH is not set
24089 +# CONFIG_PPC_EARLY_DEBUG is not set
24090 +
24091 +#
24092 +# Security options
24093 +#
24094 +# CONFIG_KEYS is not set
24095 +# CONFIG_SECURITY is not set
24096 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
24097 +# CONFIG_CRYPTO is not set
24098 +# CONFIG_PPC_CLOCK is not set
24099 +CONFIG_PPC_LIB_RHEAP=y
24100 --- /dev/null
24101 +++ b/arch/powerpc/configs/adder875-uboot_defconfig
24102 @@ -0,0 +1,798 @@
24103 +#
24104 +# Automatically generated make config: don't edit
24105 +# Linux kernel version: 2.6.24-rc6
24106 +# Thu Jan 17 16:17:18 2008
24107 +#
24108 +# CONFIG_PPC64 is not set
24109 +
24110 +#
24111 +# Processor support
24112 +#
24113 +# CONFIG_6xx is not set
24114 +# CONFIG_PPC_85xx is not set
24115 +CONFIG_PPC_8xx=y
24116 +# CONFIG_40x is not set
24117 +# CONFIG_44x is not set
24118 +# CONFIG_E200 is not set
24119 +CONFIG_8xx=y
24120 +# CONFIG_PPC_MM_SLICES is not set
24121 +CONFIG_NOT_COHERENT_CACHE=y
24122 +CONFIG_PPC32=y
24123 +CONFIG_WORD_SIZE=32
24124 +CONFIG_PPC_MERGE=y
24125 +CONFIG_MMU=y
24126 +CONFIG_GENERIC_CMOS_UPDATE=y
24127 +CONFIG_GENERIC_TIME=y
24128 +CONFIG_GENERIC_TIME_VSYSCALL=y
24129 +CONFIG_GENERIC_CLOCKEVENTS=y
24130 +CONFIG_GENERIC_HARDIRQS=y
24131 +CONFIG_IRQ_PER_CPU=y
24132 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
24133 +CONFIG_ARCH_HAS_ILOG2_U32=y
24134 +CONFIG_GENERIC_HWEIGHT=y
24135 +CONFIG_GENERIC_CALIBRATE_DELAY=y
24136 +CONFIG_GENERIC_FIND_NEXT_BIT=y
24137 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
24138 +CONFIG_PPC=y
24139 +CONFIG_EARLY_PRINTK=y
24140 +CONFIG_GENERIC_NVRAM=y
24141 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
24142 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
24143 +CONFIG_PPC_OF=y
24144 +CONFIG_OF=y
24145 +# CONFIG_PPC_UDBG_16550 is not set
24146 +# CONFIG_GENERIC_TBSYNC is not set
24147 +CONFIG_AUDIT_ARCH=y
24148 +CONFIG_GENERIC_BUG=y
24149 +# CONFIG_DEFAULT_UIMAGE is not set
24150 +CONFIG_REDBOOT=y
24151 +# CONFIG_PPC_DCR_NATIVE is not set
24152 +# CONFIG_PPC_DCR_MMIO is not set
24153 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24154 +
24155 +#
24156 +# General setup
24157 +#
24158 +CONFIG_EXPERIMENTAL=y
24159 +CONFIG_BROKEN_ON_SMP=y
24160 +CONFIG_INIT_ENV_ARG_LIMIT=32
24161 +CONFIG_LOCALVERSION=""
24162 +CONFIG_LOCALVERSION_AUTO=y
24163 +# CONFIG_SWAP is not set
24164 +CONFIG_SYSVIPC=y
24165 +CONFIG_SYSVIPC_SYSCTL=y
24166 +# CONFIG_POSIX_MQUEUE is not set
24167 +# CONFIG_BSD_PROCESS_ACCT is not set
24168 +# CONFIG_TASKSTATS is not set
24169 +# CONFIG_USER_NS is not set
24170 +# CONFIG_PID_NS is not set
24171 +# CONFIG_AUDIT is not set
24172 +# CONFIG_IKCONFIG is not set
24173 +CONFIG_LOG_BUF_SHIFT=14
24174 +# CONFIG_CGROUPS is not set
24175 +CONFIG_FAIR_GROUP_SCHED=y
24176 +CONFIG_FAIR_USER_SCHED=y
24177 +# CONFIG_FAIR_CGROUP_SCHED is not set
24178 +CONFIG_SYSFS_DEPRECATED=y
24179 +# CONFIG_RELAY is not set
24180 +# CONFIG_BLK_DEV_INITRD is not set
24181 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
24182 +CONFIG_SYSCTL=y
24183 +CONFIG_EMBEDDED=y
24184 +# CONFIG_SYSCTL_SYSCALL is not set
24185 +CONFIG_KALLSYMS=y
24186 +# CONFIG_KALLSYMS_ALL is not set
24187 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
24188 +CONFIG_HOTPLUG=y
24189 +CONFIG_PRINTK=y
24190 +CONFIG_BUG=y
24191 +# CONFIG_ELF_CORE is not set
24192 +# CONFIG_BASE_FULL is not set
24193 +# CONFIG_FUTEX is not set
24194 +CONFIG_ANON_INODES=y
24195 +CONFIG_EPOLL=y
24196 +CONFIG_SIGNALFD=y
24197 +CONFIG_EVENTFD=y
24198 +CONFIG_SHMEM=y
24199 +# CONFIG_VM_EVENT_COUNTERS is not set
24200 +CONFIG_SLUB_DEBUG=y
24201 +# CONFIG_SLAB is not set
24202 +CONFIG_SLUB=y
24203 +# CONFIG_SLOB is not set
24204 +# CONFIG_TINY_SHMEM is not set
24205 +CONFIG_BASE_SMALL=1
24206 +# CONFIG_MODULES is not set
24207 +CONFIG_BLOCK=y
24208 +# CONFIG_LBD is not set
24209 +# CONFIG_BLK_DEV_IO_TRACE is not set
24210 +# CONFIG_LSF is not set
24211 +# CONFIG_BLK_DEV_BSG is not set
24212 +
24213 +#
24214 +# IO Schedulers
24215 +#
24216 +CONFIG_IOSCHED_NOOP=y
24217 +# CONFIG_IOSCHED_AS is not set
24218 +CONFIG_IOSCHED_DEADLINE=y
24219 +# CONFIG_IOSCHED_CFQ is not set
24220 +# CONFIG_DEFAULT_AS is not set
24221 +CONFIG_DEFAULT_DEADLINE=y
24222 +# CONFIG_DEFAULT_CFQ is not set
24223 +# CONFIG_DEFAULT_NOOP is not set
24224 +CONFIG_DEFAULT_IOSCHED="deadline"
24225 +
24226 +#
24227 +# Platform support
24228 +#
24229 +# CONFIG_PPC_MPC52xx is not set
24230 +# CONFIG_PPC_MPC5200 is not set
24231 +# CONFIG_PPC_CELL is not set
24232 +# CONFIG_PPC_CELL_NATIVE is not set
24233 +CONFIG_CPM1=y
24234 +# CONFIG_MPC8XXFADS is not set
24235 +# CONFIG_MPC86XADS is not set
24236 +# CONFIG_MPC885ADS is not set
24237 +# CONFIG_PPC_EP88XC is not set
24238 +CONFIG_PPC_ADDER875=y
24239 +
24240 +#
24241 +# MPC8xx CPM Options
24242 +#
24243 +
24244 +#
24245 +# Generic MPC8xx Options
24246 +#
24247 +CONFIG_8xx_COPYBACK=y
24248 +# CONFIG_8xx_CPU6 is not set
24249 +CONFIG_8xx_CPU15=y
24250 +CONFIG_NO_UCODE_PATCH=y
24251 +# CONFIG_USB_SOF_UCODE_PATCH is not set
24252 +# CONFIG_I2C_SPI_UCODE_PATCH is not set
24253 +# CONFIG_I2C_SPI_SMC1_UCODE_PATCH is not set
24254 +# CONFIG_PQ2ADS is not set
24255 +# CONFIG_MPIC is not set
24256 +# CONFIG_MPIC_WEIRD is not set
24257 +# CONFIG_PPC_I8259 is not set
24258 +# CONFIG_PPC_RTAS is not set
24259 +# CONFIG_MMIO_NVRAM is not set
24260 +# CONFIG_PPC_MPC106 is not set
24261 +# CONFIG_PPC_970_NAP is not set
24262 +# CONFIG_PPC_INDIRECT_IO is not set
24263 +# CONFIG_GENERIC_IOMAP is not set
24264 +# CONFIG_CPU_FREQ is not set
24265 +# CONFIG_CPM2 is not set
24266 +CONFIG_PPC_CPM_NEW_BINDING=y
24267 +# CONFIG_FSL_ULI1575 is not set
24268 +CONFIG_CPM=y
24269 +
24270 +#
24271 +# Kernel options
24272 +#
24273 +# CONFIG_HIGHMEM is not set
24274 +# CONFIG_TICK_ONESHOT is not set
24275 +# CONFIG_NO_HZ is not set
24276 +# CONFIG_HIGH_RES_TIMERS is not set
24277 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
24278 +# CONFIG_HZ_100 is not set
24279 +# CONFIG_HZ_250 is not set
24280 +# CONFIG_HZ_300 is not set
24281 +CONFIG_HZ_1000=y
24282 +CONFIG_HZ=1000
24283 +CONFIG_PREEMPT_NONE=y
24284 +# CONFIG_PREEMPT_VOLUNTARY is not set
24285 +# CONFIG_PREEMPT is not set
24286 +CONFIG_BINFMT_ELF=y
24287 +# CONFIG_BINFMT_MISC is not set
24288 +# CONFIG_MATH_EMULATION is not set
24289 +# CONFIG_8XX_MINIMAL_FPEMU is not set
24290 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
24291 +CONFIG_ARCH_FLATMEM_ENABLE=y
24292 +CONFIG_ARCH_POPULATES_NODE_MAP=y
24293 +CONFIG_SELECT_MEMORY_MODEL=y
24294 +CONFIG_FLATMEM_MANUAL=y
24295 +# CONFIG_DISCONTIGMEM_MANUAL is not set
24296 +# CONFIG_SPARSEMEM_MANUAL is not set
24297 +CONFIG_FLATMEM=y
24298 +CONFIG_FLAT_NODE_MEM_MAP=y
24299 +# CONFIG_SPARSEMEM_STATIC is not set
24300 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
24301 +CONFIG_SPLIT_PTLOCK_CPUS=4
24302 +# CONFIG_RESOURCES_64BIT is not set
24303 +CONFIG_ZONE_DMA_FLAG=1
24304 +CONFIG_BOUNCE=y
24305 +CONFIG_VIRT_TO_BUS=y
24306 +# CONFIG_PROC_DEVICETREE is not set
24307 +# CONFIG_CMDLINE_BOOL is not set
24308 +# CONFIG_PM is not set
24309 +CONFIG_SUSPEND_UP_POSSIBLE=y
24310 +CONFIG_HIBERNATION_UP_POSSIBLE=y
24311 +# CONFIG_SECCOMP is not set
24312 +CONFIG_WANT_DEVICE_TREE=y
24313 +CONFIG_DEVICE_TREE="adder875-uboot.dts"
24314 +CONFIG_ISA_DMA_API=y
24315 +
24316 +#
24317 +# Bus options
24318 +#
24319 +CONFIG_ZONE_DMA=y
24320 +CONFIG_FSL_SOC=y
24321 +# CONFIG_PCI is not set
24322 +# CONFIG_PCI_DOMAINS is not set
24323 +# CONFIG_PCI_SYSCALL is not set
24324 +# CONFIG_PCI_QSPAN is not set
24325 +# CONFIG_ARCH_SUPPORTS_MSI is not set
24326 +# CONFIG_PCCARD is not set
24327 +
24328 +#
24329 +# Advanced setup
24330 +#
24331 +# CONFIG_ADVANCED_OPTIONS is not set
24332 +
24333 +#
24334 +# Default settings for advanced configuration options are used
24335 +#
24336 +CONFIG_HIGHMEM_START=0xfe000000
24337 +CONFIG_LOWMEM_SIZE=0x30000000
24338 +CONFIG_KERNEL_START=0xc0000000
24339 +CONFIG_TASK_SIZE=0x80000000
24340 +CONFIG_CONSISTENT_START=0xfd000000
24341 +CONFIG_CONSISTENT_SIZE=0x00200000
24342 +CONFIG_BOOT_LOAD=0x00400000
24343 +
24344 +#
24345 +# Networking
24346 +#
24347 +CONFIG_NET=y
24348 +
24349 +#
24350 +# Networking options
24351 +#
24352 +CONFIG_PACKET=y
24353 +# CONFIG_PACKET_MMAP is not set
24354 +CONFIG_UNIX=y
24355 +# CONFIG_NET_KEY is not set
24356 +CONFIG_INET=y
24357 +CONFIG_IP_MULTICAST=y
24358 +# CONFIG_IP_ADVANCED_ROUTER is not set
24359 +CONFIG_IP_FIB_HASH=y
24360 +CONFIG_IP_PNP=y
24361 +# CONFIG_IP_PNP_DHCP is not set
24362 +# CONFIG_IP_PNP_BOOTP is not set
24363 +# CONFIG_IP_PNP_RARP is not set
24364 +# CONFIG_NET_IPIP is not set
24365 +# CONFIG_NET_IPGRE is not set
24366 +# CONFIG_IP_MROUTE is not set
24367 +# CONFIG_ARPD is not set
24368 +CONFIG_SYN_COOKIES=y
24369 +# CONFIG_INET_AH is not set
24370 +# CONFIG_INET_ESP is not set
24371 +# CONFIG_INET_IPCOMP is not set
24372 +# CONFIG_INET_XFRM_TUNNEL is not set
24373 +# CONFIG_INET_TUNNEL is not set
24374 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
24375 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
24376 +# CONFIG_INET_XFRM_MODE_BEET is not set
24377 +# CONFIG_INET_LRO is not set
24378 +CONFIG_INET_DIAG=y
24379 +CONFIG_INET_TCP_DIAG=y
24380 +# CONFIG_TCP_CONG_ADVANCED is not set
24381 +CONFIG_TCP_CONG_CUBIC=y
24382 +CONFIG_DEFAULT_TCP_CONG="cubic"
24383 +# CONFIG_TCP_MD5SIG is not set
24384 +# CONFIG_IPV6 is not set
24385 +# CONFIG_INET6_XFRM_TUNNEL is not set
24386 +# CONFIG_INET6_TUNNEL is not set
24387 +# CONFIG_NETWORK_SECMARK is not set
24388 +# CONFIG_NETFILTER is not set
24389 +# CONFIG_IP_DCCP is not set
24390 +# CONFIG_IP_SCTP is not set
24391 +# CONFIG_TIPC is not set
24392 +# CONFIG_ATM is not set
24393 +# CONFIG_BRIDGE is not set
24394 +# CONFIG_VLAN_8021Q is not set
24395 +# CONFIG_DECNET is not set
24396 +# CONFIG_LLC2 is not set
24397 +# CONFIG_IPX is not set
24398 +# CONFIG_ATALK is not set
24399 +# CONFIG_X25 is not set
24400 +# CONFIG_LAPB is not set
24401 +# CONFIG_ECONET is not set
24402 +# CONFIG_WAN_ROUTER is not set
24403 +# CONFIG_NET_SCHED is not set
24404 +
24405 +#
24406 +# Network testing
24407 +#
24408 +# CONFIG_NET_PKTGEN is not set
24409 +# CONFIG_HAMRADIO is not set
24410 +# CONFIG_IRDA is not set
24411 +# CONFIG_BT is not set
24412 +# CONFIG_AF_RXRPC is not set
24413 +
24414 +#
24415 +# Wireless
24416 +#
24417 +# CONFIG_CFG80211 is not set
24418 +# CONFIG_WIRELESS_EXT is not set
24419 +# CONFIG_MAC80211 is not set
24420 +# CONFIG_IEEE80211 is not set
24421 +# CONFIG_RFKILL is not set
24422 +# CONFIG_NET_9P is not set
24423 +
24424 +#
24425 +# Device Drivers
24426 +#
24427 +
24428 +#
24429 +# Generic Driver Options
24430 +#
24431 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
24432 +CONFIG_STANDALONE=y
24433 +CONFIG_PREVENT_FIRMWARE_BUILD=y
24434 +# CONFIG_FW_LOADER is not set
24435 +# CONFIG_DEBUG_DRIVER is not set
24436 +# CONFIG_DEBUG_DEVRES is not set
24437 +# CONFIG_SYS_HYPERVISOR is not set
24438 +# CONFIG_CONNECTOR is not set
24439 +CONFIG_MTD=y
24440 +# CONFIG_MTD_DEBUG is not set
24441 +# CONFIG_MTD_CONCAT is not set
24442 +# CONFIG_MTD_PARTITIONS is not set
24443 +
24444 +#
24445 +# User Modules And Translation Layers
24446 +#
24447 +CONFIG_MTD_CHAR=y
24448 +CONFIG_MTD_BLKDEVS=y
24449 +CONFIG_MTD_BLOCK=y
24450 +# CONFIG_FTL is not set
24451 +# CONFIG_NFTL is not set
24452 +# CONFIG_INFTL is not set
24453 +# CONFIG_RFD_FTL is not set
24454 +# CONFIG_SSFDC is not set
24455 +# CONFIG_MTD_OOPS is not set
24456 +
24457 +#
24458 +# RAM/ROM/Flash chip drivers
24459 +#
24460 +CONFIG_MTD_CFI=y
24461 +# CONFIG_MTD_JEDECPROBE is not set
24462 +CONFIG_MTD_GEN_PROBE=y
24463 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
24464 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
24465 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
24466 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
24467 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
24468 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
24469 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
24470 +CONFIG_MTD_CFI_I1=y
24471 +CONFIG_MTD_CFI_I2=y
24472 +# CONFIG_MTD_CFI_I4 is not set
24473 +# CONFIG_MTD_CFI_I8 is not set
24474 +# CONFIG_MTD_CFI_INTELEXT is not set
24475 +CONFIG_MTD_CFI_AMDSTD=y
24476 +# CONFIG_MTD_CFI_STAA is not set
24477 +CONFIG_MTD_CFI_UTIL=y
24478 +# CONFIG_MTD_RAM is not set
24479 +# CONFIG_MTD_ROM is not set
24480 +# CONFIG_MTD_ABSENT is not set
24481 +
24482 +#
24483 +# Mapping drivers for chip access
24484 +#
24485 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
24486 +# CONFIG_MTD_PHYSMAP is not set
24487 +CONFIG_MTD_PHYSMAP_OF=y
24488 +# CONFIG_MTD_CFI_FLAGADM is not set
24489 +# CONFIG_MTD_PLATRAM is not set
24490 +
24491 +#
24492 +# Self-contained MTD device drivers
24493 +#
24494 +# CONFIG_MTD_SLRAM is not set
24495 +# CONFIG_MTD_PHRAM is not set
24496 +# CONFIG_MTD_MTDRAM is not set
24497 +# CONFIG_MTD_BLOCK2MTD is not set
24498 +
24499 +#
24500 +# Disk-On-Chip Device Drivers
24501 +#
24502 +# CONFIG_MTD_DOC2000 is not set
24503 +# CONFIG_MTD_DOC2001 is not set
24504 +# CONFIG_MTD_DOC2001PLUS is not set
24505 +# CONFIG_MTD_NAND is not set
24506 +# CONFIG_MTD_ONENAND is not set
24507 +
24508 +#
24509 +# UBI - Unsorted block images
24510 +#
24511 +# CONFIG_MTD_UBI is not set
24512 +CONFIG_OF_DEVICE=y
24513 +# CONFIG_PARPORT is not set
24514 +# CONFIG_BLK_DEV is not set
24515 +# CONFIG_MISC_DEVICES is not set
24516 +# CONFIG_IDE is not set
24517 +
24518 +#
24519 +# SCSI device support
24520 +#
24521 +# CONFIG_RAID_ATTRS is not set
24522 +# CONFIG_SCSI is not set
24523 +# CONFIG_SCSI_DMA is not set
24524 +# CONFIG_SCSI_NETLINK is not set
24525 +# CONFIG_ATA is not set
24526 +# CONFIG_MD is not set
24527 +# CONFIG_MACINTOSH_DRIVERS is not set
24528 +CONFIG_NETDEVICES=y
24529 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
24530 +# CONFIG_DUMMY is not set
24531 +# CONFIG_BONDING is not set
24532 +# CONFIG_MACVLAN is not set
24533 +# CONFIG_EQUALIZER is not set
24534 +# CONFIG_TUN is not set
24535 +# CONFIG_VETH is not set
24536 +CONFIG_PHYLIB=y
24537 +
24538 +#
24539 +# MII PHY device drivers
24540 +#
24541 +# CONFIG_MARVELL_PHY is not set
24542 +CONFIG_DAVICOM_PHY=y
24543 +# CONFIG_QSEMI_PHY is not set
24544 +# CONFIG_LXT_PHY is not set
24545 +# CONFIG_CICADA_PHY is not set
24546 +# CONFIG_VITESSE_PHY is not set
24547 +# CONFIG_SMSC_PHY is not set
24548 +# CONFIG_BROADCOM_PHY is not set
24549 +# CONFIG_ICPLUS_PHY is not set
24550 +# CONFIG_FIXED_PHY is not set
24551 +# CONFIG_MDIO_BITBANG is not set
24552 +CONFIG_NET_ETHERNET=y
24553 +CONFIG_MII=y
24554 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
24555 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
24556 +# CONFIG_IBM_NEW_EMAC_TAH is not set
24557 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
24558 +# CONFIG_B44 is not set
24559 +CONFIG_FS_ENET=y
24560 +# CONFIG_FS_ENET_HAS_SCC is not set
24561 +CONFIG_FS_ENET_HAS_FEC=y
24562 +CONFIG_FS_ENET_MDIO_FEC=y
24563 +# CONFIG_NETDEV_1000 is not set
24564 +# CONFIG_NETDEV_10000 is not set
24565 +
24566 +#
24567 +# Wireless LAN
24568 +#
24569 +# CONFIG_WLAN_PRE80211 is not set
24570 +# CONFIG_WLAN_80211 is not set
24571 +# CONFIG_WAN is not set
24572 +# CONFIG_PPP is not set
24573 +# CONFIG_SLIP is not set
24574 +# CONFIG_SHAPER is not set
24575 +# CONFIG_NETCONSOLE is not set
24576 +# CONFIG_NETPOLL is not set
24577 +# CONFIG_NET_POLL_CONTROLLER is not set
24578 +# CONFIG_ISDN is not set
24579 +# CONFIG_PHONE is not set
24580 +
24581 +#
24582 +# Input device support
24583 +#
24584 +CONFIG_INPUT=y
24585 +# CONFIG_INPUT_FF_MEMLESS is not set
24586 +# CONFIG_INPUT_POLLDEV is not set
24587 +
24588 +#
24589 +# Userland interfaces
24590 +#
24591 +CONFIG_INPUT_MOUSEDEV=y
24592 +CONFIG_INPUT_MOUSEDEV_PSAUX=y
24593 +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
24594 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
24595 +# CONFIG_INPUT_JOYDEV is not set
24596 +# CONFIG_INPUT_EVDEV is not set
24597 +# CONFIG_INPUT_EVBUG is not set
24598 +
24599 +#
24600 +# Input Device Drivers
24601 +#
24602 +CONFIG_INPUT_KEYBOARD=y
24603 +CONFIG_KEYBOARD_ATKBD=y
24604 +# CONFIG_KEYBOARD_SUNKBD is not set
24605 +# CONFIG_KEYBOARD_LKKBD is not set
24606 +# CONFIG_KEYBOARD_XTKBD is not set
24607 +# CONFIG_KEYBOARD_NEWTON is not set
24608 +# CONFIG_KEYBOARD_STOWAWAY is not set
24609 +CONFIG_INPUT_MOUSE=y
24610 +CONFIG_MOUSE_PS2=y
24611 +CONFIG_MOUSE_PS2_ALPS=y
24612 +CONFIG_MOUSE_PS2_LOGIPS2PP=y
24613 +CONFIG_MOUSE_PS2_SYNAPTICS=y
24614 +CONFIG_MOUSE_PS2_LIFEBOOK=y
24615 +CONFIG_MOUSE_PS2_TRACKPOINT=y
24616 +# CONFIG_MOUSE_PS2_TOUCHKIT is not set
24617 +# CONFIG_MOUSE_SERIAL is not set
24618 +# CONFIG_MOUSE_VSXXXAA is not set
24619 +# CONFIG_INPUT_JOYSTICK is not set
24620 +# CONFIG_INPUT_TABLET is not set
24621 +# CONFIG_INPUT_TOUCHSCREEN is not set
24622 +# CONFIG_INPUT_MISC is not set
24623 +
24624 +#
24625 +# Hardware I/O ports
24626 +#
24627 +CONFIG_SERIO=y
24628 +CONFIG_SERIO_I8042=y
24629 +CONFIG_SERIO_SERPORT=y
24630 +CONFIG_SERIO_LIBPS2=y
24631 +# CONFIG_SERIO_RAW is not set
24632 +# CONFIG_GAMEPORT is not set
24633 +
24634 +#
24635 +# Character devices
24636 +#
24637 +# CONFIG_VT is not set
24638 +# CONFIG_SERIAL_NONSTANDARD is not set
24639 +
24640 +#
24641 +# Serial drivers
24642 +#
24643 +# CONFIG_SERIAL_8250 is not set
24644 +
24645 +#
24646 +# Non-8250 serial port support
24647 +#
24648 +# CONFIG_SERIAL_UARTLITE is not set
24649 +CONFIG_SERIAL_CORE=y
24650 +CONFIG_SERIAL_CORE_CONSOLE=y
24651 +CONFIG_SERIAL_CPM=y
24652 +CONFIG_SERIAL_CPM_CONSOLE=y
24653 +# CONFIG_SERIAL_CPM_SCC1 is not set
24654 +# CONFIG_SERIAL_CPM_SCC2 is not set
24655 +# CONFIG_SERIAL_CPM_SCC3 is not set
24656 +# CONFIG_SERIAL_CPM_SCC4 is not set
24657 +CONFIG_SERIAL_CPM_SMC1=y
24658 +CONFIG_SERIAL_CPM_SMC2=y
24659 +CONFIG_UNIX98_PTYS=y
24660 +# CONFIG_LEGACY_PTYS is not set
24661 +# CONFIG_IPMI_HANDLER is not set
24662 +CONFIG_HW_RANDOM=y
24663 +# CONFIG_NVRAM is not set
24664 +CONFIG_GEN_RTC=y
24665 +# CONFIG_GEN_RTC_X is not set
24666 +# CONFIG_R3964 is not set
24667 +# CONFIG_RAW_DRIVER is not set
24668 +# CONFIG_TCG_TPM is not set
24669 +# CONFIG_I2C is not set
24670 +
24671 +#
24672 +# SPI support
24673 +#
24674 +# CONFIG_SPI is not set
24675 +# CONFIG_SPI_MASTER is not set
24676 +# CONFIG_W1 is not set
24677 +# CONFIG_POWER_SUPPLY is not set
24678 +# CONFIG_HWMON is not set
24679 +# CONFIG_WATCHDOG is not set
24680 +
24681 +#
24682 +# Sonics Silicon Backplane
24683 +#
24684 +CONFIG_SSB_POSSIBLE=y
24685 +# CONFIG_SSB is not set
24686 +
24687 +#
24688 +# Multifunction device drivers
24689 +#
24690 +# CONFIG_MFD_SM501 is not set
24691 +
24692 +#
24693 +# Multimedia devices
24694 +#
24695 +# CONFIG_VIDEO_DEV is not set
24696 +# CONFIG_DVB_CORE is not set
24697 +CONFIG_DAB=y
24698 +
24699 +#
24700 +# Graphics support
24701 +#
24702 +# CONFIG_VGASTATE is not set
24703 +CONFIG_VIDEO_OUTPUT_CONTROL=y
24704 +# CONFIG_FB is not set
24705 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
24706 +
24707 +#
24708 +# Display device support
24709 +#
24710 +# CONFIG_DISPLAY_SUPPORT is not set
24711 +
24712 +#
24713 +# Sound
24714 +#
24715 +# CONFIG_SOUND is not set
24716 +# CONFIG_HID_SUPPORT is not set
24717 +# CONFIG_USB_SUPPORT is not set
24718 +# CONFIG_MMC is not set
24719 +# CONFIG_NEW_LEDS is not set
24720 +# CONFIG_EDAC is not set
24721 +# CONFIG_RTC_CLASS is not set
24722 +
24723 +#
24724 +# Userspace I/O
24725 +#
24726 +# CONFIG_UIO is not set
24727 +
24728 +#
24729 +# File systems
24730 +#
24731 +# CONFIG_EXT2_FS is not set
24732 +# CONFIG_EXT3_FS is not set
24733 +# CONFIG_EXT4DEV_FS is not set
24734 +# CONFIG_REISERFS_FS is not set
24735 +# CONFIG_JFS_FS is not set
24736 +# CONFIG_FS_POSIX_ACL is not set
24737 +# CONFIG_XFS_FS is not set
24738 +# CONFIG_GFS2_FS is not set
24739 +# CONFIG_OCFS2_FS is not set
24740 +# CONFIG_MINIX_FS is not set
24741 +# CONFIG_ROMFS_FS is not set
24742 +# CONFIG_INOTIFY is not set
24743 +# CONFIG_QUOTA is not set
24744 +# CONFIG_DNOTIFY is not set
24745 +# CONFIG_AUTOFS_FS is not set
24746 +# CONFIG_AUTOFS4_FS is not set
24747 +# CONFIG_FUSE_FS is not set
24748 +
24749 +#
24750 +# CD-ROM/DVD Filesystems
24751 +#
24752 +# CONFIG_ISO9660_FS is not set
24753 +# CONFIG_UDF_FS is not set
24754 +
24755 +#
24756 +# DOS/FAT/NT Filesystems
24757 +#
24758 +# CONFIG_MSDOS_FS is not set
24759 +# CONFIG_VFAT_FS is not set
24760 +# CONFIG_NTFS_FS is not set
24761 +
24762 +#
24763 +# Pseudo filesystems
24764 +#
24765 +CONFIG_PROC_FS=y
24766 +# CONFIG_PROC_KCORE is not set
24767 +CONFIG_PROC_SYSCTL=y
24768 +CONFIG_SYSFS=y
24769 +CONFIG_TMPFS=y
24770 +# CONFIG_TMPFS_POSIX_ACL is not set
24771 +# CONFIG_HUGETLB_PAGE is not set
24772 +# CONFIG_CONFIGFS_FS is not set
24773 +
24774 +#
24775 +# Miscellaneous filesystems
24776 +#
24777 +# CONFIG_ADFS_FS is not set
24778 +# CONFIG_AFFS_FS is not set
24779 +# CONFIG_HFS_FS is not set
24780 +# CONFIG_HFSPLUS_FS is not set
24781 +# CONFIG_BEFS_FS is not set
24782 +# CONFIG_BFS_FS is not set
24783 +# CONFIG_EFS_FS is not set
24784 +# CONFIG_JFFS2_FS is not set
24785 +CONFIG_CRAMFS=y
24786 +# CONFIG_VXFS_FS is not set
24787 +# CONFIG_HPFS_FS is not set
24788 +# CONFIG_QNX4FS_FS is not set
24789 +# CONFIG_SYSV_FS is not set
24790 +# CONFIG_UFS_FS is not set
24791 +CONFIG_NETWORK_FILESYSTEMS=y
24792 +CONFIG_NFS_FS=y
24793 +CONFIG_NFS_V3=y
24794 +# CONFIG_NFS_V3_ACL is not set
24795 +# CONFIG_NFS_V4 is not set
24796 +# CONFIG_NFS_DIRECTIO is not set
24797 +# CONFIG_NFSD is not set
24798 +CONFIG_ROOT_NFS=y
24799 +CONFIG_LOCKD=y
24800 +CONFIG_LOCKD_V4=y
24801 +CONFIG_NFS_COMMON=y
24802 +CONFIG_SUNRPC=y
24803 +# CONFIG_SUNRPC_BIND34 is not set
24804 +# CONFIG_RPCSEC_GSS_KRB5 is not set
24805 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
24806 +# CONFIG_SMB_FS is not set
24807 +# CONFIG_CIFS is not set
24808 +# CONFIG_NCP_FS is not set
24809 +# CONFIG_CODA_FS is not set
24810 +# CONFIG_AFS_FS is not set
24811 +
24812 +#
24813 +# Partition Types
24814 +#
24815 +CONFIG_PARTITION_ADVANCED=y
24816 +# CONFIG_ACORN_PARTITION is not set
24817 +# CONFIG_OSF_PARTITION is not set
24818 +# CONFIG_AMIGA_PARTITION is not set
24819 +# CONFIG_ATARI_PARTITION is not set
24820 +# CONFIG_MAC_PARTITION is not set
24821 +CONFIG_MSDOS_PARTITION=y
24822 +# CONFIG_BSD_DISKLABEL is not set
24823 +# CONFIG_MINIX_SUBPARTITION is not set
24824 +# CONFIG_SOLARIS_X86_PARTITION is not set
24825 +# CONFIG_UNIXWARE_DISKLABEL is not set
24826 +# CONFIG_LDM_PARTITION is not set
24827 +# CONFIG_SGI_PARTITION is not set
24828 +# CONFIG_ULTRIX_PARTITION is not set
24829 +# CONFIG_SUN_PARTITION is not set
24830 +# CONFIG_KARMA_PARTITION is not set
24831 +# CONFIG_EFI_PARTITION is not set
24832 +# CONFIG_SYSV68_PARTITION is not set
24833 +# CONFIG_NLS is not set
24834 +# CONFIG_DLM is not set
24835 +# CONFIG_UCC_SLOW is not set
24836 +
24837 +#
24838 +# Library routines
24839 +#
24840 +# CONFIG_CRC_CCITT is not set
24841 +# CONFIG_CRC16 is not set
24842 +# CONFIG_CRC_ITU_T is not set
24843 +# CONFIG_CRC32 is not set
24844 +# CONFIG_CRC7 is not set
24845 +# CONFIG_LIBCRC32C is not set
24846 +CONFIG_ZLIB_INFLATE=y
24847 +CONFIG_HAS_IOMEM=y
24848 +CONFIG_HAS_IOPORT=y
24849 +CONFIG_HAS_DMA=y
24850 +CONFIG_INSTRUMENTATION=y
24851 +# CONFIG_PROFILING is not set
24852 +# CONFIG_MARKERS is not set
24853 +
24854 +#
24855 +# Kernel hacking
24856 +#
24857 +# CONFIG_PRINTK_TIME is not set
24858 +CONFIG_ENABLE_WARN_DEPRECATED=y
24859 +CONFIG_ENABLE_MUST_CHECK=y
24860 +CONFIG_MAGIC_SYSRQ=y
24861 +# CONFIG_UNUSED_SYMBOLS is not set
24862 +# CONFIG_DEBUG_FS is not set
24863 +# CONFIG_HEADERS_CHECK is not set
24864 +CONFIG_DEBUG_KERNEL=y
24865 +# CONFIG_DEBUG_SHIRQ is not set
24866 +CONFIG_DETECT_SOFTLOCKUP=y
24867 +CONFIG_SCHED_DEBUG=y
24868 +# CONFIG_SCHEDSTATS is not set
24869 +# CONFIG_TIMER_STATS is not set
24870 +# CONFIG_SLUB_DEBUG_ON is not set
24871 +# CONFIG_DEBUG_SPINLOCK is not set
24872 +# CONFIG_DEBUG_MUTEXES is not set
24873 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
24874 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
24875 +# CONFIG_DEBUG_KOBJECT is not set
24876 +CONFIG_DEBUG_BUGVERBOSE=y
24877 +CONFIG_DEBUG_INFO=y
24878 +# CONFIG_DEBUG_VM is not set
24879 +# CONFIG_DEBUG_LIST is not set
24880 +# CONFIG_DEBUG_SG is not set
24881 +CONFIG_FORCED_INLINING=y
24882 +# CONFIG_BOOT_PRINTK_DELAY is not set
24883 +# CONFIG_FAULT_INJECTION is not set
24884 +# CONFIG_SAMPLES is not set
24885 +# CONFIG_DEBUG_STACKOVERFLOW is not set
24886 +# CONFIG_DEBUG_STACK_USAGE is not set
24887 +# CONFIG_DEBUG_PAGEALLOC is not set
24888 +# CONFIG_DEBUGGER is not set
24889 +# CONFIG_BDI_SWITCH is not set
24890 +# CONFIG_PPC_EARLY_DEBUG is not set
24891 +
24892 +#
24893 +# Security options
24894 +#
24895 +# CONFIG_KEYS is not set
24896 +# CONFIG_SECURITY is not set
24897 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
24898 +# CONFIG_CRYPTO is not set
24899 +# CONFIG_PPC_CLOCK is not set
24900 +CONFIG_PPC_LIB_RHEAP=y
24901 --- a/arch/powerpc/configs/bamboo_defconfig
24902 +++ b/arch/powerpc/configs/bamboo_defconfig
24903 @@ -1,7 +1,7 @@
24904  #
24905  # Automatically generated make config: don't edit
24906 -# Linux kernel version: 2.6.24-rc4
24907 -# Thu Dec  6 16:48:04 2007
24908 +# Linux kernel version: 2.6.24-rc6
24909 +# Mon Dec 24 10:49:50 2007
24910  #
24911  # CONFIG_PPC64 is not set
24912  
24913 @@ -131,6 +131,7 @@
24914  # CONFIG_DEFAULT_CFQ is not set
24915  # CONFIG_DEFAULT_NOOP is not set
24916  CONFIG_DEFAULT_IOSCHED="anticipatory"
24917 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
24918  
24919  #
24920  # Platform support
24921 @@ -143,6 +144,9 @@
24922  CONFIG_BAMBOO=y
24923  # CONFIG_EBONY is not set
24924  # CONFIG_SEQUOIA is not set
24925 +# CONFIG_TAISHAN is not set
24926 +# CONFIG_KATMAI is not set
24927 +# CONFIG_RAINIER is not set
24928  CONFIG_440EP=y
24929  CONFIG_IBM440EP_ERR42=y
24930  # CONFIG_MPIC is not set
24931 @@ -372,9 +376,7 @@
24932  # CONFIG_FIREWIRE is not set
24933  # CONFIG_IEEE1394 is not set
24934  # CONFIG_I2O is not set
24935 -CONFIG_MACINTOSH_DRIVERS=y
24936 -# CONFIG_MAC_EMUMOUSEBTN is not set
24937 -# CONFIG_WINDFARM is not set
24938 +# CONFIG_MACINTOSH_DRIVERS is not set
24939  CONFIG_NETDEVICES=y
24940  # CONFIG_NETDEVICES_MULTIQUEUE is not set
24941  # CONFIG_DUMMY is not set
24942 @@ -736,19 +738,7 @@
24943  # CONFIG_KGDB is not set
24944  # CONFIG_XMON is not set
24945  # CONFIG_BDI_SWITCH is not set
24946 -CONFIG_PPC_EARLY_DEBUG=y
24947 -# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
24948 -# CONFIG_PPC_EARLY_DEBUG_G5 is not set
24949 -# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
24950 -# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
24951 -# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
24952 -# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
24953 -# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
24954 -# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
24955 -CONFIG_PPC_EARLY_DEBUG_44x=y
24956 -# CONFIG_PPC_EARLY_DEBUG_CPM is not set
24957 -CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
24958 -CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x0
24959 +# CONFIG_PPC_EARLY_DEBUG is not set
24960  
24961  #
24962  # Security options
24963 --- a/arch/powerpc/configs/celleb_defconfig
24964 +++ b/arch/powerpc/configs/celleb_defconfig
24965 @@ -50,7 +50,8 @@
24966  CONFIG_GENERIC_BUG=y
24967  # CONFIG_DEFAULT_UIMAGE is not set
24968  # CONFIG_PPC_DCR_NATIVE is not set
24969 -# CONFIG_PPC_DCR_MMIO is not set
24970 +CONFIG_PPC_DCR_MMIO=y
24971 +CONFIG_PPC_DCR=y
24972  CONFIG_PPC_OF_PLATFORM_PCI=y
24973  CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24974  
24975 @@ -148,7 +149,7 @@
24976  CONFIG_PPC_CELLEB=y
24977  # CONFIG_PPC_PS3 is not set
24978  CONFIG_PPC_CELL=y
24979 -# CONFIG_PPC_CELL_NATIVE is not set
24980 +CONFIG_PPC_CELL_NATIVE=y
24981  # CONFIG_PPC_IBM_CELL_BLADE is not set
24982  
24983  #
24984 @@ -157,13 +158,19 @@
24985  CONFIG_SPU_FS=y
24986  CONFIG_SPU_FS_64K_LS=y
24987  CONFIG_SPU_BASE=y
24988 +CONFIG_CBE_RAS=y
24989 +# CONFIG_CBE_THERM is not set
24990  # CONFIG_PQ2ADS is not set
24991 +CONFIG_PPC_NATIVE=y
24992 +CONFIG_UDBG_RTAS_CONSOLE=y
24993  CONFIG_PPC_UDBG_BEAT=y
24994 -# CONFIG_MPIC is not set
24995 +CONFIG_MPIC=y
24996  # CONFIG_MPIC_WEIRD is not set
24997  # CONFIG_PPC_I8259 is not set
24998  # CONFIG_U3_DART is not set
24999 -# CONFIG_PPC_RTAS is not set
25000 +CONFIG_PPC_RTAS=y
25001 +# CONFIG_RTAS_ERROR_LOGGING is not set
25002 +# CONFIG_RTAS_PROC is not set
25003  # CONFIG_MMIO_NVRAM is not set
25004  # CONFIG_PPC_MPC106 is not set
25005  # CONFIG_PPC_970_NAP is not set
25006 @@ -593,10 +600,11 @@
25007  # CONFIG_NET_VENDOR_3COM is not set
25008  # CONFIG_NET_TULIP is not set
25009  # CONFIG_HP100 is not set
25010 -# CONFIG_IBM_NEW_EMAC_ZMII is not set
25011 -# CONFIG_IBM_NEW_EMAC_RGMII is not set
25012 -# CONFIG_IBM_NEW_EMAC_TAH is not set
25013 -# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
25014 +# CONFIG_IBM_NEW_EMAC is not set
25015 +CONFIG_IBM_NEW_EMAC_ZMII=y
25016 +CONFIG_IBM_NEW_EMAC_RGMII=y
25017 +CONFIG_IBM_NEW_EMAC_TAH=y
25018 +CONFIG_IBM_NEW_EMAC_EMAC4=y
25019  # CONFIG_NET_PCI is not set
25020  # CONFIG_B44 is not set
25021  CONFIG_NETDEV_1000=y
25022 @@ -741,6 +749,7 @@
25023  CONFIG_UNIX98_PTYS=y
25024  # CONFIG_LEGACY_PTYS is not set
25025  CONFIG_HVC_DRIVER=y
25026 +CONFIG_HVC_RTAS=y
25027  CONFIG_HVC_BEAT=y
25028  # CONFIG_IPMI_HANDLER is not set
25029  # CONFIG_HW_RANDOM is not set
25030 @@ -822,6 +831,7 @@
25031  # Watchdog Device Drivers
25032  #
25033  # CONFIG_SOFT_WATCHDOG is not set
25034 +# CONFIG_WATCHDOG_RTAS is not set
25035  
25036  #
25037  # PCI-based Watchdog Cards
25038 @@ -1245,17 +1255,7 @@
25039  CONFIG_IRQSTACKS=y
25040  # CONFIG_VIRQ_DEBUG is not set
25041  # CONFIG_BOOTX_TEXT is not set
25042 -CONFIG_PPC_EARLY_DEBUG=y
25043 -# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
25044 -# CONFIG_PPC_EARLY_DEBUG_G5 is not set
25045 -# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
25046 -# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
25047 -# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
25048 -# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
25049 -# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
25050 -CONFIG_PPC_EARLY_DEBUG_BEAT=y
25051 -# CONFIG_PPC_EARLY_DEBUG_44x is not set
25052 -# CONFIG_PPC_EARLY_DEBUG_CPM is not set
25053 +# CONFIG_PPC_EARLY_DEBUG is not set
25054  
25055  #
25056  # Security options
25057 --- a/arch/powerpc/configs/ebony_defconfig
25058 +++ b/arch/powerpc/configs/ebony_defconfig
25059 @@ -1,7 +1,7 @@
25060  #
25061  # Automatically generated make config: don't edit
25062 -# Linux kernel version: 2.6.24-rc4
25063 -# Thu Dec  6 16:48:11 2007
25064 +# Linux kernel version: 2.6.24-rc6
25065 +# Mon Dec 24 11:16:26 2007
25066  #
25067  # CONFIG_PPC64 is not set
25068  
25069 @@ -130,6 +130,7 @@
25070  # CONFIG_DEFAULT_CFQ is not set
25071  # CONFIG_DEFAULT_NOOP is not set
25072  CONFIG_DEFAULT_IOSCHED="anticipatory"
25073 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
25074  
25075  #
25076  # Platform support
25077 @@ -142,6 +143,9 @@
25078  # CONFIG_BAMBOO is not set
25079  CONFIG_EBONY=y
25080  # CONFIG_SEQUOIA is not set
25081 +# CONFIG_TAISHAN is not set
25082 +# CONFIG_KATMAI is not set
25083 +# CONFIG_RAINIER is not set
25084  CONFIG_440GP=y
25085  # CONFIG_MPIC is not set
25086  # CONFIG_MPIC_WEIRD is not set
25087 --- /dev/null
25088 +++ b/arch/powerpc/configs/ep405_defconfig
25089 @@ -0,0 +1,952 @@
25090 +#
25091 +# Automatically generated make config: don't edit
25092 +# Linux kernel version: 2.6.24-rc6
25093 +# Mon Dec 24 11:17:13 2007
25094 +#
25095 +# CONFIG_PPC64 is not set
25096 +
25097 +#
25098 +# Processor support
25099 +#
25100 +# CONFIG_6xx is not set
25101 +# CONFIG_PPC_85xx is not set
25102 +# CONFIG_PPC_8xx is not set
25103 +CONFIG_40x=y
25104 +# CONFIG_44x is not set
25105 +# CONFIG_E200 is not set
25106 +CONFIG_4xx=y
25107 +# CONFIG_PPC_MM_SLICES is not set
25108 +CONFIG_NOT_COHERENT_CACHE=y
25109 +CONFIG_PPC32=y
25110 +CONFIG_WORD_SIZE=32
25111 +CONFIG_PPC_MERGE=y
25112 +CONFIG_MMU=y
25113 +CONFIG_GENERIC_CMOS_UPDATE=y
25114 +CONFIG_GENERIC_TIME=y
25115 +CONFIG_GENERIC_TIME_VSYSCALL=y
25116 +CONFIG_GENERIC_CLOCKEVENTS=y
25117 +CONFIG_GENERIC_HARDIRQS=y
25118 +CONFIG_IRQ_PER_CPU=y
25119 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
25120 +CONFIG_ARCH_HAS_ILOG2_U32=y
25121 +CONFIG_GENERIC_HWEIGHT=y
25122 +CONFIG_GENERIC_CALIBRATE_DELAY=y
25123 +CONFIG_GENERIC_FIND_NEXT_BIT=y
25124 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
25125 +CONFIG_PPC=y
25126 +CONFIG_EARLY_PRINTK=y
25127 +CONFIG_GENERIC_NVRAM=y
25128 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
25129 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
25130 +CONFIG_PPC_OF=y
25131 +CONFIG_OF=y
25132 +CONFIG_PPC_UDBG_16550=y
25133 +# CONFIG_GENERIC_TBSYNC is not set
25134 +CONFIG_AUDIT_ARCH=y
25135 +CONFIG_GENERIC_BUG=y
25136 +# CONFIG_DEFAULT_UIMAGE is not set
25137 +CONFIG_PPC_DCR_NATIVE=y
25138 +# CONFIG_PPC_DCR_MMIO is not set
25139 +CONFIG_PPC_DCR=y
25140 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
25141 +
25142 +#
25143 +# General setup
25144 +#
25145 +CONFIG_EXPERIMENTAL=y
25146 +CONFIG_BROKEN_ON_SMP=y
25147 +CONFIG_INIT_ENV_ARG_LIMIT=32
25148 +CONFIG_LOCALVERSION=""
25149 +CONFIG_LOCALVERSION_AUTO=y
25150 +CONFIG_SWAP=y
25151 +CONFIG_SYSVIPC=y
25152 +CONFIG_SYSVIPC_SYSCTL=y
25153 +CONFIG_POSIX_MQUEUE=y
25154 +# CONFIG_BSD_PROCESS_ACCT is not set
25155 +# CONFIG_TASKSTATS is not set
25156 +# CONFIG_USER_NS is not set
25157 +# CONFIG_PID_NS is not set
25158 +# CONFIG_AUDIT is not set
25159 +# CONFIG_IKCONFIG is not set
25160 +CONFIG_LOG_BUF_SHIFT=14
25161 +# CONFIG_CGROUPS is not set
25162 +CONFIG_FAIR_GROUP_SCHED=y
25163 +CONFIG_FAIR_USER_SCHED=y
25164 +# CONFIG_FAIR_CGROUP_SCHED is not set
25165 +CONFIG_SYSFS_DEPRECATED=y
25166 +# CONFIG_RELAY is not set
25167 +CONFIG_BLK_DEV_INITRD=y
25168 +CONFIG_INITRAMFS_SOURCE=""
25169 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
25170 +CONFIG_SYSCTL=y
25171 +CONFIG_EMBEDDED=y
25172 +CONFIG_SYSCTL_SYSCALL=y
25173 +CONFIG_KALLSYMS=y
25174 +CONFIG_KALLSYMS_ALL=y
25175 +CONFIG_KALLSYMS_EXTRA_PASS=y
25176 +CONFIG_HOTPLUG=y
25177 +CONFIG_PRINTK=y
25178 +CONFIG_BUG=y
25179 +CONFIG_ELF_CORE=y
25180 +CONFIG_BASE_FULL=y
25181 +CONFIG_FUTEX=y
25182 +CONFIG_ANON_INODES=y
25183 +CONFIG_EPOLL=y
25184 +CONFIG_SIGNALFD=y
25185 +CONFIG_EVENTFD=y
25186 +CONFIG_SHMEM=y
25187 +CONFIG_VM_EVENT_COUNTERS=y
25188 +CONFIG_SLUB_DEBUG=y
25189 +# CONFIG_SLAB is not set
25190 +CONFIG_SLUB=y
25191 +# CONFIG_SLOB is not set
25192 +CONFIG_RT_MUTEXES=y
25193 +# CONFIG_TINY_SHMEM is not set
25194 +CONFIG_BASE_SMALL=0
25195 +CONFIG_MODULES=y
25196 +CONFIG_MODULE_UNLOAD=y
25197 +# CONFIG_MODULE_FORCE_UNLOAD is not set
25198 +# CONFIG_MODVERSIONS is not set
25199 +# CONFIG_MODULE_SRCVERSION_ALL is not set
25200 +CONFIG_KMOD=y
25201 +CONFIG_BLOCK=y
25202 +CONFIG_LBD=y
25203 +# CONFIG_BLK_DEV_IO_TRACE is not set
25204 +# CONFIG_LSF is not set
25205 +# CONFIG_BLK_DEV_BSG is not set
25206 +
25207 +#
25208 +# IO Schedulers
25209 +#
25210 +CONFIG_IOSCHED_NOOP=y
25211 +CONFIG_IOSCHED_AS=y
25212 +CONFIG_IOSCHED_DEADLINE=y
25213 +CONFIG_IOSCHED_CFQ=y
25214 +CONFIG_DEFAULT_AS=y
25215 +# CONFIG_DEFAULT_DEADLINE is not set
25216 +# CONFIG_DEFAULT_CFQ is not set
25217 +# CONFIG_DEFAULT_NOOP is not set
25218 +CONFIG_DEFAULT_IOSCHED="anticipatory"
25219 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
25220 +
25221 +#
25222 +# Platform support
25223 +#
25224 +# CONFIG_PPC_MPC52xx is not set
25225 +# CONFIG_PPC_MPC5200 is not set
25226 +# CONFIG_PPC_CELL is not set
25227 +# CONFIG_PPC_CELL_NATIVE is not set
25228 +# CONFIG_PQ2ADS is not set
25229 +CONFIG_EP405=y
25230 +# CONFIG_KILAUEA is not set
25231 +# CONFIG_MAKALU is not set
25232 +# CONFIG_WALNUT is not set
25233 +# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
25234 +CONFIG_405GP=y
25235 +CONFIG_IBM405_ERR77=y
25236 +CONFIG_IBM405_ERR51=y
25237 +# CONFIG_MPIC is not set
25238 +# CONFIG_MPIC_WEIRD is not set
25239 +# CONFIG_PPC_I8259 is not set
25240 +# CONFIG_PPC_RTAS is not set
25241 +# CONFIG_MMIO_NVRAM is not set
25242 +# CONFIG_PPC_MPC106 is not set
25243 +# CONFIG_PPC_970_NAP is not set
25244 +# CONFIG_PPC_INDIRECT_IO is not set
25245 +# CONFIG_GENERIC_IOMAP is not set
25246 +# CONFIG_CPU_FREQ is not set
25247 +# CONFIG_CPM2 is not set
25248 +# CONFIG_FSL_ULI1575 is not set
25249 +
25250 +#
25251 +# Kernel options
25252 +#
25253 +# CONFIG_HIGHMEM is not set
25254 +# CONFIG_TICK_ONESHOT is not set
25255 +# CONFIG_NO_HZ is not set
25256 +# CONFIG_HIGH_RES_TIMERS is not set
25257 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
25258 +# CONFIG_HZ_100 is not set
25259 +CONFIG_HZ_250=y
25260 +# CONFIG_HZ_300 is not set
25261 +# CONFIG_HZ_1000 is not set
25262 +CONFIG_HZ=250
25263 +CONFIG_PREEMPT_NONE=y
25264 +# CONFIG_PREEMPT_VOLUNTARY is not set
25265 +# CONFIG_PREEMPT is not set
25266 +CONFIG_BINFMT_ELF=y
25267 +# CONFIG_BINFMT_MISC is not set
25268 +# CONFIG_MATH_EMULATION is not set
25269 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
25270 +CONFIG_ARCH_FLATMEM_ENABLE=y
25271 +CONFIG_ARCH_POPULATES_NODE_MAP=y
25272 +CONFIG_SELECT_MEMORY_MODEL=y
25273 +CONFIG_FLATMEM_MANUAL=y
25274 +# CONFIG_DISCONTIGMEM_MANUAL is not set
25275 +# CONFIG_SPARSEMEM_MANUAL is not set
25276 +CONFIG_FLATMEM=y
25277 +CONFIG_FLAT_NODE_MEM_MAP=y
25278 +# CONFIG_SPARSEMEM_STATIC is not set
25279 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
25280 +CONFIG_SPLIT_PTLOCK_CPUS=4
25281 +# CONFIG_RESOURCES_64BIT is not set
25282 +CONFIG_ZONE_DMA_FLAG=1
25283 +CONFIG_BOUNCE=y
25284 +CONFIG_VIRT_TO_BUS=y
25285 +CONFIG_PROC_DEVICETREE=y
25286 +# CONFIG_CMDLINE_BOOL is not set
25287 +# CONFIG_PM is not set
25288 +CONFIG_SUSPEND_UP_POSSIBLE=y
25289 +CONFIG_HIBERNATION_UP_POSSIBLE=y
25290 +CONFIG_SECCOMP=y
25291 +CONFIG_WANT_DEVICE_TREE=y
25292 +CONFIG_DEVICE_TREE="ep405.dts"
25293 +CONFIG_ISA_DMA_API=y
25294 +
25295 +#
25296 +# Bus options
25297 +#
25298 +CONFIG_ZONE_DMA=y
25299 +CONFIG_PPC_INDIRECT_PCI=y
25300 +CONFIG_PCI=y
25301 +CONFIG_PCI_DOMAINS=y
25302 +CONFIG_PCI_SYSCALL=y
25303 +# CONFIG_PCIEPORTBUS is not set
25304 +CONFIG_ARCH_SUPPORTS_MSI=y
25305 +# CONFIG_PCI_MSI is not set
25306 +CONFIG_PCI_LEGACY=y
25307 +# CONFIG_PCI_DEBUG is not set
25308 +# CONFIG_PCCARD is not set
25309 +# CONFIG_HOTPLUG_PCI is not set
25310 +
25311 +#
25312 +# Advanced setup
25313 +#
25314 +# CONFIG_ADVANCED_OPTIONS is not set
25315 +
25316 +#
25317 +# Default settings for advanced configuration options are used
25318 +#
25319 +CONFIG_HIGHMEM_START=0xfe000000
25320 +CONFIG_LOWMEM_SIZE=0x30000000
25321 +CONFIG_KERNEL_START=0xc0000000
25322 +CONFIG_TASK_SIZE=0xc0000000
25323 +CONFIG_CONSISTENT_START=0xff100000
25324 +CONFIG_CONSISTENT_SIZE=0x00200000
25325 +CONFIG_BOOT_LOAD=0x00400000
25326 +
25327 +#
25328 +# Networking
25329 +#
25330 +CONFIG_NET=y
25331 +
25332 +#
25333 +# Networking options
25334 +#
25335 +CONFIG_PACKET=y
25336 +# CONFIG_PACKET_MMAP is not set
25337 +CONFIG_UNIX=y
25338 +# CONFIG_NET_KEY is not set
25339 +CONFIG_INET=y
25340 +# CONFIG_IP_MULTICAST is not set
25341 +# CONFIG_IP_ADVANCED_ROUTER is not set
25342 +CONFIG_IP_FIB_HASH=y
25343 +CONFIG_IP_PNP=y
25344 +CONFIG_IP_PNP_DHCP=y
25345 +CONFIG_IP_PNP_BOOTP=y
25346 +# CONFIG_IP_PNP_RARP is not set
25347 +# CONFIG_NET_IPIP is not set
25348 +# CONFIG_NET_IPGRE is not set
25349 +# CONFIG_ARPD is not set
25350 +# CONFIG_SYN_COOKIES is not set
25351 +# CONFIG_INET_AH is not set
25352 +# CONFIG_INET_ESP is not set
25353 +# CONFIG_INET_IPCOMP is not set
25354 +# CONFIG_INET_XFRM_TUNNEL is not set
25355 +# CONFIG_INET_TUNNEL is not set
25356 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
25357 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
25358 +# CONFIG_INET_XFRM_MODE_BEET is not set
25359 +# CONFIG_INET_LRO is not set
25360 +CONFIG_INET_DIAG=y
25361 +CONFIG_INET_TCP_DIAG=y
25362 +# CONFIG_TCP_CONG_ADVANCED is not set
25363 +CONFIG_TCP_CONG_CUBIC=y
25364 +CONFIG_DEFAULT_TCP_CONG="cubic"
25365 +# CONFIG_TCP_MD5SIG is not set
25366 +# CONFIG_IPV6 is not set
25367 +# CONFIG_INET6_XFRM_TUNNEL is not set
25368 +# CONFIG_INET6_TUNNEL is not set
25369 +# CONFIG_NETWORK_SECMARK is not set
25370 +# CONFIG_NETFILTER is not set
25371 +# CONFIG_IP_DCCP is not set
25372 +# CONFIG_IP_SCTP is not set
25373 +# CONFIG_TIPC is not set
25374 +# CONFIG_ATM is not set
25375 +# CONFIG_BRIDGE is not set
25376 +# CONFIG_VLAN_8021Q is not set
25377 +# CONFIG_DECNET is not set
25378 +# CONFIG_LLC2 is not set
25379 +# CONFIG_IPX is not set
25380 +# CONFIG_ATALK is not set
25381 +# CONFIG_X25 is not set
25382 +# CONFIG_LAPB is not set
25383 +# CONFIG_ECONET is not set
25384 +# CONFIG_WAN_ROUTER is not set
25385 +# CONFIG_NET_SCHED is not set
25386 +
25387 +#
25388 +# Network testing
25389 +#
25390 +# CONFIG_NET_PKTGEN is not set
25391 +# CONFIG_HAMRADIO is not set
25392 +# CONFIG_IRDA is not set
25393 +# CONFIG_BT is not set
25394 +# CONFIG_AF_RXRPC is not set
25395 +
25396 +#
25397 +# Wireless
25398 +#
25399 +# CONFIG_CFG80211 is not set
25400 +# CONFIG_WIRELESS_EXT is not set
25401 +# CONFIG_MAC80211 is not set
25402 +# CONFIG_IEEE80211 is not set
25403 +# CONFIG_RFKILL is not set
25404 +# CONFIG_NET_9P is not set
25405 +
25406 +#
25407 +# Device Drivers
25408 +#
25409 +
25410 +#
25411 +# Generic Driver Options
25412 +#
25413 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
25414 +CONFIG_STANDALONE=y
25415 +CONFIG_PREVENT_FIRMWARE_BUILD=y
25416 +CONFIG_FW_LOADER=y
25417 +# CONFIG_DEBUG_DRIVER is not set
25418 +# CONFIG_DEBUG_DEVRES is not set
25419 +# CONFIG_SYS_HYPERVISOR is not set
25420 +CONFIG_CONNECTOR=y
25421 +CONFIG_PROC_EVENTS=y
25422 +CONFIG_MTD=y
25423 +# CONFIG_MTD_DEBUG is not set
25424 +# CONFIG_MTD_CONCAT is not set
25425 +CONFIG_MTD_PARTITIONS=y
25426 +# CONFIG_MTD_REDBOOT_PARTS is not set
25427 +CONFIG_MTD_CMDLINE_PARTS=y
25428 +
25429 +#
25430 +# User Modules And Translation Layers
25431 +#
25432 +CONFIG_MTD_CHAR=y
25433 +CONFIG_MTD_BLKDEVS=m
25434 +CONFIG_MTD_BLOCK=m
25435 +# CONFIG_MTD_BLOCK_RO is not set
25436 +# CONFIG_FTL is not set
25437 +# CONFIG_NFTL is not set
25438 +# CONFIG_INFTL is not set
25439 +# CONFIG_RFD_FTL is not set
25440 +# CONFIG_SSFDC is not set
25441 +# CONFIG_MTD_OOPS is not set
25442 +
25443 +#
25444 +# RAM/ROM/Flash chip drivers
25445 +#
25446 +CONFIG_MTD_CFI=y
25447 +CONFIG_MTD_JEDECPROBE=y
25448 +CONFIG_MTD_GEN_PROBE=y
25449 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
25450 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
25451 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
25452 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
25453 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
25454 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
25455 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
25456 +CONFIG_MTD_CFI_I1=y
25457 +CONFIG_MTD_CFI_I2=y
25458 +# CONFIG_MTD_CFI_I4 is not set
25459 +# CONFIG_MTD_CFI_I8 is not set
25460 +# CONFIG_MTD_CFI_INTELEXT is not set
25461 +CONFIG_MTD_CFI_AMDSTD=y
25462 +# CONFIG_MTD_CFI_STAA is not set
25463 +CONFIG_MTD_CFI_UTIL=y
25464 +# CONFIG_MTD_RAM is not set
25465 +# CONFIG_MTD_ROM is not set
25466 +# CONFIG_MTD_ABSENT is not set
25467 +
25468 +#
25469 +# Mapping drivers for chip access
25470 +#
25471 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
25472 +# CONFIG_MTD_PHYSMAP is not set
25473 +CONFIG_MTD_PHYSMAP_OF=y
25474 +# CONFIG_MTD_INTEL_VR_NOR is not set
25475 +# CONFIG_MTD_PLATRAM is not set
25476 +
25477 +#
25478 +# Self-contained MTD device drivers
25479 +#
25480 +# CONFIG_MTD_PMC551 is not set
25481 +# CONFIG_MTD_SLRAM is not set
25482 +# CONFIG_MTD_PHRAM is not set
25483 +# CONFIG_MTD_MTDRAM is not set
25484 +# CONFIG_MTD_BLOCK2MTD is not set
25485 +
25486 +#
25487 +# Disk-On-Chip Device Drivers
25488 +#
25489 +# CONFIG_MTD_DOC2000 is not set
25490 +# CONFIG_MTD_DOC2001 is not set
25491 +# CONFIG_MTD_DOC2001PLUS is not set
25492 +# CONFIG_MTD_NAND is not set
25493 +# CONFIG_MTD_ONENAND is not set
25494 +
25495 +#
25496 +# UBI - Unsorted block images
25497 +#
25498 +# CONFIG_MTD_UBI is not set
25499 +CONFIG_OF_DEVICE=y
25500 +# CONFIG_PARPORT is not set
25501 +CONFIG_BLK_DEV=y
25502 +# CONFIG_BLK_DEV_FD is not set
25503 +# CONFIG_BLK_CPQ_DA is not set
25504 +# CONFIG_BLK_CPQ_CISS_DA is not set
25505 +# CONFIG_BLK_DEV_DAC960 is not set
25506 +# CONFIG_BLK_DEV_UMEM is not set
25507 +# CONFIG_BLK_DEV_COW_COMMON is not set
25508 +# CONFIG_BLK_DEV_LOOP is not set
25509 +# CONFIG_BLK_DEV_NBD is not set
25510 +# CONFIG_BLK_DEV_SX8 is not set
25511 +# CONFIG_BLK_DEV_UB is not set
25512 +CONFIG_BLK_DEV_RAM=y
25513 +CONFIG_BLK_DEV_RAM_COUNT=16
25514 +CONFIG_BLK_DEV_RAM_SIZE=35000
25515 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
25516 +# CONFIG_CDROM_PKTCDVD is not set
25517 +# CONFIG_ATA_OVER_ETH is not set
25518 +# CONFIG_XILINX_SYSACE is not set
25519 +CONFIG_MISC_DEVICES=y
25520 +# CONFIG_PHANTOM is not set
25521 +# CONFIG_EEPROM_93CX6 is not set
25522 +# CONFIG_SGI_IOC4 is not set
25523 +# CONFIG_TIFM_CORE is not set
25524 +# CONFIG_IDE is not set
25525 +
25526 +#
25527 +# SCSI device support
25528 +#
25529 +# CONFIG_RAID_ATTRS is not set
25530 +# CONFIG_SCSI is not set
25531 +# CONFIG_SCSI_DMA is not set
25532 +# CONFIG_SCSI_NETLINK is not set
25533 +# CONFIG_ATA is not set
25534 +# CONFIG_MD is not set
25535 +# CONFIG_FUSION is not set
25536 +
25537 +#
25538 +# IEEE 1394 (FireWire) support
25539 +#
25540 +# CONFIG_FIREWIRE is not set
25541 +# CONFIG_IEEE1394 is not set
25542 +# CONFIG_I2O is not set
25543 +# CONFIG_MACINTOSH_DRIVERS is not set
25544 +CONFIG_NETDEVICES=y
25545 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
25546 +# CONFIG_DUMMY is not set
25547 +# CONFIG_BONDING is not set
25548 +# CONFIG_MACVLAN is not set
25549 +# CONFIG_EQUALIZER is not set
25550 +# CONFIG_TUN is not set
25551 +# CONFIG_VETH is not set
25552 +# CONFIG_IP1000 is not set
25553 +# CONFIG_ARCNET is not set
25554 +# CONFIG_PHYLIB is not set
25555 +CONFIG_NET_ETHERNET=y
25556 +# CONFIG_MII is not set
25557 +# CONFIG_HAPPYMEAL is not set
25558 +# CONFIG_SUNGEM is not set
25559 +# CONFIG_CASSINI is not set
25560 +# CONFIG_NET_VENDOR_3COM is not set
25561 +# CONFIG_NET_TULIP is not set
25562 +# CONFIG_HP100 is not set
25563 +CONFIG_IBM_NEW_EMAC=y
25564 +CONFIG_IBM_NEW_EMAC_RXB=128
25565 +CONFIG_IBM_NEW_EMAC_TXB=64
25566 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
25567 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
25568 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
25569 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
25570 +CONFIG_IBM_NEW_EMAC_ZMII=y
25571 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
25572 +# CONFIG_IBM_NEW_EMAC_TAH is not set
25573 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
25574 +# CONFIG_NET_PCI is not set
25575 +# CONFIG_B44 is not set
25576 +CONFIG_NETDEV_1000=y
25577 +# CONFIG_ACENIC is not set
25578 +# CONFIG_DL2K is not set
25579 +# CONFIG_E1000 is not set
25580 +# CONFIG_E1000E is not set
25581 +# CONFIG_NS83820 is not set
25582 +# CONFIG_HAMACHI is not set
25583 +# CONFIG_YELLOWFIN is not set
25584 +# CONFIG_R8169 is not set
25585 +# CONFIG_SIS190 is not set
25586 +# CONFIG_SKGE is not set
25587 +# CONFIG_SKY2 is not set
25588 +# CONFIG_SK98LIN is not set
25589 +# CONFIG_VIA_VELOCITY is not set
25590 +# CONFIG_TIGON3 is not set
25591 +# CONFIG_BNX2 is not set
25592 +# CONFIG_QLA3XXX is not set
25593 +# CONFIG_ATL1 is not set
25594 +CONFIG_NETDEV_10000=y
25595 +# CONFIG_CHELSIO_T1 is not set
25596 +# CONFIG_CHELSIO_T3 is not set
25597 +# CONFIG_IXGBE is not set
25598 +# CONFIG_IXGB is not set
25599 +# CONFIG_S2IO is not set
25600 +# CONFIG_MYRI10GE is not set
25601 +# CONFIG_NETXEN_NIC is not set
25602 +# CONFIG_NIU is not set
25603 +# CONFIG_MLX4_CORE is not set
25604 +# CONFIG_TEHUTI is not set
25605 +# CONFIG_TR is not set
25606 +
25607 +#
25608 +# Wireless LAN
25609 +#
25610 +# CONFIG_WLAN_PRE80211 is not set
25611 +# CONFIG_WLAN_80211 is not set
25612 +
25613 +#
25614 +# USB Network Adapters
25615 +#
25616 +# CONFIG_USB_CATC is not set
25617 +# CONFIG_USB_KAWETH is not set
25618 +# CONFIG_USB_PEGASUS is not set
25619 +# CONFIG_USB_RTL8150 is not set
25620 +# CONFIG_USB_USBNET is not set
25621 +# CONFIG_WAN is not set
25622 +# CONFIG_FDDI is not set
25623 +# CONFIG_HIPPI is not set
25624 +# CONFIG_PPP is not set
25625 +# CONFIG_SLIP is not set
25626 +# CONFIG_SHAPER is not set
25627 +# CONFIG_NETCONSOLE is not set
25628 +# CONFIG_NETPOLL is not set
25629 +# CONFIG_NET_POLL_CONTROLLER is not set
25630 +# CONFIG_ISDN is not set
25631 +# CONFIG_PHONE is not set
25632 +
25633 +#
25634 +# Input device support
25635 +#
25636 +# CONFIG_INPUT is not set
25637 +
25638 +#
25639 +# Hardware I/O ports
25640 +#
25641 +# CONFIG_SERIO is not set
25642 +# CONFIG_GAMEPORT is not set
25643 +
25644 +#
25645 +# Character devices
25646 +#
25647 +# CONFIG_VT is not set
25648 +# CONFIG_SERIAL_NONSTANDARD is not set
25649 +
25650 +#
25651 +# Serial drivers
25652 +#
25653 +CONFIG_SERIAL_8250=y
25654 +CONFIG_SERIAL_8250_CONSOLE=y
25655 +CONFIG_SERIAL_8250_PCI=y
25656 +CONFIG_SERIAL_8250_NR_UARTS=4
25657 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
25658 +CONFIG_SERIAL_8250_EXTENDED=y
25659 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
25660 +CONFIG_SERIAL_8250_SHARE_IRQ=y
25661 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
25662 +# CONFIG_SERIAL_8250_RSA is not set
25663 +
25664 +#
25665 +# Non-8250 serial port support
25666 +#
25667 +# CONFIG_SERIAL_UARTLITE is not set
25668 +CONFIG_SERIAL_CORE=y
25669 +CONFIG_SERIAL_CORE_CONSOLE=y
25670 +# CONFIG_SERIAL_JSM is not set
25671 +CONFIG_SERIAL_OF_PLATFORM=y
25672 +CONFIG_UNIX98_PTYS=y
25673 +CONFIG_LEGACY_PTYS=y
25674 +CONFIG_LEGACY_PTY_COUNT=256
25675 +# CONFIG_IPMI_HANDLER is not set
25676 +# CONFIG_HW_RANDOM is not set
25677 +# CONFIG_NVRAM is not set
25678 +# CONFIG_GEN_RTC is not set
25679 +# CONFIG_R3964 is not set
25680 +# CONFIG_APPLICOM is not set
25681 +# CONFIG_RAW_DRIVER is not set
25682 +# CONFIG_TCG_TPM is not set
25683 +CONFIG_DEVPORT=y
25684 +# CONFIG_I2C is not set
25685 +
25686 +#
25687 +# SPI support
25688 +#
25689 +# CONFIG_SPI is not set
25690 +# CONFIG_SPI_MASTER is not set
25691 +# CONFIG_W1 is not set
25692 +# CONFIG_POWER_SUPPLY is not set
25693 +# CONFIG_HWMON is not set
25694 +# CONFIG_WATCHDOG is not set
25695 +
25696 +#
25697 +# Sonics Silicon Backplane
25698 +#
25699 +CONFIG_SSB_POSSIBLE=y
25700 +# CONFIG_SSB is not set
25701 +
25702 +#
25703 +# Multifunction device drivers
25704 +#
25705 +# CONFIG_MFD_SM501 is not set
25706 +
25707 +#
25708 +# Multimedia devices
25709 +#
25710 +# CONFIG_VIDEO_DEV is not set
25711 +# CONFIG_DVB_CORE is not set
25712 +# CONFIG_DAB is not set
25713 +
25714 +#
25715 +# Graphics support
25716 +#
25717 +# CONFIG_AGP is not set
25718 +# CONFIG_DRM is not set
25719 +# CONFIG_VGASTATE is not set
25720 +CONFIG_VIDEO_OUTPUT_CONTROL=m
25721 +# CONFIG_FB is not set
25722 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
25723 +
25724 +#
25725 +# Display device support
25726 +#
25727 +# CONFIG_DISPLAY_SUPPORT is not set
25728 +
25729 +#
25730 +# Sound
25731 +#
25732 +# CONFIG_SOUND is not set
25733 +CONFIG_USB_SUPPORT=y
25734 +CONFIG_USB_ARCH_HAS_HCD=y
25735 +CONFIG_USB_ARCH_HAS_OHCI=y
25736 +CONFIG_USB_ARCH_HAS_EHCI=y
25737 +CONFIG_USB=y
25738 +# CONFIG_USB_DEBUG is not set
25739 +
25740 +#
25741 +# Miscellaneous USB options
25742 +#
25743 +CONFIG_USB_DEVICEFS=y
25744 +CONFIG_USB_DEVICE_CLASS=y
25745 +# CONFIG_USB_DYNAMIC_MINORS is not set
25746 +# CONFIG_USB_OTG is not set
25747 +
25748 +#
25749 +# USB Host Controller Drivers
25750 +#
25751 +# CONFIG_USB_EHCI_HCD is not set
25752 +# CONFIG_USB_ISP116X_HCD is not set
25753 +CONFIG_USB_OHCI_HCD=y
25754 +CONFIG_USB_OHCI_HCD_PPC_OF=y
25755 +CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
25756 +CONFIG_USB_OHCI_HCD_PPC_OF_LE=y
25757 +CONFIG_USB_OHCI_HCD_PCI=y
25758 +CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
25759 +CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
25760 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
25761 +# CONFIG_USB_UHCI_HCD is not set
25762 +# CONFIG_USB_SL811_HCD is not set
25763 +# CONFIG_USB_R8A66597_HCD is not set
25764 +
25765 +#
25766 +# USB Device Class drivers
25767 +#
25768 +# CONFIG_USB_ACM is not set
25769 +# CONFIG_USB_PRINTER is not set
25770 +
25771 +#
25772 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
25773 +#
25774 +
25775 +#
25776 +# may also be needed; see USB_STORAGE Help for more information
25777 +#
25778 +# CONFIG_USB_LIBUSUAL is not set
25779 +
25780 +#
25781 +# USB Imaging devices
25782 +#
25783 +# CONFIG_USB_MDC800 is not set
25784 +CONFIG_USB_MON=y
25785 +
25786 +#
25787 +# USB port drivers
25788 +#
25789 +
25790 +#
25791 +# USB Serial Converter support
25792 +#
25793 +# CONFIG_USB_SERIAL is not set
25794 +
25795 +#
25796 +# USB Miscellaneous drivers
25797 +#
25798 +# CONFIG_USB_EMI62 is not set
25799 +# CONFIG_USB_EMI26 is not set
25800 +# CONFIG_USB_ADUTUX is not set
25801 +# CONFIG_USB_AUERSWALD is not set
25802 +# CONFIG_USB_RIO500 is not set
25803 +# CONFIG_USB_LEGOTOWER is not set
25804 +# CONFIG_USB_LCD is not set
25805 +# CONFIG_USB_BERRY_CHARGE is not set
25806 +# CONFIG_USB_LED is not set
25807 +# CONFIG_USB_CYPRESS_CY7C63 is not set
25808 +# CONFIG_USB_CYTHERM is not set
25809 +# CONFIG_USB_PHIDGET is not set
25810 +# CONFIG_USB_IDMOUSE is not set
25811 +# CONFIG_USB_FTDI_ELAN is not set
25812 +# CONFIG_USB_APPLEDISPLAY is not set
25813 +# CONFIG_USB_LD is not set
25814 +# CONFIG_USB_TRANCEVIBRATOR is not set
25815 +# CONFIG_USB_IOWARRIOR is not set
25816 +# CONFIG_USB_TEST is not set
25817 +
25818 +#
25819 +# USB DSL modem support
25820 +#
25821 +
25822 +#
25823 +# USB Gadget Support
25824 +#
25825 +# CONFIG_USB_GADGET is not set
25826 +# CONFIG_MMC is not set
25827 +# CONFIG_NEW_LEDS is not set
25828 +# CONFIG_INFINIBAND is not set
25829 +# CONFIG_EDAC is not set
25830 +# CONFIG_RTC_CLASS is not set
25831 +
25832 +#
25833 +# Userspace I/O
25834 +#
25835 +# CONFIG_UIO is not set
25836 +
25837 +#
25838 +# File systems
25839 +#
25840 +CONFIG_EXT2_FS=y
25841 +# CONFIG_EXT2_FS_XATTR is not set
25842 +# CONFIG_EXT2_FS_XIP is not set
25843 +# CONFIG_EXT3_FS is not set
25844 +# CONFIG_EXT4DEV_FS is not set
25845 +# CONFIG_REISERFS_FS is not set
25846 +# CONFIG_JFS_FS is not set
25847 +# CONFIG_FS_POSIX_ACL is not set
25848 +# CONFIG_XFS_FS is not set
25849 +# CONFIG_GFS2_FS is not set
25850 +# CONFIG_OCFS2_FS is not set
25851 +# CONFIG_MINIX_FS is not set
25852 +# CONFIG_ROMFS_FS is not set
25853 +CONFIG_INOTIFY=y
25854 +CONFIG_INOTIFY_USER=y
25855 +# CONFIG_QUOTA is not set
25856 +CONFIG_DNOTIFY=y
25857 +# CONFIG_AUTOFS_FS is not set
25858 +# CONFIG_AUTOFS4_FS is not set
25859 +# CONFIG_FUSE_FS is not set
25860 +
25861 +#
25862 +# CD-ROM/DVD Filesystems
25863 +#
25864 +# CONFIG_ISO9660_FS is not set
25865 +# CONFIG_UDF_FS is not set
25866 +
25867 +#
25868 +# DOS/FAT/NT Filesystems
25869 +#
25870 +# CONFIG_MSDOS_FS is not set
25871 +# CONFIG_VFAT_FS is not set
25872 +# CONFIG_NTFS_FS is not set
25873 +
25874 +#
25875 +# Pseudo filesystems
25876 +#
25877 +CONFIG_PROC_FS=y
25878 +CONFIG_PROC_KCORE=y
25879 +CONFIG_PROC_SYSCTL=y
25880 +CONFIG_SYSFS=y
25881 +CONFIG_TMPFS=y
25882 +# CONFIG_TMPFS_POSIX_ACL is not set
25883 +# CONFIG_HUGETLB_PAGE is not set
25884 +# CONFIG_CONFIGFS_FS is not set
25885 +
25886 +#
25887 +# Miscellaneous filesystems
25888 +#
25889 +# CONFIG_ADFS_FS is not set
25890 +# CONFIG_AFFS_FS is not set
25891 +# CONFIG_HFS_FS is not set
25892 +# CONFIG_HFSPLUS_FS is not set
25893 +# CONFIG_BEFS_FS is not set
25894 +# CONFIG_BFS_FS is not set
25895 +# CONFIG_EFS_FS is not set
25896 +# CONFIG_JFFS2_FS is not set
25897 +CONFIG_CRAMFS=y
25898 +# CONFIG_VXFS_FS is not set
25899 +# CONFIG_HPFS_FS is not set
25900 +# CONFIG_QNX4FS_FS is not set
25901 +# CONFIG_SYSV_FS is not set
25902 +# CONFIG_UFS_FS is not set
25903 +CONFIG_NETWORK_FILESYSTEMS=y
25904 +CONFIG_NFS_FS=y
25905 +CONFIG_NFS_V3=y
25906 +# CONFIG_NFS_V3_ACL is not set
25907 +# CONFIG_NFS_V4 is not set
25908 +# CONFIG_NFS_DIRECTIO is not set
25909 +# CONFIG_NFSD is not set
25910 +CONFIG_ROOT_NFS=y
25911 +CONFIG_LOCKD=y
25912 +CONFIG_LOCKD_V4=y
25913 +CONFIG_NFS_COMMON=y
25914 +CONFIG_SUNRPC=y
25915 +# CONFIG_SUNRPC_BIND34 is not set
25916 +# CONFIG_RPCSEC_GSS_KRB5 is not set
25917 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
25918 +# CONFIG_SMB_FS is not set
25919 +# CONFIG_CIFS is not set
25920 +# CONFIG_NCP_FS is not set
25921 +# CONFIG_CODA_FS is not set
25922 +# CONFIG_AFS_FS is not set
25923 +
25924 +#
25925 +# Partition Types
25926 +#
25927 +# CONFIG_PARTITION_ADVANCED is not set
25928 +CONFIG_MSDOS_PARTITION=y
25929 +# CONFIG_NLS is not set
25930 +# CONFIG_DLM is not set
25931 +# CONFIG_UCC_SLOW is not set
25932 +
25933 +#
25934 +# Library routines
25935 +#
25936 +CONFIG_BITREVERSE=y
25937 +# CONFIG_CRC_CCITT is not set
25938 +# CONFIG_CRC16 is not set
25939 +# CONFIG_CRC_ITU_T is not set
25940 +CONFIG_CRC32=y
25941 +# CONFIG_CRC7 is not set
25942 +# CONFIG_LIBCRC32C is not set
25943 +CONFIG_ZLIB_INFLATE=y
25944 +CONFIG_PLIST=y
25945 +CONFIG_HAS_IOMEM=y
25946 +CONFIG_HAS_IOPORT=y
25947 +CONFIG_HAS_DMA=y
25948 +CONFIG_INSTRUMENTATION=y
25949 +# CONFIG_PROFILING is not set
25950 +# CONFIG_KPROBES is not set
25951 +# CONFIG_MARKERS is not set
25952 +
25953 +#
25954 +# Kernel hacking
25955 +#
25956 +# CONFIG_PRINTK_TIME is not set
25957 +CONFIG_ENABLE_WARN_DEPRECATED=y
25958 +CONFIG_ENABLE_MUST_CHECK=y
25959 +CONFIG_MAGIC_SYSRQ=y
25960 +# CONFIG_UNUSED_SYMBOLS is not set
25961 +# CONFIG_DEBUG_FS is not set
25962 +# CONFIG_HEADERS_CHECK is not set
25963 +CONFIG_DEBUG_KERNEL=y
25964 +# CONFIG_DEBUG_SHIRQ is not set
25965 +CONFIG_DETECT_SOFTLOCKUP=y
25966 +CONFIG_SCHED_DEBUG=y
25967 +# CONFIG_SCHEDSTATS is not set
25968 +# CONFIG_TIMER_STATS is not set
25969 +# CONFIG_SLUB_DEBUG_ON is not set
25970 +# CONFIG_DEBUG_RT_MUTEXES is not set
25971 +# CONFIG_RT_MUTEX_TESTER is not set
25972 +# CONFIG_DEBUG_SPINLOCK is not set
25973 +# CONFIG_DEBUG_MUTEXES is not set
25974 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
25975 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
25976 +# CONFIG_DEBUG_KOBJECT is not set
25977 +CONFIG_DEBUG_BUGVERBOSE=y
25978 +# CONFIG_DEBUG_INFO is not set
25979 +# CONFIG_DEBUG_VM is not set
25980 +# CONFIG_DEBUG_LIST is not set
25981 +# CONFIG_DEBUG_SG is not set
25982 +CONFIG_FORCED_INLINING=y
25983 +# CONFIG_BOOT_PRINTK_DELAY is not set
25984 +# CONFIG_RCU_TORTURE_TEST is not set
25985 +# CONFIG_FAULT_INJECTION is not set
25986 +# CONFIG_SAMPLES is not set
25987 +# CONFIG_DEBUG_STACKOVERFLOW is not set
25988 +# CONFIG_DEBUG_STACK_USAGE is not set
25989 +# CONFIG_DEBUG_PAGEALLOC is not set
25990 +# CONFIG_DEBUGGER is not set
25991 +# CONFIG_BDI_SWITCH is not set
25992 +# CONFIG_PPC_EARLY_DEBUG is not set
25993 +
25994 +#
25995 +# Security options
25996 +#
25997 +# CONFIG_KEYS is not set
25998 +# CONFIG_SECURITY is not set
25999 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
26000 +CONFIG_CRYPTO=y
26001 +CONFIG_CRYPTO_ALGAPI=y
26002 +CONFIG_CRYPTO_BLKCIPHER=y
26003 +CONFIG_CRYPTO_MANAGER=y
26004 +# CONFIG_CRYPTO_HMAC is not set
26005 +# CONFIG_CRYPTO_XCBC is not set
26006 +# CONFIG_CRYPTO_NULL is not set
26007 +# CONFIG_CRYPTO_MD4 is not set
26008 +CONFIG_CRYPTO_MD5=y
26009 +# CONFIG_CRYPTO_SHA1 is not set
26010 +# CONFIG_CRYPTO_SHA256 is not set
26011 +# CONFIG_CRYPTO_SHA512 is not set
26012 +# CONFIG_CRYPTO_WP512 is not set
26013 +# CONFIG_CRYPTO_TGR192 is not set
26014 +# CONFIG_CRYPTO_GF128MUL is not set
26015 +CONFIG_CRYPTO_ECB=y
26016 +CONFIG_CRYPTO_CBC=y
26017 +CONFIG_CRYPTO_PCBC=y
26018 +# CONFIG_CRYPTO_LRW is not set
26019 +# CONFIG_CRYPTO_XTS is not set
26020 +# CONFIG_CRYPTO_CRYPTD is not set
26021 +CONFIG_CRYPTO_DES=y
26022 +# CONFIG_CRYPTO_FCRYPT is not set
26023 +# CONFIG_CRYPTO_BLOWFISH is not set
26024 +# CONFIG_CRYPTO_TWOFISH is not set
26025 +# CONFIG_CRYPTO_SERPENT is not set
26026 +# CONFIG_CRYPTO_AES is not set
26027 +# CONFIG_CRYPTO_CAST5 is not set
26028 +# CONFIG_CRYPTO_CAST6 is not set
26029 +# CONFIG_CRYPTO_TEA is not set
26030 +# CONFIG_CRYPTO_ARC4 is not set
26031 +# CONFIG_CRYPTO_KHAZAD is not set
26032 +# CONFIG_CRYPTO_ANUBIS is not set
26033 +# CONFIG_CRYPTO_SEED is not set
26034 +# CONFIG_CRYPTO_DEFLATE is not set
26035 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
26036 +# CONFIG_CRYPTO_CRC32C is not set
26037 +# CONFIG_CRYPTO_CAMELLIA is not set
26038 +# CONFIG_CRYPTO_TEST is not set
26039 +# CONFIG_CRYPTO_AUTHENC is not set
26040 +CONFIG_CRYPTO_HW=y
26041 +# CONFIG_PPC_CLOCK is not set
26042 --- /dev/null
26043 +++ b/arch/powerpc/configs/ep8248e_defconfig
26044 @@ -0,0 +1,821 @@
26045 +#
26046 +# Automatically generated make config: don't edit
26047 +# Linux kernel version: 2.6.24-rc6
26048 +# Fri Jan 11 14:02:06 2008
26049 +#
26050 +# CONFIG_PPC64 is not set
26051 +
26052 +#
26053 +# Processor support
26054 +#
26055 +CONFIG_6xx=y
26056 +# CONFIG_PPC_85xx is not set
26057 +# CONFIG_PPC_8xx is not set
26058 +# CONFIG_40x is not set
26059 +# CONFIG_44x is not set
26060 +# CONFIG_E200 is not set
26061 +CONFIG_PPC_FPU=y
26062 +CONFIG_PPC_STD_MMU=y
26063 +CONFIG_PPC_STD_MMU_32=y
26064 +# CONFIG_PPC_MM_SLICES is not set
26065 +# CONFIG_SMP is not set
26066 +CONFIG_PPC32=y
26067 +CONFIG_WORD_SIZE=32
26068 +CONFIG_PPC_MERGE=y
26069 +CONFIG_MMU=y
26070 +CONFIG_GENERIC_CMOS_UPDATE=y
26071 +CONFIG_GENERIC_TIME=y
26072 +CONFIG_GENERIC_TIME_VSYSCALL=y
26073 +CONFIG_GENERIC_CLOCKEVENTS=y
26074 +CONFIG_GENERIC_HARDIRQS=y
26075 +CONFIG_IRQ_PER_CPU=y
26076 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
26077 +CONFIG_ARCH_HAS_ILOG2_U32=y
26078 +CONFIG_GENERIC_HWEIGHT=y
26079 +CONFIG_GENERIC_CALIBRATE_DELAY=y
26080 +CONFIG_GENERIC_FIND_NEXT_BIT=y
26081 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
26082 +CONFIG_PPC=y
26083 +CONFIG_EARLY_PRINTK=y
26084 +CONFIG_GENERIC_NVRAM=y
26085 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
26086 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
26087 +CONFIG_PPC_OF=y
26088 +CONFIG_OF=y
26089 +# CONFIG_PPC_UDBG_16550 is not set
26090 +# CONFIG_GENERIC_TBSYNC is not set
26091 +CONFIG_AUDIT_ARCH=y
26092 +CONFIG_GENERIC_BUG=y
26093 +# CONFIG_DEFAULT_UIMAGE is not set
26094 +# CONFIG_PPC_DCR_NATIVE is not set
26095 +# CONFIG_PPC_DCR_MMIO is not set
26096 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
26097 +
26098 +#
26099 +# General setup
26100 +#
26101 +# CONFIG_EXPERIMENTAL is not set
26102 +CONFIG_BROKEN_ON_SMP=y
26103 +CONFIG_INIT_ENV_ARG_LIMIT=32
26104 +CONFIG_LOCALVERSION=""
26105 +CONFIG_LOCALVERSION_AUTO=y
26106 +CONFIG_SWAP=y
26107 +CONFIG_SYSVIPC=y
26108 +CONFIG_SYSVIPC_SYSCTL=y
26109 +# CONFIG_BSD_PROCESS_ACCT is not set
26110 +# CONFIG_TASKSTATS is not set
26111 +# CONFIG_AUDIT is not set
26112 +CONFIG_IKCONFIG=y
26113 +CONFIG_IKCONFIG_PROC=y
26114 +CONFIG_LOG_BUF_SHIFT=14
26115 +# CONFIG_CGROUPS is not set
26116 +CONFIG_FAIR_GROUP_SCHED=y
26117 +CONFIG_FAIR_USER_SCHED=y
26118 +# CONFIG_FAIR_CGROUP_SCHED is not set
26119 +CONFIG_SYSFS_DEPRECATED=y
26120 +# CONFIG_RELAY is not set
26121 +# CONFIG_BLK_DEV_INITRD is not set
26122 +CONFIG_SYSCTL=y
26123 +CONFIG_EMBEDDED=y
26124 +CONFIG_SYSCTL_SYSCALL=y
26125 +CONFIG_KALLSYMS=y
26126 +CONFIG_KALLSYMS_ALL=y
26127 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
26128 +CONFIG_HOTPLUG=y
26129 +CONFIG_PRINTK=y
26130 +CONFIG_BUG=y
26131 +CONFIG_ELF_CORE=y
26132 +CONFIG_BASE_FULL=y
26133 +CONFIG_FUTEX=y
26134 +CONFIG_ANON_INODES=y
26135 +CONFIG_EPOLL=y
26136 +CONFIG_SIGNALFD=y
26137 +CONFIG_EVENTFD=y
26138 +CONFIG_SHMEM=y
26139 +CONFIG_VM_EVENT_COUNTERS=y
26140 +CONFIG_SLAB=y
26141 +# CONFIG_SLUB is not set
26142 +# CONFIG_SLOB is not set
26143 +CONFIG_RT_MUTEXES=y
26144 +# CONFIG_TINY_SHMEM is not set
26145 +CONFIG_BASE_SMALL=0
26146 +# CONFIG_MODULES is not set
26147 +CONFIG_BLOCK=y
26148 +# CONFIG_LBD is not set
26149 +# CONFIG_BLK_DEV_IO_TRACE is not set
26150 +# CONFIG_LSF is not set
26151 +
26152 +#
26153 +# IO Schedulers
26154 +#
26155 +CONFIG_IOSCHED_NOOP=y
26156 +# CONFIG_IOSCHED_AS is not set
26157 +CONFIG_IOSCHED_DEADLINE=y
26158 +# CONFIG_IOSCHED_CFQ is not set
26159 +# CONFIG_DEFAULT_AS is not set
26160 +CONFIG_DEFAULT_DEADLINE=y
26161 +# CONFIG_DEFAULT_CFQ is not set
26162 +# CONFIG_DEFAULT_NOOP is not set
26163 +CONFIG_DEFAULT_IOSCHED="deadline"
26164 +
26165 +#
26166 +# Platform support
26167 +#
26168 +# CONFIG_PPC_MULTIPLATFORM is not set
26169 +CONFIG_PPC_82xx=y
26170 +# CONFIG_PPC_83xx is not set
26171 +# CONFIG_PPC_86xx is not set
26172 +# CONFIG_PPC_MPC52xx is not set
26173 +# CONFIG_PPC_MPC5200 is not set
26174 +# CONFIG_PPC_CELL is not set
26175 +# CONFIG_PPC_CELL_NATIVE is not set
26176 +# CONFIG_MPC8272_ADS is not set
26177 +# CONFIG_PQ2FADS is not set
26178 +CONFIG_EP8248E=y
26179 +# CONFIG_PQ2ADS is not set
26180 +CONFIG_8260=y
26181 +CONFIG_8272=y
26182 +# CONFIG_MPIC is not set
26183 +# CONFIG_MPIC_WEIRD is not set
26184 +# CONFIG_PPC_I8259 is not set
26185 +# CONFIG_PPC_RTAS is not set
26186 +# CONFIG_MMIO_NVRAM is not set
26187 +# CONFIG_PPC_MPC106 is not set
26188 +# CONFIG_PPC_970_NAP is not set
26189 +# CONFIG_PPC_INDIRECT_IO is not set
26190 +# CONFIG_GENERIC_IOMAP is not set
26191 +# CONFIG_CPU_FREQ is not set
26192 +CONFIG_CPM2=y
26193 +CONFIG_PPC_CPM_NEW_BINDING=y
26194 +# CONFIG_FSL_ULI1575 is not set
26195 +CONFIG_CPM=y
26196 +
26197 +#
26198 +# Kernel options
26199 +#
26200 +# CONFIG_HIGHMEM is not set
26201 +# CONFIG_TICK_ONESHOT is not set
26202 +# CONFIG_NO_HZ is not set
26203 +# CONFIG_HIGH_RES_TIMERS is not set
26204 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
26205 +# CONFIG_HZ_100 is not set
26206 +CONFIG_HZ_250=y
26207 +# CONFIG_HZ_300 is not set
26208 +# CONFIG_HZ_1000 is not set
26209 +CONFIG_HZ=250
26210 +CONFIG_PREEMPT_NONE=y
26211 +# CONFIG_PREEMPT_VOLUNTARY is not set
26212 +# CONFIG_PREEMPT is not set
26213 +CONFIG_BINFMT_ELF=y
26214 +CONFIG_BINFMT_MISC=y
26215 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
26216 +CONFIG_ARCH_FLATMEM_ENABLE=y
26217 +CONFIG_ARCH_POPULATES_NODE_MAP=y
26218 +CONFIG_FLATMEM=y
26219 +CONFIG_FLAT_NODE_MEM_MAP=y
26220 +# CONFIG_SPARSEMEM_STATIC is not set
26221 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
26222 +CONFIG_SPLIT_PTLOCK_CPUS=4
26223 +# CONFIG_RESOURCES_64BIT is not set
26224 +CONFIG_ZONE_DMA_FLAG=1
26225 +CONFIG_BOUNCE=y
26226 +CONFIG_VIRT_TO_BUS=y
26227 +CONFIG_PROC_DEVICETREE=y
26228 +# CONFIG_CMDLINE_BOOL is not set
26229 +# CONFIG_PM is not set
26230 +CONFIG_SUSPEND_UP_POSSIBLE=y
26231 +CONFIG_HIBERNATION_UP_POSSIBLE=y
26232 +# CONFIG_SECCOMP is not set
26233 +CONFIG_WANT_DEVICE_TREE=y
26234 +CONFIG_DEVICE_TREE="ep8248e.dts"
26235 +CONFIG_ISA_DMA_API=y
26236 +
26237 +#
26238 +# Bus options
26239 +#
26240 +CONFIG_ZONE_DMA=y
26241 +CONFIG_FSL_SOC=y
26242 +# CONFIG_PCI is not set
26243 +# CONFIG_PCI_DOMAINS is not set
26244 +# CONFIG_PCI_SYSCALL is not set
26245 +# CONFIG_ARCH_SUPPORTS_MSI is not set
26246 +# CONFIG_PCCARD is not set
26247 +
26248 +#
26249 +# Advanced setup
26250 +#
26251 +# CONFIG_ADVANCED_OPTIONS is not set
26252 +
26253 +#
26254 +# Default settings for advanced configuration options are used
26255 +#
26256 +CONFIG_HIGHMEM_START=0xfe000000
26257 +CONFIG_LOWMEM_SIZE=0x30000000
26258 +CONFIG_KERNEL_START=0xc0000000
26259 +CONFIG_TASK_SIZE=0xc0000000
26260 +CONFIG_BOOT_LOAD=0x00400000
26261 +
26262 +#
26263 +# Networking
26264 +#
26265 +CONFIG_NET=y
26266 +
26267 +#
26268 +# Networking options
26269 +#
26270 +CONFIG_PACKET=y
26271 +# CONFIG_PACKET_MMAP is not set
26272 +CONFIG_UNIX=y
26273 +CONFIG_XFRM=y
26274 +# CONFIG_XFRM_USER is not set
26275 +# CONFIG_NET_KEY is not set
26276 +CONFIG_INET=y
26277 +CONFIG_IP_MULTICAST=y
26278 +# CONFIG_IP_ADVANCED_ROUTER is not set
26279 +CONFIG_IP_FIB_HASH=y
26280 +CONFIG_IP_PNP=y
26281 +CONFIG_IP_PNP_DHCP=y
26282 +CONFIG_IP_PNP_BOOTP=y
26283 +# CONFIG_IP_PNP_RARP is not set
26284 +# CONFIG_NET_IPIP is not set
26285 +# CONFIG_NET_IPGRE is not set
26286 +# CONFIG_IP_MROUTE is not set
26287 +CONFIG_SYN_COOKIES=y
26288 +# CONFIG_INET_AH is not set
26289 +# CONFIG_INET_ESP is not set
26290 +# CONFIG_INET_IPCOMP is not set
26291 +# CONFIG_INET_XFRM_TUNNEL is not set
26292 +CONFIG_INET_TUNNEL=y
26293 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
26294 +CONFIG_INET_XFRM_MODE_TUNNEL=y
26295 +CONFIG_INET_XFRM_MODE_BEET=y
26296 +# CONFIG_INET_LRO is not set
26297 +CONFIG_INET_DIAG=y
26298 +CONFIG_INET_TCP_DIAG=y
26299 +# CONFIG_TCP_CONG_ADVANCED is not set
26300 +CONFIG_TCP_CONG_CUBIC=y
26301 +CONFIG_DEFAULT_TCP_CONG="cubic"
26302 +# CONFIG_IP_VS is not set
26303 +CONFIG_IPV6=y
26304 +# CONFIG_IPV6_PRIVACY is not set
26305 +# CONFIG_IPV6_ROUTER_PREF is not set
26306 +# CONFIG_INET6_AH is not set
26307 +# CONFIG_INET6_ESP is not set
26308 +# CONFIG_INET6_IPCOMP is not set
26309 +# CONFIG_INET6_XFRM_TUNNEL is not set
26310 +# CONFIG_INET6_TUNNEL is not set
26311 +CONFIG_INET6_XFRM_MODE_TRANSPORT=y
26312 +CONFIG_INET6_XFRM_MODE_TUNNEL=y
26313 +CONFIG_INET6_XFRM_MODE_BEET=y
26314 +CONFIG_IPV6_SIT=y
26315 +# CONFIG_IPV6_TUNNEL is not set
26316 +# CONFIG_NETWORK_SECMARK is not set
26317 +CONFIG_NETFILTER=y
26318 +# CONFIG_NETFILTER_DEBUG is not set
26319 +
26320 +#
26321 +# Core Netfilter Configuration
26322 +#
26323 +# CONFIG_NETFILTER_NETLINK is not set
26324 +# CONFIG_NF_CONNTRACK_ENABLED is not set
26325 +# CONFIG_NF_CONNTRACK is not set
26326 +# CONFIG_NETFILTER_XTABLES is not set
26327 +
26328 +#
26329 +# IP: Netfilter Configuration
26330 +#
26331 +# CONFIG_IP_NF_QUEUE is not set
26332 +# CONFIG_IP_NF_IPTABLES is not set
26333 +# CONFIG_IP_NF_ARPTABLES is not set
26334 +# CONFIG_BRIDGE is not set
26335 +# CONFIG_VLAN_8021Q is not set
26336 +# CONFIG_DECNET is not set
26337 +# CONFIG_LLC2 is not set
26338 +# CONFIG_IPX is not set
26339 +# CONFIG_ATALK is not set
26340 +# CONFIG_NET_SCHED is not set
26341 +
26342 +#
26343 +# Network testing
26344 +#
26345 +# CONFIG_NET_PKTGEN is not set
26346 +# CONFIG_HAMRADIO is not set
26347 +# CONFIG_IRDA is not set
26348 +# CONFIG_BT is not set
26349 +
26350 +#
26351 +# Wireless
26352 +#
26353 +# CONFIG_CFG80211 is not set
26354 +# CONFIG_WIRELESS_EXT is not set
26355 +# CONFIG_IEEE80211 is not set
26356 +# CONFIG_RFKILL is not set
26357 +
26358 +#
26359 +# Device Drivers
26360 +#
26361 +
26362 +#
26363 +# Generic Driver Options
26364 +#
26365 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
26366 +CONFIG_STANDALONE=y
26367 +CONFIG_PREVENT_FIRMWARE_BUILD=y
26368 +# CONFIG_FW_LOADER is not set
26369 +# CONFIG_DEBUG_DRIVER is not set
26370 +# CONFIG_DEBUG_DEVRES is not set
26371 +# CONFIG_SYS_HYPERVISOR is not set
26372 +# CONFIG_CONNECTOR is not set
26373 +CONFIG_MTD=y
26374 +# CONFIG_MTD_DEBUG is not set
26375 +# CONFIG_MTD_CONCAT is not set
26376 +# CONFIG_MTD_PARTITIONS is not set
26377 +
26378 +#
26379 +# User Modules And Translation Layers
26380 +#
26381 +CONFIG_MTD_CHAR=y
26382 +CONFIG_MTD_BLKDEVS=y
26383 +CONFIG_MTD_BLOCK=y
26384 +# CONFIG_FTL is not set
26385 +# CONFIG_NFTL is not set
26386 +# CONFIG_INFTL is not set
26387 +# CONFIG_RFD_FTL is not set
26388 +# CONFIG_SSFDC is not set
26389 +# CONFIG_MTD_OOPS is not set
26390 +
26391 +#
26392 +# RAM/ROM/Flash chip drivers
26393 +#
26394 +CONFIG_MTD_CFI=y
26395 +# CONFIG_MTD_JEDECPROBE is not set
26396 +CONFIG_MTD_GEN_PROBE=y
26397 +CONFIG_MTD_CFI_ADV_OPTIONS=y
26398 +CONFIG_MTD_CFI_NOSWAP=y
26399 +# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
26400 +# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
26401 +CONFIG_MTD_CFI_GEOMETRY=y
26402 +# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
26403 +# CONFIG_MTD_MAP_BANK_WIDTH_2 is not set
26404 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
26405 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
26406 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
26407 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
26408 +# CONFIG_MTD_CFI_I1 is not set
26409 +CONFIG_MTD_CFI_I2=y
26410 +# CONFIG_MTD_CFI_I4 is not set
26411 +# CONFIG_MTD_CFI_I8 is not set
26412 +# CONFIG_MTD_OTP is not set
26413 +# CONFIG_MTD_CFI_INTELEXT is not set
26414 +CONFIG_MTD_CFI_AMDSTD=y
26415 +# CONFIG_MTD_CFI_STAA is not set
26416 +CONFIG_MTD_CFI_UTIL=y
26417 +# CONFIG_MTD_RAM is not set
26418 +# CONFIG_MTD_ROM is not set
26419 +# CONFIG_MTD_ABSENT is not set
26420 +
26421 +#
26422 +# Mapping drivers for chip access
26423 +#
26424 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
26425 +# CONFIG_MTD_PHYSMAP is not set
26426 +CONFIG_MTD_PHYSMAP_OF=y
26427 +# CONFIG_MTD_PLATRAM is not set
26428 +
26429 +#
26430 +# Self-contained MTD device drivers
26431 +#
26432 +# CONFIG_MTD_SLRAM is not set
26433 +# CONFIG_MTD_PHRAM is not set
26434 +# CONFIG_MTD_MTDRAM is not set
26435 +# CONFIG_MTD_BLOCK2MTD is not set
26436 +
26437 +#
26438 +# Disk-On-Chip Device Drivers
26439 +#
26440 +# CONFIG_MTD_DOC2000 is not set
26441 +# CONFIG_MTD_DOC2001 is not set
26442 +# CONFIG_MTD_DOC2001PLUS is not set
26443 +# CONFIG_MTD_NAND is not set
26444 +# CONFIG_MTD_ONENAND is not set
26445 +
26446 +#
26447 +# UBI - Unsorted block images
26448 +#
26449 +# CONFIG_MTD_UBI is not set
26450 +CONFIG_OF_DEVICE=y
26451 +# CONFIG_PARPORT is not set
26452 +CONFIG_BLK_DEV=y
26453 +# CONFIG_BLK_DEV_FD is not set
26454 +# CONFIG_BLK_DEV_COW_COMMON is not set
26455 +CONFIG_BLK_DEV_LOOP=y
26456 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
26457 +# CONFIG_BLK_DEV_NBD is not set
26458 +# CONFIG_BLK_DEV_RAM is not set
26459 +# CONFIG_CDROM_PKTCDVD is not set
26460 +# CONFIG_ATA_OVER_ETH is not set
26461 +# CONFIG_MISC_DEVICES is not set
26462 +# CONFIG_IDE is not set
26463 +
26464 +#
26465 +# SCSI device support
26466 +#
26467 +# CONFIG_RAID_ATTRS is not set
26468 +# CONFIG_SCSI is not set
26469 +# CONFIG_SCSI_DMA is not set
26470 +# CONFIG_SCSI_NETLINK is not set
26471 +# CONFIG_ATA is not set
26472 +# CONFIG_MD is not set
26473 +# CONFIG_MACINTOSH_DRIVERS is not set
26474 +CONFIG_NETDEVICES=y
26475 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
26476 +# CONFIG_DUMMY is not set
26477 +# CONFIG_BONDING is not set
26478 +# CONFIG_EQUALIZER is not set
26479 +# CONFIG_TUN is not set
26480 +# CONFIG_VETH is not set
26481 +CONFIG_PHYLIB=y
26482 +
26483 +#
26484 +# MII PHY device drivers
26485 +#
26486 +# CONFIG_MARVELL_PHY is not set
26487 +CONFIG_DAVICOM_PHY=y
26488 +# CONFIG_QSEMI_PHY is not set
26489 +# CONFIG_LXT_PHY is not set
26490 +# CONFIG_CICADA_PHY is not set
26491 +# CONFIG_VITESSE_PHY is not set
26492 +# CONFIG_SMSC_PHY is not set
26493 +# CONFIG_BROADCOM_PHY is not set
26494 +# CONFIG_ICPLUS_PHY is not set
26495 +# CONFIG_FIXED_PHY is not set
26496 +CONFIG_MDIO_BITBANG=y
26497 +CONFIG_NET_ETHERNET=y
26498 +CONFIG_MII=y
26499 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
26500 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
26501 +# CONFIG_IBM_NEW_EMAC_TAH is not set
26502 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
26503 +# CONFIG_B44 is not set
26504 +CONFIG_FS_ENET=y
26505 +# CONFIG_FS_ENET_HAS_SCC is not set
26506 +CONFIG_FS_ENET_HAS_FCC=y
26507 +# CONFIG_FS_ENET_MDIO_FCC is not set
26508 +CONFIG_NETDEV_1000=y
26509 +CONFIG_NETDEV_10000=y
26510 +
26511 +#
26512 +# Wireless LAN
26513 +#
26514 +# CONFIG_WLAN_PRE80211 is not set
26515 +# CONFIG_WLAN_80211 is not set
26516 +# CONFIG_WAN is not set
26517 +# CONFIG_PPP is not set
26518 +# CONFIG_SLIP is not set
26519 +# CONFIG_NETPOLL is not set
26520 +# CONFIG_NET_POLL_CONTROLLER is not set
26521 +# CONFIG_ISDN is not set
26522 +# CONFIG_PHONE is not set
26523 +
26524 +#
26525 +# Input device support
26526 +#
26527 +# CONFIG_INPUT is not set
26528 +
26529 +#
26530 +# Hardware I/O ports
26531 +#
26532 +# CONFIG_SERIO is not set
26533 +# CONFIG_GAMEPORT is not set
26534 +
26535 +#
26536 +# Character devices
26537 +#
26538 +# CONFIG_VT is not set
26539 +# CONFIG_SERIAL_NONSTANDARD is not set
26540 +
26541 +#
26542 +# Serial drivers
26543 +#
26544 +# CONFIG_SERIAL_8250 is not set
26545 +
26546 +#
26547 +# Non-8250 serial port support
26548 +#
26549 +# CONFIG_SERIAL_UARTLITE is not set
26550 +CONFIG_SERIAL_CORE=y
26551 +CONFIG_SERIAL_CORE_CONSOLE=y
26552 +CONFIG_SERIAL_CPM=y
26553 +CONFIG_SERIAL_CPM_CONSOLE=y
26554 +CONFIG_SERIAL_CPM_SCC1=y
26555 +# CONFIG_SERIAL_CPM_SCC2 is not set
26556 +# CONFIG_SERIAL_CPM_SCC3 is not set
26557 +CONFIG_SERIAL_CPM_SCC4=y
26558 +# CONFIG_SERIAL_CPM_SMC1 is not set
26559 +# CONFIG_SERIAL_CPM_SMC2 is not set
26560 +CONFIG_UNIX98_PTYS=y
26561 +CONFIG_LEGACY_PTYS=y
26562 +CONFIG_LEGACY_PTY_COUNT=256
26563 +# CONFIG_IPMI_HANDLER is not set
26564 +CONFIG_HW_RANDOM=y
26565 +# CONFIG_NVRAM is not set
26566 +# CONFIG_GEN_RTC is not set
26567 +# CONFIG_R3964 is not set
26568 +# CONFIG_RAW_DRIVER is not set
26569 +# CONFIG_I2C is not set
26570 +
26571 +#
26572 +# SPI support
26573 +#
26574 +# CONFIG_SPI is not set
26575 +# CONFIG_SPI_MASTER is not set
26576 +# CONFIG_W1 is not set
26577 +# CONFIG_POWER_SUPPLY is not set
26578 +# CONFIG_HWMON is not set
26579 +# CONFIG_WATCHDOG is not set
26580 +
26581 +#
26582 +# Sonics Silicon Backplane
26583 +#
26584 +CONFIG_SSB_POSSIBLE=y
26585 +# CONFIG_SSB is not set
26586 +
26587 +#
26588 +# Multifunction device drivers
26589 +#
26590 +# CONFIG_MFD_SM501 is not set
26591 +
26592 +#
26593 +# Multimedia devices
26594 +#
26595 +# CONFIG_VIDEO_DEV is not set
26596 +# CONFIG_DVB_CORE is not set
26597 +CONFIG_DAB=y
26598 +
26599 +#
26600 +# Graphics support
26601 +#
26602 +# CONFIG_VGASTATE is not set
26603 +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
26604 +# CONFIG_FB is not set
26605 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
26606 +
26607 +#
26608 +# Display device support
26609 +#
26610 +# CONFIG_DISPLAY_SUPPORT is not set
26611 +
26612 +#
26613 +# Sound
26614 +#
26615 +# CONFIG_SOUND is not set
26616 +# CONFIG_USB_SUPPORT is not set
26617 +# CONFIG_MMC is not set
26618 +# CONFIG_NEW_LEDS is not set
26619 +# CONFIG_RTC_CLASS is not set
26620 +
26621 +#
26622 +# Userspace I/O
26623 +#
26624 +# CONFIG_UIO is not set
26625 +
26626 +#
26627 +# File systems
26628 +#
26629 +CONFIG_EXT2_FS=y
26630 +# CONFIG_EXT2_FS_XATTR is not set
26631 +# CONFIG_EXT2_FS_XIP is not set
26632 +CONFIG_EXT3_FS=y
26633 +# CONFIG_EXT3_FS_XATTR is not set
26634 +CONFIG_JBD=y
26635 +# CONFIG_REISERFS_FS is not set
26636 +# CONFIG_JFS_FS is not set
26637 +# CONFIG_FS_POSIX_ACL is not set
26638 +# CONFIG_XFS_FS is not set
26639 +# CONFIG_OCFS2_FS is not set
26640 +# CONFIG_MINIX_FS is not set
26641 +# CONFIG_ROMFS_FS is not set
26642 +CONFIG_INOTIFY=y
26643 +CONFIG_INOTIFY_USER=y
26644 +# CONFIG_QUOTA is not set
26645 +CONFIG_DNOTIFY=y
26646 +# CONFIG_AUTOFS_FS is not set
26647 +CONFIG_AUTOFS4_FS=y
26648 +# CONFIG_FUSE_FS is not set
26649 +
26650 +#
26651 +# CD-ROM/DVD Filesystems
26652 +#
26653 +# CONFIG_ISO9660_FS is not set
26654 +# CONFIG_UDF_FS is not set
26655 +
26656 +#
26657 +# DOS/FAT/NT Filesystems
26658 +#
26659 +# CONFIG_MSDOS_FS is not set
26660 +# CONFIG_VFAT_FS is not set
26661 +# CONFIG_NTFS_FS is not set
26662 +
26663 +#
26664 +# Pseudo filesystems
26665 +#
26666 +CONFIG_PROC_FS=y
26667 +CONFIG_PROC_KCORE=y
26668 +CONFIG_PROC_SYSCTL=y
26669 +CONFIG_SYSFS=y
26670 +CONFIG_TMPFS=y
26671 +# CONFIG_TMPFS_POSIX_ACL is not set
26672 +# CONFIG_HUGETLB_PAGE is not set
26673 +
26674 +#
26675 +# Miscellaneous filesystems
26676 +#
26677 +# CONFIG_HFSPLUS_FS is not set
26678 +# CONFIG_JFFS2_FS is not set
26679 +CONFIG_CRAMFS=y
26680 +# CONFIG_VXFS_FS is not set
26681 +# CONFIG_HPFS_FS is not set
26682 +# CONFIG_QNX4FS_FS is not set
26683 +# CONFIG_SYSV_FS is not set
26684 +# CONFIG_UFS_FS is not set
26685 +CONFIG_NETWORK_FILESYSTEMS=y
26686 +CONFIG_NFS_FS=y
26687 +CONFIG_NFS_V3=y
26688 +# CONFIG_NFS_V3_ACL is not set
26689 +# CONFIG_NFS_DIRECTIO is not set
26690 +# CONFIG_NFSD is not set
26691 +CONFIG_ROOT_NFS=y
26692 +CONFIG_LOCKD=y
26693 +CONFIG_LOCKD_V4=y
26694 +CONFIG_NFS_COMMON=y
26695 +CONFIG_SUNRPC=y
26696 +# CONFIG_SMB_FS is not set
26697 +# CONFIG_CIFS is not set
26698 +# CONFIG_NCP_FS is not set
26699 +# CONFIG_CODA_FS is not set
26700 +
26701 +#
26702 +# Partition Types
26703 +#
26704 +CONFIG_PARTITION_ADVANCED=y
26705 +# CONFIG_ACORN_PARTITION is not set
26706 +# CONFIG_OSF_PARTITION is not set
26707 +# CONFIG_AMIGA_PARTITION is not set
26708 +# CONFIG_ATARI_PARTITION is not set
26709 +# CONFIG_MAC_PARTITION is not set
26710 +CONFIG_MSDOS_PARTITION=y
26711 +# CONFIG_BSD_DISKLABEL is not set
26712 +# CONFIG_MINIX_SUBPARTITION is not set
26713 +# CONFIG_SOLARIS_X86_PARTITION is not set
26714 +# CONFIG_UNIXWARE_DISKLABEL is not set
26715 +# CONFIG_LDM_PARTITION is not set
26716 +# CONFIG_SGI_PARTITION is not set
26717 +# CONFIG_ULTRIX_PARTITION is not set
26718 +# CONFIG_SUN_PARTITION is not set
26719 +# CONFIG_KARMA_PARTITION is not set
26720 +# CONFIG_EFI_PARTITION is not set
26721 +# CONFIG_SYSV68_PARTITION is not set
26722 +CONFIG_NLS=y
26723 +CONFIG_NLS_DEFAULT="iso8859-1"
26724 +CONFIG_NLS_CODEPAGE_437=y
26725 +# CONFIG_NLS_CODEPAGE_737 is not set
26726 +# CONFIG_NLS_CODEPAGE_775 is not set
26727 +# CONFIG_NLS_CODEPAGE_850 is not set
26728 +# CONFIG_NLS_CODEPAGE_852 is not set
26729 +# CONFIG_NLS_CODEPAGE_855 is not set
26730 +# CONFIG_NLS_CODEPAGE_857 is not set
26731 +# CONFIG_NLS_CODEPAGE_860 is not set
26732 +# CONFIG_NLS_CODEPAGE_861 is not set
26733 +# CONFIG_NLS_CODEPAGE_862 is not set
26734 +# CONFIG_NLS_CODEPAGE_863 is not set
26735 +# CONFIG_NLS_CODEPAGE_864 is not set
26736 +# CONFIG_NLS_CODEPAGE_865 is not set
26737 +# CONFIG_NLS_CODEPAGE_866 is not set
26738 +# CONFIG_NLS_CODEPAGE_869 is not set
26739 +# CONFIG_NLS_CODEPAGE_936 is not set
26740 +# CONFIG_NLS_CODEPAGE_950 is not set
26741 +# CONFIG_NLS_CODEPAGE_932 is not set
26742 +# CONFIG_NLS_CODEPAGE_949 is not set
26743 +# CONFIG_NLS_CODEPAGE_874 is not set
26744 +# CONFIG_NLS_ISO8859_8 is not set
26745 +# CONFIG_NLS_CODEPAGE_1250 is not set
26746 +# CONFIG_NLS_CODEPAGE_1251 is not set
26747 +CONFIG_NLS_ASCII=y
26748 +CONFIG_NLS_ISO8859_1=y
26749 +# CONFIG_NLS_ISO8859_2 is not set
26750 +# CONFIG_NLS_ISO8859_3 is not set
26751 +# CONFIG_NLS_ISO8859_4 is not set
26752 +# CONFIG_NLS_ISO8859_5 is not set
26753 +# CONFIG_NLS_ISO8859_6 is not set
26754 +# CONFIG_NLS_ISO8859_7 is not set
26755 +# CONFIG_NLS_ISO8859_9 is not set
26756 +# CONFIG_NLS_ISO8859_13 is not set
26757 +# CONFIG_NLS_ISO8859_14 is not set
26758 +# CONFIG_NLS_ISO8859_15 is not set
26759 +# CONFIG_NLS_KOI8_R is not set
26760 +# CONFIG_NLS_KOI8_U is not set
26761 +CONFIG_NLS_UTF8=y
26762 +# CONFIG_UCC_SLOW is not set
26763 +
26764 +#
26765 +# Library routines
26766 +#
26767 +# CONFIG_CRC_CCITT is not set
26768 +# CONFIG_CRC16 is not set
26769 +# CONFIG_CRC_ITU_T is not set
26770 +# CONFIG_CRC32 is not set
26771 +# CONFIG_CRC7 is not set
26772 +# CONFIG_LIBCRC32C is not set
26773 +CONFIG_ZLIB_INFLATE=y
26774 +CONFIG_PLIST=y
26775 +CONFIG_HAS_IOMEM=y
26776 +CONFIG_HAS_IOPORT=y
26777 +CONFIG_HAS_DMA=y
26778 +CONFIG_INSTRUMENTATION=y
26779 +# CONFIG_PROFILING is not set
26780 +# CONFIG_MARKERS is not set
26781 +
26782 +#
26783 +# Kernel hacking
26784 +#
26785 +# CONFIG_PRINTK_TIME is not set
26786 +CONFIG_ENABLE_WARN_DEPRECATED=y
26787 +CONFIG_ENABLE_MUST_CHECK=y
26788 +CONFIG_MAGIC_SYSRQ=y
26789 +# CONFIG_UNUSED_SYMBOLS is not set
26790 +# CONFIG_DEBUG_FS is not set
26791 +# CONFIG_HEADERS_CHECK is not set
26792 +CONFIG_DEBUG_KERNEL=y
26793 +# CONFIG_DEBUG_SHIRQ is not set
26794 +# CONFIG_DETECT_SOFTLOCKUP is not set
26795 +# CONFIG_SCHED_DEBUG is not set
26796 +# CONFIG_SCHEDSTATS is not set
26797 +# CONFIG_TIMER_STATS is not set
26798 +# CONFIG_DEBUG_SLAB is not set
26799 +# CONFIG_DEBUG_RT_MUTEXES is not set
26800 +# CONFIG_RT_MUTEX_TESTER is not set
26801 +# CONFIG_DEBUG_SPINLOCK is not set
26802 +# CONFIG_DEBUG_MUTEXES is not set
26803 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
26804 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
26805 +# CONFIG_DEBUG_KOBJECT is not set
26806 +CONFIG_DEBUG_BUGVERBOSE=y
26807 +CONFIG_DEBUG_INFO=y
26808 +# CONFIG_DEBUG_VM is not set
26809 +# CONFIG_DEBUG_LIST is not set
26810 +# CONFIG_DEBUG_SG is not set
26811 +CONFIG_FORCED_INLINING=y
26812 +# CONFIG_BOOT_PRINTK_DELAY is not set
26813 +# CONFIG_FAULT_INJECTION is not set
26814 +# CONFIG_SAMPLES is not set
26815 +# CONFIG_DEBUG_STACKOVERFLOW is not set
26816 +# CONFIG_DEBUG_STACK_USAGE is not set
26817 +# CONFIG_DEBUG_PAGEALLOC is not set
26818 +# CONFIG_DEBUGGER is not set
26819 +# CONFIG_KGDB_CONSOLE is not set
26820 +CONFIG_BDI_SWITCH=y
26821 +# CONFIG_PPC_EARLY_DEBUG is not set
26822 +
26823 +#
26824 +# Security options
26825 +#
26826 +# CONFIG_KEYS is not set
26827 +# CONFIG_SECURITY is not set
26828 +CONFIG_CRYPTO=y
26829 +CONFIG_CRYPTO_ALGAPI=y
26830 +CONFIG_CRYPTO_BLKCIPHER=y
26831 +CONFIG_CRYPTO_MANAGER=y
26832 +# CONFIG_CRYPTO_HMAC is not set
26833 +# CONFIG_CRYPTO_NULL is not set
26834 +# CONFIG_CRYPTO_MD4 is not set
26835 +CONFIG_CRYPTO_MD5=y
26836 +# CONFIG_CRYPTO_SHA1 is not set
26837 +# CONFIG_CRYPTO_SHA256 is not set
26838 +# CONFIG_CRYPTO_SHA512 is not set
26839 +# CONFIG_CRYPTO_WP512 is not set
26840 +# CONFIG_CRYPTO_TGR192 is not set
26841 +CONFIG_CRYPTO_ECB=y
26842 +CONFIG_CRYPTO_CBC=y
26843 +CONFIG_CRYPTO_PCBC=y
26844 +# CONFIG_CRYPTO_CRYPTD is not set
26845 +CONFIG_CRYPTO_DES=y
26846 +# CONFIG_CRYPTO_FCRYPT is not set
26847 +# CONFIG_CRYPTO_BLOWFISH is not set
26848 +# CONFIG_CRYPTO_TWOFISH is not set
26849 +# CONFIG_CRYPTO_SERPENT is not set
26850 +# CONFIG_CRYPTO_AES is not set
26851 +# CONFIG_CRYPTO_CAST5 is not set
26852 +# CONFIG_CRYPTO_CAST6 is not set
26853 +# CONFIG_CRYPTO_TEA is not set
26854 +# CONFIG_CRYPTO_ARC4 is not set
26855 +# CONFIG_CRYPTO_KHAZAD is not set
26856 +# CONFIG_CRYPTO_ANUBIS is not set
26857 +# CONFIG_CRYPTO_SEED is not set
26858 +# CONFIG_CRYPTO_DEFLATE is not set
26859 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
26860 +# CONFIG_CRYPTO_CRC32C is not set
26861 +# CONFIG_CRYPTO_CAMELLIA is not set
26862 +# CONFIG_CRYPTO_AUTHENC is not set
26863 +# CONFIG_CRYPTO_HW is not set
26864 +# CONFIG_PPC_CLOCK is not set
26865 +CONFIG_PPC_LIB_RHEAP=y
26866 --- /dev/null
26867 +++ b/arch/powerpc/configs/katmai_defconfig
26868 @@ -0,0 +1,790 @@
26869 +#
26870 +# Automatically generated make config: don't edit
26871 +# Linux kernel version: 2.6.24-rc6
26872 +# Mon Dec 24 11:17:43 2007
26873 +#
26874 +# CONFIG_PPC64 is not set
26875 +
26876 +#
26877 +# Processor support
26878 +#
26879 +# CONFIG_6xx is not set
26880 +# CONFIG_PPC_85xx is not set
26881 +# CONFIG_PPC_8xx is not set
26882 +# CONFIG_40x is not set
26883 +CONFIG_44x=y
26884 +# CONFIG_E200 is not set
26885 +CONFIG_4xx=y
26886 +CONFIG_BOOKE=y
26887 +CONFIG_PTE_64BIT=y
26888 +CONFIG_PHYS_64BIT=y
26889 +# CONFIG_PPC_MM_SLICES is not set
26890 +CONFIG_NOT_COHERENT_CACHE=y
26891 +CONFIG_PPC32=y
26892 +CONFIG_WORD_SIZE=32
26893 +CONFIG_PPC_MERGE=y
26894 +CONFIG_MMU=y
26895 +CONFIG_GENERIC_CMOS_UPDATE=y
26896 +CONFIG_GENERIC_TIME=y
26897 +CONFIG_GENERIC_TIME_VSYSCALL=y
26898 +CONFIG_GENERIC_CLOCKEVENTS=y
26899 +CONFIG_GENERIC_HARDIRQS=y
26900 +CONFIG_IRQ_PER_CPU=y
26901 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
26902 +CONFIG_ARCH_HAS_ILOG2_U32=y
26903 +CONFIG_GENERIC_HWEIGHT=y
26904 +CONFIG_GENERIC_CALIBRATE_DELAY=y
26905 +CONFIG_GENERIC_FIND_NEXT_BIT=y
26906 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
26907 +CONFIG_PPC=y
26908 +CONFIG_EARLY_PRINTK=y
26909 +CONFIG_GENERIC_NVRAM=y
26910 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
26911 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
26912 +CONFIG_PPC_OF=y
26913 +CONFIG_OF=y
26914 +CONFIG_PPC_UDBG_16550=y
26915 +# CONFIG_GENERIC_TBSYNC is not set
26916 +CONFIG_AUDIT_ARCH=y
26917 +CONFIG_GENERIC_BUG=y
26918 +# CONFIG_DEFAULT_UIMAGE is not set
26919 +CONFIG_PPC_DCR_NATIVE=y
26920 +# CONFIG_PPC_DCR_MMIO is not set
26921 +CONFIG_PPC_DCR=y
26922 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
26923 +
26924 +#
26925 +# General setup
26926 +#
26927 +CONFIG_EXPERIMENTAL=y
26928 +CONFIG_BROKEN_ON_SMP=y
26929 +CONFIG_INIT_ENV_ARG_LIMIT=32
26930 +CONFIG_LOCALVERSION=""
26931 +CONFIG_LOCALVERSION_AUTO=y
26932 +CONFIG_SWAP=y
26933 +CONFIG_SYSVIPC=y
26934 +CONFIG_SYSVIPC_SYSCTL=y
26935 +CONFIG_POSIX_MQUEUE=y
26936 +# CONFIG_BSD_PROCESS_ACCT is not set
26937 +# CONFIG_TASKSTATS is not set
26938 +# CONFIG_USER_NS is not set
26939 +# CONFIG_PID_NS is not set
26940 +# CONFIG_AUDIT is not set
26941 +# CONFIG_IKCONFIG is not set
26942 +CONFIG_LOG_BUF_SHIFT=14
26943 +# CONFIG_CGROUPS is not set
26944 +CONFIG_FAIR_GROUP_SCHED=y
26945 +CONFIG_FAIR_USER_SCHED=y
26946 +# CONFIG_FAIR_CGROUP_SCHED is not set
26947 +CONFIG_SYSFS_DEPRECATED=y
26948 +# CONFIG_RELAY is not set
26949 +CONFIG_BLK_DEV_INITRD=y
26950 +CONFIG_INITRAMFS_SOURCE=""
26951 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
26952 +CONFIG_SYSCTL=y
26953 +CONFIG_EMBEDDED=y
26954 +CONFIG_SYSCTL_SYSCALL=y
26955 +CONFIG_KALLSYMS=y
26956 +# CONFIG_KALLSYMS_ALL is not set
26957 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
26958 +CONFIG_HOTPLUG=y
26959 +CONFIG_PRINTK=y
26960 +CONFIG_BUG=y
26961 +CONFIG_ELF_CORE=y
26962 +CONFIG_BASE_FULL=y
26963 +CONFIG_FUTEX=y
26964 +CONFIG_ANON_INODES=y
26965 +CONFIG_EPOLL=y
26966 +CONFIG_SIGNALFD=y
26967 +CONFIG_EVENTFD=y
26968 +CONFIG_SHMEM=y
26969 +CONFIG_VM_EVENT_COUNTERS=y
26970 +CONFIG_SLUB_DEBUG=y
26971 +# CONFIG_SLAB is not set
26972 +CONFIG_SLUB=y
26973 +# CONFIG_SLOB is not set
26974 +CONFIG_RT_MUTEXES=y
26975 +# CONFIG_TINY_SHMEM is not set
26976 +CONFIG_BASE_SMALL=0
26977 +CONFIG_MODULES=y
26978 +CONFIG_MODULE_UNLOAD=y
26979 +# CONFIG_MODULE_FORCE_UNLOAD is not set
26980 +# CONFIG_MODVERSIONS is not set
26981 +# CONFIG_MODULE_SRCVERSION_ALL is not set
26982 +CONFIG_KMOD=y
26983 +CONFIG_BLOCK=y
26984 +CONFIG_LBD=y
26985 +# CONFIG_BLK_DEV_IO_TRACE is not set
26986 +# CONFIG_LSF is not set
26987 +# CONFIG_BLK_DEV_BSG is not set
26988 +
26989 +#
26990 +# IO Schedulers
26991 +#
26992 +CONFIG_IOSCHED_NOOP=y
26993 +CONFIG_IOSCHED_AS=y
26994 +CONFIG_IOSCHED_DEADLINE=y
26995 +CONFIG_IOSCHED_CFQ=y
26996 +CONFIG_DEFAULT_AS=y
26997 +# CONFIG_DEFAULT_DEADLINE is not set
26998 +# CONFIG_DEFAULT_CFQ is not set
26999 +# CONFIG_DEFAULT_NOOP is not set
27000 +CONFIG_DEFAULT_IOSCHED="anticipatory"
27001 +CONFIG_PPC4xx_PCI_EXPRESS=y
27002 +
27003 +#
27004 +# Platform support
27005 +#
27006 +# CONFIG_PPC_MPC52xx is not set
27007 +# CONFIG_PPC_MPC5200 is not set
27008 +# CONFIG_PPC_CELL is not set
27009 +# CONFIG_PPC_CELL_NATIVE is not set
27010 +# CONFIG_PQ2ADS is not set
27011 +# CONFIG_BAMBOO is not set
27012 +# CONFIG_EBONY is not set
27013 +# CONFIG_SEQUOIA is not set
27014 +# CONFIG_TAISHAN is not set
27015 +CONFIG_KATMAI=y
27016 +# CONFIG_RAINIER is not set
27017 +CONFIG_440SPe=y
27018 +# CONFIG_MPIC is not set
27019 +# CONFIG_MPIC_WEIRD is not set
27020 +# CONFIG_PPC_I8259 is not set
27021 +# CONFIG_PPC_RTAS is not set
27022 +# CONFIG_MMIO_NVRAM is not set
27023 +# CONFIG_PPC_MPC106 is not set
27024 +# CONFIG_PPC_970_NAP is not set
27025 +# CONFIG_PPC_INDIRECT_IO is not set
27026 +# CONFIG_GENERIC_IOMAP is not set
27027 +# CONFIG_CPU_FREQ is not set
27028 +# CONFIG_CPM2 is not set
27029 +# CONFIG_FSL_ULI1575 is not set
27030 +
27031 +#
27032 +# Kernel options
27033 +#
27034 +# CONFIG_HIGHMEM is not set
27035 +# CONFIG_TICK_ONESHOT is not set
27036 +# CONFIG_NO_HZ is not set
27037 +# CONFIG_HIGH_RES_TIMERS is not set
27038 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
27039 +# CONFIG_HZ_100 is not set
27040 +CONFIG_HZ_250=y
27041 +# CONFIG_HZ_300 is not set
27042 +# CONFIG_HZ_1000 is not set
27043 +CONFIG_HZ=250
27044 +CONFIG_PREEMPT_NONE=y
27045 +# CONFIG_PREEMPT_VOLUNTARY is not set
27046 +# CONFIG_PREEMPT is not set
27047 +CONFIG_BINFMT_ELF=y
27048 +# CONFIG_BINFMT_MISC is not set
27049 +# CONFIG_MATH_EMULATION is not set
27050 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
27051 +CONFIG_ARCH_FLATMEM_ENABLE=y
27052 +CONFIG_ARCH_POPULATES_NODE_MAP=y
27053 +CONFIG_SELECT_MEMORY_MODEL=y
27054 +CONFIG_FLATMEM_MANUAL=y
27055 +# CONFIG_DISCONTIGMEM_MANUAL is not set
27056 +# CONFIG_SPARSEMEM_MANUAL is not set
27057 +CONFIG_FLATMEM=y
27058 +CONFIG_FLAT_NODE_MEM_MAP=y
27059 +# CONFIG_SPARSEMEM_STATIC is not set
27060 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
27061 +CONFIG_SPLIT_PTLOCK_CPUS=4
27062 +CONFIG_RESOURCES_64BIT=y
27063 +CONFIG_ZONE_DMA_FLAG=1
27064 +CONFIG_BOUNCE=y
27065 +CONFIG_VIRT_TO_BUS=y
27066 +CONFIG_PROC_DEVICETREE=y
27067 +CONFIG_CMDLINE_BOOL=y
27068 +CONFIG_CMDLINE=""
27069 +CONFIG_SECCOMP=y
27070 +CONFIG_WANT_DEVICE_TREE=y
27071 +CONFIG_DEVICE_TREE="katmai.dts"
27072 +CONFIG_ISA_DMA_API=y
27073 +
27074 +#
27075 +# Bus options
27076 +#
27077 +CONFIG_ZONE_DMA=y
27078 +CONFIG_PPC_INDIRECT_PCI=y
27079 +CONFIG_PCI=y
27080 +CONFIG_PCI_DOMAINS=y
27081 +CONFIG_PCI_SYSCALL=y
27082 +# CONFIG_PCIEPORTBUS is not set
27083 +CONFIG_ARCH_SUPPORTS_MSI=y
27084 +# CONFIG_PCI_MSI is not set
27085 +CONFIG_PCI_LEGACY=y
27086 +# CONFIG_PCI_DEBUG is not set
27087 +# CONFIG_PCCARD is not set
27088 +# CONFIG_HOTPLUG_PCI is not set
27089 +
27090 +#
27091 +# Advanced setup
27092 +#
27093 +# CONFIG_ADVANCED_OPTIONS is not set
27094 +
27095 +#
27096 +# Default settings for advanced configuration options are used
27097 +#
27098 +CONFIG_HIGHMEM_START=0xfe000000
27099 +CONFIG_LOWMEM_SIZE=0x30000000
27100 +CONFIG_KERNEL_START=0xc0000000
27101 +CONFIG_TASK_SIZE=0xc0000000
27102 +CONFIG_CONSISTENT_START=0xff100000
27103 +CONFIG_CONSISTENT_SIZE=0x00200000
27104 +CONFIG_BOOT_LOAD=0x01000000
27105 +
27106 +#
27107 +# Networking
27108 +#
27109 +CONFIG_NET=y
27110 +
27111 +#
27112 +# Networking options
27113 +#
27114 +CONFIG_PACKET=y
27115 +# CONFIG_PACKET_MMAP is not set
27116 +CONFIG_UNIX=y
27117 +# CONFIG_NET_KEY is not set
27118 +CONFIG_INET=y
27119 +# CONFIG_IP_MULTICAST is not set
27120 +# CONFIG_IP_ADVANCED_ROUTER is not set
27121 +CONFIG_IP_FIB_HASH=y
27122 +CONFIG_IP_PNP=y
27123 +CONFIG_IP_PNP_DHCP=y
27124 +CONFIG_IP_PNP_BOOTP=y
27125 +# CONFIG_IP_PNP_RARP is not set
27126 +# CONFIG_NET_IPIP is not set
27127 +# CONFIG_NET_IPGRE is not set
27128 +# CONFIG_ARPD is not set
27129 +# CONFIG_SYN_COOKIES is not set
27130 +# CONFIG_INET_AH is not set
27131 +# CONFIG_INET_ESP is not set
27132 +# CONFIG_INET_IPCOMP is not set
27133 +# CONFIG_INET_XFRM_TUNNEL is not set
27134 +# CONFIG_INET_TUNNEL is not set
27135 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
27136 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
27137 +# CONFIG_INET_XFRM_MODE_BEET is not set
27138 +# CONFIG_INET_LRO is not set
27139 +CONFIG_INET_DIAG=y
27140 +CONFIG_INET_TCP_DIAG=y
27141 +# CONFIG_TCP_CONG_ADVANCED is not set
27142 +CONFIG_TCP_CONG_CUBIC=y
27143 +CONFIG_DEFAULT_TCP_CONG="cubic"
27144 +# CONFIG_TCP_MD5SIG is not set
27145 +# CONFIG_IPV6 is not set
27146 +# CONFIG_INET6_XFRM_TUNNEL is not set
27147 +# CONFIG_INET6_TUNNEL is not set
27148 +# CONFIG_NETWORK_SECMARK is not set
27149 +# CONFIG_NETFILTER is not set
27150 +# CONFIG_IP_DCCP is not set
27151 +# CONFIG_IP_SCTP is not set
27152 +# CONFIG_TIPC is not set
27153 +# CONFIG_ATM is not set
27154 +# CONFIG_BRIDGE is not set
27155 +# CONFIG_VLAN_8021Q is not set
27156 +# CONFIG_DECNET is not set
27157 +# CONFIG_LLC2 is not set
27158 +# CONFIG_IPX is not set
27159 +# CONFIG_ATALK is not set
27160 +# CONFIG_X25 is not set
27161 +# CONFIG_LAPB is not set
27162 +# CONFIG_ECONET is not set
27163 +# CONFIG_WAN_ROUTER is not set
27164 +# CONFIG_NET_SCHED is not set
27165 +
27166 +#
27167 +# Network testing
27168 +#
27169 +# CONFIG_NET_PKTGEN is not set
27170 +# CONFIG_HAMRADIO is not set
27171 +# CONFIG_IRDA is not set
27172 +# CONFIG_BT is not set
27173 +# CONFIG_AF_RXRPC is not set
27174 +
27175 +#
27176 +# Wireless
27177 +#
27178 +# CONFIG_CFG80211 is not set
27179 +# CONFIG_WIRELESS_EXT is not set
27180 +# CONFIG_MAC80211 is not set
27181 +# CONFIG_IEEE80211 is not set
27182 +# CONFIG_RFKILL is not set
27183 +# CONFIG_NET_9P is not set
27184 +
27185 +#
27186 +# Device Drivers
27187 +#
27188 +
27189 +#
27190 +# Generic Driver Options
27191 +#
27192 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
27193 +CONFIG_STANDALONE=y
27194 +CONFIG_PREVENT_FIRMWARE_BUILD=y
27195 +CONFIG_FW_LOADER=y
27196 +# CONFIG_DEBUG_DRIVER is not set
27197 +# CONFIG_DEBUG_DEVRES is not set
27198 +# CONFIG_SYS_HYPERVISOR is not set
27199 +CONFIG_CONNECTOR=y
27200 +CONFIG_PROC_EVENTS=y
27201 +# CONFIG_MTD is not set
27202 +CONFIG_OF_DEVICE=y
27203 +# CONFIG_PARPORT is not set
27204 +CONFIG_BLK_DEV=y
27205 +# CONFIG_BLK_DEV_FD is not set
27206 +# CONFIG_BLK_CPQ_DA is not set
27207 +# CONFIG_BLK_CPQ_CISS_DA is not set
27208 +# CONFIG_BLK_DEV_DAC960 is not set
27209 +# CONFIG_BLK_DEV_UMEM is not set
27210 +# CONFIG_BLK_DEV_COW_COMMON is not set
27211 +# CONFIG_BLK_DEV_LOOP is not set
27212 +# CONFIG_BLK_DEV_NBD is not set
27213 +# CONFIG_BLK_DEV_SX8 is not set
27214 +CONFIG_BLK_DEV_RAM=y
27215 +CONFIG_BLK_DEV_RAM_COUNT=16
27216 +CONFIG_BLK_DEV_RAM_SIZE=35000
27217 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
27218 +# CONFIG_CDROM_PKTCDVD is not set
27219 +# CONFIG_ATA_OVER_ETH is not set
27220 +# CONFIG_XILINX_SYSACE is not set
27221 +CONFIG_MISC_DEVICES=y
27222 +# CONFIG_PHANTOM is not set
27223 +# CONFIG_EEPROM_93CX6 is not set
27224 +# CONFIG_SGI_IOC4 is not set
27225 +# CONFIG_TIFM_CORE is not set
27226 +# CONFIG_IDE is not set
27227 +
27228 +#
27229 +# SCSI device support
27230 +#
27231 +# CONFIG_RAID_ATTRS is not set
27232 +# CONFIG_SCSI is not set
27233 +# CONFIG_SCSI_DMA is not set
27234 +# CONFIG_SCSI_NETLINK is not set
27235 +# CONFIG_ATA is not set
27236 +# CONFIG_MD is not set
27237 +# CONFIG_FUSION is not set
27238 +
27239 +#
27240 +# IEEE 1394 (FireWire) support
27241 +#
27242 +# CONFIG_FIREWIRE is not set
27243 +# CONFIG_IEEE1394 is not set
27244 +# CONFIG_I2O is not set
27245 +CONFIG_MACINTOSH_DRIVERS=y
27246 +# CONFIG_MAC_EMUMOUSEBTN is not set
27247 +# CONFIG_WINDFARM is not set
27248 +CONFIG_NETDEVICES=y
27249 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
27250 +# CONFIG_DUMMY is not set
27251 +# CONFIG_BONDING is not set
27252 +# CONFIG_MACVLAN is not set
27253 +# CONFIG_EQUALIZER is not set
27254 +# CONFIG_TUN is not set
27255 +# CONFIG_VETH is not set
27256 +# CONFIG_IP1000 is not set
27257 +# CONFIG_ARCNET is not set
27258 +# CONFIG_PHYLIB is not set
27259 +CONFIG_NET_ETHERNET=y
27260 +# CONFIG_MII is not set
27261 +# CONFIG_HAPPYMEAL is not set
27262 +# CONFIG_SUNGEM is not set
27263 +# CONFIG_CASSINI is not set
27264 +# CONFIG_NET_VENDOR_3COM is not set
27265 +# CONFIG_NET_TULIP is not set
27266 +# CONFIG_HP100 is not set
27267 +CONFIG_IBM_NEW_EMAC=y
27268 +CONFIG_IBM_NEW_EMAC_RXB=128
27269 +CONFIG_IBM_NEW_EMAC_TXB=64
27270 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
27271 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
27272 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
27273 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
27274 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
27275 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
27276 +# CONFIG_IBM_NEW_EMAC_TAH is not set
27277 +CONFIG_IBM_NEW_EMAC_EMAC4=y
27278 +# CONFIG_NET_PCI is not set
27279 +# CONFIG_B44 is not set
27280 +CONFIG_NETDEV_1000=y
27281 +# CONFIG_ACENIC is not set
27282 +# CONFIG_DL2K is not set
27283 +# CONFIG_E1000 is not set
27284 +# CONFIG_E1000E is not set
27285 +# CONFIG_NS83820 is not set
27286 +# CONFIG_HAMACHI is not set
27287 +# CONFIG_YELLOWFIN is not set
27288 +# CONFIG_R8169 is not set
27289 +# CONFIG_SIS190 is not set
27290 +# CONFIG_SKGE is not set
27291 +# CONFIG_SKY2 is not set
27292 +# CONFIG_SK98LIN is not set
27293 +# CONFIG_VIA_VELOCITY is not set
27294 +# CONFIG_TIGON3 is not set
27295 +# CONFIG_BNX2 is not set
27296 +# CONFIG_QLA3XXX is not set
27297 +# CONFIG_ATL1 is not set
27298 +CONFIG_NETDEV_10000=y
27299 +# CONFIG_CHELSIO_T1 is not set
27300 +# CONFIG_CHELSIO_T3 is not set
27301 +# CONFIG_IXGBE is not set
27302 +# CONFIG_IXGB is not set
27303 +# CONFIG_S2IO is not set
27304 +# CONFIG_MYRI10GE is not set
27305 +# CONFIG_NETXEN_NIC is not set
27306 +# CONFIG_NIU is not set
27307 +# CONFIG_MLX4_CORE is not set
27308 +# CONFIG_TEHUTI is not set
27309 +# CONFIG_TR is not set
27310 +
27311 +#
27312 +# Wireless LAN
27313 +#
27314 +# CONFIG_WLAN_PRE80211 is not set
27315 +# CONFIG_WLAN_80211 is not set
27316 +# CONFIG_WAN is not set
27317 +# CONFIG_FDDI is not set
27318 +# CONFIG_HIPPI is not set
27319 +# CONFIG_PPP is not set
27320 +# CONFIG_SLIP is not set
27321 +# CONFIG_SHAPER is not set
27322 +# CONFIG_NETCONSOLE is not set
27323 +# CONFIG_NETPOLL is not set
27324 +# CONFIG_NET_POLL_CONTROLLER is not set
27325 +# CONFIG_ISDN is not set
27326 +# CONFIG_PHONE is not set
27327 +
27328 +#
27329 +# Input device support
27330 +#
27331 +# CONFIG_INPUT is not set
27332 +
27333 +#
27334 +# Hardware I/O ports
27335 +#
27336 +# CONFIG_SERIO is not set
27337 +# CONFIG_GAMEPORT is not set
27338 +
27339 +#
27340 +# Character devices
27341 +#
27342 +# CONFIG_VT is not set
27343 +# CONFIG_SERIAL_NONSTANDARD is not set
27344 +
27345 +#
27346 +# Serial drivers
27347 +#
27348 +CONFIG_SERIAL_8250=y
27349 +CONFIG_SERIAL_8250_CONSOLE=y
27350 +# CONFIG_SERIAL_8250_PCI is not set
27351 +CONFIG_SERIAL_8250_NR_UARTS=4
27352 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
27353 +CONFIG_SERIAL_8250_EXTENDED=y
27354 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
27355 +CONFIG_SERIAL_8250_SHARE_IRQ=y
27356 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
27357 +# CONFIG_SERIAL_8250_RSA is not set
27358 +
27359 +#
27360 +# Non-8250 serial port support
27361 +#
27362 +# CONFIG_SERIAL_UARTLITE is not set
27363 +CONFIG_SERIAL_CORE=y
27364 +CONFIG_SERIAL_CORE_CONSOLE=y
27365 +# CONFIG_SERIAL_JSM is not set
27366 +CONFIG_SERIAL_OF_PLATFORM=y
27367 +CONFIG_UNIX98_PTYS=y
27368 +CONFIG_LEGACY_PTYS=y
27369 +CONFIG_LEGACY_PTY_COUNT=256
27370 +# CONFIG_IPMI_HANDLER is not set
27371 +# CONFIG_HW_RANDOM is not set
27372 +# CONFIG_NVRAM is not set
27373 +# CONFIG_GEN_RTC is not set
27374 +# CONFIG_R3964 is not set
27375 +# CONFIG_APPLICOM is not set
27376 +# CONFIG_RAW_DRIVER is not set
27377 +# CONFIG_TCG_TPM is not set
27378 +CONFIG_DEVPORT=y
27379 +# CONFIG_I2C is not set
27380 +
27381 +#
27382 +# SPI support
27383 +#
27384 +# CONFIG_SPI is not set
27385 +# CONFIG_SPI_MASTER is not set
27386 +# CONFIG_W1 is not set
27387 +# CONFIG_POWER_SUPPLY is not set
27388 +# CONFIG_HWMON is not set
27389 +# CONFIG_WATCHDOG is not set
27390 +
27391 +#
27392 +# Sonics Silicon Backplane
27393 +#
27394 +CONFIG_SSB_POSSIBLE=y
27395 +# CONFIG_SSB is not set
27396 +
27397 +#
27398 +# Multifunction device drivers
27399 +#
27400 +# CONFIG_MFD_SM501 is not set
27401 +
27402 +#
27403 +# Multimedia devices
27404 +#
27405 +# CONFIG_VIDEO_DEV is not set
27406 +# CONFIG_DVB_CORE is not set
27407 +CONFIG_DAB=y
27408 +
27409 +#
27410 +# Graphics support
27411 +#
27412 +# CONFIG_AGP is not set
27413 +# CONFIG_DRM is not set
27414 +# CONFIG_VGASTATE is not set
27415 +CONFIG_VIDEO_OUTPUT_CONTROL=m
27416 +# CONFIG_FB is not set
27417 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
27418 +
27419 +#
27420 +# Display device support
27421 +#
27422 +# CONFIG_DISPLAY_SUPPORT is not set
27423 +
27424 +#
27425 +# Sound
27426 +#
27427 +# CONFIG_SOUND is not set
27428 +CONFIG_USB_SUPPORT=y
27429 +CONFIG_USB_ARCH_HAS_HCD=y
27430 +CONFIG_USB_ARCH_HAS_OHCI=y
27431 +CONFIG_USB_ARCH_HAS_EHCI=y
27432 +# CONFIG_USB is not set
27433 +
27434 +#
27435 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
27436 +#
27437 +
27438 +#
27439 +# USB Gadget Support
27440 +#
27441 +# CONFIG_USB_GADGET is not set
27442 +# CONFIG_MMC is not set
27443 +# CONFIG_NEW_LEDS is not set
27444 +# CONFIG_INFINIBAND is not set
27445 +# CONFIG_EDAC is not set
27446 +# CONFIG_RTC_CLASS is not set
27447 +
27448 +#
27449 +# Userspace I/O
27450 +#
27451 +# CONFIG_UIO is not set
27452 +
27453 +#
27454 +# File systems
27455 +#
27456 +CONFIG_EXT2_FS=y
27457 +# CONFIG_EXT2_FS_XATTR is not set
27458 +# CONFIG_EXT2_FS_XIP is not set
27459 +# CONFIG_EXT3_FS is not set
27460 +# CONFIG_EXT4DEV_FS is not set
27461 +# CONFIG_REISERFS_FS is not set
27462 +# CONFIG_JFS_FS is not set
27463 +# CONFIG_FS_POSIX_ACL is not set
27464 +# CONFIG_XFS_FS is not set
27465 +# CONFIG_GFS2_FS is not set
27466 +# CONFIG_OCFS2_FS is not set
27467 +# CONFIG_MINIX_FS is not set
27468 +# CONFIG_ROMFS_FS is not set
27469 +CONFIG_INOTIFY=y
27470 +CONFIG_INOTIFY_USER=y
27471 +# CONFIG_QUOTA is not set
27472 +CONFIG_DNOTIFY=y
27473 +# CONFIG_AUTOFS_FS is not set
27474 +# CONFIG_AUTOFS4_FS is not set
27475 +# CONFIG_FUSE_FS is not set
27476 +
27477 +#
27478 +# CD-ROM/DVD Filesystems
27479 +#
27480 +# CONFIG_ISO9660_FS is not set
27481 +# CONFIG_UDF_FS is not set
27482 +
27483 +#
27484 +# DOS/FAT/NT Filesystems
27485 +#
27486 +# CONFIG_MSDOS_FS is not set
27487 +# CONFIG_VFAT_FS is not set
27488 +# CONFIG_NTFS_FS is not set
27489 +
27490 +#
27491 +# Pseudo filesystems
27492 +#
27493 +CONFIG_PROC_FS=y
27494 +CONFIG_PROC_KCORE=y
27495 +CONFIG_PROC_SYSCTL=y
27496 +CONFIG_SYSFS=y
27497 +CONFIG_TMPFS=y
27498 +# CONFIG_TMPFS_POSIX_ACL is not set
27499 +# CONFIG_HUGETLB_PAGE is not set
27500 +# CONFIG_CONFIGFS_FS is not set
27501 +
27502 +#
27503 +# Miscellaneous filesystems
27504 +#
27505 +# CONFIG_ADFS_FS is not set
27506 +# CONFIG_AFFS_FS is not set
27507 +# CONFIG_HFS_FS is not set
27508 +# CONFIG_HFSPLUS_FS is not set
27509 +# CONFIG_BEFS_FS is not set
27510 +# CONFIG_BFS_FS is not set
27511 +# CONFIG_EFS_FS is not set
27512 +CONFIG_CRAMFS=y
27513 +# CONFIG_VXFS_FS is not set
27514 +# CONFIG_HPFS_FS is not set
27515 +# CONFIG_QNX4FS_FS is not set
27516 +# CONFIG_SYSV_FS is not set
27517 +# CONFIG_UFS_FS is not set
27518 +CONFIG_NETWORK_FILESYSTEMS=y
27519 +CONFIG_NFS_FS=y
27520 +CONFIG_NFS_V3=y
27521 +# CONFIG_NFS_V3_ACL is not set
27522 +# CONFIG_NFS_V4 is not set
27523 +# CONFIG_NFS_DIRECTIO is not set
27524 +# CONFIG_NFSD is not set
27525 +CONFIG_ROOT_NFS=y
27526 +CONFIG_LOCKD=y
27527 +CONFIG_LOCKD_V4=y
27528 +CONFIG_NFS_COMMON=y
27529 +CONFIG_SUNRPC=y
27530 +# CONFIG_SUNRPC_BIND34 is not set
27531 +# CONFIG_RPCSEC_GSS_KRB5 is not set
27532 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
27533 +# CONFIG_SMB_FS is not set
27534 +# CONFIG_CIFS is not set
27535 +# CONFIG_NCP_FS is not set
27536 +# CONFIG_CODA_FS is not set
27537 +# CONFIG_AFS_FS is not set
27538 +
27539 +#
27540 +# Partition Types
27541 +#
27542 +# CONFIG_PARTITION_ADVANCED is not set
27543 +CONFIG_MSDOS_PARTITION=y
27544 +# CONFIG_NLS is not set
27545 +# CONFIG_DLM is not set
27546 +# CONFIG_UCC_SLOW is not set
27547 +
27548 +#
27549 +# Library routines
27550 +#
27551 +CONFIG_BITREVERSE=y
27552 +# CONFIG_CRC_CCITT is not set
27553 +# CONFIG_CRC16 is not set
27554 +# CONFIG_CRC_ITU_T is not set
27555 +CONFIG_CRC32=y
27556 +# CONFIG_CRC7 is not set
27557 +# CONFIG_LIBCRC32C is not set
27558 +CONFIG_ZLIB_INFLATE=y
27559 +CONFIG_PLIST=y
27560 +CONFIG_HAS_IOMEM=y
27561 +CONFIG_HAS_IOPORT=y
27562 +CONFIG_HAS_DMA=y
27563 +CONFIG_INSTRUMENTATION=y
27564 +# CONFIG_PROFILING is not set
27565 +# CONFIG_KPROBES is not set
27566 +# CONFIG_MARKERS is not set
27567 +
27568 +#
27569 +# Kernel hacking
27570 +#
27571 +# CONFIG_PRINTK_TIME is not set
27572 +CONFIG_ENABLE_WARN_DEPRECATED=y
27573 +CONFIG_ENABLE_MUST_CHECK=y
27574 +CONFIG_MAGIC_SYSRQ=y
27575 +# CONFIG_UNUSED_SYMBOLS is not set
27576 +# CONFIG_DEBUG_FS is not set
27577 +# CONFIG_HEADERS_CHECK is not set
27578 +CONFIG_DEBUG_KERNEL=y
27579 +# CONFIG_DEBUG_SHIRQ is not set
27580 +CONFIG_DETECT_SOFTLOCKUP=y
27581 +CONFIG_SCHED_DEBUG=y
27582 +# CONFIG_SCHEDSTATS is not set
27583 +# CONFIG_TIMER_STATS is not set
27584 +# CONFIG_SLUB_DEBUG_ON is not set
27585 +# CONFIG_DEBUG_RT_MUTEXES is not set
27586 +# CONFIG_RT_MUTEX_TESTER is not set
27587 +# CONFIG_DEBUG_SPINLOCK is not set
27588 +# CONFIG_DEBUG_MUTEXES is not set
27589 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
27590 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
27591 +# CONFIG_DEBUG_KOBJECT is not set
27592 +# CONFIG_DEBUG_BUGVERBOSE is not set
27593 +# CONFIG_DEBUG_INFO is not set
27594 +# CONFIG_DEBUG_VM is not set
27595 +# CONFIG_DEBUG_LIST is not set
27596 +# CONFIG_DEBUG_SG is not set
27597 +CONFIG_FORCED_INLINING=y
27598 +# CONFIG_BOOT_PRINTK_DELAY is not set
27599 +# CONFIG_RCU_TORTURE_TEST is not set
27600 +# CONFIG_FAULT_INJECTION is not set
27601 +# CONFIG_SAMPLES is not set
27602 +# CONFIG_DEBUG_STACKOVERFLOW is not set
27603 +# CONFIG_DEBUG_STACK_USAGE is not set
27604 +# CONFIG_DEBUG_PAGEALLOC is not set
27605 +CONFIG_DEBUGGER=y
27606 +# CONFIG_KGDB is not set
27607 +# CONFIG_XMON is not set
27608 +# CONFIG_BDI_SWITCH is not set
27609 +# CONFIG_PPC_EARLY_DEBUG is not set
27610 +
27611 +#
27612 +# Security options
27613 +#
27614 +# CONFIG_KEYS is not set
27615 +# CONFIG_SECURITY is not set
27616 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
27617 +CONFIG_CRYPTO=y
27618 +CONFIG_CRYPTO_ALGAPI=y
27619 +CONFIG_CRYPTO_BLKCIPHER=y
27620 +CONFIG_CRYPTO_MANAGER=y
27621 +# CONFIG_CRYPTO_HMAC is not set
27622 +# CONFIG_CRYPTO_XCBC is not set
27623 +# CONFIG_CRYPTO_NULL is not set
27624 +# CONFIG_CRYPTO_MD4 is not set
27625 +CONFIG_CRYPTO_MD5=y
27626 +# CONFIG_CRYPTO_SHA1 is not set
27627 +# CONFIG_CRYPTO_SHA256 is not set
27628 +# CONFIG_CRYPTO_SHA512 is not set
27629 +# CONFIG_CRYPTO_WP512 is not set
27630 +# CONFIG_CRYPTO_TGR192 is not set
27631 +# CONFIG_CRYPTO_GF128MUL is not set
27632 +CONFIG_CRYPTO_ECB=y
27633 +CONFIG_CRYPTO_CBC=y
27634 +CONFIG_CRYPTO_PCBC=y
27635 +# CONFIG_CRYPTO_LRW is not set
27636 +# CONFIG_CRYPTO_XTS is not set
27637 +# CONFIG_CRYPTO_CRYPTD is not set
27638 +CONFIG_CRYPTO_DES=y
27639 +# CONFIG_CRYPTO_FCRYPT is not set
27640 +# CONFIG_CRYPTO_BLOWFISH is not set
27641 +# CONFIG_CRYPTO_TWOFISH is not set
27642 +# CONFIG_CRYPTO_SERPENT is not set
27643 +# CONFIG_CRYPTO_AES is not set
27644 +# CONFIG_CRYPTO_CAST5 is not set
27645 +# CONFIG_CRYPTO_CAST6 is not set
27646 +# CONFIG_CRYPTO_TEA is not set
27647 +# CONFIG_CRYPTO_ARC4 is not set
27648 +# CONFIG_CRYPTO_KHAZAD is not set
27649 +# CONFIG_CRYPTO_ANUBIS is not set
27650 +# CONFIG_CRYPTO_SEED is not set
27651 +# CONFIG_CRYPTO_DEFLATE is not set
27652 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
27653 +# CONFIG_CRYPTO_CRC32C is not set
27654 +# CONFIG_CRYPTO_CAMELLIA is not set
27655 +# CONFIG_CRYPTO_TEST is not set
27656 +# CONFIG_CRYPTO_AUTHENC is not set
27657 +CONFIG_CRYPTO_HW=y
27658 +# CONFIG_PPC_CLOCK is not set
27659 --- a/arch/powerpc/configs/kilauea_defconfig
27660 +++ b/arch/powerpc/configs/kilauea_defconfig
27661 @@ -1,7 +1,7 @@
27662  #
27663  # Automatically generated make config: don't edit
27664 -# Linux kernel version: 2.6.24-rc4
27665 -# Thu Dec  6 16:48:20 2007
27666 +# Linux kernel version: 2.6.24-rc6
27667 +# Thu Jan  3 14:21:31 2008
27668  #
27669  # CONFIG_PPC64 is not set
27670  
27671 @@ -40,7 +40,7 @@
27672  CONFIG_ARCH_MAY_HAVE_PC_FDC=y
27673  CONFIG_PPC_OF=y
27674  CONFIG_OF=y
27675 -# CONFIG_PPC_UDBG_16550 is not set
27676 +CONFIG_PPC_UDBG_16550=y
27677  # CONFIG_GENERIC_TBSYNC is not set
27678  CONFIG_AUDIT_ARCH=y
27679  CONFIG_GENERIC_BUG=y
27680 @@ -125,6 +125,7 @@
27681  # CONFIG_DEFAULT_CFQ is not set
27682  # CONFIG_DEFAULT_NOOP is not set
27683  CONFIG_DEFAULT_IOSCHED="anticipatory"
27684 +CONFIG_PPC4xx_PCI_EXPRESS=y
27685  
27686  #
27687  # Platform support
27688 @@ -134,9 +135,12 @@
27689  # CONFIG_PPC_CELL is not set
27690  # CONFIG_PPC_CELL_NATIVE is not set
27691  # CONFIG_PQ2ADS is not set
27692 +# CONFIG_EP405 is not set
27693  CONFIG_KILAUEA=y
27694 +# CONFIG_MAKALU is not set
27695  # CONFIG_WALNUT is not set
27696  # CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
27697 +CONFIG_405EX=y
27698  # CONFIG_MPIC is not set
27699  # CONFIG_MPIC_WEIRD is not set
27700  # CONFIG_PPC_I8259 is not set
27701 @@ -199,11 +203,17 @@
27702  # Bus options
27703  #
27704  CONFIG_ZONE_DMA=y
27705 -# CONFIG_PCI is not set
27706 -# CONFIG_PCI_DOMAINS is not set
27707 -# CONFIG_PCI_SYSCALL is not set
27708 -# CONFIG_ARCH_SUPPORTS_MSI is not set
27709 +CONFIG_PPC_INDIRECT_PCI=y
27710 +CONFIG_PCI=y
27711 +CONFIG_PCI_DOMAINS=y
27712 +CONFIG_PCI_SYSCALL=y
27713 +# CONFIG_PCIEPORTBUS is not set
27714 +CONFIG_ARCH_SUPPORTS_MSI=y
27715 +# CONFIG_PCI_MSI is not set
27716 +CONFIG_PCI_LEGACY=y
27717 +# CONFIG_PCI_DEBUG is not set
27718  # CONFIG_PCCARD is not set
27719 +# CONFIG_HOTPLUG_PCI is not set
27720  
27721  #
27722  # Advanced setup
27723 @@ -368,11 +378,13 @@
27724  # CONFIG_MTD_COMPLEX_MAPPINGS is not set
27725  # CONFIG_MTD_PHYSMAP is not set
27726  CONFIG_MTD_PHYSMAP_OF=y
27727 +# CONFIG_MTD_INTEL_VR_NOR is not set
27728  # CONFIG_MTD_PLATRAM is not set
27729  
27730  #
27731  # Self-contained MTD device drivers
27732  #
27733 +# CONFIG_MTD_PMC551 is not set
27734  # CONFIG_MTD_SLRAM is not set
27735  # CONFIG_MTD_PHRAM is not set
27736  # CONFIG_MTD_MTDRAM is not set
27737 @@ -395,9 +407,14 @@
27738  # CONFIG_PARPORT is not set
27739  CONFIG_BLK_DEV=y
27740  # CONFIG_BLK_DEV_FD is not set
27741 +# CONFIG_BLK_CPQ_DA is not set
27742 +# CONFIG_BLK_CPQ_CISS_DA is not set
27743 +# CONFIG_BLK_DEV_DAC960 is not set
27744 +# CONFIG_BLK_DEV_UMEM is not set
27745  # CONFIG_BLK_DEV_COW_COMMON is not set
27746  # CONFIG_BLK_DEV_LOOP is not set
27747  # CONFIG_BLK_DEV_NBD is not set
27748 +# CONFIG_BLK_DEV_SX8 is not set
27749  CONFIG_BLK_DEV_RAM=y
27750  CONFIG_BLK_DEV_RAM_COUNT=16
27751  CONFIG_BLK_DEV_RAM_SIZE=35000
27752 @@ -417,6 +434,14 @@
27753  # CONFIG_SCSI_NETLINK is not set
27754  # CONFIG_ATA is not set
27755  # CONFIG_MD is not set
27756 +# CONFIG_FUSION is not set
27757 +
27758 +#
27759 +# IEEE 1394 (FireWire) support
27760 +#
27761 +# CONFIG_FIREWIRE is not set
27762 +# CONFIG_IEEE1394 is not set
27763 +# CONFIG_I2O is not set
27764  # CONFIG_MACINTOSH_DRIVERS is not set
27765  CONFIG_NETDEVICES=y
27766  # CONFIG_NETDEVICES_MULTIQUEUE is not set
27767 @@ -426,9 +451,33 @@
27768  # CONFIG_EQUALIZER is not set
27769  # CONFIG_TUN is not set
27770  # CONFIG_VETH is not set
27771 -# CONFIG_NET_ETHERNET is not set
27772 +# CONFIG_IP1000 is not set
27773 +# CONFIG_ARCNET is not set
27774 +# CONFIG_PHYLIB is not set
27775 +CONFIG_NET_ETHERNET=y
27776 +# CONFIG_MII is not set
27777 +# CONFIG_HAPPYMEAL is not set
27778 +# CONFIG_SUNGEM is not set
27779 +# CONFIG_CASSINI is not set
27780 +# CONFIG_NET_VENDOR_3COM is not set
27781 +# CONFIG_NET_TULIP is not set
27782 +# CONFIG_HP100 is not set
27783 +CONFIG_IBM_NEW_EMAC=y
27784 +CONFIG_IBM_NEW_EMAC_RXB=256
27785 +CONFIG_IBM_NEW_EMAC_TXB=256
27786 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
27787 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
27788 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
27789 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
27790 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
27791 +CONFIG_IBM_NEW_EMAC_RGMII=y
27792 +# CONFIG_IBM_NEW_EMAC_TAH is not set
27793 +CONFIG_IBM_NEW_EMAC_EMAC4=y
27794 +# CONFIG_NET_PCI is not set
27795 +# CONFIG_B44 is not set
27796  # CONFIG_NETDEV_1000 is not set
27797  # CONFIG_NETDEV_10000 is not set
27798 +# CONFIG_TR is not set
27799  
27800  #
27801  # Wireless LAN
27802 @@ -436,6 +485,8 @@
27803  # CONFIG_WLAN_PRE80211 is not set
27804  # CONFIG_WLAN_80211 is not set
27805  # CONFIG_WAN is not set
27806 +# CONFIG_FDDI is not set
27807 +# CONFIG_HIPPI is not set
27808  # CONFIG_PPP is not set
27809  # CONFIG_SLIP is not set
27810  # CONFIG_SHAPER is not set
27811 @@ -467,6 +518,7 @@
27812  #
27813  CONFIG_SERIAL_8250=y
27814  CONFIG_SERIAL_8250_CONSOLE=y
27815 +CONFIG_SERIAL_8250_PCI=y
27816  CONFIG_SERIAL_8250_NR_UARTS=4
27817  CONFIG_SERIAL_8250_RUNTIME_UARTS=4
27818  CONFIG_SERIAL_8250_EXTENDED=y
27819 @@ -481,6 +533,7 @@
27820  # CONFIG_SERIAL_UARTLITE is not set
27821  CONFIG_SERIAL_CORE=y
27822  CONFIG_SERIAL_CORE_CONSOLE=y
27823 +# CONFIG_SERIAL_JSM is not set
27824  CONFIG_SERIAL_OF_PLATFORM=y
27825  CONFIG_UNIX98_PTYS=y
27826  CONFIG_LEGACY_PTYS=y
27827 @@ -490,8 +543,10 @@
27828  # CONFIG_NVRAM is not set
27829  # CONFIG_GEN_RTC is not set
27830  # CONFIG_R3964 is not set
27831 +# CONFIG_APPLICOM is not set
27832  # CONFIG_RAW_DRIVER is not set
27833  # CONFIG_TCG_TPM is not set
27834 +CONFIG_DEVPORT=y
27835  # CONFIG_I2C is not set
27836  
27837  #
27838 @@ -525,6 +580,8 @@
27839  #
27840  # Graphics support
27841  #
27842 +# CONFIG_AGP is not set
27843 +# CONFIG_DRM is not set
27844  # CONFIG_VGASTATE is not set
27845  # CONFIG_VIDEO_OUTPUT_CONTROL is not set
27846  # CONFIG_FB is not set
27847 @@ -542,6 +599,7 @@
27848  # CONFIG_USB_SUPPORT is not set
27849  # CONFIG_MMC is not set
27850  # CONFIG_NEW_LEDS is not set
27851 +# CONFIG_INFINIBAND is not set
27852  # CONFIG_EDAC is not set
27853  # CONFIG_RTC_CLASS is not set
27854  
27855 --- a/arch/powerpc/configs/lite5200_defconfig
27856 +++ /dev/null
27857 @@ -1,847 +0,0 @@
27858 -#
27859 -# Automatically generated make config: don't edit
27860 -# Linux kernel version: 2.6.24-rc4
27861 -# Thu Dec  6 16:48:24 2007
27862 -#
27863 -# CONFIG_PPC64 is not set
27864 -
27865 -#
27866 -# Processor support
27867 -#
27868 -CONFIG_6xx=y
27869 -# CONFIG_PPC_85xx is not set
27870 -# CONFIG_PPC_8xx is not set
27871 -# CONFIG_40x is not set
27872 -# CONFIG_44x is not set
27873 -# CONFIG_E200 is not set
27874 -CONFIG_PPC_FPU=y
27875 -# CONFIG_ALTIVEC is not set
27876 -CONFIG_PPC_STD_MMU=y
27877 -CONFIG_PPC_STD_MMU_32=y
27878 -# CONFIG_PPC_MM_SLICES is not set
27879 -# CONFIG_SMP is not set
27880 -CONFIG_PPC32=y
27881 -CONFIG_WORD_SIZE=32
27882 -CONFIG_PPC_MERGE=y
27883 -CONFIG_MMU=y
27884 -CONFIG_GENERIC_CMOS_UPDATE=y
27885 -CONFIG_GENERIC_TIME=y
27886 -CONFIG_GENERIC_TIME_VSYSCALL=y
27887 -CONFIG_GENERIC_CLOCKEVENTS=y
27888 -CONFIG_GENERIC_HARDIRQS=y
27889 -CONFIG_IRQ_PER_CPU=y
27890 -CONFIG_RWSEM_XCHGADD_ALGORITHM=y
27891 -CONFIG_ARCH_HAS_ILOG2_U32=y
27892 -CONFIG_GENERIC_HWEIGHT=y
27893 -CONFIG_GENERIC_CALIBRATE_DELAY=y
27894 -CONFIG_GENERIC_FIND_NEXT_BIT=y
27895 -# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
27896 -CONFIG_PPC=y
27897 -CONFIG_EARLY_PRINTK=y
27898 -CONFIG_GENERIC_NVRAM=y
27899 -CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
27900 -CONFIG_ARCH_MAY_HAVE_PC_FDC=y
27901 -CONFIG_PPC_OF=y
27902 -CONFIG_OF=y
27903 -# CONFIG_PPC_UDBG_16550 is not set
27904 -# CONFIG_GENERIC_TBSYNC is not set
27905 -CONFIG_AUDIT_ARCH=y
27906 -CONFIG_GENERIC_BUG=y
27907 -# CONFIG_DEFAULT_UIMAGE is not set
27908 -# CONFIG_PPC_DCR_NATIVE is not set
27909 -# CONFIG_PPC_DCR_MMIO is not set
27910 -CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
27911 -
27912 -#
27913 -# General setup
27914 -#
27915 -CONFIG_EXPERIMENTAL=y
27916 -CONFIG_BROKEN_ON_SMP=y
27917 -CONFIG_INIT_ENV_ARG_LIMIT=32
27918 -CONFIG_LOCALVERSION=""
27919 -CONFIG_LOCALVERSION_AUTO=y
27920 -CONFIG_SWAP=y
27921 -CONFIG_SYSVIPC=y
27922 -CONFIG_SYSVIPC_SYSCTL=y
27923 -# CONFIG_POSIX_MQUEUE is not set
27924 -# CONFIG_BSD_PROCESS_ACCT is not set
27925 -# CONFIG_TASKSTATS is not set
27926 -# CONFIG_USER_NS is not set
27927 -# CONFIG_PID_NS is not set
27928 -# CONFIG_AUDIT is not set
27929 -# CONFIG_IKCONFIG is not set
27930 -CONFIG_LOG_BUF_SHIFT=14
27931 -# CONFIG_CGROUPS is not set
27932 -# CONFIG_FAIR_GROUP_SCHED is not set
27933 -CONFIG_SYSFS_DEPRECATED=y
27934 -# CONFIG_RELAY is not set
27935 -CONFIG_BLK_DEV_INITRD=y
27936 -CONFIG_INITRAMFS_SOURCE=""
27937 -# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
27938 -CONFIG_SYSCTL=y
27939 -CONFIG_EMBEDDED=y
27940 -# CONFIG_SYSCTL_SYSCALL is not set
27941 -# CONFIG_KALLSYMS is not set
27942 -CONFIG_HOTPLUG=y
27943 -CONFIG_PRINTK=y
27944 -CONFIG_BUG=y
27945 -CONFIG_ELF_CORE=y
27946 -CONFIG_BASE_FULL=y
27947 -CONFIG_FUTEX=y
27948 -CONFIG_ANON_INODES=y
27949 -# CONFIG_EPOLL is not set
27950 -CONFIG_SIGNALFD=y
27951 -CONFIG_EVENTFD=y
27952 -CONFIG_SHMEM=y
27953 -CONFIG_VM_EVENT_COUNTERS=y
27954 -CONFIG_SLUB_DEBUG=y
27955 -# CONFIG_SLAB is not set
27956 -CONFIG_SLUB=y
27957 -# CONFIG_SLOB is not set
27958 -CONFIG_RT_MUTEXES=y
27959 -# CONFIG_TINY_SHMEM is not set
27960 -CONFIG_BASE_SMALL=0
27961 -CONFIG_MODULES=y
27962 -CONFIG_MODULE_UNLOAD=y
27963 -# CONFIG_MODULE_FORCE_UNLOAD is not set
27964 -# CONFIG_MODVERSIONS is not set
27965 -# CONFIG_MODULE_SRCVERSION_ALL is not set
27966 -# CONFIG_KMOD is not set
27967 -CONFIG_BLOCK=y
27968 -# CONFIG_LBD is not set
27969 -# CONFIG_BLK_DEV_IO_TRACE is not set
27970 -# CONFIG_LSF is not set
27971 -# CONFIG_BLK_DEV_BSG is not set
27972 -
27973 -#
27974 -# IO Schedulers
27975 -#
27976 -CONFIG_IOSCHED_NOOP=y
27977 -CONFIG_IOSCHED_AS=y
27978 -CONFIG_IOSCHED_DEADLINE=y
27979 -CONFIG_IOSCHED_CFQ=y
27980 -CONFIG_DEFAULT_AS=y
27981 -# CONFIG_DEFAULT_DEADLINE is not set
27982 -# CONFIG_DEFAULT_CFQ is not set
27983 -# CONFIG_DEFAULT_NOOP is not set
27984 -CONFIG_DEFAULT_IOSCHED="anticipatory"
27985 -
27986 -#
27987 -# Platform support
27988 -#
27989 -CONFIG_PPC_MULTIPLATFORM=y
27990 -# CONFIG_PPC_82xx is not set
27991 -# CONFIG_PPC_83xx is not set
27992 -# CONFIG_PPC_86xx is not set
27993 -CONFIG_CLASSIC32=y
27994 -# CONFIG_PPC_CHRP is not set
27995 -CONFIG_PPC_MPC52xx=y
27996 -CONFIG_PPC_MPC5200=y
27997 -CONFIG_PPC_MPC5200_BUGFIX=y
27998 -# CONFIG_PPC_EFIKA is not set
27999 -CONFIG_PPC_LITE5200=y
28000 -# CONFIG_PPC_PMAC is not set
28001 -# CONFIG_PPC_CELL is not set
28002 -# CONFIG_PPC_CELL_NATIVE is not set
28003 -# CONFIG_PQ2ADS is not set
28004 -# CONFIG_EMBEDDED6xx is not set
28005 -# CONFIG_MPIC is not set
28006 -# CONFIG_MPIC_WEIRD is not set
28007 -# CONFIG_PPC_I8259 is not set
28008 -# CONFIG_PPC_RTAS is not set
28009 -# CONFIG_MMIO_NVRAM is not set
28010 -# CONFIG_PPC_MPC106 is not set
28011 -# CONFIG_PPC_970_NAP is not set
28012 -# CONFIG_PPC_INDIRECT_IO is not set
28013 -# CONFIG_GENERIC_IOMAP is not set
28014 -# CONFIG_CPU_FREQ is not set
28015 -# CONFIG_TAU is not set
28016 -# CONFIG_CPM2 is not set
28017 -# CONFIG_FSL_ULI1575 is not set
28018 -CONFIG_PPC_BESTCOMM=y
28019 -CONFIG_PPC_BESTCOMM_ATA=y
28020 -CONFIG_PPC_BESTCOMM_FEC=y
28021 -CONFIG_PPC_BESTCOMM_GEN_BD=y
28022 -
28023 -#
28024 -# Kernel options
28025 -#
28026 -# CONFIG_HIGHMEM is not set
28027 -CONFIG_TICK_ONESHOT=y
28028 -CONFIG_NO_HZ=y
28029 -CONFIG_HIGH_RES_TIMERS=y
28030 -CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
28031 -# CONFIG_HZ_100 is not set
28032 -CONFIG_HZ_250=y
28033 -# CONFIG_HZ_300 is not set
28034 -# CONFIG_HZ_1000 is not set
28035 -CONFIG_HZ=250
28036 -CONFIG_PREEMPT_NONE=y
28037 -# CONFIG_PREEMPT_VOLUNTARY is not set
28038 -# CONFIG_PREEMPT is not set
28039 -CONFIG_BINFMT_ELF=y
28040 -# CONFIG_BINFMT_MISC is not set
28041 -CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
28042 -# CONFIG_KEXEC is not set
28043 -CONFIG_ARCH_FLATMEM_ENABLE=y
28044 -CONFIG_ARCH_POPULATES_NODE_MAP=y
28045 -CONFIG_SELECT_MEMORY_MODEL=y
28046 -CONFIG_FLATMEM_MANUAL=y
28047 -# CONFIG_DISCONTIGMEM_MANUAL is not set
28048 -# CONFIG_SPARSEMEM_MANUAL is not set
28049 -CONFIG_FLATMEM=y
28050 -CONFIG_FLAT_NODE_MEM_MAP=y
28051 -# CONFIG_SPARSEMEM_STATIC is not set
28052 -# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
28053 -CONFIG_SPLIT_PTLOCK_CPUS=4
28054 -# CONFIG_RESOURCES_64BIT is not set
28055 -CONFIG_ZONE_DMA_FLAG=1
28056 -CONFIG_BOUNCE=y
28057 -CONFIG_VIRT_TO_BUS=y
28058 -CONFIG_PROC_DEVICETREE=y
28059 -# CONFIG_CMDLINE_BOOL is not set
28060 -CONFIG_PM=y
28061 -# CONFIG_PM_LEGACY is not set
28062 -# CONFIG_PM_DEBUG is not set
28063 -CONFIG_PM_SLEEP=y
28064 -CONFIG_SUSPEND_UP_POSSIBLE=y
28065 -CONFIG_SUSPEND=y
28066 -CONFIG_HIBERNATION_UP_POSSIBLE=y
28067 -# CONFIG_HIBERNATION is not set
28068 -CONFIG_SECCOMP=y
28069 -CONFIG_WANT_DEVICE_TREE=y
28070 -CONFIG_DEVICE_TREE=""
28071 -CONFIG_ISA_DMA_API=y
28072 -
28073 -#
28074 -# Bus options
28075 -#
28076 -CONFIG_ZONE_DMA=y
28077 -CONFIG_GENERIC_ISA_DMA=y
28078 -# CONFIG_PPC_INDIRECT_PCI is not set
28079 -CONFIG_FSL_SOC=y
28080 -CONFIG_PCI=y
28081 -CONFIG_PCI_DOMAINS=y
28082 -CONFIG_PCI_SYSCALL=y
28083 -# CONFIG_PCIEPORTBUS is not set
28084 -CONFIG_ARCH_SUPPORTS_MSI=y
28085 -# CONFIG_PCI_MSI is not set
28086 -CONFIG_PCI_LEGACY=y
28087 -# CONFIG_PCI_DEBUG is not set
28088 -# CONFIG_PCCARD is not set
28089 -# CONFIG_HOTPLUG_PCI is not set
28090 -
28091 -#
28092 -# Advanced setup
28093 -#
28094 -# CONFIG_ADVANCED_OPTIONS is not set
28095 -
28096 -#
28097 -# Default settings for advanced configuration options are used
28098 -#
28099 -CONFIG_HIGHMEM_START=0xfe000000
28100 -CONFIG_LOWMEM_SIZE=0x30000000
28101 -CONFIG_KERNEL_START=0xc0000000
28102 -CONFIG_TASK_SIZE=0xc0000000
28103 -CONFIG_BOOT_LOAD=0x00800000
28104 -
28105 -#
28106 -# Networking
28107 -#
28108 -CONFIG_NET=y
28109 -
28110 -#
28111 -# Networking options
28112 -#
28113 -CONFIG_PACKET=y
28114 -# CONFIG_PACKET_MMAP is not set
28115 -CONFIG_UNIX=y
28116 -CONFIG_XFRM=y
28117 -CONFIG_XFRM_USER=m
28118 -# CONFIG_XFRM_SUB_POLICY is not set
28119 -# CONFIG_XFRM_MIGRATE is not set
28120 -# CONFIG_NET_KEY is not set
28121 -CONFIG_INET=y
28122 -CONFIG_IP_MULTICAST=y
28123 -# CONFIG_IP_ADVANCED_ROUTER is not set
28124 -CONFIG_IP_FIB_HASH=y
28125 -CONFIG_IP_PNP=y
28126 -CONFIG_IP_PNP_DHCP=y
28127 -CONFIG_IP_PNP_BOOTP=y
28128 -# CONFIG_IP_PNP_RARP is not set
28129 -# CONFIG_NET_IPIP is not set
28130 -# CONFIG_NET_IPGRE is not set
28131 -# CONFIG_IP_MROUTE is not set
28132 -# CONFIG_ARPD is not set
28133 -CONFIG_SYN_COOKIES=y
28134 -# CONFIG_INET_AH is not set
28135 -# CONFIG_INET_ESP is not set
28136 -# CONFIG_INET_IPCOMP is not set
28137 -# CONFIG_INET_XFRM_TUNNEL is not set
28138 -# CONFIG_INET_TUNNEL is not set
28139 -CONFIG_INET_XFRM_MODE_TRANSPORT=y
28140 -CONFIG_INET_XFRM_MODE_TUNNEL=y
28141 -CONFIG_INET_XFRM_MODE_BEET=y
28142 -# CONFIG_INET_LRO is not set
28143 -CONFIG_INET_DIAG=y
28144 -CONFIG_INET_TCP_DIAG=y
28145 -# CONFIG_TCP_CONG_ADVANCED is not set
28146 -CONFIG_TCP_CONG_CUBIC=y
28147 -CONFIG_DEFAULT_TCP_CONG="cubic"
28148 -# CONFIG_TCP_MD5SIG is not set
28149 -# CONFIG_IPV6 is not set
28150 -# CONFIG_INET6_XFRM_TUNNEL is not set
28151 -# CONFIG_INET6_TUNNEL is not set
28152 -# CONFIG_NETWORK_SECMARK is not set
28153 -# CONFIG_NETFILTER is not set
28154 -# CONFIG_IP_DCCP is not set
28155 -# CONFIG_IP_SCTP is not set
28156 -# CONFIG_TIPC is not set
28157 -# CONFIG_ATM is not set
28158 -# CONFIG_BRIDGE is not set
28159 -# CONFIG_VLAN_8021Q is not set
28160 -# CONFIG_DECNET is not set
28161 -# CONFIG_LLC2 is not set
28162 -# CONFIG_IPX is not set
28163 -# CONFIG_ATALK is not set
28164 -# CONFIG_X25 is not set
28165 -# CONFIG_LAPB is not set
28166 -# CONFIG_ECONET is not set
28167 -# CONFIG_WAN_ROUTER is not set
28168 -# CONFIG_NET_SCHED is not set
28169 -
28170 -#
28171 -# Network testing
28172 -#
28173 -# CONFIG_NET_PKTGEN is not set
28174 -# CONFIG_HAMRADIO is not set
28175 -# CONFIG_IRDA is not set
28176 -# CONFIG_BT is not set
28177 -# CONFIG_AF_RXRPC is not set
28178 -
28179 -#
28180 -# Wireless
28181 -#
28182 -# CONFIG_CFG80211 is not set
28183 -# CONFIG_WIRELESS_EXT is not set
28184 -# CONFIG_MAC80211 is not set
28185 -# CONFIG_IEEE80211 is not set
28186 -# CONFIG_RFKILL is not set
28187 -# CONFIG_NET_9P is not set
28188 -
28189 -#
28190 -# Device Drivers
28191 -#
28192 -
28193 -#
28194 -# Generic Driver Options
28195 -#
28196 -CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
28197 -CONFIG_STANDALONE=y
28198 -CONFIG_PREVENT_FIRMWARE_BUILD=y
28199 -# CONFIG_FW_LOADER is not set
28200 -# CONFIG_DEBUG_DRIVER is not set
28201 -# CONFIG_DEBUG_DEVRES is not set
28202 -# CONFIG_SYS_HYPERVISOR is not set
28203 -# CONFIG_CONNECTOR is not set
28204 -# CONFIG_MTD is not set
28205 -CONFIG_OF_DEVICE=y
28206 -# CONFIG_PARPORT is not set
28207 -CONFIG_BLK_DEV=y
28208 -# CONFIG_BLK_DEV_FD is not set
28209 -# CONFIG_BLK_CPQ_DA is not set
28210 -# CONFIG_BLK_CPQ_CISS_DA is not set
28211 -# CONFIG_BLK_DEV_DAC960 is not set
28212 -# CONFIG_BLK_DEV_UMEM is not set
28213 -# CONFIG_BLK_DEV_COW_COMMON is not set
28214 -CONFIG_BLK_DEV_LOOP=y
28215 -# CONFIG_BLK_DEV_CRYPTOLOOP is not set
28216 -# CONFIG_BLK_DEV_NBD is not set
28217 -# CONFIG_BLK_DEV_SX8 is not set
28218 -CONFIG_BLK_DEV_RAM=y
28219 -CONFIG_BLK_DEV_RAM_COUNT=16
28220 -CONFIG_BLK_DEV_RAM_SIZE=32768
28221 -CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
28222 -# CONFIG_CDROM_PKTCDVD is not set
28223 -# CONFIG_ATA_OVER_ETH is not set
28224 -CONFIG_MISC_DEVICES=y
28225 -# CONFIG_PHANTOM is not set
28226 -# CONFIG_EEPROM_93CX6 is not set
28227 -# CONFIG_SGI_IOC4 is not set
28228 -# CONFIG_TIFM_CORE is not set
28229 -# CONFIG_IDE is not set
28230 -
28231 -#
28232 -# SCSI device support
28233 -#
28234 -# CONFIG_RAID_ATTRS is not set
28235 -CONFIG_SCSI=y
28236 -CONFIG_SCSI_DMA=y
28237 -# CONFIG_SCSI_TGT is not set
28238 -# CONFIG_SCSI_NETLINK is not set
28239 -# CONFIG_SCSI_PROC_FS is not set
28240 -
28241 -#
28242 -# SCSI support type (disk, tape, CD-ROM)
28243 -#
28244 -# CONFIG_BLK_DEV_SD is not set
28245 -# CONFIG_CHR_DEV_ST is not set
28246 -# CONFIG_CHR_DEV_OSST is not set
28247 -# CONFIG_BLK_DEV_SR is not set
28248 -# CONFIG_CHR_DEV_SG is not set
28249 -# CONFIG_CHR_DEV_SCH is not set
28250 -
28251 -#
28252 -# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
28253 -#
28254 -# CONFIG_SCSI_MULTI_LUN is not set
28255 -# CONFIG_SCSI_CONSTANTS is not set
28256 -# CONFIG_SCSI_LOGGING is not set
28257 -# CONFIG_SCSI_SCAN_ASYNC is not set
28258 -CONFIG_SCSI_WAIT_SCAN=m
28259 -
28260 -#
28261 -# SCSI Transports
28262 -#
28263 -# CONFIG_SCSI_SPI_ATTRS is not set
28264 -# CONFIG_SCSI_FC_ATTRS is not set
28265 -# CONFIG_SCSI_ISCSI_ATTRS is not set
28266 -# CONFIG_SCSI_SAS_LIBSAS is not set
28267 -# CONFIG_SCSI_SRP_ATTRS is not set
28268 -CONFIG_SCSI_LOWLEVEL=y
28269 -# CONFIG_ISCSI_TCP is not set
28270 -# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
28271 -# CONFIG_SCSI_3W_9XXX is not set
28272 -# CONFIG_SCSI_ACARD is not set
28273 -# CONFIG_SCSI_AACRAID is not set
28274 -# CONFIG_SCSI_AIC7XXX is not set
28275 -# CONFIG_SCSI_AIC7XXX_OLD is not set
28276 -# CONFIG_SCSI_AIC79XX is not set
28277 -# CONFIG_SCSI_AIC94XX is not set
28278 -# CONFIG_SCSI_DPT_I2O is not set
28279 -# CONFIG_SCSI_ADVANSYS is not set
28280 -# CONFIG_SCSI_ARCMSR is not set
28281 -# CONFIG_MEGARAID_NEWGEN is not set
28282 -# CONFIG_MEGARAID_LEGACY is not set
28283 -# CONFIG_MEGARAID_SAS is not set
28284 -# CONFIG_SCSI_HPTIOP is not set
28285 -# CONFIG_SCSI_BUSLOGIC is not set
28286 -# CONFIG_SCSI_DMX3191D is not set
28287 -# CONFIG_SCSI_EATA is not set
28288 -# CONFIG_SCSI_FUTURE_DOMAIN is not set
28289 -# CONFIG_SCSI_GDTH is not set
28290 -# CONFIG_SCSI_IPS is not set
28291 -# CONFIG_SCSI_INITIO is not set
28292 -# CONFIG_SCSI_INIA100 is not set
28293 -# CONFIG_SCSI_STEX is not set
28294 -# CONFIG_SCSI_SYM53C8XX_2 is not set
28295 -# CONFIG_SCSI_IPR is not set
28296 -# CONFIG_SCSI_QLOGIC_1280 is not set
28297 -# CONFIG_SCSI_QLA_FC is not set
28298 -# CONFIG_SCSI_QLA_ISCSI is not set
28299 -# CONFIG_SCSI_LPFC is not set
28300 -# CONFIG_SCSI_DC395x is not set
28301 -# CONFIG_SCSI_DC390T is not set
28302 -# CONFIG_SCSI_NSP32 is not set
28303 -# CONFIG_SCSI_DEBUG is not set
28304 -# CONFIG_SCSI_SRP is not set
28305 -CONFIG_ATA=y
28306 -# CONFIG_ATA_NONSTANDARD is not set
28307 -# CONFIG_SATA_AHCI is not set
28308 -# CONFIG_SATA_SVW is not set
28309 -# CONFIG_ATA_PIIX is not set
28310 -# CONFIG_SATA_MV is not set
28311 -# CONFIG_SATA_NV is not set
28312 -# CONFIG_PDC_ADMA is not set
28313 -# CONFIG_SATA_QSTOR is not set
28314 -# CONFIG_SATA_PROMISE is not set
28315 -# CONFIG_SATA_SX4 is not set
28316 -# CONFIG_SATA_SIL is not set
28317 -# CONFIG_SATA_SIL24 is not set
28318 -# CONFIG_SATA_SIS is not set
28319 -# CONFIG_SATA_ULI is not set
28320 -# CONFIG_SATA_VIA is not set
28321 -# CONFIG_SATA_VITESSE is not set
28322 -# CONFIG_SATA_INIC162X is not set
28323 -# CONFIG_PATA_ALI is not set
28324 -# CONFIG_PATA_AMD is not set
28325 -# CONFIG_PATA_ARTOP is not set
28326 -# CONFIG_PATA_ATIIXP is not set
28327 -# CONFIG_PATA_CMD640_PCI is not set
28328 -# CONFIG_PATA_CMD64X is not set
28329 -# CONFIG_PATA_CS5520 is not set
28330 -# CONFIG_PATA_CS5530 is not set
28331 -# CONFIG_PATA_CYPRESS is not set
28332 -# CONFIG_PATA_EFAR is not set
28333 -# CONFIG_ATA_GENERIC is not set
28334 -# CONFIG_PATA_HPT366 is not set
28335 -# CONFIG_PATA_HPT37X is not set
28336 -# CONFIG_PATA_HPT3X2N is not set
28337 -# CONFIG_PATA_HPT3X3 is not set
28338 -# CONFIG_PATA_IT821X is not set
28339 -# CONFIG_PATA_IT8213 is not set
28340 -# CONFIG_PATA_JMICRON is not set
28341 -# CONFIG_PATA_TRIFLEX is not set
28342 -# CONFIG_PATA_MARVELL is not set
28343 -CONFIG_PATA_MPC52xx=y
28344 -# CONFIG_PATA_MPIIX is not set
28345 -# CONFIG_PATA_OLDPIIX is not set
28346 -# CONFIG_PATA_NETCELL is not set
28347 -# CONFIG_PATA_NS87410 is not set
28348 -# CONFIG_PATA_NS87415 is not set
28349 -# CONFIG_PATA_OPTI is not set
28350 -# CONFIG_PATA_OPTIDMA is not set
28351 -# CONFIG_PATA_PDC_OLD is not set
28352 -# CONFIG_PATA_RADISYS is not set
28353 -# CONFIG_PATA_RZ1000 is not set
28354 -# CONFIG_PATA_SC1200 is not set
28355 -# CONFIG_PATA_SERVERWORKS is not set
28356 -# CONFIG_PATA_PDC2027X is not set
28357 -# CONFIG_PATA_SIL680 is not set
28358 -# CONFIG_PATA_SIS is not set
28359 -# CONFIG_PATA_VIA is not set
28360 -# CONFIG_PATA_WINBOND is not set
28361 -# CONFIG_PATA_PLATFORM is not set
28362 -# CONFIG_MD is not set
28363 -# CONFIG_FUSION is not set
28364 -
28365 -#
28366 -# IEEE 1394 (FireWire) support
28367 -#
28368 -# CONFIG_FIREWIRE is not set
28369 -# CONFIG_IEEE1394 is not set
28370 -# CONFIG_I2O is not set
28371 -# CONFIG_MACINTOSH_DRIVERS is not set
28372 -CONFIG_NETDEVICES=y
28373 -# CONFIG_NETDEVICES_MULTIQUEUE is not set
28374 -# CONFIG_DUMMY is not set
28375 -# CONFIG_BONDING is not set
28376 -# CONFIG_MACVLAN is not set
28377 -# CONFIG_EQUALIZER is not set
28378 -# CONFIG_TUN is not set
28379 -# CONFIG_VETH is not set
28380 -# CONFIG_IP1000 is not set
28381 -# CONFIG_ARCNET is not set
28382 -# CONFIG_NET_ETHERNET is not set
28383 -CONFIG_NETDEV_1000=y
28384 -# CONFIG_ACENIC is not set
28385 -# CONFIG_DL2K is not set
28386 -# CONFIG_E1000 is not set
28387 -# CONFIG_E1000E is not set
28388 -# CONFIG_NS83820 is not set
28389 -# CONFIG_HAMACHI is not set
28390 -# CONFIG_YELLOWFIN is not set
28391 -# CONFIG_R8169 is not set
28392 -# CONFIG_SIS190 is not set
28393 -# CONFIG_SKGE is not set
28394 -# CONFIG_SKY2 is not set
28395 -# CONFIG_SK98LIN is not set
28396 -# CONFIG_VIA_VELOCITY is not set
28397 -# CONFIG_TIGON3 is not set
28398 -# CONFIG_BNX2 is not set
28399 -# CONFIG_MV643XX_ETH is not set
28400 -# CONFIG_QLA3XXX is not set
28401 -# CONFIG_ATL1 is not set
28402 -CONFIG_NETDEV_10000=y
28403 -# CONFIG_CHELSIO_T1 is not set
28404 -# CONFIG_CHELSIO_T3 is not set
28405 -# CONFIG_IXGBE is not set
28406 -# CONFIG_IXGB is not set
28407 -# CONFIG_S2IO is not set
28408 -# CONFIG_MYRI10GE is not set
28409 -# CONFIG_NETXEN_NIC is not set
28410 -# CONFIG_NIU is not set
28411 -# CONFIG_MLX4_CORE is not set
28412 -# CONFIG_TEHUTI is not set
28413 -# CONFIG_TR is not set
28414 -
28415 -#
28416 -# Wireless LAN
28417 -#
28418 -# CONFIG_WLAN_PRE80211 is not set
28419 -# CONFIG_WLAN_80211 is not set
28420 -# CONFIG_WAN is not set
28421 -# CONFIG_FDDI is not set
28422 -# CONFIG_HIPPI is not set
28423 -# CONFIG_PPP is not set
28424 -# CONFIG_SLIP is not set
28425 -# CONFIG_NET_FC is not set
28426 -# CONFIG_SHAPER is not set
28427 -# CONFIG_NETCONSOLE is not set
28428 -# CONFIG_NETPOLL is not set
28429 -# CONFIG_NET_POLL_CONTROLLER is not set
28430 -# CONFIG_ISDN is not set
28431 -# CONFIG_PHONE is not set
28432 -
28433 -#
28434 -# Input device support
28435 -#
28436 -# CONFIG_INPUT is not set
28437 -
28438 -#
28439 -# Hardware I/O ports
28440 -#
28441 -# CONFIG_SERIO is not set
28442 -# CONFIG_GAMEPORT is not set
28443 -
28444 -#
28445 -# Character devices
28446 -#
28447 -# CONFIG_VT is not set
28448 -# CONFIG_SERIAL_NONSTANDARD is not set
28449 -
28450 -#
28451 -# Serial drivers
28452 -#
28453 -# CONFIG_SERIAL_8250 is not set
28454 -
28455 -#
28456 -# Non-8250 serial port support
28457 -#
28458 -# CONFIG_SERIAL_UARTLITE is not set
28459 -CONFIG_SERIAL_CORE=y
28460 -CONFIG_SERIAL_CORE_CONSOLE=y
28461 -CONFIG_SERIAL_MPC52xx=y
28462 -CONFIG_SERIAL_MPC52xx_CONSOLE=y
28463 -CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=9600
28464 -# CONFIG_SERIAL_JSM is not set
28465 -CONFIG_UNIX98_PTYS=y
28466 -CONFIG_LEGACY_PTYS=y
28467 -CONFIG_LEGACY_PTY_COUNT=256
28468 -# CONFIG_IPMI_HANDLER is not set
28469 -# CONFIG_HW_RANDOM is not set
28470 -# CONFIG_NVRAM is not set
28471 -# CONFIG_GEN_RTC is not set
28472 -# CONFIG_R3964 is not set
28473 -# CONFIG_APPLICOM is not set
28474 -# CONFIG_RAW_DRIVER is not set
28475 -# CONFIG_TCG_TPM is not set
28476 -CONFIG_DEVPORT=y
28477 -# CONFIG_I2C is not set
28478 -
28479 -#
28480 -# SPI support
28481 -#
28482 -# CONFIG_SPI is not set
28483 -# CONFIG_SPI_MASTER is not set
28484 -# CONFIG_W1 is not set
28485 -# CONFIG_POWER_SUPPLY is not set
28486 -# CONFIG_HWMON is not set
28487 -# CONFIG_WATCHDOG is not set
28488 -
28489 -#
28490 -# Sonics Silicon Backplane
28491 -#
28492 -CONFIG_SSB_POSSIBLE=y
28493 -# CONFIG_SSB is not set
28494 -
28495 -#
28496 -# Multifunction device drivers
28497 -#
28498 -# CONFIG_MFD_SM501 is not set
28499 -
28500 -#
28501 -# Multimedia devices
28502 -#
28503 -# CONFIG_VIDEO_DEV is not set
28504 -# CONFIG_DVB_CORE is not set
28505 -# CONFIG_DAB is not set
28506 -
28507 -#
28508 -# Graphics support
28509 -#
28510 -# CONFIG_AGP is not set
28511 -# CONFIG_DRM is not set
28512 -# CONFIG_VGASTATE is not set
28513 -CONFIG_VIDEO_OUTPUT_CONTROL=m
28514 -# CONFIG_FB is not set
28515 -# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
28516 -
28517 -#
28518 -# Display device support
28519 -#
28520 -# CONFIG_DISPLAY_SUPPORT is not set
28521 -
28522 -#
28523 -# Sound
28524 -#
28525 -# CONFIG_SOUND is not set
28526 -CONFIG_USB_SUPPORT=y
28527 -CONFIG_USB_ARCH_HAS_HCD=y
28528 -CONFIG_USB_ARCH_HAS_OHCI=y
28529 -CONFIG_USB_ARCH_HAS_EHCI=y
28530 -# CONFIG_USB is not set
28531 -
28532 -#
28533 -# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
28534 -#
28535 -
28536 -#
28537 -# USB Gadget Support
28538 -#
28539 -# CONFIG_USB_GADGET is not set
28540 -# CONFIG_MMC is not set
28541 -# CONFIG_NEW_LEDS is not set
28542 -# CONFIG_INFINIBAND is not set
28543 -# CONFIG_EDAC is not set
28544 -# CONFIG_RTC_CLASS is not set
28545 -
28546 -#
28547 -# Userspace I/O
28548 -#
28549 -# CONFIG_UIO is not set
28550 -
28551 -#
28552 -# File systems
28553 -#
28554 -CONFIG_EXT2_FS=y
28555 -# CONFIG_EXT2_FS_XATTR is not set
28556 -# CONFIG_EXT2_FS_XIP is not set
28557 -CONFIG_EXT3_FS=y
28558 -CONFIG_EXT3_FS_XATTR=y
28559 -# CONFIG_EXT3_FS_POSIX_ACL is not set
28560 -# CONFIG_EXT3_FS_SECURITY is not set
28561 -# CONFIG_EXT4DEV_FS is not set
28562 -CONFIG_JBD=y
28563 -CONFIG_FS_MBCACHE=y
28564 -# CONFIG_REISERFS_FS is not set
28565 -# CONFIG_JFS_FS is not set
28566 -# CONFIG_FS_POSIX_ACL is not set
28567 -# CONFIG_XFS_FS is not set
28568 -# CONFIG_GFS2_FS is not set
28569 -# CONFIG_OCFS2_FS is not set
28570 -# CONFIG_MINIX_FS is not set
28571 -# CONFIG_ROMFS_FS is not set
28572 -CONFIG_INOTIFY=y
28573 -CONFIG_INOTIFY_USER=y
28574 -# CONFIG_QUOTA is not set
28575 -CONFIG_DNOTIFY=y
28576 -# CONFIG_AUTOFS_FS is not set
28577 -# CONFIG_AUTOFS4_FS is not set
28578 -# CONFIG_FUSE_FS is not set
28579 -
28580 -#
28581 -# CD-ROM/DVD Filesystems
28582 -#
28583 -# CONFIG_ISO9660_FS is not set
28584 -# CONFIG_UDF_FS is not set
28585 -
28586 -#
28587 -# DOS/FAT/NT Filesystems
28588 -#
28589 -# CONFIG_MSDOS_FS is not set
28590 -# CONFIG_VFAT_FS is not set
28591 -# CONFIG_NTFS_FS is not set
28592 -
28593 -#
28594 -# Pseudo filesystems
28595 -#
28596 -CONFIG_PROC_FS=y
28597 -CONFIG_PROC_KCORE=y
28598 -CONFIG_PROC_SYSCTL=y
28599 -CONFIG_SYSFS=y
28600 -CONFIG_TMPFS=y
28601 -# CONFIG_TMPFS_POSIX_ACL is not set
28602 -# CONFIG_HUGETLB_PAGE is not set
28603 -# CONFIG_CONFIGFS_FS is not set
28604 -
28605 -#
28606 -# Miscellaneous filesystems
28607 -#
28608 -# CONFIG_ADFS_FS is not set
28609 -# CONFIG_AFFS_FS is not set
28610 -# CONFIG_HFS_FS is not set
28611 -# CONFIG_HFSPLUS_FS is not set
28612 -# CONFIG_BEFS_FS is not set
28613 -# CONFIG_BFS_FS is not set
28614 -# CONFIG_EFS_FS is not set
28615 -# CONFIG_CRAMFS is not set
28616 -# CONFIG_VXFS_FS is not set
28617 -# CONFIG_HPFS_FS is not set
28618 -# CONFIG_QNX4FS_FS is not set
28619 -# CONFIG_SYSV_FS is not set
28620 -# CONFIG_UFS_FS is not set
28621 -CONFIG_NETWORK_FILESYSTEMS=y
28622 -# CONFIG_NFS_FS is not set
28623 -# CONFIG_NFSD is not set
28624 -# CONFIG_SMB_FS is not set
28625 -# CONFIG_CIFS is not set
28626 -# CONFIG_NCP_FS is not set
28627 -# CONFIG_CODA_FS is not set
28628 -# CONFIG_AFS_FS is not set
28629 -
28630 -#
28631 -# Partition Types
28632 -#
28633 -# CONFIG_PARTITION_ADVANCED is not set
28634 -CONFIG_MSDOS_PARTITION=y
28635 -# CONFIG_NLS is not set
28636 -# CONFIG_DLM is not set
28637 -# CONFIG_UCC_SLOW is not set
28638 -
28639 -#
28640 -# Library routines
28641 -#
28642 -# CONFIG_CRC_CCITT is not set
28643 -# CONFIG_CRC16 is not set
28644 -# CONFIG_CRC_ITU_T is not set
28645 -# CONFIG_CRC32 is not set
28646 -# CONFIG_CRC7 is not set
28647 -# CONFIG_LIBCRC32C is not set
28648 -CONFIG_PLIST=y
28649 -CONFIG_HAS_IOMEM=y
28650 -CONFIG_HAS_IOPORT=y
28651 -CONFIG_HAS_DMA=y
28652 -# CONFIG_INSTRUMENTATION is not set
28653 -
28654 -#
28655 -# Kernel hacking
28656 -#
28657 -CONFIG_PRINTK_TIME=y
28658 -CONFIG_ENABLE_WARN_DEPRECATED=y
28659 -CONFIG_ENABLE_MUST_CHECK=y
28660 -# CONFIG_MAGIC_SYSRQ is not set
28661 -# CONFIG_UNUSED_SYMBOLS is not set
28662 -# CONFIG_DEBUG_FS is not set
28663 -# CONFIG_HEADERS_CHECK is not set
28664 -CONFIG_DEBUG_KERNEL=y
28665 -# CONFIG_DEBUG_SHIRQ is not set
28666 -CONFIG_DETECT_SOFTLOCKUP=y
28667 -CONFIG_SCHED_DEBUG=y
28668 -# CONFIG_SCHEDSTATS is not set
28669 -# CONFIG_TIMER_STATS is not set
28670 -# CONFIG_SLUB_DEBUG_ON is not set
28671 -# CONFIG_DEBUG_RT_MUTEXES is not set
28672 -# CONFIG_RT_MUTEX_TESTER is not set
28673 -# CONFIG_DEBUG_SPINLOCK is not set
28674 -# CONFIG_DEBUG_MUTEXES is not set
28675 -# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
28676 -# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
28677 -# CONFIG_DEBUG_KOBJECT is not set
28678 -# CONFIG_DEBUG_BUGVERBOSE is not set
28679 -CONFIG_DEBUG_INFO=y
28680 -# CONFIG_DEBUG_VM is not set
28681 -# CONFIG_DEBUG_LIST is not set
28682 -# CONFIG_DEBUG_SG is not set
28683 -CONFIG_FORCED_INLINING=y
28684 -# CONFIG_BOOT_PRINTK_DELAY is not set
28685 -# CONFIG_RCU_TORTURE_TEST is not set
28686 -# CONFIG_FAULT_INJECTION is not set
28687 -# CONFIG_SAMPLES is not set
28688 -# CONFIG_DEBUG_STACKOVERFLOW is not set
28689 -# CONFIG_DEBUG_STACK_USAGE is not set
28690 -# CONFIG_DEBUG_PAGEALLOC is not set
28691 -# CONFIG_DEBUGGER is not set
28692 -# CONFIG_BDI_SWITCH is not set
28693 -# CONFIG_BOOTX_TEXT is not set
28694 -# CONFIG_PPC_EARLY_DEBUG is not set
28695 -
28696 -#
28697 -# Security options
28698 -#
28699 -# CONFIG_KEYS is not set
28700 -# CONFIG_SECURITY is not set
28701 -# CONFIG_SECURITY_FILE_CAPABILITIES is not set
28702 -# CONFIG_CRYPTO is not set
28703 -CONFIG_PPC_CLOCK=y
28704 -CONFIG_PPC_LIB_RHEAP=y
28705 --- /dev/null
28706 +++ b/arch/powerpc/configs/makalu_defconfig
28707 @@ -0,0 +1,812 @@
28708 +#
28709 +# Automatically generated make config: don't edit
28710 +# Linux kernel version: 2.6.24-rc6
28711 +# Mon Dec 24 11:18:32 2007
28712 +#
28713 +# CONFIG_PPC64 is not set
28714 +
28715 +#
28716 +# Processor support
28717 +#
28718 +# CONFIG_6xx is not set
28719 +# CONFIG_PPC_85xx is not set
28720 +# CONFIG_PPC_8xx is not set
28721 +CONFIG_40x=y
28722 +# CONFIG_44x is not set
28723 +# CONFIG_E200 is not set
28724 +CONFIG_4xx=y
28725 +# CONFIG_PPC_MM_SLICES is not set
28726 +CONFIG_NOT_COHERENT_CACHE=y
28727 +CONFIG_PPC32=y
28728 +CONFIG_WORD_SIZE=32
28729 +CONFIG_PPC_MERGE=y
28730 +CONFIG_MMU=y
28731 +CONFIG_GENERIC_CMOS_UPDATE=y
28732 +CONFIG_GENERIC_TIME=y
28733 +CONFIG_GENERIC_TIME_VSYSCALL=y
28734 +CONFIG_GENERIC_CLOCKEVENTS=y
28735 +CONFIG_GENERIC_HARDIRQS=y
28736 +CONFIG_IRQ_PER_CPU=y
28737 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
28738 +CONFIG_ARCH_HAS_ILOG2_U32=y
28739 +CONFIG_GENERIC_HWEIGHT=y
28740 +CONFIG_GENERIC_CALIBRATE_DELAY=y
28741 +CONFIG_GENERIC_FIND_NEXT_BIT=y
28742 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
28743 +CONFIG_PPC=y
28744 +CONFIG_EARLY_PRINTK=y
28745 +CONFIG_GENERIC_NVRAM=y
28746 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
28747 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
28748 +CONFIG_PPC_OF=y
28749 +CONFIG_OF=y
28750 +CONFIG_PPC_UDBG_16550=y
28751 +# CONFIG_GENERIC_TBSYNC is not set
28752 +CONFIG_AUDIT_ARCH=y
28753 +CONFIG_GENERIC_BUG=y
28754 +# CONFIG_DEFAULT_UIMAGE is not set
28755 +CONFIG_PPC_DCR_NATIVE=y
28756 +# CONFIG_PPC_DCR_MMIO is not set
28757 +CONFIG_PPC_DCR=y
28758 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28759 +
28760 +#
28761 +# General setup
28762 +#
28763 +CONFIG_EXPERIMENTAL=y
28764 +CONFIG_BROKEN_ON_SMP=y
28765 +CONFIG_INIT_ENV_ARG_LIMIT=32
28766 +CONFIG_LOCALVERSION=""
28767 +CONFIG_LOCALVERSION_AUTO=y
28768 +CONFIG_SWAP=y
28769 +CONFIG_SYSVIPC=y
28770 +CONFIG_SYSVIPC_SYSCTL=y
28771 +CONFIG_POSIX_MQUEUE=y
28772 +# CONFIG_BSD_PROCESS_ACCT is not set
28773 +# CONFIG_TASKSTATS is not set
28774 +# CONFIG_USER_NS is not set
28775 +# CONFIG_PID_NS is not set
28776 +# CONFIG_AUDIT is not set
28777 +# CONFIG_IKCONFIG is not set
28778 +CONFIG_LOG_BUF_SHIFT=14
28779 +# CONFIG_CGROUPS is not set
28780 +# CONFIG_FAIR_GROUP_SCHED is not set
28781 +CONFIG_SYSFS_DEPRECATED=y
28782 +# CONFIG_RELAY is not set
28783 +CONFIG_BLK_DEV_INITRD=y
28784 +CONFIG_INITRAMFS_SOURCE=""
28785 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
28786 +CONFIG_SYSCTL=y
28787 +CONFIG_EMBEDDED=y
28788 +CONFIG_SYSCTL_SYSCALL=y
28789 +CONFIG_KALLSYMS=y
28790 +CONFIG_KALLSYMS_ALL=y
28791 +CONFIG_KALLSYMS_EXTRA_PASS=y
28792 +CONFIG_HOTPLUG=y
28793 +CONFIG_PRINTK=y
28794 +CONFIG_BUG=y
28795 +CONFIG_ELF_CORE=y
28796 +CONFIG_BASE_FULL=y
28797 +CONFIG_FUTEX=y
28798 +CONFIG_ANON_INODES=y
28799 +CONFIG_EPOLL=y
28800 +CONFIG_SIGNALFD=y
28801 +CONFIG_EVENTFD=y
28802 +CONFIG_SHMEM=y
28803 +CONFIG_VM_EVENT_COUNTERS=y
28804 +CONFIG_SLUB_DEBUG=y
28805 +# CONFIG_SLAB is not set
28806 +CONFIG_SLUB=y
28807 +# CONFIG_SLOB is not set
28808 +CONFIG_RT_MUTEXES=y
28809 +# CONFIG_TINY_SHMEM is not set
28810 +CONFIG_BASE_SMALL=0
28811 +CONFIG_MODULES=y
28812 +CONFIG_MODULE_UNLOAD=y
28813 +# CONFIG_MODULE_FORCE_UNLOAD is not set
28814 +# CONFIG_MODVERSIONS is not set
28815 +# CONFIG_MODULE_SRCVERSION_ALL is not set
28816 +CONFIG_KMOD=y
28817 +CONFIG_BLOCK=y
28818 +CONFIG_LBD=y
28819 +# CONFIG_BLK_DEV_IO_TRACE is not set
28820 +# CONFIG_LSF is not set
28821 +# CONFIG_BLK_DEV_BSG is not set
28822 +
28823 +#
28824 +# IO Schedulers
28825 +#
28826 +CONFIG_IOSCHED_NOOP=y
28827 +CONFIG_IOSCHED_AS=y
28828 +CONFIG_IOSCHED_DEADLINE=y
28829 +CONFIG_IOSCHED_CFQ=y
28830 +CONFIG_DEFAULT_AS=y
28831 +# CONFIG_DEFAULT_DEADLINE is not set
28832 +# CONFIG_DEFAULT_CFQ is not set
28833 +# CONFIG_DEFAULT_NOOP is not set
28834 +CONFIG_DEFAULT_IOSCHED="anticipatory"
28835 +CONFIG_PPC4xx_PCI_EXPRESS=y
28836 +
28837 +#
28838 +# Platform support
28839 +#
28840 +# CONFIG_PPC_MPC52xx is not set
28841 +# CONFIG_PPC_MPC5200 is not set
28842 +# CONFIG_PPC_CELL is not set
28843 +# CONFIG_PPC_CELL_NATIVE is not set
28844 +# CONFIG_PQ2ADS is not set
28845 +# CONFIG_EP405 is not set
28846 +# CONFIG_KILAUEA is not set
28847 +CONFIG_MAKALU=y
28848 +# CONFIG_WALNUT is not set
28849 +# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
28850 +CONFIG_405EX=y
28851 +# CONFIG_MPIC is not set
28852 +# CONFIG_MPIC_WEIRD is not set
28853 +# CONFIG_PPC_I8259 is not set
28854 +# CONFIG_PPC_RTAS is not set
28855 +# CONFIG_MMIO_NVRAM is not set
28856 +# CONFIG_PPC_MPC106 is not set
28857 +# CONFIG_PPC_970_NAP is not set
28858 +# CONFIG_PPC_INDIRECT_IO is not set
28859 +# CONFIG_GENERIC_IOMAP is not set
28860 +# CONFIG_CPU_FREQ is not set
28861 +# CONFIG_CPM2 is not set
28862 +# CONFIG_FSL_ULI1575 is not set
28863 +
28864 +#
28865 +# Kernel options
28866 +#
28867 +# CONFIG_HIGHMEM is not set
28868 +# CONFIG_TICK_ONESHOT is not set
28869 +# CONFIG_NO_HZ is not set
28870 +# CONFIG_HIGH_RES_TIMERS is not set
28871 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
28872 +# CONFIG_HZ_100 is not set
28873 +CONFIG_HZ_250=y
28874 +# CONFIG_HZ_300 is not set
28875 +# CONFIG_HZ_1000 is not set
28876 +CONFIG_HZ=250
28877 +CONFIG_PREEMPT_NONE=y
28878 +# CONFIG_PREEMPT_VOLUNTARY is not set
28879 +# CONFIG_PREEMPT is not set
28880 +CONFIG_BINFMT_ELF=y
28881 +# CONFIG_BINFMT_MISC is not set
28882 +# CONFIG_MATH_EMULATION is not set
28883 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
28884 +CONFIG_ARCH_FLATMEM_ENABLE=y
28885 +CONFIG_ARCH_POPULATES_NODE_MAP=y
28886 +CONFIG_SELECT_MEMORY_MODEL=y
28887 +CONFIG_FLATMEM_MANUAL=y
28888 +# CONFIG_DISCONTIGMEM_MANUAL is not set
28889 +# CONFIG_SPARSEMEM_MANUAL is not set
28890 +CONFIG_FLATMEM=y
28891 +CONFIG_FLAT_NODE_MEM_MAP=y
28892 +# CONFIG_SPARSEMEM_STATIC is not set
28893 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
28894 +CONFIG_SPLIT_PTLOCK_CPUS=4
28895 +# CONFIG_RESOURCES_64BIT is not set
28896 +CONFIG_ZONE_DMA_FLAG=1
28897 +CONFIG_BOUNCE=y
28898 +CONFIG_VIRT_TO_BUS=y
28899 +CONFIG_PROC_DEVICETREE=y
28900 +# CONFIG_CMDLINE_BOOL is not set
28901 +# CONFIG_PM is not set
28902 +CONFIG_SUSPEND_UP_POSSIBLE=y
28903 +CONFIG_HIBERNATION_UP_POSSIBLE=y
28904 +CONFIG_SECCOMP=y
28905 +CONFIG_WANT_DEVICE_TREE=y
28906 +CONFIG_DEVICE_TREE="kilauea.dts"
28907 +CONFIG_ISA_DMA_API=y
28908 +
28909 +#
28910 +# Bus options
28911 +#
28912 +CONFIG_ZONE_DMA=y
28913 +CONFIG_PPC_INDIRECT_PCI=y
28914 +CONFIG_PCI=y
28915 +CONFIG_PCI_DOMAINS=y
28916 +CONFIG_PCI_SYSCALL=y
28917 +# CONFIG_PCIEPORTBUS is not set
28918 +CONFIG_ARCH_SUPPORTS_MSI=y
28919 +# CONFIG_PCI_MSI is not set
28920 +CONFIG_PCI_LEGACY=y
28921 +# CONFIG_PCI_DEBUG is not set
28922 +# CONFIG_PCCARD is not set
28923 +# CONFIG_HOTPLUG_PCI is not set
28924 +
28925 +#
28926 +# Advanced setup
28927 +#
28928 +# CONFIG_ADVANCED_OPTIONS is not set
28929 +
28930 +#
28931 +# Default settings for advanced configuration options are used
28932 +#
28933 +CONFIG_HIGHMEM_START=0xfe000000
28934 +CONFIG_LOWMEM_SIZE=0x30000000
28935 +CONFIG_KERNEL_START=0xc0000000
28936 +CONFIG_TASK_SIZE=0xc0000000
28937 +CONFIG_CONSISTENT_START=0xff100000
28938 +CONFIG_CONSISTENT_SIZE=0x00200000
28939 +CONFIG_BOOT_LOAD=0x00400000
28940 +
28941 +#
28942 +# Networking
28943 +#
28944 +CONFIG_NET=y
28945 +
28946 +#
28947 +# Networking options
28948 +#
28949 +CONFIG_PACKET=y
28950 +# CONFIG_PACKET_MMAP is not set
28951 +CONFIG_UNIX=y
28952 +# CONFIG_NET_KEY is not set
28953 +CONFIG_INET=y
28954 +# CONFIG_IP_MULTICAST is not set
28955 +# CONFIG_IP_ADVANCED_ROUTER is not set
28956 +CONFIG_IP_FIB_HASH=y
28957 +CONFIG_IP_PNP=y
28958 +CONFIG_IP_PNP_DHCP=y
28959 +CONFIG_IP_PNP_BOOTP=y
28960 +# CONFIG_IP_PNP_RARP is not set
28961 +# CONFIG_NET_IPIP is not set
28962 +# CONFIG_NET_IPGRE is not set
28963 +# CONFIG_ARPD is not set
28964 +# CONFIG_SYN_COOKIES is not set
28965 +# CONFIG_INET_AH is not set
28966 +# CONFIG_INET_ESP is not set
28967 +# CONFIG_INET_IPCOMP is not set
28968 +# CONFIG_INET_XFRM_TUNNEL is not set
28969 +# CONFIG_INET_TUNNEL is not set
28970 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
28971 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
28972 +# CONFIG_INET_XFRM_MODE_BEET is not set
28973 +# CONFIG_INET_LRO is not set
28974 +CONFIG_INET_DIAG=y
28975 +CONFIG_INET_TCP_DIAG=y
28976 +# CONFIG_TCP_CONG_ADVANCED is not set
28977 +CONFIG_TCP_CONG_CUBIC=y
28978 +CONFIG_DEFAULT_TCP_CONG="cubic"
28979 +# CONFIG_TCP_MD5SIG is not set
28980 +# CONFIG_IPV6 is not set
28981 +# CONFIG_INET6_XFRM_TUNNEL is not set
28982 +# CONFIG_INET6_TUNNEL is not set
28983 +# CONFIG_NETWORK_SECMARK is not set
28984 +# CONFIG_NETFILTER is not set
28985 +# CONFIG_IP_DCCP is not set
28986 +# CONFIG_IP_SCTP is not set
28987 +# CONFIG_TIPC is not set
28988 +# CONFIG_ATM is not set
28989 +# CONFIG_BRIDGE is not set
28990 +# CONFIG_VLAN_8021Q is not set
28991 +# CONFIG_DECNET is not set
28992 +# CONFIG_LLC2 is not set
28993 +# CONFIG_IPX is not set
28994 +# CONFIG_ATALK is not set
28995 +# CONFIG_X25 is not set
28996 +# CONFIG_LAPB is not set
28997 +# CONFIG_ECONET is not set
28998 +# CONFIG_WAN_ROUTER is not set
28999 +# CONFIG_NET_SCHED is not set
29000 +
29001 +#
29002 +# Network testing
29003 +#
29004 +# CONFIG_NET_PKTGEN is not set
29005 +# CONFIG_HAMRADIO is not set
29006 +# CONFIG_IRDA is not set
29007 +# CONFIG_BT is not set
29008 +# CONFIG_AF_RXRPC is not set
29009 +
29010 +#
29011 +# Wireless
29012 +#
29013 +# CONFIG_CFG80211 is not set
29014 +# CONFIG_WIRELESS_EXT is not set
29015 +# CONFIG_MAC80211 is not set
29016 +# CONFIG_IEEE80211 is not set
29017 +# CONFIG_RFKILL is not set
29018 +# CONFIG_NET_9P is not set
29019 +
29020 +#
29021 +# Device Drivers
29022 +#
29023 +
29024 +#
29025 +# Generic Driver Options
29026 +#
29027 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
29028 +CONFIG_STANDALONE=y
29029 +CONFIG_PREVENT_FIRMWARE_BUILD=y
29030 +CONFIG_FW_LOADER=y
29031 +# CONFIG_DEBUG_DRIVER is not set
29032 +# CONFIG_DEBUG_DEVRES is not set
29033 +# CONFIG_SYS_HYPERVISOR is not set
29034 +CONFIG_CONNECTOR=y
29035 +CONFIG_PROC_EVENTS=y
29036 +CONFIG_MTD=y
29037 +# CONFIG_MTD_DEBUG is not set
29038 +# CONFIG_MTD_CONCAT is not set
29039 +CONFIG_MTD_PARTITIONS=y
29040 +# CONFIG_MTD_REDBOOT_PARTS is not set
29041 +CONFIG_MTD_CMDLINE_PARTS=y
29042 +
29043 +#
29044 +# User Modules And Translation Layers
29045 +#
29046 +CONFIG_MTD_CHAR=y
29047 +CONFIG_MTD_BLKDEVS=m
29048 +CONFIG_MTD_BLOCK=m
29049 +# CONFIG_MTD_BLOCK_RO is not set
29050 +# CONFIG_FTL is not set
29051 +# CONFIG_NFTL is not set
29052 +# CONFIG_INFTL is not set
29053 +# CONFIG_RFD_FTL is not set
29054 +# CONFIG_SSFDC is not set
29055 +# CONFIG_MTD_OOPS is not set
29056 +
29057 +#
29058 +# RAM/ROM/Flash chip drivers
29059 +#
29060 +CONFIG_MTD_CFI=y
29061 +CONFIG_MTD_JEDECPROBE=y
29062 +CONFIG_MTD_GEN_PROBE=y
29063 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
29064 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
29065 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
29066 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
29067 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
29068 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
29069 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
29070 +CONFIG_MTD_CFI_I1=y
29071 +CONFIG_MTD_CFI_I2=y
29072 +# CONFIG_MTD_CFI_I4 is not set
29073 +# CONFIG_MTD_CFI_I8 is not set
29074 +# CONFIG_MTD_CFI_INTELEXT is not set
29075 +CONFIG_MTD_CFI_AMDSTD=y
29076 +# CONFIG_MTD_CFI_STAA is not set
29077 +CONFIG_MTD_CFI_UTIL=y
29078 +# CONFIG_MTD_RAM is not set
29079 +# CONFIG_MTD_ROM is not set
29080 +# CONFIG_MTD_ABSENT is not set
29081 +
29082 +#
29083 +# Mapping drivers for chip access
29084 +#
29085 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
29086 +# CONFIG_MTD_PHYSMAP is not set
29087 +CONFIG_MTD_PHYSMAP_OF=y
29088 +# CONFIG_MTD_INTEL_VR_NOR is not set
29089 +# CONFIG_MTD_PLATRAM is not set
29090 +
29091 +#
29092 +# Self-contained MTD device drivers
29093 +#
29094 +# CONFIG_MTD_PMC551 is not set
29095 +# CONFIG_MTD_SLRAM is not set
29096 +# CONFIG_MTD_PHRAM is not set
29097 +# CONFIG_MTD_MTDRAM is not set
29098 +# CONFIG_MTD_BLOCK2MTD is not set
29099 +
29100 +#
29101 +# Disk-On-Chip Device Drivers
29102 +#
29103 +# CONFIG_MTD_DOC2000 is not set
29104 +# CONFIG_MTD_DOC2001 is not set
29105 +# CONFIG_MTD_DOC2001PLUS is not set
29106 +# CONFIG_MTD_NAND is not set
29107 +# CONFIG_MTD_ONENAND is not set
29108 +
29109 +#
29110 +# UBI - Unsorted block images
29111 +#
29112 +# CONFIG_MTD_UBI is not set
29113 +CONFIG_OF_DEVICE=y
29114 +# CONFIG_PARPORT is not set
29115 +CONFIG_BLK_DEV=y
29116 +# CONFIG_BLK_DEV_FD is not set
29117 +# CONFIG_BLK_CPQ_DA is not set
29118 +# CONFIG_BLK_CPQ_CISS_DA is not set
29119 +# CONFIG_BLK_DEV_DAC960 is not set
29120 +# CONFIG_BLK_DEV_UMEM is not set
29121 +# CONFIG_BLK_DEV_COW_COMMON is not set
29122 +# CONFIG_BLK_DEV_LOOP is not set
29123 +# CONFIG_BLK_DEV_NBD is not set
29124 +# CONFIG_BLK_DEV_SX8 is not set
29125 +CONFIG_BLK_DEV_RAM=y
29126 +CONFIG_BLK_DEV_RAM_COUNT=16
29127 +CONFIG_BLK_DEV_RAM_SIZE=35000
29128 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
29129 +# CONFIG_CDROM_PKTCDVD is not set
29130 +# CONFIG_ATA_OVER_ETH is not set
29131 +# CONFIG_XILINX_SYSACE is not set
29132 +# CONFIG_MISC_DEVICES is not set
29133 +# CONFIG_IDE is not set
29134 +
29135 +#
29136 +# SCSI device support
29137 +#
29138 +# CONFIG_RAID_ATTRS is not set
29139 +# CONFIG_SCSI is not set
29140 +# CONFIG_SCSI_DMA is not set
29141 +# CONFIG_SCSI_NETLINK is not set
29142 +# CONFIG_ATA is not set
29143 +# CONFIG_MD is not set
29144 +# CONFIG_FUSION is not set
29145 +
29146 +#
29147 +# IEEE 1394 (FireWire) support
29148 +#
29149 +# CONFIG_FIREWIRE is not set
29150 +# CONFIG_IEEE1394 is not set
29151 +# CONFIG_I2O is not set
29152 +# CONFIG_MACINTOSH_DRIVERS is not set
29153 +CONFIG_NETDEVICES=y
29154 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
29155 +# CONFIG_DUMMY is not set
29156 +# CONFIG_BONDING is not set
29157 +# CONFIG_MACVLAN is not set
29158 +# CONFIG_EQUALIZER is not set
29159 +# CONFIG_TUN is not set
29160 +# CONFIG_VETH is not set
29161 +# CONFIG_IP1000 is not set
29162 +# CONFIG_ARCNET is not set
29163 +# CONFIG_PHYLIB is not set
29164 +CONFIG_NET_ETHERNET=y
29165 +# CONFIG_MII is not set
29166 +# CONFIG_HAPPYMEAL is not set
29167 +# CONFIG_SUNGEM is not set
29168 +# CONFIG_CASSINI is not set
29169 +# CONFIG_NET_VENDOR_3COM is not set
29170 +# CONFIG_NET_TULIP is not set
29171 +# CONFIG_HP100 is not set
29172 +CONFIG_IBM_NEW_EMAC=y
29173 +CONFIG_IBM_NEW_EMAC_RXB=256
29174 +CONFIG_IBM_NEW_EMAC_TXB=256
29175 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
29176 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
29177 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
29178 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
29179 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
29180 +CONFIG_IBM_NEW_EMAC_RGMII=y
29181 +# CONFIG_IBM_NEW_EMAC_TAH is not set
29182 +CONFIG_IBM_NEW_EMAC_EMAC4=y
29183 +# CONFIG_NET_PCI is not set
29184 +# CONFIG_B44 is not set
29185 +# CONFIG_NETDEV_1000 is not set
29186 +# CONFIG_NETDEV_10000 is not set
29187 +# CONFIG_TR is not set
29188 +
29189 +#
29190 +# Wireless LAN
29191 +#
29192 +# CONFIG_WLAN_PRE80211 is not set
29193 +# CONFIG_WLAN_80211 is not set
29194 +# CONFIG_WAN is not set
29195 +# CONFIG_FDDI is not set
29196 +# CONFIG_HIPPI is not set
29197 +# CONFIG_PPP is not set
29198 +# CONFIG_SLIP is not set
29199 +# CONFIG_SHAPER is not set
29200 +# CONFIG_NETCONSOLE is not set
29201 +# CONFIG_NETPOLL is not set
29202 +# CONFIG_NET_POLL_CONTROLLER is not set
29203 +# CONFIG_ISDN is not set
29204 +# CONFIG_PHONE is not set
29205 +
29206 +#
29207 +# Input device support
29208 +#
29209 +# CONFIG_INPUT is not set
29210 +
29211 +#
29212 +# Hardware I/O ports
29213 +#
29214 +# CONFIG_SERIO is not set
29215 +# CONFIG_GAMEPORT is not set
29216 +
29217 +#
29218 +# Character devices
29219 +#
29220 +# CONFIG_VT is not set
29221 +# CONFIG_SERIAL_NONSTANDARD is not set
29222 +
29223 +#
29224 +# Serial drivers
29225 +#
29226 +CONFIG_SERIAL_8250=y
29227 +CONFIG_SERIAL_8250_CONSOLE=y
29228 +CONFIG_SERIAL_8250_PCI=y
29229 +CONFIG_SERIAL_8250_NR_UARTS=4
29230 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
29231 +CONFIG_SERIAL_8250_EXTENDED=y
29232 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
29233 +CONFIG_SERIAL_8250_SHARE_IRQ=y
29234 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
29235 +# CONFIG_SERIAL_8250_RSA is not set
29236 +
29237 +#
29238 +# Non-8250 serial port support
29239 +#
29240 +# CONFIG_SERIAL_UARTLITE is not set
29241 +CONFIG_SERIAL_CORE=y
29242 +CONFIG_SERIAL_CORE_CONSOLE=y
29243 +# CONFIG_SERIAL_JSM is not set
29244 +CONFIG_SERIAL_OF_PLATFORM=y
29245 +CONFIG_UNIX98_PTYS=y
29246 +CONFIG_LEGACY_PTYS=y
29247 +CONFIG_LEGACY_PTY_COUNT=256
29248 +# CONFIG_IPMI_HANDLER is not set
29249 +# CONFIG_HW_RANDOM is not set
29250 +# CONFIG_NVRAM is not set
29251 +# CONFIG_GEN_RTC is not set
29252 +# CONFIG_R3964 is not set
29253 +# CONFIG_APPLICOM is not set
29254 +# CONFIG_RAW_DRIVER is not set
29255 +# CONFIG_TCG_TPM is not set
29256 +CONFIG_DEVPORT=y
29257 +# CONFIG_I2C is not set
29258 +
29259 +#
29260 +# SPI support
29261 +#
29262 +# CONFIG_SPI is not set
29263 +# CONFIG_SPI_MASTER is not set
29264 +# CONFIG_W1 is not set
29265 +# CONFIG_POWER_SUPPLY is not set
29266 +# CONFIG_HWMON is not set
29267 +# CONFIG_WATCHDOG is not set
29268 +
29269 +#
29270 +# Sonics Silicon Backplane
29271 +#
29272 +CONFIG_SSB_POSSIBLE=y
29273 +# CONFIG_SSB is not set
29274 +
29275 +#
29276 +# Multifunction device drivers
29277 +#
29278 +# CONFIG_MFD_SM501 is not set
29279 +
29280 +#
29281 +# Multimedia devices
29282 +#
29283 +# CONFIG_VIDEO_DEV is not set
29284 +# CONFIG_DVB_CORE is not set
29285 +# CONFIG_DAB is not set
29286 +
29287 +#
29288 +# Graphics support
29289 +#
29290 +# CONFIG_AGP is not set
29291 +# CONFIG_DRM is not set
29292 +# CONFIG_VGASTATE is not set
29293 +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
29294 +# CONFIG_FB is not set
29295 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
29296 +
29297 +#
29298 +# Display device support
29299 +#
29300 +# CONFIG_DISPLAY_SUPPORT is not set
29301 +
29302 +#
29303 +# Sound
29304 +#
29305 +# CONFIG_SOUND is not set
29306 +# CONFIG_USB_SUPPORT is not set
29307 +# CONFIG_MMC is not set
29308 +# CONFIG_NEW_LEDS is not set
29309 +# CONFIG_INFINIBAND is not set
29310 +# CONFIG_EDAC is not set
29311 +# CONFIG_RTC_CLASS is not set
29312 +
29313 +#
29314 +# Userspace I/O
29315 +#
29316 +# CONFIG_UIO is not set
29317 +
29318 +#
29319 +# File systems
29320 +#
29321 +CONFIG_EXT2_FS=y
29322 +# CONFIG_EXT2_FS_XATTR is not set
29323 +# CONFIG_EXT2_FS_XIP is not set
29324 +# CONFIG_EXT3_FS is not set
29325 +# CONFIG_EXT4DEV_FS is not set
29326 +# CONFIG_REISERFS_FS is not set
29327 +# CONFIG_JFS_FS is not set
29328 +# CONFIG_FS_POSIX_ACL is not set
29329 +# CONFIG_XFS_FS is not set
29330 +# CONFIG_GFS2_FS is not set
29331 +# CONFIG_OCFS2_FS is not set
29332 +# CONFIG_MINIX_FS is not set
29333 +# CONFIG_ROMFS_FS is not set
29334 +CONFIG_INOTIFY=y
29335 +CONFIG_INOTIFY_USER=y
29336 +# CONFIG_QUOTA is not set
29337 +CONFIG_DNOTIFY=y
29338 +# CONFIG_AUTOFS_FS is not set
29339 +# CONFIG_AUTOFS4_FS is not set
29340 +# CONFIG_FUSE_FS is not set
29341 +
29342 +#
29343 +# CD-ROM/DVD Filesystems
29344 +#
29345 +# CONFIG_ISO9660_FS is not set
29346 +# CONFIG_UDF_FS is not set
29347 +
29348 +#
29349 +# DOS/FAT/NT Filesystems
29350 +#
29351 +# CONFIG_MSDOS_FS is not set
29352 +# CONFIG_VFAT_FS is not set
29353 +# CONFIG_NTFS_FS is not set
29354 +
29355 +#
29356 +# Pseudo filesystems
29357 +#
29358 +CONFIG_PROC_FS=y
29359 +CONFIG_PROC_KCORE=y
29360 +CONFIG_PROC_SYSCTL=y
29361 +CONFIG_SYSFS=y
29362 +CONFIG_TMPFS=y
29363 +# CONFIG_TMPFS_POSIX_ACL is not set
29364 +# CONFIG_HUGETLB_PAGE is not set
29365 +# CONFIG_CONFIGFS_FS is not set
29366 +
29367 +#
29368 +# Miscellaneous filesystems
29369 +#
29370 +# CONFIG_ADFS_FS is not set
29371 +# CONFIG_AFFS_FS is not set
29372 +# CONFIG_HFS_FS is not set
29373 +# CONFIG_HFSPLUS_FS is not set
29374 +# CONFIG_BEFS_FS is not set
29375 +# CONFIG_BFS_FS is not set
29376 +# CONFIG_EFS_FS is not set
29377 +# CONFIG_JFFS2_FS is not set
29378 +CONFIG_CRAMFS=y
29379 +# CONFIG_VXFS_FS is not set
29380 +# CONFIG_HPFS_FS is not set
29381 +# CONFIG_QNX4FS_FS is not set
29382 +# CONFIG_SYSV_FS is not set
29383 +# CONFIG_UFS_FS is not set
29384 +CONFIG_NETWORK_FILESYSTEMS=y
29385 +CONFIG_NFS_FS=y
29386 +CONFIG_NFS_V3=y
29387 +# CONFIG_NFS_V3_ACL is not set
29388 +# CONFIG_NFS_V4 is not set
29389 +# CONFIG_NFS_DIRECTIO is not set
29390 +# CONFIG_NFSD is not set
29391 +CONFIG_ROOT_NFS=y
29392 +CONFIG_LOCKD=y
29393 +CONFIG_LOCKD_V4=y
29394 +CONFIG_NFS_COMMON=y
29395 +CONFIG_SUNRPC=y
29396 +# CONFIG_SUNRPC_BIND34 is not set
29397 +# CONFIG_RPCSEC_GSS_KRB5 is not set
29398 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
29399 +# CONFIG_SMB_FS is not set
29400 +# CONFIG_CIFS is not set
29401 +# CONFIG_NCP_FS is not set
29402 +# CONFIG_CODA_FS is not set
29403 +# CONFIG_AFS_FS is not set
29404 +
29405 +#
29406 +# Partition Types
29407 +#
29408 +# CONFIG_PARTITION_ADVANCED is not set
29409 +CONFIG_MSDOS_PARTITION=y
29410 +# CONFIG_NLS is not set
29411 +# CONFIG_DLM is not set
29412 +# CONFIG_UCC_SLOW is not set
29413 +
29414 +#
29415 +# Library routines
29416 +#
29417 +CONFIG_BITREVERSE=y
29418 +# CONFIG_CRC_CCITT is not set
29419 +# CONFIG_CRC16 is not set
29420 +# CONFIG_CRC_ITU_T is not set
29421 +CONFIG_CRC32=y
29422 +# CONFIG_CRC7 is not set
29423 +# CONFIG_LIBCRC32C is not set
29424 +CONFIG_ZLIB_INFLATE=y
29425 +CONFIG_PLIST=y
29426 +CONFIG_HAS_IOMEM=y
29427 +CONFIG_HAS_IOPORT=y
29428 +CONFIG_HAS_DMA=y
29429 +# CONFIG_INSTRUMENTATION is not set
29430 +
29431 +#
29432 +# Kernel hacking
29433 +#
29434 +# CONFIG_PRINTK_TIME is not set
29435 +CONFIG_ENABLE_WARN_DEPRECATED=y
29436 +CONFIG_ENABLE_MUST_CHECK=y
29437 +CONFIG_MAGIC_SYSRQ=y
29438 +# CONFIG_UNUSED_SYMBOLS is not set
29439 +# CONFIG_DEBUG_FS is not set
29440 +# CONFIG_HEADERS_CHECK is not set
29441 +CONFIG_DEBUG_KERNEL=y
29442 +# CONFIG_DEBUG_SHIRQ is not set
29443 +CONFIG_DETECT_SOFTLOCKUP=y
29444 +CONFIG_SCHED_DEBUG=y
29445 +# CONFIG_SCHEDSTATS is not set
29446 +# CONFIG_TIMER_STATS is not set
29447 +# CONFIG_SLUB_DEBUG_ON is not set
29448 +# CONFIG_DEBUG_RT_MUTEXES is not set
29449 +# CONFIG_RT_MUTEX_TESTER is not set
29450 +# CONFIG_DEBUG_SPINLOCK is not set
29451 +# CONFIG_DEBUG_MUTEXES is not set
29452 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
29453 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
29454 +# CONFIG_DEBUG_KOBJECT is not set
29455 +CONFIG_DEBUG_BUGVERBOSE=y
29456 +# CONFIG_DEBUG_INFO is not set
29457 +# CONFIG_DEBUG_VM is not set
29458 +# CONFIG_DEBUG_LIST is not set
29459 +# CONFIG_DEBUG_SG is not set
29460 +CONFIG_FORCED_INLINING=y
29461 +# CONFIG_BOOT_PRINTK_DELAY is not set
29462 +# CONFIG_RCU_TORTURE_TEST is not set
29463 +# CONFIG_FAULT_INJECTION is not set
29464 +# CONFIG_SAMPLES is not set
29465 +# CONFIG_DEBUG_STACKOVERFLOW is not set
29466 +# CONFIG_DEBUG_STACK_USAGE is not set
29467 +# CONFIG_DEBUG_PAGEALLOC is not set
29468 +# CONFIG_DEBUGGER is not set
29469 +# CONFIG_BDI_SWITCH is not set
29470 +# CONFIG_PPC_EARLY_DEBUG is not set
29471 +
29472 +#
29473 +# Security options
29474 +#
29475 +# CONFIG_KEYS is not set
29476 +# CONFIG_SECURITY is not set
29477 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
29478 +CONFIG_CRYPTO=y
29479 +CONFIG_CRYPTO_ALGAPI=y
29480 +CONFIG_CRYPTO_BLKCIPHER=y
29481 +CONFIG_CRYPTO_MANAGER=y
29482 +# CONFIG_CRYPTO_HMAC is not set
29483 +# CONFIG_CRYPTO_XCBC is not set
29484 +# CONFIG_CRYPTO_NULL is not set
29485 +# CONFIG_CRYPTO_MD4 is not set
29486 +CONFIG_CRYPTO_MD5=y
29487 +# CONFIG_CRYPTO_SHA1 is not set
29488 +# CONFIG_CRYPTO_SHA256 is not set
29489 +# CONFIG_CRYPTO_SHA512 is not set
29490 +# CONFIG_CRYPTO_WP512 is not set
29491 +# CONFIG_CRYPTO_TGR192 is not set
29492 +# CONFIG_CRYPTO_GF128MUL is not set
29493 +CONFIG_CRYPTO_ECB=y
29494 +CONFIG_CRYPTO_CBC=y
29495 +CONFIG_CRYPTO_PCBC=y
29496 +# CONFIG_CRYPTO_LRW is not set
29497 +# CONFIG_CRYPTO_XTS is not set
29498 +# CONFIG_CRYPTO_CRYPTD is not set
29499 +CONFIG_CRYPTO_DES=y
29500 +# CONFIG_CRYPTO_FCRYPT is not set
29501 +# CONFIG_CRYPTO_BLOWFISH is not set
29502 +# CONFIG_CRYPTO_TWOFISH is not set
29503 +# CONFIG_CRYPTO_SERPENT is not set
29504 +# CONFIG_CRYPTO_AES is not set
29505 +# CONFIG_CRYPTO_CAST5 is not set
29506 +# CONFIG_CRYPTO_CAST6 is not set
29507 +# CONFIG_CRYPTO_TEA is not set
29508 +# CONFIG_CRYPTO_ARC4 is not set
29509 +# CONFIG_CRYPTO_KHAZAD is not set
29510 +# CONFIG_CRYPTO_ANUBIS is not set
29511 +# CONFIG_CRYPTO_SEED is not set
29512 +# CONFIG_CRYPTO_DEFLATE is not set
29513 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
29514 +# CONFIG_CRYPTO_CRC32C is not set
29515 +# CONFIG_CRYPTO_CAMELLIA is not set
29516 +# CONFIG_CRYPTO_TEST is not set
29517 +# CONFIG_CRYPTO_AUTHENC is not set
29518 +CONFIG_CRYPTO_HW=y
29519 +# CONFIG_PPC_CLOCK is not set
29520 --- /dev/null
29521 +++ b/arch/powerpc/configs/mpc5200_defconfig
29522 @@ -0,0 +1,1286 @@
29523 +#
29524 +# Automatically generated make config: don't edit
29525 +# Linux kernel version: 2.6.24-rc6
29526 +# Fri Jan 18 14:19:54 2008
29527 +#
29528 +# CONFIG_PPC64 is not set
29529 +
29530 +#
29531 +# Processor support
29532 +#
29533 +CONFIG_6xx=y
29534 +# CONFIG_PPC_85xx is not set
29535 +# CONFIG_PPC_8xx is not set
29536 +# CONFIG_40x is not set
29537 +# CONFIG_44x is not set
29538 +# CONFIG_E200 is not set
29539 +CONFIG_PPC_FPU=y
29540 +# CONFIG_ALTIVEC is not set
29541 +CONFIG_PPC_STD_MMU=y
29542 +CONFIG_PPC_STD_MMU_32=y
29543 +# CONFIG_PPC_MM_SLICES is not set
29544 +# CONFIG_SMP is not set
29545 +CONFIG_PPC32=y
29546 +CONFIG_WORD_SIZE=32
29547 +CONFIG_PPC_MERGE=y
29548 +CONFIG_MMU=y
29549 +CONFIG_GENERIC_CMOS_UPDATE=y
29550 +CONFIG_GENERIC_TIME=y
29551 +CONFIG_GENERIC_TIME_VSYSCALL=y
29552 +CONFIG_GENERIC_CLOCKEVENTS=y
29553 +CONFIG_GENERIC_HARDIRQS=y
29554 +CONFIG_IRQ_PER_CPU=y
29555 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
29556 +CONFIG_ARCH_HAS_ILOG2_U32=y
29557 +CONFIG_GENERIC_HWEIGHT=y
29558 +CONFIG_GENERIC_CALIBRATE_DELAY=y
29559 +CONFIG_GENERIC_FIND_NEXT_BIT=y
29560 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
29561 +CONFIG_PPC=y
29562 +CONFIG_EARLY_PRINTK=y
29563 +CONFIG_GENERIC_NVRAM=y
29564 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
29565 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
29566 +CONFIG_PPC_OF=y
29567 +CONFIG_OF=y
29568 +# CONFIG_PPC_UDBG_16550 is not set
29569 +# CONFIG_GENERIC_TBSYNC is not set
29570 +CONFIG_AUDIT_ARCH=y
29571 +CONFIG_GENERIC_BUG=y
29572 +# CONFIG_DEFAULT_UIMAGE is not set
29573 +# CONFIG_PPC_DCR_NATIVE is not set
29574 +# CONFIG_PPC_DCR_MMIO is not set
29575 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
29576 +
29577 +#
29578 +# General setup
29579 +#
29580 +CONFIG_EXPERIMENTAL=y
29581 +CONFIG_BROKEN_ON_SMP=y
29582 +CONFIG_INIT_ENV_ARG_LIMIT=32
29583 +CONFIG_LOCALVERSION=""
29584 +CONFIG_LOCALVERSION_AUTO=y
29585 +CONFIG_SWAP=y
29586 +CONFIG_SYSVIPC=y
29587 +CONFIG_SYSVIPC_SYSCTL=y
29588 +# CONFIG_POSIX_MQUEUE is not set
29589 +# CONFIG_BSD_PROCESS_ACCT is not set
29590 +# CONFIG_TASKSTATS is not set
29591 +# CONFIG_USER_NS is not set
29592 +# CONFIG_PID_NS is not set
29593 +# CONFIG_AUDIT is not set
29594 +# CONFIG_IKCONFIG is not set
29595 +CONFIG_LOG_BUF_SHIFT=14
29596 +# CONFIG_CGROUPS is not set
29597 +CONFIG_FAIR_GROUP_SCHED=y
29598 +CONFIG_FAIR_USER_SCHED=y
29599 +# CONFIG_FAIR_CGROUP_SCHED is not set
29600 +CONFIG_SYSFS_DEPRECATED=y
29601 +# CONFIG_RELAY is not set
29602 +CONFIG_BLK_DEV_INITRD=y
29603 +CONFIG_INITRAMFS_SOURCE=""
29604 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
29605 +CONFIG_SYSCTL=y
29606 +CONFIG_EMBEDDED=y
29607 +# CONFIG_SYSCTL_SYSCALL is not set
29608 +# CONFIG_KALLSYMS is not set
29609 +CONFIG_HOTPLUG=y
29610 +CONFIG_PRINTK=y
29611 +CONFIG_BUG=y
29612 +CONFIG_ELF_CORE=y
29613 +CONFIG_BASE_FULL=y
29614 +CONFIG_FUTEX=y
29615 +CONFIG_ANON_INODES=y
29616 +# CONFIG_EPOLL is not set
29617 +CONFIG_SIGNALFD=y
29618 +CONFIG_EVENTFD=y
29619 +CONFIG_SHMEM=y
29620 +CONFIG_VM_EVENT_COUNTERS=y
29621 +CONFIG_SLUB_DEBUG=y
29622 +# CONFIG_SLAB is not set
29623 +CONFIG_SLUB=y
29624 +# CONFIG_SLOB is not set
29625 +CONFIG_RT_MUTEXES=y
29626 +# CONFIG_TINY_SHMEM is not set
29627 +CONFIG_BASE_SMALL=0
29628 +CONFIG_MODULES=y
29629 +CONFIG_MODULE_UNLOAD=y
29630 +# CONFIG_MODULE_FORCE_UNLOAD is not set
29631 +# CONFIG_MODVERSIONS is not set
29632 +# CONFIG_MODULE_SRCVERSION_ALL is not set
29633 +# CONFIG_KMOD is not set
29634 +CONFIG_BLOCK=y
29635 +# CONFIG_LBD is not set
29636 +# CONFIG_BLK_DEV_IO_TRACE is not set
29637 +# CONFIG_LSF is not set
29638 +# CONFIG_BLK_DEV_BSG is not set
29639 +
29640 +#
29641 +# IO Schedulers
29642 +#
29643 +CONFIG_IOSCHED_NOOP=y
29644 +CONFIG_IOSCHED_AS=y
29645 +CONFIG_IOSCHED_DEADLINE=y
29646 +CONFIG_IOSCHED_CFQ=y
29647 +CONFIG_DEFAULT_AS=y
29648 +# CONFIG_DEFAULT_DEADLINE is not set
29649 +# CONFIG_DEFAULT_CFQ is not set
29650 +# CONFIG_DEFAULT_NOOP is not set
29651 +CONFIG_DEFAULT_IOSCHED="anticipatory"
29652 +
29653 +#
29654 +# Platform support
29655 +#
29656 +CONFIG_PPC_MULTIPLATFORM=y
29657 +# CONFIG_PPC_82xx is not set
29658 +# CONFIG_PPC_83xx is not set
29659 +# CONFIG_PPC_86xx is not set
29660 +CONFIG_CLASSIC32=y
29661 +# CONFIG_PPC_CHRP is not set
29662 +CONFIG_PPC_MPC52xx=y
29663 +CONFIG_PPC_MPC5200=y
29664 +CONFIG_PPC_MPC5200_BUGFIX=y
29665 +CONFIG_PPC_MPC5200_SIMPLE=y
29666 +CONFIG_PPC_EFIKA=y
29667 +CONFIG_PPC_LITE5200=y
29668 +# CONFIG_PPC_PMAC is not set
29669 +# CONFIG_PPC_CELL is not set
29670 +# CONFIG_PPC_CELL_NATIVE is not set
29671 +# CONFIG_PQ2ADS is not set
29672 +# CONFIG_EMBEDDED6xx is not set
29673 +CONFIG_PPC_NATIVE=y
29674 +# CONFIG_UDBG_RTAS_CONSOLE is not set
29675 +# CONFIG_MPIC is not set
29676 +# CONFIG_MPIC_WEIRD is not set
29677 +# CONFIG_PPC_I8259 is not set
29678 +CONFIG_PPC_RTAS=y
29679 +# CONFIG_RTAS_ERROR_LOGGING is not set
29680 +CONFIG_RTAS_PROC=y
29681 +# CONFIG_MMIO_NVRAM is not set
29682 +# CONFIG_PPC_MPC106 is not set
29683 +# CONFIG_PPC_970_NAP is not set
29684 +# CONFIG_PPC_INDIRECT_IO is not set
29685 +# CONFIG_GENERIC_IOMAP is not set
29686 +# CONFIG_CPU_FREQ is not set
29687 +# CONFIG_TAU is not set
29688 +# CONFIG_CPM2 is not set
29689 +# CONFIG_FSL_ULI1575 is not set
29690 +CONFIG_PPC_BESTCOMM=y
29691 +CONFIG_PPC_BESTCOMM_ATA=y
29692 +CONFIG_PPC_BESTCOMM_FEC=y
29693 +CONFIG_PPC_BESTCOMM_GEN_BD=y
29694 +
29695 +#
29696 +# Kernel options
29697 +#
29698 +# CONFIG_HIGHMEM is not set
29699 +CONFIG_TICK_ONESHOT=y
29700 +CONFIG_NO_HZ=y
29701 +CONFIG_HIGH_RES_TIMERS=y
29702 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
29703 +# CONFIG_HZ_100 is not set
29704 +CONFIG_HZ_250=y
29705 +# CONFIG_HZ_300 is not set
29706 +# CONFIG_HZ_1000 is not set
29707 +CONFIG_HZ=250
29708 +CONFIG_PREEMPT_NONE=y
29709 +# CONFIG_PREEMPT_VOLUNTARY is not set
29710 +# CONFIG_PREEMPT is not set
29711 +CONFIG_BINFMT_ELF=y
29712 +# CONFIG_BINFMT_MISC is not set
29713 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
29714 +# CONFIG_KEXEC is not set
29715 +CONFIG_ARCH_FLATMEM_ENABLE=y
29716 +CONFIG_ARCH_POPULATES_NODE_MAP=y
29717 +CONFIG_SELECT_MEMORY_MODEL=y
29718 +CONFIG_FLATMEM_MANUAL=y
29719 +# CONFIG_DISCONTIGMEM_MANUAL is not set
29720 +# CONFIG_SPARSEMEM_MANUAL is not set
29721 +CONFIG_FLATMEM=y
29722 +CONFIG_FLAT_NODE_MEM_MAP=y
29723 +# CONFIG_SPARSEMEM_STATIC is not set
29724 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
29725 +CONFIG_SPLIT_PTLOCK_CPUS=4
29726 +# CONFIG_RESOURCES_64BIT is not set
29727 +CONFIG_ZONE_DMA_FLAG=1
29728 +CONFIG_BOUNCE=y
29729 +CONFIG_VIRT_TO_BUS=y
29730 +CONFIG_PROC_DEVICETREE=y
29731 +# CONFIG_CMDLINE_BOOL is not set
29732 +CONFIG_PM=y
29733 +# CONFIG_PM_LEGACY is not set
29734 +# CONFIG_PM_DEBUG is not set
29735 +CONFIG_PM_SLEEP=y
29736 +CONFIG_SUSPEND_UP_POSSIBLE=y
29737 +CONFIG_SUSPEND=y
29738 +CONFIG_HIBERNATION_UP_POSSIBLE=y
29739 +# CONFIG_HIBERNATION is not set
29740 +CONFIG_SECCOMP=y
29741 +CONFIG_WANT_DEVICE_TREE=y
29742 +CONFIG_DEVICE_TREE=""
29743 +CONFIG_ISA_DMA_API=y
29744 +
29745 +#
29746 +# Bus options
29747 +#
29748 +CONFIG_ZONE_DMA=y
29749 +CONFIG_GENERIC_ISA_DMA=y
29750 +# CONFIG_PPC_INDIRECT_PCI is not set
29751 +CONFIG_FSL_SOC=y
29752 +CONFIG_PCI=y
29753 +CONFIG_PCI_DOMAINS=y
29754 +CONFIG_PCI_SYSCALL=y
29755 +# CONFIG_PCIEPORTBUS is not set
29756 +CONFIG_ARCH_SUPPORTS_MSI=y
29757 +# CONFIG_PCI_MSI is not set
29758 +CONFIG_PCI_LEGACY=y
29759 +# CONFIG_PCI_DEBUG is not set
29760 +# CONFIG_PCCARD is not set
29761 +# CONFIG_HOTPLUG_PCI is not set
29762 +
29763 +#
29764 +# Advanced setup
29765 +#
29766 +# CONFIG_ADVANCED_OPTIONS is not set
29767 +
29768 +#
29769 +# Default settings for advanced configuration options are used
29770 +#
29771 +CONFIG_HIGHMEM_START=0xfe000000
29772 +CONFIG_LOWMEM_SIZE=0x30000000
29773 +CONFIG_KERNEL_START=0xc0000000
29774 +CONFIG_TASK_SIZE=0xc0000000
29775 +CONFIG_BOOT_LOAD=0x00800000
29776 +
29777 +#
29778 +# Networking
29779 +#
29780 +CONFIG_NET=y
29781 +
29782 +#
29783 +# Networking options
29784 +#
29785 +CONFIG_PACKET=y
29786 +# CONFIG_PACKET_MMAP is not set
29787 +CONFIG_UNIX=y
29788 +CONFIG_XFRM=y
29789 +CONFIG_XFRM_USER=m
29790 +# CONFIG_XFRM_SUB_POLICY is not set
29791 +# CONFIG_XFRM_MIGRATE is not set
29792 +# CONFIG_NET_KEY is not set
29793 +CONFIG_INET=y
29794 +CONFIG_IP_MULTICAST=y
29795 +# CONFIG_IP_ADVANCED_ROUTER is not set
29796 +CONFIG_IP_FIB_HASH=y
29797 +CONFIG_IP_PNP=y
29798 +CONFIG_IP_PNP_DHCP=y
29799 +CONFIG_IP_PNP_BOOTP=y
29800 +# CONFIG_IP_PNP_RARP is not set
29801 +# CONFIG_NET_IPIP is not set
29802 +# CONFIG_NET_IPGRE is not set
29803 +# CONFIG_IP_MROUTE is not set
29804 +# CONFIG_ARPD is not set
29805 +CONFIG_SYN_COOKIES=y
29806 +# CONFIG_INET_AH is not set
29807 +# CONFIG_INET_ESP is not set
29808 +# CONFIG_INET_IPCOMP is not set
29809 +# CONFIG_INET_XFRM_TUNNEL is not set
29810 +# CONFIG_INET_TUNNEL is not set
29811 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
29812 +CONFIG_INET_XFRM_MODE_TUNNEL=y
29813 +CONFIG_INET_XFRM_MODE_BEET=y
29814 +# CONFIG_INET_LRO is not set
29815 +CONFIG_INET_DIAG=y
29816 +CONFIG_INET_TCP_DIAG=y
29817 +# CONFIG_TCP_CONG_ADVANCED is not set
29818 +CONFIG_TCP_CONG_CUBIC=y
29819 +CONFIG_DEFAULT_TCP_CONG="cubic"
29820 +# CONFIG_TCP_MD5SIG is not set
29821 +# CONFIG_IPV6 is not set
29822 +# CONFIG_INET6_XFRM_TUNNEL is not set
29823 +# CONFIG_INET6_TUNNEL is not set
29824 +# CONFIG_NETWORK_SECMARK is not set
29825 +# CONFIG_NETFILTER is not set
29826 +# CONFIG_IP_DCCP is not set
29827 +# CONFIG_IP_SCTP is not set
29828 +# CONFIG_TIPC is not set
29829 +# CONFIG_ATM is not set
29830 +# CONFIG_BRIDGE is not set
29831 +# CONFIG_VLAN_8021Q is not set
29832 +# CONFIG_DECNET is not set
29833 +# CONFIG_LLC2 is not set
29834 +# CONFIG_IPX is not set
29835 +# CONFIG_ATALK is not set
29836 +# CONFIG_X25 is not set
29837 +# CONFIG_LAPB is not set
29838 +# CONFIG_ECONET is not set
29839 +# CONFIG_WAN_ROUTER is not set
29840 +# CONFIG_NET_SCHED is not set
29841 +
29842 +#
29843 +# Network testing
29844 +#
29845 +# CONFIG_NET_PKTGEN is not set
29846 +# CONFIG_HAMRADIO is not set
29847 +# CONFIG_IRDA is not set
29848 +# CONFIG_BT is not set
29849 +# CONFIG_AF_RXRPC is not set
29850 +
29851 +#
29852 +# Wireless
29853 +#
29854 +# CONFIG_CFG80211 is not set
29855 +# CONFIG_WIRELESS_EXT is not set
29856 +# CONFIG_MAC80211 is not set
29857 +# CONFIG_IEEE80211 is not set
29858 +# CONFIG_RFKILL is not set
29859 +# CONFIG_NET_9P is not set
29860 +
29861 +#
29862 +# Device Drivers
29863 +#
29864 +
29865 +#
29866 +# Generic Driver Options
29867 +#
29868 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
29869 +CONFIG_STANDALONE=y
29870 +CONFIG_PREVENT_FIRMWARE_BUILD=y
29871 +# CONFIG_FW_LOADER is not set
29872 +# CONFIG_DEBUG_DRIVER is not set
29873 +# CONFIG_DEBUG_DEVRES is not set
29874 +# CONFIG_SYS_HYPERVISOR is not set
29875 +# CONFIG_CONNECTOR is not set
29876 +CONFIG_MTD=y
29877 +# CONFIG_MTD_DEBUG is not set
29878 +CONFIG_MTD_CONCAT=y
29879 +CONFIG_MTD_PARTITIONS=y
29880 +# CONFIG_MTD_REDBOOT_PARTS is not set
29881 +CONFIG_MTD_CMDLINE_PARTS=y
29882 +
29883 +#
29884 +# User Modules And Translation Layers
29885 +#
29886 +CONFIG_MTD_CHAR=y
29887 +CONFIG_MTD_BLKDEVS=y
29888 +CONFIG_MTD_BLOCK=y
29889 +# CONFIG_FTL is not set
29890 +# CONFIG_NFTL is not set
29891 +# CONFIG_INFTL is not set
29892 +# CONFIG_RFD_FTL is not set
29893 +# CONFIG_SSFDC is not set
29894 +# CONFIG_MTD_OOPS is not set
29895 +
29896 +#
29897 +# RAM/ROM/Flash chip drivers
29898 +#
29899 +CONFIG_MTD_CFI=y
29900 +# CONFIG_MTD_JEDECPROBE is not set
29901 +CONFIG_MTD_GEN_PROBE=y
29902 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
29903 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
29904 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
29905 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
29906 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
29907 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
29908 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
29909 +CONFIG_MTD_CFI_I1=y
29910 +CONFIG_MTD_CFI_I2=y
29911 +# CONFIG_MTD_CFI_I4 is not set
29912 +# CONFIG_MTD_CFI_I8 is not set
29913 +# CONFIG_MTD_CFI_INTELEXT is not set
29914 +CONFIG_MTD_CFI_AMDSTD=y
29915 +# CONFIG_MTD_CFI_STAA is not set
29916 +CONFIG_MTD_CFI_UTIL=y
29917 +CONFIG_MTD_RAM=y
29918 +CONFIG_MTD_ROM=y
29919 +# CONFIG_MTD_ABSENT is not set
29920 +
29921 +#
29922 +# Mapping drivers for chip access
29923 +#
29924 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
29925 +# CONFIG_MTD_PHYSMAP is not set
29926 +CONFIG_MTD_PHYSMAP_OF=y
29927 +# CONFIG_MTD_INTEL_VR_NOR is not set
29928 +# CONFIG_MTD_PLATRAM is not set
29929 +
29930 +#
29931 +# Self-contained MTD device drivers
29932 +#
29933 +# CONFIG_MTD_PMC551 is not set
29934 +# CONFIG_MTD_SLRAM is not set
29935 +# CONFIG_MTD_PHRAM is not set
29936 +# CONFIG_MTD_MTDRAM is not set
29937 +# CONFIG_MTD_BLOCK2MTD is not set
29938 +
29939 +#
29940 +# Disk-On-Chip Device Drivers
29941 +#
29942 +# CONFIG_MTD_DOC2000 is not set
29943 +# CONFIG_MTD_DOC2001 is not set
29944 +# CONFIG_MTD_DOC2001PLUS is not set
29945 +# CONFIG_MTD_NAND is not set
29946 +# CONFIG_MTD_ONENAND is not set
29947 +
29948 +#
29949 +# UBI - Unsorted block images
29950 +#
29951 +# CONFIG_MTD_UBI is not set
29952 +CONFIG_OF_DEVICE=y
29953 +# CONFIG_PARPORT is not set
29954 +CONFIG_BLK_DEV=y
29955 +# CONFIG_BLK_DEV_FD is not set
29956 +# CONFIG_BLK_CPQ_DA is not set
29957 +# CONFIG_BLK_CPQ_CISS_DA is not set
29958 +# CONFIG_BLK_DEV_DAC960 is not set
29959 +# CONFIG_BLK_DEV_UMEM is not set
29960 +# CONFIG_BLK_DEV_COW_COMMON is not set
29961 +CONFIG_BLK_DEV_LOOP=y
29962 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
29963 +# CONFIG_BLK_DEV_NBD is not set
29964 +# CONFIG_BLK_DEV_SX8 is not set
29965 +# CONFIG_BLK_DEV_UB is not set
29966 +CONFIG_BLK_DEV_RAM=y
29967 +CONFIG_BLK_DEV_RAM_COUNT=16
29968 +CONFIG_BLK_DEV_RAM_SIZE=32768
29969 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
29970 +# CONFIG_CDROM_PKTCDVD is not set
29971 +# CONFIG_ATA_OVER_ETH is not set
29972 +CONFIG_MISC_DEVICES=y
29973 +# CONFIG_PHANTOM is not set
29974 +# CONFIG_EEPROM_93CX6 is not set
29975 +# CONFIG_SGI_IOC4 is not set
29976 +# CONFIG_TIFM_CORE is not set
29977 +# CONFIG_IDE is not set
29978 +
29979 +#
29980 +# SCSI device support
29981 +#
29982 +# CONFIG_RAID_ATTRS is not set
29983 +CONFIG_SCSI=y
29984 +CONFIG_SCSI_DMA=y
29985 +CONFIG_SCSI_TGT=y
29986 +# CONFIG_SCSI_NETLINK is not set
29987 +CONFIG_SCSI_PROC_FS=y
29988 +
29989 +#
29990 +# SCSI support type (disk, tape, CD-ROM)
29991 +#
29992 +CONFIG_BLK_DEV_SD=y
29993 +# CONFIG_CHR_DEV_ST is not set
29994 +# CONFIG_CHR_DEV_OSST is not set
29995 +# CONFIG_BLK_DEV_SR is not set
29996 +CONFIG_CHR_DEV_SG=y
29997 +# CONFIG_CHR_DEV_SCH is not set
29998 +
29999 +#
30000 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
30001 +#
30002 +# CONFIG_SCSI_MULTI_LUN is not set
30003 +# CONFIG_SCSI_CONSTANTS is not set
30004 +# CONFIG_SCSI_LOGGING is not set
30005 +# CONFIG_SCSI_SCAN_ASYNC is not set
30006 +CONFIG_SCSI_WAIT_SCAN=m
30007 +
30008 +#
30009 +# SCSI Transports
30010 +#
30011 +# CONFIG_SCSI_SPI_ATTRS is not set
30012 +# CONFIG_SCSI_FC_ATTRS is not set
30013 +# CONFIG_SCSI_ISCSI_ATTRS is not set
30014 +# CONFIG_SCSI_SAS_LIBSAS is not set
30015 +# CONFIG_SCSI_SRP_ATTRS is not set
30016 +CONFIG_SCSI_LOWLEVEL=y
30017 +# CONFIG_ISCSI_TCP is not set
30018 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
30019 +# CONFIG_SCSI_3W_9XXX is not set
30020 +# CONFIG_SCSI_ACARD is not set
30021 +# CONFIG_SCSI_AACRAID is not set
30022 +# CONFIG_SCSI_AIC7XXX is not set
30023 +# CONFIG_SCSI_AIC7XXX_OLD is not set
30024 +# CONFIG_SCSI_AIC79XX is not set
30025 +# CONFIG_SCSI_AIC94XX is not set
30026 +# CONFIG_SCSI_DPT_I2O is not set
30027 +# CONFIG_SCSI_ADVANSYS is not set
30028 +# CONFIG_SCSI_ARCMSR is not set
30029 +# CONFIG_MEGARAID_NEWGEN is not set
30030 +# CONFIG_MEGARAID_LEGACY is not set
30031 +# CONFIG_MEGARAID_SAS is not set
30032 +# CONFIG_SCSI_HPTIOP is not set
30033 +# CONFIG_SCSI_BUSLOGIC is not set
30034 +# CONFIG_SCSI_DMX3191D is not set
30035 +# CONFIG_SCSI_EATA is not set
30036 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
30037 +# CONFIG_SCSI_GDTH is not set
30038 +# CONFIG_SCSI_IPS is not set
30039 +# CONFIG_SCSI_INITIO is not set
30040 +# CONFIG_SCSI_INIA100 is not set
30041 +# CONFIG_SCSI_STEX is not set
30042 +# CONFIG_SCSI_SYM53C8XX_2 is not set
30043 +# CONFIG_SCSI_IPR is not set
30044 +# CONFIG_SCSI_QLOGIC_1280 is not set
30045 +# CONFIG_SCSI_QLA_FC is not set
30046 +# CONFIG_SCSI_QLA_ISCSI is not set
30047 +# CONFIG_SCSI_LPFC is not set
30048 +# CONFIG_SCSI_DC395x is not set
30049 +# CONFIG_SCSI_DC390T is not set
30050 +# CONFIG_SCSI_NSP32 is not set
30051 +# CONFIG_SCSI_DEBUG is not set
30052 +# CONFIG_SCSI_SRP is not set
30053 +CONFIG_ATA=y
30054 +# CONFIG_ATA_NONSTANDARD is not set
30055 +# CONFIG_SATA_AHCI is not set
30056 +# CONFIG_SATA_SVW is not set
30057 +# CONFIG_ATA_PIIX is not set
30058 +# CONFIG_SATA_MV is not set
30059 +# CONFIG_SATA_NV is not set
30060 +# CONFIG_PDC_ADMA is not set
30061 +# CONFIG_SATA_QSTOR is not set
30062 +# CONFIG_SATA_PROMISE is not set
30063 +# CONFIG_SATA_SX4 is not set
30064 +# CONFIG_SATA_SIL is not set
30065 +# CONFIG_SATA_SIL24 is not set
30066 +# CONFIG_SATA_SIS is not set
30067 +# CONFIG_SATA_ULI is not set
30068 +# CONFIG_SATA_VIA is not set
30069 +# CONFIG_SATA_VITESSE is not set
30070 +# CONFIG_SATA_INIC162X is not set
30071 +# CONFIG_PATA_ALI is not set
30072 +# CONFIG_PATA_AMD is not set
30073 +# CONFIG_PATA_ARTOP is not set
30074 +# CONFIG_PATA_ATIIXP is not set
30075 +# CONFIG_PATA_CMD640_PCI is not set
30076 +# CONFIG_PATA_CMD64X is not set
30077 +# CONFIG_PATA_CS5520 is not set
30078 +# CONFIG_PATA_CS5530 is not set
30079 +# CONFIG_PATA_CYPRESS is not set
30080 +# CONFIG_PATA_EFAR is not set
30081 +# CONFIG_ATA_GENERIC is not set
30082 +# CONFIG_PATA_HPT366 is not set
30083 +# CONFIG_PATA_HPT37X is not set
30084 +# CONFIG_PATA_HPT3X2N is not set
30085 +# CONFIG_PATA_HPT3X3 is not set
30086 +# CONFIG_PATA_IT821X is not set
30087 +# CONFIG_PATA_IT8213 is not set
30088 +# CONFIG_PATA_JMICRON is not set
30089 +# CONFIG_PATA_TRIFLEX is not set
30090 +# CONFIG_PATA_MARVELL is not set
30091 +CONFIG_PATA_MPC52xx=y
30092 +# CONFIG_PATA_MPIIX is not set
30093 +# CONFIG_PATA_OLDPIIX is not set
30094 +# CONFIG_PATA_NETCELL is not set
30095 +# CONFIG_PATA_NS87410 is not set
30096 +# CONFIG_PATA_NS87415 is not set
30097 +# CONFIG_PATA_OPTI is not set
30098 +# CONFIG_PATA_OPTIDMA is not set
30099 +# CONFIG_PATA_PDC_OLD is not set
30100 +# CONFIG_PATA_RADISYS is not set
30101 +# CONFIG_PATA_RZ1000 is not set
30102 +# CONFIG_PATA_SC1200 is not set
30103 +# CONFIG_PATA_SERVERWORKS is not set
30104 +# CONFIG_PATA_PDC2027X is not set
30105 +# CONFIG_PATA_SIL680 is not set
30106 +# CONFIG_PATA_SIS is not set
30107 +# CONFIG_PATA_VIA is not set
30108 +# CONFIG_PATA_WINBOND is not set
30109 +CONFIG_PATA_PLATFORM=y
30110 +# CONFIG_PATA_OF_PLATFORM is not set
30111 +# CONFIG_MD is not set
30112 +# CONFIG_FUSION is not set
30113 +
30114 +#
30115 +# IEEE 1394 (FireWire) support
30116 +#
30117 +# CONFIG_FIREWIRE is not set
30118 +# CONFIG_IEEE1394 is not set
30119 +# CONFIG_I2O is not set
30120 +# CONFIG_MACINTOSH_DRIVERS is not set
30121 +CONFIG_NETDEVICES=y
30122 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
30123 +# CONFIG_DUMMY is not set
30124 +# CONFIG_BONDING is not set
30125 +# CONFIG_MACVLAN is not set
30126 +# CONFIG_EQUALIZER is not set
30127 +# CONFIG_TUN is not set
30128 +# CONFIG_VETH is not set
30129 +# CONFIG_IP1000 is not set
30130 +# CONFIG_ARCNET is not set
30131 +CONFIG_PHYLIB=y
30132 +
30133 +#
30134 +# MII PHY device drivers
30135 +#
30136 +# CONFIG_MARVELL_PHY is not set
30137 +# CONFIG_DAVICOM_PHY is not set
30138 +# CONFIG_QSEMI_PHY is not set
30139 +# CONFIG_LXT_PHY is not set
30140 +# CONFIG_CICADA_PHY is not set
30141 +# CONFIG_VITESSE_PHY is not set
30142 +# CONFIG_SMSC_PHY is not set
30143 +# CONFIG_BROADCOM_PHY is not set
30144 +# CONFIG_ICPLUS_PHY is not set
30145 +# CONFIG_FIXED_PHY is not set
30146 +# CONFIG_MDIO_BITBANG is not set
30147 +CONFIG_NET_ETHERNET=y
30148 +# CONFIG_MII is not set
30149 +# CONFIG_HAPPYMEAL is not set
30150 +# CONFIG_SUNGEM is not set
30151 +# CONFIG_CASSINI is not set
30152 +# CONFIG_NET_VENDOR_3COM is not set
30153 +# CONFIG_NET_TULIP is not set
30154 +# CONFIG_HP100 is not set
30155 +# CONFIG_IBM_NEW_EMAC_ZMII is not set
30156 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
30157 +# CONFIG_IBM_NEW_EMAC_TAH is not set
30158 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
30159 +# CONFIG_NET_PCI is not set
30160 +# CONFIG_B44 is not set
30161 +CONFIG_FEC_MPC52xx=y
30162 +CONFIG_FEC_MPC52xx_MDIO=y
30163 +# CONFIG_NETDEV_1000 is not set
30164 +# CONFIG_NETDEV_10000 is not set
30165 +# CONFIG_TR is not set
30166 +
30167 +#
30168 +# Wireless LAN
30169 +#
30170 +# CONFIG_WLAN_PRE80211 is not set
30171 +# CONFIG_WLAN_80211 is not set
30172 +
30173 +#
30174 +# USB Network Adapters
30175 +#
30176 +# CONFIG_USB_CATC is not set
30177 +# CONFIG_USB_KAWETH is not set
30178 +# CONFIG_USB_PEGASUS is not set
30179 +# CONFIG_USB_RTL8150 is not set
30180 +# CONFIG_USB_USBNET is not set
30181 +# CONFIG_WAN is not set
30182 +# CONFIG_FDDI is not set
30183 +# CONFIG_HIPPI is not set
30184 +# CONFIG_PPP is not set
30185 +# CONFIG_SLIP is not set
30186 +# CONFIG_NET_FC is not set
30187 +# CONFIG_SHAPER is not set
30188 +# CONFIG_NETCONSOLE is not set
30189 +# CONFIG_NETPOLL is not set
30190 +# CONFIG_NET_POLL_CONTROLLER is not set
30191 +# CONFIG_ISDN is not set
30192 +# CONFIG_PHONE is not set
30193 +
30194 +#
30195 +# Input device support
30196 +#
30197 +# CONFIG_INPUT is not set
30198 +
30199 +#
30200 +# Hardware I/O ports
30201 +#
30202 +# CONFIG_SERIO is not set
30203 +# CONFIG_GAMEPORT is not set
30204 +
30205 +#
30206 +# Character devices
30207 +#
30208 +# CONFIG_VT is not set
30209 +# CONFIG_SERIAL_NONSTANDARD is not set
30210 +
30211 +#
30212 +# Serial drivers
30213 +#
30214 +# CONFIG_SERIAL_8250 is not set
30215 +
30216 +#
30217 +# Non-8250 serial port support
30218 +#
30219 +# CONFIG_SERIAL_UARTLITE is not set
30220 +CONFIG_SERIAL_CORE=y
30221 +CONFIG_SERIAL_CORE_CONSOLE=y
30222 +CONFIG_SERIAL_MPC52xx=y
30223 +CONFIG_SERIAL_MPC52xx_CONSOLE=y
30224 +CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200
30225 +# CONFIG_SERIAL_JSM is not set
30226 +CONFIG_UNIX98_PTYS=y
30227 +CONFIG_LEGACY_PTYS=y
30228 +CONFIG_LEGACY_PTY_COUNT=256
30229 +# CONFIG_HVC_RTAS is not set
30230 +# CONFIG_IPMI_HANDLER is not set
30231 +# CONFIG_HW_RANDOM is not set
30232 +# CONFIG_NVRAM is not set
30233 +CONFIG_GEN_RTC=y
30234 +# CONFIG_GEN_RTC_X is not set
30235 +# CONFIG_R3964 is not set
30236 +# CONFIG_APPLICOM is not set
30237 +# CONFIG_RAW_DRIVER is not set
30238 +# CONFIG_TCG_TPM is not set
30239 +CONFIG_DEVPORT=y
30240 +CONFIG_I2C=y
30241 +CONFIG_I2C_BOARDINFO=y
30242 +CONFIG_I2C_CHARDEV=y
30243 +
30244 +#
30245 +# I2C Algorithms
30246 +#
30247 +# CONFIG_I2C_ALGOBIT is not set
30248 +# CONFIG_I2C_ALGOPCF is not set
30249 +# CONFIG_I2C_ALGOPCA is not set
30250 +
30251 +#
30252 +# I2C Hardware Bus support
30253 +#
30254 +# CONFIG_I2C_ALI1535 is not set
30255 +# CONFIG_I2C_ALI1563 is not set
30256 +# CONFIG_I2C_ALI15X3 is not set
30257 +# CONFIG_I2C_AMD756 is not set
30258 +# CONFIG_I2C_AMD8111 is not set
30259 +# CONFIG_I2C_I801 is not set
30260 +# CONFIG_I2C_I810 is not set
30261 +# CONFIG_I2C_PIIX4 is not set
30262 +CONFIG_I2C_MPC=y
30263 +# CONFIG_I2C_NFORCE2 is not set
30264 +# CONFIG_I2C_OCORES is not set
30265 +# CONFIG_I2C_PARPORT_LIGHT is not set
30266 +# CONFIG_I2C_PROSAVAGE is not set
30267 +# CONFIG_I2C_SAVAGE4 is not set
30268 +# CONFIG_I2C_SIMTEC is not set
30269 +# CONFIG_I2C_SIS5595 is not set
30270 +# CONFIG_I2C_SIS630 is not set
30271 +# CONFIG_I2C_SIS96X is not set
30272 +# CONFIG_I2C_TAOS_EVM is not set
30273 +# CONFIG_I2C_STUB is not set
30274 +# CONFIG_I2C_TINY_USB is not set
30275 +# CONFIG_I2C_VIA is not set
30276 +# CONFIG_I2C_VIAPRO is not set
30277 +# CONFIG_I2C_VOODOO3 is not set
30278 +
30279 +#
30280 +# Miscellaneous I2C Chip support
30281 +#
30282 +# CONFIG_SENSORS_DS1337 is not set
30283 +# CONFIG_SENSORS_DS1374 is not set
30284 +# CONFIG_DS1682 is not set
30285 +# CONFIG_SENSORS_EEPROM is not set
30286 +# CONFIG_SENSORS_PCF8574 is not set
30287 +# CONFIG_SENSORS_PCA9539 is not set
30288 +# CONFIG_SENSORS_PCF8591 is not set
30289 +# CONFIG_SENSORS_M41T00 is not set
30290 +# CONFIG_SENSORS_MAX6875 is not set
30291 +# CONFIG_SENSORS_TSL2550 is not set
30292 +# CONFIG_I2C_DEBUG_CORE is not set
30293 +# CONFIG_I2C_DEBUG_ALGO is not set
30294 +# CONFIG_I2C_DEBUG_BUS is not set
30295 +# CONFIG_I2C_DEBUG_CHIP is not set
30296 +
30297 +#
30298 +# SPI support
30299 +#
30300 +# CONFIG_SPI is not set
30301 +# CONFIG_SPI_MASTER is not set
30302 +# CONFIG_W1 is not set
30303 +# CONFIG_POWER_SUPPLY is not set
30304 +CONFIG_HWMON=y
30305 +# CONFIG_HWMON_VID is not set
30306 +# CONFIG_SENSORS_AD7418 is not set
30307 +# CONFIG_SENSORS_ADM1021 is not set
30308 +# CONFIG_SENSORS_ADM1025 is not set
30309 +# CONFIG_SENSORS_ADM1026 is not set
30310 +# CONFIG_SENSORS_ADM1029 is not set
30311 +# CONFIG_SENSORS_ADM1031 is not set
30312 +# CONFIG_SENSORS_ADM9240 is not set
30313 +# CONFIG_SENSORS_ADT7470 is not set
30314 +# CONFIG_SENSORS_ATXP1 is not set
30315 +# CONFIG_SENSORS_DS1621 is not set
30316 +# CONFIG_SENSORS_I5K_AMB is not set
30317 +# CONFIG_SENSORS_F71805F is not set
30318 +# CONFIG_SENSORS_F71882FG is not set
30319 +# CONFIG_SENSORS_F75375S is not set
30320 +# CONFIG_SENSORS_GL518SM is not set
30321 +# CONFIG_SENSORS_GL520SM is not set
30322 +# CONFIG_SENSORS_IT87 is not set
30323 +# CONFIG_SENSORS_LM63 is not set
30324 +# CONFIG_SENSORS_LM75 is not set
30325 +# CONFIG_SENSORS_LM77 is not set
30326 +# CONFIG_SENSORS_LM78 is not set
30327 +# CONFIG_SENSORS_LM80 is not set
30328 +# CONFIG_SENSORS_LM83 is not set
30329 +# CONFIG_SENSORS_LM85 is not set
30330 +# CONFIG_SENSORS_LM87 is not set
30331 +# CONFIG_SENSORS_LM90 is not set
30332 +# CONFIG_SENSORS_LM92 is not set
30333 +# CONFIG_SENSORS_LM93 is not set
30334 +# CONFIG_SENSORS_MAX1619 is not set
30335 +# CONFIG_SENSORS_MAX6650 is not set
30336 +# CONFIG_SENSORS_PC87360 is not set
30337 +# CONFIG_SENSORS_PC87427 is not set
30338 +# CONFIG_SENSORS_SIS5595 is not set
30339 +# CONFIG_SENSORS_DME1737 is not set
30340 +# CONFIG_SENSORS_SMSC47M1 is not set
30341 +# CONFIG_SENSORS_SMSC47M192 is not set
30342 +# CONFIG_SENSORS_SMSC47B397 is not set
30343 +# CONFIG_SENSORS_THMC50 is not set
30344 +# CONFIG_SENSORS_VIA686A is not set
30345 +# CONFIG_SENSORS_VT1211 is not set
30346 +# CONFIG_SENSORS_VT8231 is not set
30347 +# CONFIG_SENSORS_W83781D is not set
30348 +# CONFIG_SENSORS_W83791D is not set
30349 +# CONFIG_SENSORS_W83792D is not set
30350 +# CONFIG_SENSORS_W83793 is not set
30351 +# CONFIG_SENSORS_W83L785TS is not set
30352 +# CONFIG_SENSORS_W83627HF is not set
30353 +# CONFIG_SENSORS_W83627EHF is not set
30354 +# CONFIG_HWMON_DEBUG_CHIP is not set
30355 +CONFIG_WATCHDOG=y
30356 +# CONFIG_WATCHDOG_NOWAYOUT is not set
30357 +
30358 +#
30359 +# Watchdog Device Drivers
30360 +#
30361 +# CONFIG_SOFT_WATCHDOG is not set
30362 +# CONFIG_MPC5200_WDT is not set
30363 +# CONFIG_WATCHDOG_RTAS is not set
30364 +
30365 +#
30366 +# PCI-based Watchdog Cards
30367 +#
30368 +# CONFIG_PCIPCWATCHDOG is not set
30369 +# CONFIG_WDTPCI is not set
30370 +
30371 +#
30372 +# USB-based Watchdog Cards
30373 +#
30374 +# CONFIG_USBPCWATCHDOG is not set
30375 +
30376 +#
30377 +# Sonics Silicon Backplane
30378 +#
30379 +CONFIG_SSB_POSSIBLE=y
30380 +# CONFIG_SSB is not set
30381 +
30382 +#
30383 +# Multifunction device drivers
30384 +#
30385 +# CONFIG_MFD_SM501 is not set
30386 +
30387 +#
30388 +# Multimedia devices
30389 +#
30390 +# CONFIG_VIDEO_DEV is not set
30391 +# CONFIG_DVB_CORE is not set
30392 +CONFIG_DAB=y
30393 +# CONFIG_USB_DABUSB is not set
30394 +
30395 +#
30396 +# Graphics support
30397 +#
30398 +# CONFIG_AGP is not set
30399 +# CONFIG_DRM is not set
30400 +# CONFIG_VGASTATE is not set
30401 +CONFIG_VIDEO_OUTPUT_CONTROL=m
30402 +# CONFIG_FB is not set
30403 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
30404 +
30405 +#
30406 +# Display device support
30407 +#
30408 +# CONFIG_DISPLAY_SUPPORT is not set
30409 +
30410 +#
30411 +# Sound
30412 +#
30413 +# CONFIG_SOUND is not set
30414 +CONFIG_USB_SUPPORT=y
30415 +CONFIG_USB_ARCH_HAS_HCD=y
30416 +CONFIG_USB_ARCH_HAS_OHCI=y
30417 +CONFIG_USB_ARCH_HAS_EHCI=y
30418 +CONFIG_USB=y
30419 +# CONFIG_USB_DEBUG is not set
30420 +
30421 +#
30422 +# Miscellaneous USB options
30423 +#
30424 +CONFIG_USB_DEVICEFS=y
30425 +# CONFIG_USB_DEVICE_CLASS is not set
30426 +# CONFIG_USB_DYNAMIC_MINORS is not set
30427 +# CONFIG_USB_SUSPEND is not set
30428 +# CONFIG_USB_PERSIST is not set
30429 +# CONFIG_USB_OTG is not set
30430 +
30431 +#
30432 +# USB Host Controller Drivers
30433 +#
30434 +# CONFIG_USB_EHCI_HCD is not set
30435 +# CONFIG_USB_ISP116X_HCD is not set
30436 +CONFIG_USB_OHCI_HCD=y
30437 +CONFIG_USB_OHCI_HCD_PPC_SOC=y
30438 +CONFIG_USB_OHCI_HCD_PPC_OF=y
30439 +CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
30440 +# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
30441 +CONFIG_USB_OHCI_HCD_PCI=y
30442 +CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
30443 +CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
30444 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
30445 +# CONFIG_USB_UHCI_HCD is not set
30446 +# CONFIG_USB_SL811_HCD is not set
30447 +# CONFIG_USB_R8A66597_HCD is not set
30448 +
30449 +#
30450 +# USB Device Class drivers
30451 +#
30452 +# CONFIG_USB_ACM is not set
30453 +# CONFIG_USB_PRINTER is not set
30454 +
30455 +#
30456 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
30457 +#
30458 +
30459 +#
30460 +# may also be needed; see USB_STORAGE Help for more information
30461 +#
30462 +CONFIG_USB_STORAGE=y
30463 +# CONFIG_USB_STORAGE_DEBUG is not set
30464 +# CONFIG_USB_STORAGE_DATAFAB is not set
30465 +# CONFIG_USB_STORAGE_FREECOM is not set
30466 +# CONFIG_USB_STORAGE_ISD200 is not set
30467 +# CONFIG_USB_STORAGE_DPCM is not set
30468 +# CONFIG_USB_STORAGE_USBAT is not set
30469 +# CONFIG_USB_STORAGE_SDDR09 is not set
30470 +# CONFIG_USB_STORAGE_SDDR55 is not set
30471 +# CONFIG_USB_STORAGE_JUMPSHOT is not set
30472 +# CONFIG_USB_STORAGE_ALAUDA is not set
30473 +# CONFIG_USB_STORAGE_KARMA is not set
30474 +# CONFIG_USB_LIBUSUAL is not set
30475 +
30476 +#
30477 +# USB Imaging devices
30478 +#
30479 +# CONFIG_USB_MDC800 is not set
30480 +# CONFIG_USB_MICROTEK is not set
30481 +CONFIG_USB_MON=y
30482 +
30483 +#
30484 +# USB port drivers
30485 +#
30486 +
30487 +#
30488 +# USB Serial Converter support
30489 +#
30490 +# CONFIG_USB_SERIAL is not set
30491 +
30492 +#
30493 +# USB Miscellaneous drivers
30494 +#
30495 +# CONFIG_USB_EMI62 is not set
30496 +# CONFIG_USB_EMI26 is not set
30497 +# CONFIG_USB_ADUTUX is not set
30498 +# CONFIG_USB_AUERSWALD is not set
30499 +# CONFIG_USB_RIO500 is not set
30500 +# CONFIG_USB_LEGOTOWER is not set
30501 +# CONFIG_USB_LCD is not set
30502 +# CONFIG_USB_BERRY_CHARGE is not set
30503 +# CONFIG_USB_LED is not set
30504 +# CONFIG_USB_CYPRESS_CY7C63 is not set
30505 +# CONFIG_USB_CYTHERM is not set
30506 +# CONFIG_USB_PHIDGET is not set
30507 +# CONFIG_USB_IDMOUSE is not set
30508 +# CONFIG_USB_FTDI_ELAN is not set
30509 +# CONFIG_USB_APPLEDISPLAY is not set
30510 +# CONFIG_USB_LD is not set
30511 +# CONFIG_USB_TRANCEVIBRATOR is not set
30512 +# CONFIG_USB_IOWARRIOR is not set
30513 +# CONFIG_USB_TEST is not set
30514 +
30515 +#
30516 +# USB DSL modem support
30517 +#
30518 +
30519 +#
30520 +# USB Gadget Support
30521 +#
30522 +# CONFIG_USB_GADGET is not set
30523 +# CONFIG_MMC is not set
30524 +CONFIG_NEW_LEDS=y
30525 +CONFIG_LEDS_CLASS=y
30526 +
30527 +#
30528 +# LED drivers
30529 +#
30530 +
30531 +#
30532 +# LED Triggers
30533 +#
30534 +CONFIG_LEDS_TRIGGERS=y
30535 +CONFIG_LEDS_TRIGGER_TIMER=y
30536 +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
30537 +# CONFIG_INFINIBAND is not set
30538 +# CONFIG_EDAC is not set
30539 +# CONFIG_RTC_CLASS is not set
30540 +
30541 +#
30542 +# Userspace I/O
30543 +#
30544 +# CONFIG_UIO is not set
30545 +
30546 +#
30547 +# File systems
30548 +#
30549 +CONFIG_EXT2_FS=y
30550 +# CONFIG_EXT2_FS_XATTR is not set
30551 +# CONFIG_EXT2_FS_XIP is not set
30552 +CONFIG_EXT3_FS=y
30553 +CONFIG_EXT3_FS_XATTR=y
30554 +# CONFIG_EXT3_FS_POSIX_ACL is not set
30555 +# CONFIG_EXT3_FS_SECURITY is not set
30556 +# CONFIG_EXT4DEV_FS is not set
30557 +CONFIG_JBD=y
30558 +CONFIG_FS_MBCACHE=y
30559 +# CONFIG_REISERFS_FS is not set
30560 +# CONFIG_JFS_FS is not set
30561 +# CONFIG_FS_POSIX_ACL is not set
30562 +# CONFIG_XFS_FS is not set
30563 +# CONFIG_GFS2_FS is not set
30564 +# CONFIG_OCFS2_FS is not set
30565 +# CONFIG_MINIX_FS is not set
30566 +# CONFIG_ROMFS_FS is not set
30567 +CONFIG_INOTIFY=y
30568 +CONFIG_INOTIFY_USER=y
30569 +# CONFIG_QUOTA is not set
30570 +CONFIG_DNOTIFY=y
30571 +# CONFIG_AUTOFS_FS is not set
30572 +# CONFIG_AUTOFS4_FS is not set
30573 +# CONFIG_FUSE_FS is not set
30574 +
30575 +#
30576 +# CD-ROM/DVD Filesystems
30577 +#
30578 +# CONFIG_ISO9660_FS is not set
30579 +# CONFIG_UDF_FS is not set
30580 +
30581 +#
30582 +# DOS/FAT/NT Filesystems
30583 +#
30584 +CONFIG_FAT_FS=y
30585 +CONFIG_MSDOS_FS=y
30586 +CONFIG_VFAT_FS=y
30587 +CONFIG_FAT_DEFAULT_CODEPAGE=437
30588 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
30589 +# CONFIG_NTFS_FS is not set
30590 +
30591 +#
30592 +# Pseudo filesystems
30593 +#
30594 +CONFIG_PROC_FS=y
30595 +CONFIG_PROC_KCORE=y
30596 +CONFIG_PROC_SYSCTL=y
30597 +CONFIG_SYSFS=y
30598 +CONFIG_TMPFS=y
30599 +# CONFIG_TMPFS_POSIX_ACL is not set
30600 +# CONFIG_HUGETLB_PAGE is not set
30601 +# CONFIG_CONFIGFS_FS is not set
30602 +
30603 +#
30604 +# Miscellaneous filesystems
30605 +#
30606 +# CONFIG_ADFS_FS is not set
30607 +# CONFIG_AFFS_FS is not set
30608 +# CONFIG_HFS_FS is not set
30609 +# CONFIG_HFSPLUS_FS is not set
30610 +# CONFIG_BEFS_FS is not set
30611 +# CONFIG_BFS_FS is not set
30612 +# CONFIG_EFS_FS is not set
30613 +CONFIG_JFFS2_FS=y
30614 +CONFIG_JFFS2_FS_DEBUG=0
30615 +CONFIG_JFFS2_FS_WRITEBUFFER=y
30616 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
30617 +# CONFIG_JFFS2_SUMMARY is not set
30618 +# CONFIG_JFFS2_FS_XATTR is not set
30619 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
30620 +CONFIG_JFFS2_ZLIB=y
30621 +# CONFIG_JFFS2_LZO is not set
30622 +CONFIG_JFFS2_RTIME=y
30623 +# CONFIG_JFFS2_RUBIN is not set
30624 +CONFIG_CRAMFS=y
30625 +# CONFIG_VXFS_FS is not set
30626 +# CONFIG_HPFS_FS is not set
30627 +# CONFIG_QNX4FS_FS is not set
30628 +# CONFIG_SYSV_FS is not set
30629 +# CONFIG_UFS_FS is not set
30630 +CONFIG_NETWORK_FILESYSTEMS=y
30631 +CONFIG_NFS_FS=y
30632 +CONFIG_NFS_V3=y
30633 +# CONFIG_NFS_V3_ACL is not set
30634 +CONFIG_NFS_V4=y
30635 +# CONFIG_NFS_DIRECTIO is not set
30636 +# CONFIG_NFSD is not set
30637 +CONFIG_ROOT_NFS=y
30638 +CONFIG_LOCKD=y
30639 +CONFIG_LOCKD_V4=y
30640 +CONFIG_NFS_COMMON=y
30641 +CONFIG_SUNRPC=y
30642 +CONFIG_SUNRPC_GSS=y
30643 +# CONFIG_SUNRPC_BIND34 is not set
30644 +CONFIG_RPCSEC_GSS_KRB5=y
30645 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
30646 +# CONFIG_SMB_FS is not set
30647 +# CONFIG_CIFS is not set
30648 +# CONFIG_NCP_FS is not set
30649 +# CONFIG_CODA_FS is not set
30650 +# CONFIG_AFS_FS is not set
30651 +
30652 +#
30653 +# Partition Types
30654 +#
30655 +# CONFIG_PARTITION_ADVANCED is not set
30656 +CONFIG_MSDOS_PARTITION=y
30657 +CONFIG_NLS=y
30658 +CONFIG_NLS_DEFAULT="iso8859-1"
30659 +CONFIG_NLS_CODEPAGE_437=y
30660 +# CONFIG_NLS_CODEPAGE_737 is not set
30661 +# CONFIG_NLS_CODEPAGE_775 is not set
30662 +# CONFIG_NLS_CODEPAGE_850 is not set
30663 +# CONFIG_NLS_CODEPAGE_852 is not set
30664 +# CONFIG_NLS_CODEPAGE_855 is not set
30665 +# CONFIG_NLS_CODEPAGE_857 is not set
30666 +# CONFIG_NLS_CODEPAGE_860 is not set
30667 +# CONFIG_NLS_CODEPAGE_861 is not set
30668 +# CONFIG_NLS_CODEPAGE_862 is not set
30669 +# CONFIG_NLS_CODEPAGE_863 is not set
30670 +# CONFIG_NLS_CODEPAGE_864 is not set
30671 +# CONFIG_NLS_CODEPAGE_865 is not set
30672 +# CONFIG_NLS_CODEPAGE_866 is not set
30673 +# CONFIG_NLS_CODEPAGE_869 is not set
30674 +# CONFIG_NLS_CODEPAGE_936 is not set
30675 +# CONFIG_NLS_CODEPAGE_950 is not set
30676 +# CONFIG_NLS_CODEPAGE_932 is not set
30677 +# CONFIG_NLS_CODEPAGE_949 is not set
30678 +# CONFIG_NLS_CODEPAGE_874 is not set
30679 +# CONFIG_NLS_ISO8859_8 is not set
30680 +# CONFIG_NLS_CODEPAGE_1250 is not set
30681 +# CONFIG_NLS_CODEPAGE_1251 is not set
30682 +# CONFIG_NLS_ASCII is not set
30683 +CONFIG_NLS_ISO8859_1=y
30684 +# CONFIG_NLS_ISO8859_2 is not set
30685 +# CONFIG_NLS_ISO8859_3 is not set
30686 +# CONFIG_NLS_ISO8859_4 is not set
30687 +# CONFIG_NLS_ISO8859_5 is not set
30688 +# CONFIG_NLS_ISO8859_6 is not set
30689 +# CONFIG_NLS_ISO8859_7 is not set
30690 +# CONFIG_NLS_ISO8859_9 is not set
30691 +# CONFIG_NLS_ISO8859_13 is not set
30692 +# CONFIG_NLS_ISO8859_14 is not set
30693 +# CONFIG_NLS_ISO8859_15 is not set
30694 +# CONFIG_NLS_KOI8_R is not set
30695 +# CONFIG_NLS_KOI8_U is not set
30696 +# CONFIG_NLS_UTF8 is not set
30697 +# CONFIG_DLM is not set
30698 +# CONFIG_UCC_SLOW is not set
30699 +
30700 +#
30701 +# Library routines
30702 +#
30703 +CONFIG_BITREVERSE=y
30704 +# CONFIG_CRC_CCITT is not set
30705 +# CONFIG_CRC16 is not set
30706 +# CONFIG_CRC_ITU_T is not set
30707 +CONFIG_CRC32=y
30708 +# CONFIG_CRC7 is not set
30709 +# CONFIG_LIBCRC32C is not set
30710 +CONFIG_ZLIB_INFLATE=y
30711 +CONFIG_ZLIB_DEFLATE=y
30712 +CONFIG_PLIST=y
30713 +CONFIG_HAS_IOMEM=y
30714 +CONFIG_HAS_IOPORT=y
30715 +CONFIG_HAS_DMA=y
30716 +# CONFIG_INSTRUMENTATION is not set
30717 +
30718 +#
30719 +# Kernel hacking
30720 +#
30721 +CONFIG_PRINTK_TIME=y
30722 +CONFIG_ENABLE_WARN_DEPRECATED=y
30723 +CONFIG_ENABLE_MUST_CHECK=y
30724 +# CONFIG_MAGIC_SYSRQ is not set
30725 +# CONFIG_UNUSED_SYMBOLS is not set
30726 +# CONFIG_DEBUG_FS is not set
30727 +# CONFIG_HEADERS_CHECK is not set
30728 +CONFIG_DEBUG_KERNEL=y
30729 +# CONFIG_DEBUG_SHIRQ is not set
30730 +CONFIG_DETECT_SOFTLOCKUP=y
30731 +CONFIG_SCHED_DEBUG=y
30732 +# CONFIG_SCHEDSTATS is not set
30733 +# CONFIG_TIMER_STATS is not set
30734 +# CONFIG_SLUB_DEBUG_ON is not set
30735 +# CONFIG_DEBUG_RT_MUTEXES is not set
30736 +# CONFIG_RT_MUTEX_TESTER is not set
30737 +# CONFIG_DEBUG_SPINLOCK is not set
30738 +# CONFIG_DEBUG_MUTEXES is not set
30739 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
30740 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
30741 +# CONFIG_DEBUG_KOBJECT is not set
30742 +# CONFIG_DEBUG_BUGVERBOSE is not set
30743 +CONFIG_DEBUG_INFO=y
30744 +# CONFIG_DEBUG_VM is not set
30745 +# CONFIG_DEBUG_LIST is not set
30746 +# CONFIG_DEBUG_SG is not set
30747 +CONFIG_FORCED_INLINING=y
30748 +# CONFIG_BOOT_PRINTK_DELAY is not set
30749 +# CONFIG_RCU_TORTURE_TEST is not set
30750 +# CONFIG_FAULT_INJECTION is not set
30751 +# CONFIG_SAMPLES is not set
30752 +# CONFIG_DEBUG_STACKOVERFLOW is not set
30753 +# CONFIG_DEBUG_STACK_USAGE is not set
30754 +# CONFIG_DEBUG_PAGEALLOC is not set
30755 +# CONFIG_DEBUGGER is not set
30756 +# CONFIG_BDI_SWITCH is not set
30757 +# CONFIG_BOOTX_TEXT is not set
30758 +# CONFIG_PPC_EARLY_DEBUG is not set
30759 +
30760 +#
30761 +# Security options
30762 +#
30763 +# CONFIG_KEYS is not set
30764 +# CONFIG_SECURITY is not set
30765 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
30766 +CONFIG_CRYPTO=y
30767 +CONFIG_CRYPTO_ALGAPI=y
30768 +CONFIG_CRYPTO_BLKCIPHER=y
30769 +CONFIG_CRYPTO_MANAGER=y
30770 +# CONFIG_CRYPTO_HMAC is not set
30771 +# CONFIG_CRYPTO_XCBC is not set
30772 +# CONFIG_CRYPTO_NULL is not set
30773 +# CONFIG_CRYPTO_MD4 is not set
30774 +CONFIG_CRYPTO_MD5=y
30775 +# CONFIG_CRYPTO_SHA1 is not set
30776 +# CONFIG_CRYPTO_SHA256 is not set
30777 +# CONFIG_CRYPTO_SHA512 is not set
30778 +# CONFIG_CRYPTO_WP512 is not set
30779 +# CONFIG_CRYPTO_TGR192 is not set
30780 +# CONFIG_CRYPTO_GF128MUL is not set
30781 +# CONFIG_CRYPTO_ECB is not set
30782 +CONFIG_CRYPTO_CBC=y
30783 +# CONFIG_CRYPTO_PCBC is not set
30784 +# CONFIG_CRYPTO_LRW is not set
30785 +# CONFIG_CRYPTO_XTS is not set
30786 +# CONFIG_CRYPTO_CRYPTD is not set
30787 +CONFIG_CRYPTO_DES=y
30788 +# CONFIG_CRYPTO_FCRYPT is not set
30789 +# CONFIG_CRYPTO_BLOWFISH is not set
30790 +# CONFIG_CRYPTO_TWOFISH is not set
30791 +# CONFIG_CRYPTO_SERPENT is not set
30792 +# CONFIG_CRYPTO_AES is not set
30793 +# CONFIG_CRYPTO_CAST5 is not set
30794 +# CONFIG_CRYPTO_CAST6 is not set
30795 +# CONFIG_CRYPTO_TEA is not set
30796 +# CONFIG_CRYPTO_ARC4 is not set
30797 +# CONFIG_CRYPTO_KHAZAD is not set
30798 +# CONFIG_CRYPTO_ANUBIS is not set
30799 +# CONFIG_CRYPTO_SEED is not set
30800 +# CONFIG_CRYPTO_DEFLATE is not set
30801 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
30802 +# CONFIG_CRYPTO_CRC32C is not set
30803 +# CONFIG_CRYPTO_CAMELLIA is not set
30804 +# CONFIG_CRYPTO_TEST is not set
30805 +# CONFIG_CRYPTO_AUTHENC is not set
30806 +CONFIG_CRYPTO_HW=y
30807 +CONFIG_PPC_CLOCK=y
30808 +CONFIG_PPC_LIB_RHEAP=y
30809 --- a/arch/powerpc/configs/mpc8313_rdb_defconfig
30810 +++ b/arch/powerpc/configs/mpc8313_rdb_defconfig
30811 @@ -1,7 +1,7 @@
30812  #
30813  # Automatically generated make config: don't edit
30814 -# Linux kernel version: 2.6.24-rc4
30815 -# Thu Dec  6 16:48:31 2007
30816 +# Linux kernel version: 2.6.24-rc6
30817 +# Thu Jan 17 16:35:55 2008
30818  #
30819  # CONFIG_PPC64 is not set
30820  
30821 @@ -144,6 +144,7 @@
30822  # CONFIG_MPC834x_MDS is not set
30823  # CONFIG_MPC834x_ITX is not set
30824  # CONFIG_MPC836x_MDS is not set
30825 +# CONFIG_MPC837x_MDS is not set
30826  CONFIG_PPC_MPC831x=y
30827  # CONFIG_MPIC is not set
30828  # CONFIG_MPIC_WEIRD is not set
30829 @@ -336,15 +337,16 @@
30830  CONFIG_MTD=y
30831  # CONFIG_MTD_DEBUG is not set
30832  # CONFIG_MTD_CONCAT is not set
30833 -# CONFIG_MTD_PARTITIONS is not set
30834 +CONFIG_MTD_PARTITIONS=y
30835 +# CONFIG_MTD_REDBOOT_PARTS is not set
30836 +# CONFIG_MTD_CMDLINE_PARTS is not set
30837  
30838  #
30839  # User Modules And Translation Layers
30840  #
30841  CONFIG_MTD_CHAR=y
30842 -# CONFIG_MTD_BLKDEVS is not set
30843 -# CONFIG_MTD_BLOCK is not set
30844 -# CONFIG_MTD_BLOCK_RO is not set
30845 +CONFIG_MTD_BLKDEVS=y
30846 +CONFIG_MTD_BLOCK=y
30847  # CONFIG_FTL is not set
30848  # CONFIG_NFTL is not set
30849  # CONFIG_INFTL is not set
30850 @@ -381,11 +383,8 @@
30851  # Mapping drivers for chip access
30852  #
30853  # CONFIG_MTD_COMPLEX_MAPPINGS is not set
30854 -CONFIG_MTD_PHYSMAP=y
30855 -CONFIG_MTD_PHYSMAP_START=0xfe000000
30856 -CONFIG_MTD_PHYSMAP_LEN=0x1000000
30857 -CONFIG_MTD_PHYSMAP_BANKWIDTH=2
30858 -# CONFIG_MTD_PHYSMAP_OF is not set
30859 +# CONFIG_MTD_PHYSMAP is not set
30860 +CONFIG_MTD_PHYSMAP_OF=y
30861  # CONFIG_MTD_INTEL_VR_NOR is not set
30862  # CONFIG_MTD_PLATRAM is not set
30863  
30864 @@ -406,7 +405,16 @@
30865  # CONFIG_MTD_DOC2000 is not set
30866  # CONFIG_MTD_DOC2001 is not set
30867  # CONFIG_MTD_DOC2001PLUS is not set
30868 -# CONFIG_MTD_NAND is not set
30869 +CONFIG_MTD_NAND=y
30870 +CONFIG_MTD_NAND_VERIFY_WRITE=y
30871 +# CONFIG_MTD_NAND_ECC_SMC is not set
30872 +# CONFIG_MTD_NAND_MUSEUM_IDS is not set
30873 +CONFIG_MTD_NAND_IDS=y
30874 +# CONFIG_MTD_NAND_DISKONCHIP is not set
30875 +# CONFIG_MTD_NAND_CAFE is not set
30876 +# CONFIG_MTD_NAND_NANDSIM is not set
30877 +# CONFIG_MTD_NAND_PLATFORM is not set
30878 +# CONFIG_MTD_ALAUDA is not set
30879  # CONFIG_MTD_ONENAND is not set
30880  
30881  #
30882 @@ -1178,7 +1186,17 @@
30883  # CONFIG_BEFS_FS is not set
30884  # CONFIG_BFS_FS is not set
30885  # CONFIG_EFS_FS is not set
30886 -# CONFIG_JFFS2_FS is not set
30887 +CONFIG_JFFS2_FS=y
30888 +CONFIG_JFFS2_FS_DEBUG=0
30889 +CONFIG_JFFS2_FS_WRITEBUFFER=y
30890 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
30891 +# CONFIG_JFFS2_SUMMARY is not set
30892 +# CONFIG_JFFS2_FS_XATTR is not set
30893 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
30894 +CONFIG_JFFS2_ZLIB=y
30895 +# CONFIG_JFFS2_LZO is not set
30896 +CONFIG_JFFS2_RTIME=y
30897 +# CONFIG_JFFS2_RUBIN is not set
30898  # CONFIG_CRAMFS is not set
30899  # CONFIG_VXFS_FS is not set
30900  # CONFIG_HPFS_FS is not set
30901 @@ -1242,6 +1260,8 @@
30902  CONFIG_CRC32=y
30903  # CONFIG_CRC7 is not set
30904  # CONFIG_LIBCRC32C is not set
30905 +CONFIG_ZLIB_INFLATE=y
30906 +CONFIG_ZLIB_DEFLATE=y
30907  CONFIG_PLIST=y
30908  CONFIG_HAS_IOMEM=y
30909  CONFIG_HAS_IOPORT=y
30910 --- a/arch/powerpc/configs/mpc834x_itx_defconfig
30911 +++ b/arch/powerpc/configs/mpc834x_itx_defconfig
30912 @@ -570,7 +570,8 @@
30913  # CONFIG_PATA_SIS is not set
30914  # CONFIG_PATA_VIA is not set
30915  # CONFIG_PATA_WINBOND is not set
30916 -# CONFIG_PATA_PLATFORM is not set
30917 +CONFIG_PATA_PLATFORM=y
30918 +CONFIG_PATA_OF_PLATFORM=y
30919  CONFIG_MD=y
30920  CONFIG_BLK_DEV_MD=y
30921  CONFIG_MD_LINEAR=y
30922 --- /dev/null
30923 +++ b/arch/powerpc/configs/mpc837x_mds_defconfig
30924 @@ -0,0 +1,878 @@
30925 +#
30926 +# Automatically generated make config: don't edit
30927 +# Linux kernel version: 2.6.23
30928 +# Wed Oct 10 16:31:39 2007
30929 +#
30930 +# CONFIG_PPC64 is not set
30931 +
30932 +#
30933 +# Processor support
30934 +#
30935 +CONFIG_6xx=y
30936 +# CONFIG_PPC_85xx is not set
30937 +# CONFIG_PPC_8xx is not set
30938 +# CONFIG_40x is not set
30939 +# CONFIG_44x is not set
30940 +# CONFIG_E200 is not set
30941 +CONFIG_83xx=y
30942 +CONFIG_PPC_FPU=y
30943 +CONFIG_PPC_STD_MMU=y
30944 +CONFIG_PPC_STD_MMU_32=y
30945 +# CONFIG_PPC_MM_SLICES is not set
30946 +# CONFIG_SMP is not set
30947 +CONFIG_PPC32=y
30948 +CONFIG_PPC_MERGE=y
30949 +CONFIG_MMU=y
30950 +CONFIG_GENERIC_HARDIRQS=y
30951 +CONFIG_IRQ_PER_CPU=y
30952 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
30953 +CONFIG_ARCH_HAS_ILOG2_U32=y
30954 +CONFIG_GENERIC_HWEIGHT=y
30955 +CONFIG_GENERIC_CALIBRATE_DELAY=y
30956 +CONFIG_GENERIC_FIND_NEXT_BIT=y
30957 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
30958 +CONFIG_PPC=y
30959 +CONFIG_EARLY_PRINTK=y
30960 +CONFIG_GENERIC_NVRAM=y
30961 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
30962 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
30963 +CONFIG_PPC_OF=y
30964 +CONFIG_OF=y
30965 +CONFIG_PPC_UDBG_16550=y
30966 +# CONFIG_GENERIC_TBSYNC is not set
30967 +CONFIG_AUDIT_ARCH=y
30968 +CONFIG_GENERIC_BUG=y
30969 +CONFIG_DEFAULT_UIMAGE=y
30970 +# CONFIG_PPC_DCR_NATIVE is not set
30971 +# CONFIG_PPC_DCR_MMIO is not set
30972 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
30973 +
30974 +#
30975 +# General setup
30976 +#
30977 +CONFIG_EXPERIMENTAL=y
30978 +CONFIG_BROKEN_ON_SMP=y
30979 +CONFIG_INIT_ENV_ARG_LIMIT=32
30980 +CONFIG_LOCALVERSION=""
30981 +CONFIG_LOCALVERSION_AUTO=y
30982 +CONFIG_SWAP=y
30983 +CONFIG_SYSVIPC=y
30984 +CONFIG_SYSVIPC_SYSCTL=y
30985 +# CONFIG_POSIX_MQUEUE is not set
30986 +# CONFIG_BSD_PROCESS_ACCT is not set
30987 +# CONFIG_TASKSTATS is not set
30988 +# CONFIG_USER_NS is not set
30989 +# CONFIG_AUDIT is not set
30990 +# CONFIG_IKCONFIG is not set
30991 +CONFIG_LOG_BUF_SHIFT=14
30992 +CONFIG_SYSFS_DEPRECATED=y
30993 +# CONFIG_RELAY is not set
30994 +CONFIG_BLK_DEV_INITRD=y
30995 +CONFIG_INITRAMFS_SOURCE=""
30996 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
30997 +CONFIG_SYSCTL=y
30998 +CONFIG_EMBEDDED=y
30999 +CONFIG_SYSCTL_SYSCALL=y
31000 +CONFIG_KALLSYMS=y
31001 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
31002 +CONFIG_HOTPLUG=y
31003 +CONFIG_PRINTK=y
31004 +CONFIG_BUG=y
31005 +CONFIG_ELF_CORE=y
31006 +CONFIG_BASE_FULL=y
31007 +CONFIG_FUTEX=y
31008 +CONFIG_ANON_INODES=y
31009 +# CONFIG_EPOLL is not set
31010 +CONFIG_SIGNALFD=y
31011 +CONFIG_EVENTFD=y
31012 +CONFIG_SHMEM=y
31013 +CONFIG_VM_EVENT_COUNTERS=y
31014 +CONFIG_SLAB=y
31015 +# CONFIG_SLUB is not set
31016 +# CONFIG_SLOB is not set
31017 +CONFIG_RT_MUTEXES=y
31018 +# CONFIG_TINY_SHMEM is not set
31019 +CONFIG_BASE_SMALL=0
31020 +CONFIG_MODULES=y
31021 +CONFIG_MODULE_UNLOAD=y
31022 +# CONFIG_MODULE_FORCE_UNLOAD is not set
31023 +# CONFIG_MODVERSIONS is not set
31024 +# CONFIG_MODULE_SRCVERSION_ALL is not set
31025 +# CONFIG_KMOD is not set
31026 +CONFIG_BLOCK=y
31027 +# CONFIG_LBD is not set
31028 +# CONFIG_BLK_DEV_IO_TRACE is not set
31029 +# CONFIG_LSF is not set
31030 +# CONFIG_BLK_DEV_BSG is not set
31031 +
31032 +#
31033 +# IO Schedulers
31034 +#
31035 +CONFIG_IOSCHED_NOOP=y
31036 +CONFIG_IOSCHED_AS=y
31037 +CONFIG_IOSCHED_DEADLINE=y
31038 +CONFIG_IOSCHED_CFQ=y
31039 +CONFIG_DEFAULT_AS=y
31040 +# CONFIG_DEFAULT_DEADLINE is not set
31041 +# CONFIG_DEFAULT_CFQ is not set
31042 +# CONFIG_DEFAULT_NOOP is not set
31043 +CONFIG_DEFAULT_IOSCHED="anticipatory"
31044 +
31045 +#
31046 +# Platform support
31047 +#
31048 +# CONFIG_PPC_MULTIPLATFORM is not set
31049 +# CONFIG_EMBEDDED6xx is not set
31050 +# CONFIG_PPC_82xx is not set
31051 +CONFIG_PPC_83xx=y
31052 +# CONFIG_PPC_86xx is not set
31053 +# CONFIG_PPC_MPC52xx is not set
31054 +# CONFIG_PPC_MPC5200 is not set
31055 +# CONFIG_PPC_CELL is not set
31056 +# CONFIG_PPC_CELL_NATIVE is not set
31057 +# CONFIG_PQ2ADS is not set
31058 +# CONFIG_MPC8313_RDB is not set
31059 +# CONFIG_MPC832x_MDS is not set
31060 +# CONFIG_MPC832x_RDB is not set
31061 +# CONFIG_MPC834x_MDS is not set
31062 +# CONFIG_MPC834x_ITX is not set
31063 +# CONFIG_MPC836x_MDS is not set
31064 +CONFIG_MPC837x_MDS=y
31065 +CONFIG_PPC_MPC837x=y
31066 +# CONFIG_MPIC is not set
31067 +# CONFIG_MPIC_WEIRD is not set
31068 +# CONFIG_PPC_I8259 is not set
31069 +# CONFIG_PPC_RTAS is not set
31070 +# CONFIG_MMIO_NVRAM is not set
31071 +# CONFIG_PPC_MPC106 is not set
31072 +# CONFIG_PPC_970_NAP is not set
31073 +# CONFIG_PPC_INDIRECT_IO is not set
31074 +# CONFIG_GENERIC_IOMAP is not set
31075 +# CONFIG_CPU_FREQ is not set
31076 +# CONFIG_CPM2 is not set
31077 +# CONFIG_FSL_ULI1575 is not set
31078 +CONFIG_FSL_SERDES=y
31079 +
31080 +#
31081 +# Kernel options
31082 +#
31083 +# CONFIG_HIGHMEM is not set
31084 +# CONFIG_HZ_100 is not set
31085 +CONFIG_HZ_250=y
31086 +# CONFIG_HZ_300 is not set
31087 +# CONFIG_HZ_1000 is not set
31088 +CONFIG_HZ=250
31089 +CONFIG_PREEMPT_NONE=y
31090 +# CONFIG_PREEMPT_VOLUNTARY is not set
31091 +# CONFIG_PREEMPT is not set
31092 +CONFIG_BINFMT_ELF=y
31093 +# CONFIG_BINFMT_MISC is not set
31094 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
31095 +CONFIG_ARCH_FLATMEM_ENABLE=y
31096 +CONFIG_ARCH_POPULATES_NODE_MAP=y
31097 +CONFIG_SELECT_MEMORY_MODEL=y
31098 +CONFIG_FLATMEM_MANUAL=y
31099 +# CONFIG_DISCONTIGMEM_MANUAL is not set
31100 +# CONFIG_SPARSEMEM_MANUAL is not set
31101 +CONFIG_FLATMEM=y
31102 +CONFIG_FLAT_NODE_MEM_MAP=y
31103 +# CONFIG_SPARSEMEM_STATIC is not set
31104 +CONFIG_SPLIT_PTLOCK_CPUS=4
31105 +# CONFIG_RESOURCES_64BIT is not set
31106 +CONFIG_ZONE_DMA_FLAG=1
31107 +CONFIG_BOUNCE=y
31108 +CONFIG_VIRT_TO_BUS=y
31109 +CONFIG_PROC_DEVICETREE=y
31110 +# CONFIG_CMDLINE_BOOL is not set
31111 +# CONFIG_PM is not set
31112 +CONFIG_SUSPEND_UP_POSSIBLE=y
31113 +CONFIG_HIBERNATION_UP_POSSIBLE=y
31114 +CONFIG_SECCOMP=y
31115 +CONFIG_WANT_DEVICE_TREE=y
31116 +CONFIG_DEVICE_TREE=""
31117 +CONFIG_ISA_DMA_API=y
31118 +
31119 +#
31120 +# Bus options
31121 +#
31122 +CONFIG_ZONE_DMA=y
31123 +CONFIG_GENERIC_ISA_DMA=y
31124 +CONFIG_PPC_INDIRECT_PCI=y
31125 +CONFIG_FSL_SOC=y
31126 +# CONFIG_PCI is not set
31127 +# CONFIG_PCI_DOMAINS is not set
31128 +# CONFIG_PCI_SYSCALL is not set
31129 +# CONFIG_ARCH_SUPPORTS_MSI is not set
31130 +
31131 +#
31132 +# PCCARD (PCMCIA/CardBus) support
31133 +#
31134 +# CONFIG_PCCARD is not set
31135 +
31136 +#
31137 +# Advanced setup
31138 +#
31139 +# CONFIG_ADVANCED_OPTIONS is not set
31140 +
31141 +#
31142 +# Default settings for advanced configuration options are used
31143 +#
31144 +CONFIG_HIGHMEM_START=0xfe000000
31145 +CONFIG_LOWMEM_SIZE=0x30000000
31146 +CONFIG_KERNEL_START=0xc0000000
31147 +CONFIG_TASK_SIZE=0x80000000
31148 +CONFIG_BOOT_LOAD=0x00800000
31149 +
31150 +#
31151 +# Networking
31152 +#
31153 +CONFIG_NET=y
31154 +
31155 +#
31156 +# Networking options
31157 +#
31158 +CONFIG_PACKET=y
31159 +# CONFIG_PACKET_MMAP is not set
31160 +CONFIG_UNIX=y
31161 +CONFIG_XFRM=y
31162 +CONFIG_XFRM_USER=m
31163 +# CONFIG_XFRM_SUB_POLICY is not set
31164 +# CONFIG_XFRM_MIGRATE is not set
31165 +# CONFIG_NET_KEY is not set
31166 +CONFIG_INET=y
31167 +CONFIG_IP_MULTICAST=y
31168 +# CONFIG_IP_ADVANCED_ROUTER is not set
31169 +CONFIG_IP_FIB_HASH=y
31170 +CONFIG_IP_PNP=y
31171 +CONFIG_IP_PNP_DHCP=y
31172 +CONFIG_IP_PNP_BOOTP=y
31173 +# CONFIG_IP_PNP_RARP is not set
31174 +# CONFIG_NET_IPIP is not set
31175 +# CONFIG_NET_IPGRE is not set
31176 +# CONFIG_IP_MROUTE is not set
31177 +# CONFIG_ARPD is not set
31178 +CONFIG_SYN_COOKIES=y
31179 +# CONFIG_INET_AH is not set
31180 +# CONFIG_INET_ESP is not set
31181 +# CONFIG_INET_IPCOMP is not set
31182 +# CONFIG_INET_XFRM_TUNNEL is not set
31183 +# CONFIG_INET_TUNNEL is not set
31184 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
31185 +CONFIG_INET_XFRM_MODE_TUNNEL=y
31186 +CONFIG_INET_XFRM_MODE_BEET=y
31187 +CONFIG_INET_DIAG=y
31188 +CONFIG_INET_TCP_DIAG=y
31189 +# CONFIG_TCP_CONG_ADVANCED is not set
31190 +CONFIG_TCP_CONG_CUBIC=y
31191 +CONFIG_DEFAULT_TCP_CONG="cubic"
31192 +# CONFIG_TCP_MD5SIG is not set
31193 +# CONFIG_IPV6 is not set
31194 +# CONFIG_INET6_XFRM_TUNNEL is not set
31195 +# CONFIG_INET6_TUNNEL is not set
31196 +# CONFIG_NETWORK_SECMARK is not set
31197 +# CONFIG_NETFILTER is not set
31198 +# CONFIG_IP_DCCP is not set
31199 +# CONFIG_IP_SCTP is not set
31200 +# CONFIG_TIPC is not set
31201 +# CONFIG_ATM is not set
31202 +# CONFIG_BRIDGE is not set
31203 +# CONFIG_VLAN_8021Q is not set
31204 +# CONFIG_DECNET is not set
31205 +# CONFIG_LLC2 is not set
31206 +# CONFIG_IPX is not set
31207 +# CONFIG_ATALK is not set
31208 +# CONFIG_X25 is not set
31209 +# CONFIG_LAPB is not set
31210 +# CONFIG_ECONET is not set
31211 +# CONFIG_WAN_ROUTER is not set
31212 +
31213 +#
31214 +# QoS and/or fair queueing
31215 +#
31216 +# CONFIG_NET_SCHED is not set
31217 +
31218 +#
31219 +# Network testing
31220 +#
31221 +# CONFIG_NET_PKTGEN is not set
31222 +# CONFIG_HAMRADIO is not set
31223 +# CONFIG_IRDA is not set
31224 +# CONFIG_BT is not set
31225 +# CONFIG_AF_RXRPC is not set
31226 +
31227 +#
31228 +# Wireless
31229 +#
31230 +# CONFIG_CFG80211 is not set
31231 +# CONFIG_WIRELESS_EXT is not set
31232 +# CONFIG_MAC80211 is not set
31233 +# CONFIG_IEEE80211 is not set
31234 +# CONFIG_RFKILL is not set
31235 +# CONFIG_NET_9P is not set
31236 +
31237 +#
31238 +# Device Drivers
31239 +#
31240 +
31241 +#
31242 +# Generic Driver Options
31243 +#
31244 +CONFIG_STANDALONE=y
31245 +CONFIG_PREVENT_FIRMWARE_BUILD=y
31246 +# CONFIG_FW_LOADER is not set
31247 +# CONFIG_SYS_HYPERVISOR is not set
31248 +# CONFIG_CONNECTOR is not set
31249 +# CONFIG_MTD is not set
31250 +CONFIG_OF_DEVICE=y
31251 +# CONFIG_PARPORT is not set
31252 +CONFIG_BLK_DEV=y
31253 +# CONFIG_BLK_DEV_FD is not set
31254 +# CONFIG_BLK_DEV_COW_COMMON is not set
31255 +CONFIG_BLK_DEV_LOOP=y
31256 +# CONFIG_BLK_DEV_CRYPTOLOOP is not set
31257 +# CONFIG_BLK_DEV_NBD is not set
31258 +CONFIG_BLK_DEV_RAM=y
31259 +CONFIG_BLK_DEV_RAM_COUNT=16
31260 +CONFIG_BLK_DEV_RAM_SIZE=32768
31261 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
31262 +# CONFIG_CDROM_PKTCDVD is not set
31263 +# CONFIG_ATA_OVER_ETH is not set
31264 +CONFIG_MISC_DEVICES=y
31265 +# CONFIG_EEPROM_93CX6 is not set
31266 +# CONFIG_IDE is not set
31267 +
31268 +#
31269 +# SCSI device support
31270 +#
31271 +# CONFIG_RAID_ATTRS is not set
31272 +CONFIG_SCSI=y
31273 +CONFIG_SCSI_DMA=y
31274 +# CONFIG_SCSI_TGT is not set
31275 +# CONFIG_SCSI_NETLINK is not set
31276 +CONFIG_SCSI_PROC_FS=y
31277 +
31278 +#
31279 +# SCSI support type (disk, tape, CD-ROM)
31280 +#
31281 +CONFIG_BLK_DEV_SD=y
31282 +# CONFIG_CHR_DEV_ST is not set
31283 +# CONFIG_CHR_DEV_OSST is not set
31284 +# CONFIG_BLK_DEV_SR is not set
31285 +CONFIG_CHR_DEV_SG=y
31286 +# CONFIG_CHR_DEV_SCH is not set
31287 +
31288 +#
31289 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
31290 +#
31291 +# CONFIG_SCSI_MULTI_LUN is not set
31292 +# CONFIG_SCSI_CONSTANTS is not set
31293 +# CONFIG_SCSI_LOGGING is not set
31294 +# CONFIG_SCSI_SCAN_ASYNC is not set
31295 +CONFIG_SCSI_WAIT_SCAN=m
31296 +
31297 +#
31298 +# SCSI Transports
31299 +#
31300 +# CONFIG_SCSI_SPI_ATTRS is not set
31301 +# CONFIG_SCSI_FC_ATTRS is not set
31302 +# CONFIG_SCSI_ISCSI_ATTRS is not set
31303 +# CONFIG_SCSI_SAS_LIBSAS is not set
31304 +CONFIG_SCSI_LOWLEVEL=y
31305 +# CONFIG_ISCSI_TCP is not set
31306 +# CONFIG_SCSI_DEBUG is not set
31307 +CONFIG_ATA=y
31308 +# CONFIG_ATA_NONSTANDARD is not set
31309 +CONFIG_SATA_FSL=y
31310 +# CONFIG_PATA_PLATFORM is not set
31311 +# CONFIG_MD is not set
31312 +# CONFIG_MACINTOSH_DRIVERS is not set
31313 +CONFIG_NETDEVICES=y
31314 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
31315 +# CONFIG_DUMMY is not set
31316 +# CONFIG_BONDING is not set
31317 +# CONFIG_MACVLAN is not set
31318 +# CONFIG_EQUALIZER is not set
31319 +# CONFIG_TUN is not set
31320 +CONFIG_PHYLIB=y
31321 +
31322 +#
31323 +# MII PHY device drivers
31324 +#
31325 +CONFIG_MARVELL_PHY=y
31326 +# CONFIG_DAVICOM_PHY is not set
31327 +# CONFIG_QSEMI_PHY is not set
31328 +# CONFIG_LXT_PHY is not set
31329 +# CONFIG_CICADA_PHY is not set
31330 +# CONFIG_VITESSE_PHY is not set
31331 +# CONFIG_SMSC_PHY is not set
31332 +# CONFIG_BROADCOM_PHY is not set
31333 +# CONFIG_ICPLUS_PHY is not set
31334 +# CONFIG_FIXED_PHY is not set
31335 +CONFIG_NET_ETHERNET=y
31336 +CONFIG_MII=y
31337 +CONFIG_NETDEV_1000=y
31338 +CONFIG_GIANFAR=y
31339 +# CONFIG_GFAR_NAPI is not set
31340 +CONFIG_NETDEV_10000=y
31341 +
31342 +#
31343 +# Wireless LAN
31344 +#
31345 +# CONFIG_WLAN_PRE80211 is not set
31346 +# CONFIG_WLAN_80211 is not set
31347 +# CONFIG_WAN is not set
31348 +# CONFIG_PPP is not set
31349 +# CONFIG_SLIP is not set
31350 +# CONFIG_SHAPER is not set
31351 +# CONFIG_NETCONSOLE is not set
31352 +# CONFIG_NETPOLL is not set
31353 +# CONFIG_NET_POLL_CONTROLLER is not set
31354 +# CONFIG_ISDN is not set
31355 +# CONFIG_PHONE is not set
31356 +
31357 +#
31358 +# Input device support
31359 +#
31360 +CONFIG_INPUT=y
31361 +# CONFIG_INPUT_FF_MEMLESS is not set
31362 +# CONFIG_INPUT_POLLDEV is not set
31363 +
31364 +#
31365 +# Userland interfaces
31366 +#
31367 +# CONFIG_INPUT_MOUSEDEV is not set
31368 +# CONFIG_INPUT_JOYDEV is not set
31369 +# CONFIG_INPUT_TSDEV is not set
31370 +# CONFIG_INPUT_EVDEV is not set
31371 +# CONFIG_INPUT_EVBUG is not set
31372 +
31373 +#
31374 +# Input Device Drivers
31375 +#
31376 +# CONFIG_INPUT_KEYBOARD is not set
31377 +# CONFIG_INPUT_MOUSE is not set
31378 +# CONFIG_INPUT_JOYSTICK is not set
31379 +# CONFIG_INPUT_TABLET is not set
31380 +# CONFIG_INPUT_TOUCHSCREEN is not set
31381 +# CONFIG_INPUT_MISC is not set
31382 +
31383 +#
31384 +# Hardware I/O ports
31385 +#
31386 +# CONFIG_SERIO is not set
31387 +# CONFIG_GAMEPORT is not set
31388 +
31389 +#
31390 +# Character devices
31391 +#
31392 +# CONFIG_VT is not set
31393 +# CONFIG_SERIAL_NONSTANDARD is not set
31394 +
31395 +#
31396 +# Serial drivers
31397 +#
31398 +CONFIG_SERIAL_8250=y
31399 +CONFIG_SERIAL_8250_CONSOLE=y
31400 +CONFIG_SERIAL_8250_NR_UARTS=4
31401 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
31402 +# CONFIG_SERIAL_8250_EXTENDED is not set
31403 +
31404 +#
31405 +# Non-8250 serial port support
31406 +#
31407 +# CONFIG_SERIAL_UARTLITE is not set
31408 +CONFIG_SERIAL_CORE=y
31409 +CONFIG_SERIAL_CORE_CONSOLE=y
31410 +# CONFIG_SERIAL_OF_PLATFORM is not set
31411 +CONFIG_UNIX98_PTYS=y
31412 +CONFIG_LEGACY_PTYS=y
31413 +CONFIG_LEGACY_PTY_COUNT=256
31414 +# CONFIG_IPMI_HANDLER is not set
31415 +CONFIG_WATCHDOG=y
31416 +# CONFIG_WATCHDOG_NOWAYOUT is not set
31417 +
31418 +#
31419 +# Watchdog Device Drivers
31420 +#
31421 +# CONFIG_SOFT_WATCHDOG is not set
31422 +CONFIG_83xx_WDT=y
31423 +# CONFIG_HW_RANDOM is not set
31424 +# CONFIG_NVRAM is not set
31425 +CONFIG_GEN_RTC=y
31426 +# CONFIG_GEN_RTC_X is not set
31427 +# CONFIG_R3964 is not set
31428 +# CONFIG_RAW_DRIVER is not set
31429 +# CONFIG_TCG_TPM is not set
31430 +CONFIG_I2C=y
31431 +CONFIG_I2C_BOARDINFO=y
31432 +CONFIG_I2C_CHARDEV=y
31433 +
31434 +#
31435 +# I2C Algorithms
31436 +#
31437 +# CONFIG_I2C_ALGOBIT is not set
31438 +# CONFIG_I2C_ALGOPCF is not set
31439 +# CONFIG_I2C_ALGOPCA is not set
31440 +
31441 +#
31442 +# I2C Hardware Bus support
31443 +#
31444 +CONFIG_I2C_MPC=y
31445 +# CONFIG_I2C_OCORES is not set
31446 +# CONFIG_I2C_PARPORT_LIGHT is not set
31447 +# CONFIG_I2C_SIMTEC is not set
31448 +# CONFIG_I2C_TAOS_EVM is not set
31449 +# CONFIG_I2C_STUB is not set
31450 +
31451 +#
31452 +# Miscellaneous I2C Chip support
31453 +#
31454 +# CONFIG_SENSORS_DS1337 is not set
31455 +# CONFIG_SENSORS_DS1374 is not set
31456 +# CONFIG_DS1682 is not set
31457 +# CONFIG_SENSORS_EEPROM is not set
31458 +# CONFIG_SENSORS_PCF8574 is not set
31459 +# CONFIG_SENSORS_PCA9539 is not set
31460 +# CONFIG_SENSORS_PCF8591 is not set
31461 +# CONFIG_SENSORS_M41T00 is not set
31462 +# CONFIG_SENSORS_MAX6875 is not set
31463 +# CONFIG_SENSORS_TSL2550 is not set
31464 +# CONFIG_I2C_DEBUG_CORE is not set
31465 +# CONFIG_I2C_DEBUG_ALGO is not set
31466 +# CONFIG_I2C_DEBUG_BUS is not set
31467 +# CONFIG_I2C_DEBUG_CHIP is not set
31468 +
31469 +#
31470 +# SPI support
31471 +#
31472 +# CONFIG_SPI is not set
31473 +# CONFIG_SPI_MASTER is not set
31474 +# CONFIG_W1 is not set
31475 +# CONFIG_POWER_SUPPLY is not set
31476 +CONFIG_HWMON=y
31477 +# CONFIG_HWMON_VID is not set
31478 +# CONFIG_SENSORS_ABITUGURU is not set
31479 +# CONFIG_SENSORS_ABITUGURU3 is not set
31480 +# CONFIG_SENSORS_AD7418 is not set
31481 +# CONFIG_SENSORS_ADM1021 is not set
31482 +# CONFIG_SENSORS_ADM1025 is not set
31483 +# CONFIG_SENSORS_ADM1026 is not set
31484 +# CONFIG_SENSORS_ADM1029 is not set
31485 +# CONFIG_SENSORS_ADM1031 is not set
31486 +# CONFIG_SENSORS_ADM9240 is not set
31487 +# CONFIG_SENSORS_ASB100 is not set
31488 +# CONFIG_SENSORS_ATXP1 is not set
31489 +# CONFIG_SENSORS_DS1621 is not set
31490 +# CONFIG_SENSORS_F71805F is not set
31491 +# CONFIG_SENSORS_FSCHER is not set
31492 +# CONFIG_SENSORS_FSCPOS is not set
31493 +# CONFIG_SENSORS_GL518SM is not set
31494 +# CONFIG_SENSORS_GL520SM is not set
31495 +# CONFIG_SENSORS_IT87 is not set
31496 +# CONFIG_SENSORS_LM63 is not set
31497 +# CONFIG_SENSORS_LM75 is not set
31498 +# CONFIG_SENSORS_LM77 is not set
31499 +# CONFIG_SENSORS_LM78 is not set
31500 +# CONFIG_SENSORS_LM80 is not set
31501 +# CONFIG_SENSORS_LM83 is not set
31502 +# CONFIG_SENSORS_LM85 is not set
31503 +# CONFIG_SENSORS_LM87 is not set
31504 +# CONFIG_SENSORS_LM90 is not set
31505 +# CONFIG_SENSORS_LM92 is not set
31506 +# CONFIG_SENSORS_LM93 is not set
31507 +# CONFIG_SENSORS_MAX1619 is not set
31508 +# CONFIG_SENSORS_MAX6650 is not set
31509 +# CONFIG_SENSORS_PC87360 is not set
31510 +# CONFIG_SENSORS_PC87427 is not set
31511 +# CONFIG_SENSORS_DME1737 is not set
31512 +# CONFIG_SENSORS_SMSC47M1 is not set
31513 +# CONFIG_SENSORS_SMSC47M192 is not set
31514 +# CONFIG_SENSORS_SMSC47B397 is not set
31515 +# CONFIG_SENSORS_THMC50 is not set
31516 +# CONFIG_SENSORS_VT1211 is not set
31517 +# CONFIG_SENSORS_W83781D is not set
31518 +# CONFIG_SENSORS_W83791D is not set
31519 +# CONFIG_SENSORS_W83792D is not set
31520 +# CONFIG_SENSORS_W83793 is not set
31521 +# CONFIG_SENSORS_W83L785TS is not set
31522 +# CONFIG_SENSORS_W83627HF is not set
31523 +# CONFIG_SENSORS_W83627EHF is not set
31524 +# CONFIG_HWMON_DEBUG_CHIP is not set
31525 +
31526 +#
31527 +# Multifunction device drivers
31528 +#
31529 +# CONFIG_MFD_SM501 is not set
31530 +
31531 +#
31532 +# Multimedia devices
31533 +#
31534 +# CONFIG_VIDEO_DEV is not set
31535 +# CONFIG_DVB_CORE is not set
31536 +CONFIG_DAB=y
31537 +
31538 +#
31539 +# Graphics support
31540 +#
31541 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
31542 +
31543 +#
31544 +# Display device support
31545 +#
31546 +# CONFIG_DISPLAY_SUPPORT is not set
31547 +# CONFIG_VGASTATE is not set
31548 +CONFIG_VIDEO_OUTPUT_CONTROL=m
31549 +# CONFIG_FB is not set
31550 +# CONFIG_FB_IBM_GXT4500 is not set
31551 +
31552 +#
31553 +# Sound
31554 +#
31555 +# CONFIG_SOUND is not set
31556 +CONFIG_HID_SUPPORT=y
31557 +CONFIG_HID=y
31558 +# CONFIG_HID_DEBUG is not set
31559 +CONFIG_USB_SUPPORT=y
31560 +CONFIG_USB_ARCH_HAS_HCD=y
31561 +# CONFIG_USB_ARCH_HAS_OHCI is not set
31562 +CONFIG_USB_ARCH_HAS_EHCI=y
31563 +# CONFIG_USB is not set
31564 +
31565 +#
31566 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
31567 +#
31568 +
31569 +#
31570 +# USB Gadget Support
31571 +#
31572 +# CONFIG_USB_GADGET is not set
31573 +# CONFIG_MMC is not set
31574 +# CONFIG_NEW_LEDS is not set
31575 +# CONFIG_EDAC is not set
31576 +# CONFIG_RTC_CLASS is not set
31577 +
31578 +#
31579 +# DMA Engine support
31580 +#
31581 +# CONFIG_DMA_ENGINE is not set
31582 +
31583 +#
31584 +# DMA Clients
31585 +#
31586 +
31587 +#
31588 +# DMA Devices
31589 +#
31590 +
31591 +#
31592 +# Userspace I/O
31593 +#
31594 +# CONFIG_UIO is not set
31595 +
31596 +#
31597 +# File systems
31598 +#
31599 +CONFIG_EXT2_FS=y
31600 +# CONFIG_EXT2_FS_XATTR is not set
31601 +# CONFIG_EXT2_FS_XIP is not set
31602 +CONFIG_EXT3_FS=y
31603 +CONFIG_EXT3_FS_XATTR=y
31604 +# CONFIG_EXT3_FS_POSIX_ACL is not set
31605 +# CONFIG_EXT3_FS_SECURITY is not set
31606 +# CONFIG_EXT4DEV_FS is not set
31607 +CONFIG_JBD=y
31608 +# CONFIG_JBD_DEBUG is not set
31609 +CONFIG_FS_MBCACHE=y
31610 +# CONFIG_REISERFS_FS is not set
31611 +# CONFIG_JFS_FS is not set
31612 +# CONFIG_FS_POSIX_ACL is not set
31613 +# CONFIG_XFS_FS is not set
31614 +# CONFIG_GFS2_FS is not set
31615 +# CONFIG_OCFS2_FS is not set
31616 +# CONFIG_MINIX_FS is not set
31617 +# CONFIG_ROMFS_FS is not set
31618 +CONFIG_INOTIFY=y
31619 +CONFIG_INOTIFY_USER=y
31620 +# CONFIG_QUOTA is not set
31621 +CONFIG_DNOTIFY=y
31622 +# CONFIG_AUTOFS_FS is not set
31623 +# CONFIG_AUTOFS4_FS is not set
31624 +# CONFIG_FUSE_FS is not set
31625 +
31626 +#
31627 +# CD-ROM/DVD Filesystems
31628 +#
31629 +# CONFIG_ISO9660_FS is not set
31630 +# CONFIG_UDF_FS is not set
31631 +
31632 +#
31633 +# DOS/FAT/NT Filesystems
31634 +#
31635 +# CONFIG_MSDOS_FS is not set
31636 +# CONFIG_VFAT_FS is not set
31637 +# CONFIG_NTFS_FS is not set
31638 +
31639 +#
31640 +# Pseudo filesystems
31641 +#
31642 +CONFIG_PROC_FS=y
31643 +CONFIG_PROC_KCORE=y
31644 +CONFIG_PROC_SYSCTL=y
31645 +CONFIG_SYSFS=y
31646 +CONFIG_TMPFS=y
31647 +# CONFIG_TMPFS_POSIX_ACL is not set
31648 +# CONFIG_HUGETLB_PAGE is not set
31649 +CONFIG_RAMFS=y
31650 +# CONFIG_CONFIGFS_FS is not set
31651 +
31652 +#
31653 +# Miscellaneous filesystems
31654 +#
31655 +# CONFIG_ADFS_FS is not set
31656 +# CONFIG_AFFS_FS is not set
31657 +# CONFIG_HFS_FS is not set
31658 +# CONFIG_HFSPLUS_FS is not set
31659 +# CONFIG_BEFS_FS is not set
31660 +# CONFIG_BFS_FS is not set
31661 +# CONFIG_EFS_FS is not set
31662 +# CONFIG_CRAMFS is not set
31663 +# CONFIG_VXFS_FS is not set
31664 +# CONFIG_HPFS_FS is not set
31665 +# CONFIG_QNX4FS_FS is not set
31666 +# CONFIG_SYSV_FS is not set
31667 +# CONFIG_UFS_FS is not set
31668 +
31669 +#
31670 +# Network File Systems
31671 +#
31672 +CONFIG_NFS_FS=y
31673 +CONFIG_NFS_V3=y
31674 +# CONFIG_NFS_V3_ACL is not set
31675 +CONFIG_NFS_V4=y
31676 +# CONFIG_NFS_DIRECTIO is not set
31677 +# CONFIG_NFSD is not set
31678 +CONFIG_ROOT_NFS=y
31679 +CONFIG_LOCKD=y
31680 +CONFIG_LOCKD_V4=y
31681 +CONFIG_NFS_COMMON=y
31682 +CONFIG_SUNRPC=y
31683 +CONFIG_SUNRPC_GSS=y
31684 +# CONFIG_SUNRPC_BIND34 is not set
31685 +CONFIG_RPCSEC_GSS_KRB5=y
31686 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
31687 +# CONFIG_SMB_FS is not set
31688 +# CONFIG_CIFS is not set
31689 +# CONFIG_NCP_FS is not set
31690 +# CONFIG_CODA_FS is not set
31691 +# CONFIG_AFS_FS is not set
31692 +
31693 +#
31694 +# Partition Types
31695 +#
31696 +CONFIG_PARTITION_ADVANCED=y
31697 +# CONFIG_ACORN_PARTITION is not set
31698 +# CONFIG_OSF_PARTITION is not set
31699 +# CONFIG_AMIGA_PARTITION is not set
31700 +# CONFIG_ATARI_PARTITION is not set
31701 +# CONFIG_MAC_PARTITION is not set
31702 +CONFIG_MSDOS_PARTITION=y
31703 +# CONFIG_BSD_DISKLABEL is not set
31704 +# CONFIG_MINIX_SUBPARTITION is not set
31705 +# CONFIG_SOLARIS_X86_PARTITION is not set
31706 +# CONFIG_UNIXWARE_DISKLABEL is not set
31707 +# CONFIG_LDM_PARTITION is not set
31708 +# CONFIG_SGI_PARTITION is not set
31709 +# CONFIG_ULTRIX_PARTITION is not set
31710 +# CONFIG_SUN_PARTITION is not set
31711 +# CONFIG_KARMA_PARTITION is not set
31712 +# CONFIG_EFI_PARTITION is not set
31713 +# CONFIG_SYSV68_PARTITION is not set
31714 +
31715 +#
31716 +# Native Language Support
31717 +#
31718 +# CONFIG_NLS is not set
31719 +
31720 +#
31721 +# Distributed Lock Manager
31722 +#
31723 +# CONFIG_DLM is not set
31724 +# CONFIG_UCC_SLOW is not set
31725 +
31726 +#
31727 +# Library routines
31728 +#
31729 +CONFIG_BITREVERSE=y
31730 +# CONFIG_CRC_CCITT is not set
31731 +# CONFIG_CRC16 is not set
31732 +# CONFIG_CRC_ITU_T is not set
31733 +CONFIG_CRC32=y
31734 +# CONFIG_CRC7 is not set
31735 +# CONFIG_LIBCRC32C is not set
31736 +CONFIG_PLIST=y
31737 +CONFIG_HAS_IOMEM=y
31738 +CONFIG_HAS_IOPORT=y
31739 +CONFIG_HAS_DMA=y
31740 +
31741 +#
31742 +# Instrumentation Support
31743 +#
31744 +# CONFIG_PROFILING is not set
31745 +# CONFIG_KPROBES is not set
31746 +
31747 +#
31748 +# Kernel hacking
31749 +#
31750 +# CONFIG_PRINTK_TIME is not set
31751 +CONFIG_ENABLE_MUST_CHECK=y
31752 +# CONFIG_MAGIC_SYSRQ is not set
31753 +# CONFIG_UNUSED_SYMBOLS is not set
31754 +# CONFIG_DEBUG_FS is not set
31755 +# CONFIG_HEADERS_CHECK is not set
31756 +# CONFIG_DEBUG_KERNEL is not set
31757 +# CONFIG_DEBUG_BUGVERBOSE is not set
31758 +# CONFIG_PPC_EARLY_DEBUG is not set
31759 +
31760 +#
31761 +# Security options
31762 +#
31763 +# CONFIG_KEYS is not set
31764 +# CONFIG_SECURITY is not set
31765 +CONFIG_CRYPTO=y
31766 +CONFIG_CRYPTO_ALGAPI=y
31767 +CONFIG_CRYPTO_BLKCIPHER=y
31768 +CONFIG_CRYPTO_MANAGER=y
31769 +# CONFIG_CRYPTO_HMAC is not set
31770 +# CONFIG_CRYPTO_XCBC is not set
31771 +# CONFIG_CRYPTO_NULL is not set
31772 +# CONFIG_CRYPTO_MD4 is not set
31773 +CONFIG_CRYPTO_MD5=y
31774 +# CONFIG_CRYPTO_SHA1 is not set
31775 +# CONFIG_CRYPTO_SHA256 is not set
31776 +# CONFIG_CRYPTO_SHA512 is not set
31777 +# CONFIG_CRYPTO_WP512 is not set
31778 +# CONFIG_CRYPTO_TGR192 is not set
31779 +# CONFIG_CRYPTO_GF128MUL is not set
31780 +CONFIG_CRYPTO_ECB=m
31781 +CONFIG_CRYPTO_CBC=y
31782 +CONFIG_CRYPTO_PCBC=m
31783 +# CONFIG_CRYPTO_LRW is not set
31784 +# CONFIG_CRYPTO_CRYPTD is not set
31785 +CONFIG_CRYPTO_DES=y
31786 +# CONFIG_CRYPTO_FCRYPT is not set
31787 +# CONFIG_CRYPTO_BLOWFISH is not set
31788 +# CONFIG_CRYPTO_TWOFISH is not set
31789 +# CONFIG_CRYPTO_SERPENT is not set
31790 +# CONFIG_CRYPTO_AES is not set
31791 +# CONFIG_CRYPTO_CAST5 is not set
31792 +# CONFIG_CRYPTO_CAST6 is not set
31793 +# CONFIG_CRYPTO_TEA is not set
31794 +# CONFIG_CRYPTO_ARC4 is not set
31795 +# CONFIG_CRYPTO_KHAZAD is not set
31796 +# CONFIG_CRYPTO_ANUBIS is not set
31797 +# CONFIG_CRYPTO_DEFLATE is not set
31798 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
31799 +# CONFIG_CRYPTO_CRC32C is not set
31800 +# CONFIG_CRYPTO_CAMELLIA is not set
31801 +# CONFIG_CRYPTO_TEST is not set
31802 +CONFIG_CRYPTO_HW=y
31803 --- a/arch/powerpc/configs/mpc8610_hpcd_defconfig
31804 +++ b/arch/powerpc/configs/mpc8610_hpcd_defconfig
31805 @@ -696,7 +696,7 @@
31806  CONFIG_SERIAL_CORE=y
31807  CONFIG_SERIAL_CORE_CONSOLE=y
31808  # CONFIG_SERIAL_JSM is not set
31809 -CONFIG_SERIAL_OF_PLATFORM=y
31810 +# CONFIG_SERIAL_OF_PLATFORM is not set
31811  CONFIG_UNIX98_PTYS=y
31812  # CONFIG_LEGACY_PTYS is not set
31813  # CONFIG_IPMI_HANDLER is not set
31814 @@ -708,7 +708,60 @@
31815  # CONFIG_RAW_DRIVER is not set
31816  # CONFIG_TCG_TPM is not set
31817  CONFIG_DEVPORT=y
31818 -# CONFIG_I2C is not set
31819 +CONFIG_I2C=y
31820 +CONFIG_I2C_BOARDINFO=y
31821 +# CONFIG_I2C_CHARDEV is not set
31822 +
31823 +#
31824 +# I2C Algorithms
31825 +#
31826 +# CONFIG_I2C_ALGOBIT is not set
31827 +# CONFIG_I2C_ALGOPCF is not set
31828 +# CONFIG_I2C_ALGOPCA is not set
31829 +
31830 +#
31831 +# I2C Hardware Bus support
31832 +#
31833 +# CONFIG_I2C_ALI1535 is not set
31834 +# CONFIG_I2C_ALI1563 is not set
31835 +# CONFIG_I2C_ALI15X3 is not set
31836 +# CONFIG_I2C_AMD756 is not set
31837 +# CONFIG_I2C_AMD8111 is not set
31838 +# CONFIG_I2C_I801 is not set
31839 +# CONFIG_I2C_I810 is not set
31840 +# CONFIG_I2C_PIIX4 is not set
31841 +CONFIG_I2C_MPC=y
31842 +# CONFIG_I2C_NFORCE2 is not set
31843 +# CONFIG_I2C_OCORES is not set
31844 +# CONFIG_I2C_PARPORT_LIGHT is not set
31845 +# CONFIG_I2C_PROSAVAGE is not set
31846 +# CONFIG_I2C_SAVAGE4 is not set
31847 +# CONFIG_I2C_SIMTEC is not set
31848 +# CONFIG_I2C_SIS5595 is not set
31849 +# CONFIG_I2C_SIS630 is not set
31850 +# CONFIG_I2C_SIS96X is not set
31851 +# CONFIG_I2C_TAOS_EVM is not set
31852 +# CONFIG_I2C_VIA is not set
31853 +# CONFIG_I2C_VIAPRO is not set
31854 +# CONFIG_I2C_VOODOO3 is not set
31855 +
31856 +#
31857 +# Miscellaneous I2C Chip support
31858 +#
31859 +# CONFIG_SENSORS_DS1337 is not set
31860 +# CONFIG_SENSORS_DS1374 is not set
31861 +# CONFIG_DS1682 is not set
31862 +# CONFIG_SENSORS_EEPROM is not set
31863 +# CONFIG_SENSORS_PCF8574 is not set
31864 +# CONFIG_SENSORS_PCA9539 is not set
31865 +# CONFIG_SENSORS_PCF8591 is not set
31866 +# CONFIG_SENSORS_M41T00 is not set
31867 +# CONFIG_SENSORS_MAX6875 is not set
31868 +# CONFIG_SENSORS_TSL2550 is not set
31869 +# CONFIG_I2C_DEBUG_CORE is not set
31870 +# CONFIG_I2C_DEBUG_ALGO is not set
31871 +# CONFIG_I2C_DEBUG_BUS is not set
31872 +# CONFIG_I2C_DEBUG_CHIP is not set
31873  
31874  #
31875  # SPI support
31876 @@ -763,7 +816,119 @@
31877  #
31878  # Sound
31879  #
31880 -# CONFIG_SOUND is not set
31881 +CONFIG_SOUND=y
31882 +
31883 +#
31884 +# Advanced Linux Sound Architecture
31885 +#
31886 +CONFIG_SND=y
31887 +CONFIG_SND_TIMER=y
31888 +CONFIG_SND_PCM=y
31889 +# CONFIG_SND_SEQUENCER is not set
31890 +CONFIG_SND_OSSEMUL=y
31891 +CONFIG_SND_MIXER_OSS=y
31892 +CONFIG_SND_PCM_OSS=y
31893 +# CONFIG_SND_PCM_OSS_PLUGINS is not set
31894 +# CONFIG_SND_DYNAMIC_MINORS is not set
31895 +# CONFIG_SND_SUPPORT_OLD_API is not set
31896 +CONFIG_SND_VERBOSE_PROCFS=y
31897 +# CONFIG_SND_VERBOSE_PRINTK is not set
31898 +# CONFIG_SND_DEBUG is not set
31899 +
31900 +#
31901 +# Generic devices
31902 +#
31903 +# CONFIG_SND_DUMMY is not set
31904 +# CONFIG_SND_MTPAV is not set
31905 +# CONFIG_SND_SERIAL_U16550 is not set
31906 +# CONFIG_SND_MPU401 is not set
31907 +
31908 +#
31909 +# PCI devices
31910 +#
31911 +# CONFIG_SND_AD1889 is not set
31912 +# CONFIG_SND_ALS300 is not set
31913 +# CONFIG_SND_ALS4000 is not set
31914 +# CONFIG_SND_ALI5451 is not set
31915 +# CONFIG_SND_ATIIXP is not set
31916 +# CONFIG_SND_ATIIXP_MODEM is not set
31917 +# CONFIG_SND_AU8810 is not set
31918 +# CONFIG_SND_AU8820 is not set
31919 +# CONFIG_SND_AU8830 is not set
31920 +# CONFIG_SND_AZT3328 is not set
31921 +# CONFIG_SND_BT87X is not set
31922 +# CONFIG_SND_CA0106 is not set
31923 +# CONFIG_SND_CMIPCI is not set
31924 +# CONFIG_SND_CS4281 is not set
31925 +# CONFIG_SND_CS46XX is not set
31926 +# CONFIG_SND_CS5530 is not set
31927 +# CONFIG_SND_DARLA20 is not set
31928 +# CONFIG_SND_GINA20 is not set
31929 +# CONFIG_SND_LAYLA20 is not set
31930 +# CONFIG_SND_DARLA24 is not set
31931 +# CONFIG_SND_GINA24 is not set
31932 +# CONFIG_SND_LAYLA24 is not set
31933 +# CONFIG_SND_MONA is not set
31934 +# CONFIG_SND_MIA is not set
31935 +# CONFIG_SND_ECHO3G is not set
31936 +# CONFIG_SND_INDIGO is not set
31937 +# CONFIG_SND_INDIGOIO is not set
31938 +# CONFIG_SND_INDIGODJ is not set
31939 +# CONFIG_SND_EMU10K1 is not set
31940 +# CONFIG_SND_EMU10K1X is not set
31941 +# CONFIG_SND_ENS1370 is not set
31942 +# CONFIG_SND_ENS1371 is not set
31943 +# CONFIG_SND_ES1938 is not set
31944 +# CONFIG_SND_ES1968 is not set
31945 +# CONFIG_SND_FM801 is not set
31946 +# CONFIG_SND_HDA_INTEL is not set
31947 +# CONFIG_SND_HDSP is not set
31948 +# CONFIG_SND_HDSPM is not set
31949 +# CONFIG_SND_ICE1712 is not set
31950 +# CONFIG_SND_ICE1724 is not set
31951 +# CONFIG_SND_INTEL8X0 is not set
31952 +# CONFIG_SND_INTEL8X0M is not set
31953 +# CONFIG_SND_KORG1212 is not set
31954 +# CONFIG_SND_MAESTRO3 is not set
31955 +# CONFIG_SND_MIXART is not set
31956 +# CONFIG_SND_NM256 is not set
31957 +# CONFIG_SND_PCXHR is not set
31958 +# CONFIG_SND_RIPTIDE is not set
31959 +# CONFIG_SND_RME32 is not set
31960 +# CONFIG_SND_RME96 is not set
31961 +# CONFIG_SND_RME9652 is not set
31962 +# CONFIG_SND_SONICVIBES is not set
31963 +# CONFIG_SND_TRIDENT is not set
31964 +# CONFIG_SND_VIA82XX is not set
31965 +# CONFIG_SND_VIA82XX_MODEM is not set
31966 +# CONFIG_SND_VX222 is not set
31967 +# CONFIG_SND_YMFPCI is not set
31968 +
31969 +#
31970 +# ALSA PowerMac devices
31971 +#
31972 +
31973 +#
31974 +# ALSA PowerPC devices
31975 +#
31976 +
31977 +#
31978 +# System on Chip audio support
31979 +#
31980 +CONFIG_SND_SOC=y
31981 +
31982 +#
31983 +# SoC Audio support for SuperH
31984 +#
31985 +
31986 +#
31987 +# ALSA SoC audio for Freescale SOCs
31988 +#
31989 +CONFIG_SND_SOC_MPC8610=y
31990 +CONFIG_SND_SOC_MPC8610_HPCD=y
31991 +CONFIG_SND_SOC_CS4270=y
31992 +CONFIG_SND_SOC_CS4270_VD33_ERRATA=y
31993 +
31994  CONFIG_HID_SUPPORT=y
31995  CONFIG_HID=y
31996  # CONFIG_HID_DEBUG is not set
31997 --- a/arch/powerpc/configs/pasemi_defconfig
31998 +++ b/arch/powerpc/configs/pasemi_defconfig
31999 @@ -1,7 +1,7 @@
32000  #
32001  # Automatically generated make config: don't edit
32002 -# Linux kernel version: 2.6.24-rc4
32003 -# Thu Dec  6 16:49:03 2007
32004 +# Linux kernel version: 2.6.24-rc6
32005 +# Tue Jan 15 10:26:10 2008
32006  #
32007  CONFIG_PPC64=y
32008  
32009 @@ -152,7 +152,6 @@
32010  CONFIG_PPC_PASEMI_IOMMU=y
32011  # CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE is not set
32012  CONFIG_PPC_PASEMI_MDIO=y
32013 -CONFIG_ELECTRA_IDE=y
32014  # CONFIG_PPC_CELLEB is not set
32015  # CONFIG_PPC_PS3 is not set
32016  # CONFIG_PPC_CELL is not set
32017 @@ -256,7 +255,7 @@
32018  CONFIG_PCI_SYSCALL=y
32019  # CONFIG_PCIEPORTBUS is not set
32020  CONFIG_ARCH_SUPPORTS_MSI=y
32021 -# CONFIG_PCI_MSI is not set
32022 +CONFIG_PCI_MSI=y
32023  CONFIG_PCI_LEGACY=y
32024  # CONFIG_PCI_DEBUG is not set
32025  CONFIG_PCCARD=y
32026 @@ -663,7 +662,26 @@
32027  # CONFIG_PATA_VIA is not set
32028  # CONFIG_PATA_WINBOND is not set
32029  CONFIG_PATA_PLATFORM=y
32030 -# CONFIG_MD is not set
32031 +CONFIG_PATA_OF_PLATFORM=y
32032 +CONFIG_MD=y
32033 +CONFIG_BLK_DEV_MD=y
32034 +CONFIG_MD_LINEAR=y
32035 +CONFIG_MD_RAID0=y
32036 +CONFIG_MD_RAID1=y
32037 +CONFIG_MD_RAID10=y
32038 +CONFIG_MD_RAID456=y
32039 +CONFIG_MD_RAID5_RESHAPE=y
32040 +# CONFIG_MD_MULTIPATH is not set
32041 +# CONFIG_MD_FAULTY is not set
32042 +CONFIG_BLK_DEV_DM=y
32043 +# CONFIG_DM_DEBUG is not set
32044 +CONFIG_DM_CRYPT=y
32045 +# CONFIG_DM_SNAPSHOT is not set
32046 +# CONFIG_DM_MIRROR is not set
32047 +# CONFIG_DM_ZERO is not set
32048 +# CONFIG_DM_MULTIPATH is not set
32049 +# CONFIG_DM_DELAY is not set
32050 +# CONFIG_DM_UEVENT is not set
32051  # CONFIG_FUSION is not set
32052  
32053  #
32054 @@ -1686,6 +1704,10 @@
32055  # CONFIG_KEYS is not set
32056  # CONFIG_SECURITY is not set
32057  # CONFIG_SECURITY_FILE_CAPABILITIES is not set
32058 +CONFIG_XOR_BLOCKS=y
32059 +CONFIG_ASYNC_CORE=y
32060 +CONFIG_ASYNC_MEMCPY=y
32061 +CONFIG_ASYNC_XOR=y
32062  CONFIG_CRYPTO=y
32063  CONFIG_CRYPTO_ALGAPI=y
32064  CONFIG_CRYPTO_BLKCIPHER=y
32065 --- a/arch/powerpc/configs/ppc64_defconfig
32066 +++ b/arch/powerpc/configs/ppc64_defconfig
32067 @@ -1,7 +1,7 @@
32068  #
32069  # Automatically generated make config: don't edit
32070  # Linux kernel version: 2.6.24-rc4
32071 -# Thu Dec  6 16:49:07 2007
32072 +# Fri Dec 21 14:47:29 2007
32073  #
32074  CONFIG_PPC64=y
32075  
32076 @@ -211,7 +211,7 @@
32077  CONFIG_MPIC_U3_HT_IRQS=y
32078  CONFIG_MPIC_BROKEN_REGREAD=y
32079  CONFIG_IBMVIO=y
32080 -# CONFIG_IBMEBUS is not set
32081 +CONFIG_IBMEBUS=y
32082  # CONFIG_PPC_MPC106 is not set
32083  CONFIG_PPC_970_NAP=y
32084  CONFIG_PPC_INDIRECT_IO=y
32085 @@ -375,7 +375,7 @@
32086  CONFIG_INET_XFRM_MODE_TRANSPORT=y
32087  CONFIG_INET_XFRM_MODE_TUNNEL=y
32088  CONFIG_INET_XFRM_MODE_BEET=y
32089 -# CONFIG_INET_LRO is not set
32090 +CONFIG_INET_LRO=m
32091  CONFIG_INET_DIAG=y
32092  CONFIG_INET_TCP_DIAG=y
32093  # CONFIG_TCP_CONG_ADVANCED is not set
32094 @@ -929,6 +929,7 @@
32095  CONFIG_NETDEV_10000=y
32096  # CONFIG_CHELSIO_T1 is not set
32097  # CONFIG_CHELSIO_T3 is not set
32098 +CONFIG_EHEA=m
32099  # CONFIG_IXGBE is not set
32100  CONFIG_IXGB=m
32101  # CONFIG_IXGB_NAPI is not set
32102 @@ -1558,6 +1559,7 @@
32103  CONFIG_INFINIBAND_MTHCA=m
32104  CONFIG_INFINIBAND_MTHCA_DEBUG=y
32105  # CONFIG_INFINIBAND_IPATH is not set
32106 +CONFIG_INFINIBAND_EHCA=m
32107  # CONFIG_INFINIBAND_AMSO1100 is not set
32108  # CONFIG_MLX4_INFINIBAND is not set
32109  CONFIG_INFINIBAND_IPOIB=m
32110 --- a/arch/powerpc/configs/ps3_defconfig
32111 +++ b/arch/powerpc/configs/ps3_defconfig
32112 @@ -1,7 +1,7 @@
32113  #
32114  # Automatically generated make config: don't edit
32115 -# Linux kernel version: 2.6.24-rc4
32116 -# Tue Dec  4 22:49:57 2007
32117 +# Linux kernel version: 2.6.24-rc8
32118 +# Wed Jan 16 14:31:21 2008
32119  #
32120  CONFIG_PPC64=y
32121  
32122 @@ -103,6 +103,7 @@
32123  CONFIG_SLAB=y
32124  # CONFIG_SLUB is not set
32125  # CONFIG_SLOB is not set
32126 +CONFIG_SLABINFO=y
32127  CONFIG_RT_MUTEXES=y
32128  # CONFIG_TINY_SHMEM is not set
32129  CONFIG_BASE_SMALL=0
32130 @@ -154,7 +155,6 @@
32131  # CONFIG_PS3_ADVANCED is not set
32132  CONFIG_PS3_HTAB_SIZE=20
32133  # CONFIG_PS3_DYNAMIC_DMA is not set
32134 -CONFIG_PS3_USE_LPAR_ADDR=y
32135  CONFIG_PS3_VUART=y
32136  CONFIG_PS3_PS3AV=y
32137  CONFIG_PS3_SYS_MANAGER=y
32138 @@ -162,6 +162,7 @@
32139  CONFIG_PS3_DISK=y
32140  CONFIG_PS3_ROM=y
32141  CONFIG_PS3_FLASH=y
32142 +CONFIG_PS3_LPM=m
32143  CONFIG_PPC_CELL=y
32144  # CONFIG_PPC_CELL_NATIVE is not set
32145  # CONFIG_PPC_IBM_CELL_BLADE is not set
32146 @@ -225,7 +226,7 @@
32147  # CONFIG_SPARSEMEM_STATIC is not set
32148  CONFIG_SPARSEMEM_EXTREME=y
32149  CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
32150 -CONFIG_SPARSEMEM_VMEMMAP=y
32151 +# CONFIG_SPARSEMEM_VMEMMAP is not set
32152  CONFIG_MEMORY_HOTPLUG=y
32153  CONFIG_MEMORY_HOTPLUG_SPARSE=y
32154  CONFIG_SPLIT_PTLOCK_CPUS=4
32155 @@ -338,7 +339,26 @@
32156  # CONFIG_NET_PKTGEN is not set
32157  # CONFIG_HAMRADIO is not set
32158  # CONFIG_IRDA is not set
32159 -# CONFIG_BT is not set
32160 +CONFIG_BT=m
32161 +CONFIG_BT_L2CAP=m
32162 +CONFIG_BT_SCO=m
32163 +CONFIG_BT_RFCOMM=m
32164 +CONFIG_BT_RFCOMM_TTY=y
32165 +CONFIG_BT_BNEP=m
32166 +CONFIG_BT_BNEP_MC_FILTER=y
32167 +CONFIG_BT_BNEP_PROTO_FILTER=y
32168 +CONFIG_BT_HIDP=m
32169 +
32170 +#
32171 +# Bluetooth device drivers
32172 +#
32173 +CONFIG_BT_HCIUSB=m
32174 +CONFIG_BT_HCIUSB_SCO=y
32175 +# CONFIG_BT_HCIUART is not set
32176 +# CONFIG_BT_HCIBCM203X is not set
32177 +# CONFIG_BT_HCIBPA10X is not set
32178 +# CONFIG_BT_HCIBFUSB is not set
32179 +# CONFIG_BT_HCIVHCI is not set
32180  # CONFIG_AF_RXRPC is not set
32181  
32182  #
32183 @@ -666,14 +686,14 @@
32184  #
32185  # Sound
32186  #
32187 -CONFIG_SOUND=y
32188 +CONFIG_SOUND=m
32189  
32190  #
32191  # Advanced Linux Sound Architecture
32192  #
32193 -CONFIG_SND=y
32194 -CONFIG_SND_TIMER=y
32195 -CONFIG_SND_PCM=y
32196 +CONFIG_SND=m
32197 +CONFIG_SND_TIMER=m
32198 +CONFIG_SND_PCM=m
32199  # CONFIG_SND_SEQUENCER is not set
32200  # CONFIG_SND_MIXER_OSS is not set
32201  # CONFIG_SND_PCM_OSS is not set
32202 @@ -702,7 +722,7 @@
32203  #
32204  # ALSA PowerPC devices
32205  #
32206 -CONFIG_SND_PS3=y
32207 +CONFIG_SND_PS3=m
32208  CONFIG_SND_PS3_DEFAULT_START_DELAY=2000
32209  
32210  #
32211 @@ -747,7 +767,7 @@
32212  CONFIG_USB_ARCH_HAS_HCD=y
32213  CONFIG_USB_ARCH_HAS_OHCI=y
32214  CONFIG_USB_ARCH_HAS_EHCI=y
32215 -CONFIG_USB=y
32216 +CONFIG_USB=m
32217  # CONFIG_USB_DEBUG is not set
32218  
32219  #
32220 @@ -761,13 +781,13 @@
32221  #
32222  # USB Host Controller Drivers
32223  #
32224 -CONFIG_USB_EHCI_HCD=y
32225 +CONFIG_USB_EHCI_HCD=m
32226  # CONFIG_USB_EHCI_SPLIT_ISO is not set
32227  # CONFIG_USB_EHCI_ROOT_HUB_TT is not set
32228  # CONFIG_USB_EHCI_TT_NEWSCHED is not set
32229  CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y
32230  # CONFIG_USB_ISP116X_HCD is not set
32231 -CONFIG_USB_OHCI_HCD=y
32232 +CONFIG_USB_OHCI_HCD=m
32233  # CONFIG_USB_OHCI_HCD_PPC_OF is not set
32234  # CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
32235  CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
32236 @@ -1033,7 +1053,8 @@
32237  CONFIG_HAS_IOPORT=y
32238  CONFIG_HAS_DMA=y
32239  CONFIG_INSTRUMENTATION=y
32240 -# CONFIG_PROFILING is not set
32241 +CONFIG_PROFILING=y
32242 +CONFIG_OPROFILE=m
32243  # CONFIG_KPROBES is not set
32244  # CONFIG_MARKERS is not set
32245  
32246 --- /dev/null
32247 +++ b/arch/powerpc/configs/rainier_defconfig
32248 @@ -0,0 +1,873 @@
32249 +#
32250 +# Automatically generated make config: don't edit
32251 +# Linux kernel version: 2.6.24-rc6
32252 +# Mon Dec 24 11:22:40 2007
32253 +#
32254 +# CONFIG_PPC64 is not set
32255 +
32256 +#
32257 +# Processor support
32258 +#
32259 +# CONFIG_6xx is not set
32260 +# CONFIG_PPC_85xx is not set
32261 +# CONFIG_PPC_8xx is not set
32262 +# CONFIG_40x is not set
32263 +CONFIG_44x=y
32264 +# CONFIG_E200 is not set
32265 +CONFIG_4xx=y
32266 +CONFIG_BOOKE=y
32267 +CONFIG_PTE_64BIT=y
32268 +CONFIG_PHYS_64BIT=y
32269 +# CONFIG_PPC_MM_SLICES is not set
32270 +CONFIG_NOT_COHERENT_CACHE=y
32271 +CONFIG_PPC32=y
32272 +CONFIG_WORD_SIZE=32
32273 +CONFIG_PPC_MERGE=y
32274 +CONFIG_MMU=y
32275 +CONFIG_GENERIC_CMOS_UPDATE=y
32276 +CONFIG_GENERIC_TIME=y
32277 +CONFIG_GENERIC_TIME_VSYSCALL=y
32278 +CONFIG_GENERIC_CLOCKEVENTS=y
32279 +CONFIG_GENERIC_HARDIRQS=y
32280 +CONFIG_IRQ_PER_CPU=y
32281 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
32282 +CONFIG_ARCH_HAS_ILOG2_U32=y
32283 +CONFIG_GENERIC_HWEIGHT=y
32284 +CONFIG_GENERIC_CALIBRATE_DELAY=y
32285 +CONFIG_GENERIC_FIND_NEXT_BIT=y
32286 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
32287 +CONFIG_PPC=y
32288 +CONFIG_EARLY_PRINTK=y
32289 +CONFIG_GENERIC_NVRAM=y
32290 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
32291 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
32292 +CONFIG_PPC_OF=y
32293 +CONFIG_OF=y
32294 +CONFIG_PPC_UDBG_16550=y
32295 +# CONFIG_GENERIC_TBSYNC is not set
32296 +CONFIG_AUDIT_ARCH=y
32297 +CONFIG_GENERIC_BUG=y
32298 +# CONFIG_DEFAULT_UIMAGE is not set
32299 +CONFIG_PPC_DCR_NATIVE=y
32300 +# CONFIG_PPC_DCR_MMIO is not set
32301 +CONFIG_PPC_DCR=y
32302 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
32303 +
32304 +#
32305 +# General setup
32306 +#
32307 +CONFIG_EXPERIMENTAL=y
32308 +CONFIG_BROKEN_ON_SMP=y
32309 +CONFIG_INIT_ENV_ARG_LIMIT=32
32310 +CONFIG_LOCALVERSION=""
32311 +CONFIG_LOCALVERSION_AUTO=y
32312 +CONFIG_SWAP=y
32313 +CONFIG_SYSVIPC=y
32314 +CONFIG_SYSVIPC_SYSCTL=y
32315 +CONFIG_POSIX_MQUEUE=y
32316 +# CONFIG_BSD_PROCESS_ACCT is not set
32317 +# CONFIG_TASKSTATS is not set
32318 +# CONFIG_USER_NS is not set
32319 +# CONFIG_PID_NS is not set
32320 +# CONFIG_AUDIT is not set
32321 +# CONFIG_IKCONFIG is not set
32322 +CONFIG_LOG_BUF_SHIFT=14
32323 +# CONFIG_CGROUPS is not set
32324 +CONFIG_FAIR_GROUP_SCHED=y
32325 +CONFIG_FAIR_USER_SCHED=y
32326 +# CONFIG_FAIR_CGROUP_SCHED is not set
32327 +CONFIG_SYSFS_DEPRECATED=y
32328 +# CONFIG_RELAY is not set
32329 +CONFIG_BLK_DEV_INITRD=y
32330 +CONFIG_INITRAMFS_SOURCE=""
32331 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
32332 +CONFIG_SYSCTL=y
32333 +CONFIG_EMBEDDED=y
32334 +CONFIG_SYSCTL_SYSCALL=y
32335 +CONFIG_KALLSYMS=y
32336 +# CONFIG_KALLSYMS_ALL is not set
32337 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
32338 +CONFIG_HOTPLUG=y
32339 +CONFIG_PRINTK=y
32340 +CONFIG_BUG=y
32341 +CONFIG_ELF_CORE=y
32342 +CONFIG_BASE_FULL=y
32343 +CONFIG_FUTEX=y
32344 +CONFIG_ANON_INODES=y
32345 +CONFIG_EPOLL=y
32346 +CONFIG_SIGNALFD=y
32347 +CONFIG_EVENTFD=y
32348 +CONFIG_SHMEM=y
32349 +CONFIG_VM_EVENT_COUNTERS=y
32350 +CONFIG_SLUB_DEBUG=y
32351 +# CONFIG_SLAB is not set
32352 +CONFIG_SLUB=y
32353 +# CONFIG_SLOB is not set
32354 +CONFIG_RT_MUTEXES=y
32355 +# CONFIG_TINY_SHMEM is not set
32356 +CONFIG_BASE_SMALL=0
32357 +CONFIG_MODULES=y
32358 +CONFIG_MODULE_UNLOAD=y
32359 +# CONFIG_MODULE_FORCE_UNLOAD is not set
32360 +# CONFIG_MODVERSIONS is not set
32361 +# CONFIG_MODULE_SRCVERSION_ALL is not set
32362 +CONFIG_KMOD=y
32363 +CONFIG_BLOCK=y
32364 +CONFIG_LBD=y
32365 +# CONFIG_BLK_DEV_IO_TRACE is not set
32366 +# CONFIG_LSF is not set
32367 +# CONFIG_BLK_DEV_BSG is not set
32368 +
32369 +#
32370 +# IO Schedulers
32371 +#
32372 +CONFIG_IOSCHED_NOOP=y
32373 +CONFIG_IOSCHED_AS=y
32374 +CONFIG_IOSCHED_DEADLINE=y
32375 +CONFIG_IOSCHED_CFQ=y
32376 +CONFIG_DEFAULT_AS=y
32377 +# CONFIG_DEFAULT_DEADLINE is not set
32378 +# CONFIG_DEFAULT_CFQ is not set
32379 +# CONFIG_DEFAULT_NOOP is not set
32380 +CONFIG_DEFAULT_IOSCHED="anticipatory"
32381 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
32382 +
32383 +#
32384 +# Platform support
32385 +#
32386 +# CONFIG_PPC_MPC52xx is not set
32387 +# CONFIG_PPC_MPC5200 is not set
32388 +# CONFIG_PPC_CELL is not set
32389 +# CONFIG_PPC_CELL_NATIVE is not set
32390 +# CONFIG_PQ2ADS is not set
32391 +# CONFIG_BAMBOO is not set
32392 +# CONFIG_EBONY is not set
32393 +# CONFIG_SEQUOIA is not set
32394 +# CONFIG_TAISHAN is not set
32395 +# CONFIG_KATMAI is not set
32396 +CONFIG_RAINIER=y
32397 +CONFIG_440GRX=y
32398 +# CONFIG_MPIC is not set
32399 +# CONFIG_MPIC_WEIRD is not set
32400 +# CONFIG_PPC_I8259 is not set
32401 +# CONFIG_PPC_RTAS is not set
32402 +# CONFIG_MMIO_NVRAM is not set
32403 +# CONFIG_PPC_MPC106 is not set
32404 +# CONFIG_PPC_970_NAP is not set
32405 +# CONFIG_PPC_INDIRECT_IO is not set
32406 +# CONFIG_GENERIC_IOMAP is not set
32407 +# CONFIG_CPU_FREQ is not set
32408 +# CONFIG_CPM2 is not set
32409 +# CONFIG_FSL_ULI1575 is not set
32410 +
32411 +#
32412 +# Kernel options
32413 +#
32414 +# CONFIG_HIGHMEM is not set
32415 +# CONFIG_TICK_ONESHOT is not set
32416 +# CONFIG_NO_HZ is not set
32417 +# CONFIG_HIGH_RES_TIMERS is not set
32418 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
32419 +# CONFIG_HZ_100 is not set
32420 +CONFIG_HZ_250=y
32421 +# CONFIG_HZ_300 is not set
32422 +# CONFIG_HZ_1000 is not set
32423 +CONFIG_HZ=250
32424 +CONFIG_PREEMPT_NONE=y
32425 +# CONFIG_PREEMPT_VOLUNTARY is not set
32426 +# CONFIG_PREEMPT is not set
32427 +CONFIG_BINFMT_ELF=y
32428 +# CONFIG_BINFMT_MISC is not set
32429 +CONFIG_MATH_EMULATION=y
32430 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
32431 +CONFIG_ARCH_FLATMEM_ENABLE=y
32432 +CONFIG_ARCH_POPULATES_NODE_MAP=y
32433 +CONFIG_SELECT_MEMORY_MODEL=y
32434 +CONFIG_FLATMEM_MANUAL=y
32435 +# CONFIG_DISCONTIGMEM_MANUAL is not set
32436 +# CONFIG_SPARSEMEM_MANUAL is not set
32437 +CONFIG_FLATMEM=y
32438 +CONFIG_FLAT_NODE_MEM_MAP=y
32439 +# CONFIG_SPARSEMEM_STATIC is not set
32440 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
32441 +CONFIG_SPLIT_PTLOCK_CPUS=4
32442 +CONFIG_RESOURCES_64BIT=y
32443 +CONFIG_ZONE_DMA_FLAG=1
32444 +CONFIG_BOUNCE=y
32445 +CONFIG_VIRT_TO_BUS=y
32446 +CONFIG_PROC_DEVICETREE=y
32447 +CONFIG_CMDLINE_BOOL=y
32448 +CONFIG_CMDLINE=""
32449 +CONFIG_SECCOMP=y
32450 +CONFIG_WANT_DEVICE_TREE=y
32451 +CONFIG_DEVICE_TREE="rainier.dts"
32452 +CONFIG_ISA_DMA_API=y
32453 +
32454 +#
32455 +# Bus options
32456 +#
32457 +CONFIG_ZONE_DMA=y
32458 +CONFIG_PPC_INDIRECT_PCI=y
32459 +CONFIG_PCI=y
32460 +CONFIG_PCI_DOMAINS=y
32461 +CONFIG_PCI_SYSCALL=y
32462 +# CONFIG_PCIEPORTBUS is not set
32463 +CONFIG_ARCH_SUPPORTS_MSI=y
32464 +# CONFIG_PCI_MSI is not set
32465 +CONFIG_PCI_LEGACY=y
32466 +# CONFIG_PCI_DEBUG is not set
32467 +# CONFIG_PCCARD is not set
32468 +# CONFIG_HOTPLUG_PCI is not set
32469 +
32470 +#
32471 +# Advanced setup
32472 +#
32473 +# CONFIG_ADVANCED_OPTIONS is not set
32474 +
32475 +#
32476 +# Default settings for advanced configuration options are used
32477 +#
32478 +CONFIG_HIGHMEM_START=0xfe000000
32479 +CONFIG_LOWMEM_SIZE=0x30000000
32480 +CONFIG_KERNEL_START=0xc0000000
32481 +CONFIG_TASK_SIZE=0xc0000000
32482 +CONFIG_CONSISTENT_START=0xff100000
32483 +CONFIG_CONSISTENT_SIZE=0x00200000
32484 +CONFIG_BOOT_LOAD=0x01000000
32485 +
32486 +#
32487 +# Networking
32488 +#
32489 +CONFIG_NET=y
32490 +
32491 +#
32492 +# Networking options
32493 +#
32494 +CONFIG_PACKET=y
32495 +# CONFIG_PACKET_MMAP is not set
32496 +CONFIG_UNIX=y
32497 +# CONFIG_NET_KEY is not set
32498 +CONFIG_INET=y
32499 +# CONFIG_IP_MULTICAST is not set
32500 +# CONFIG_IP_ADVANCED_ROUTER is not set
32501 +CONFIG_IP_FIB_HASH=y
32502 +CONFIG_IP_PNP=y
32503 +CONFIG_IP_PNP_DHCP=y
32504 +CONFIG_IP_PNP_BOOTP=y
32505 +# CONFIG_IP_PNP_RARP is not set
32506 +# CONFIG_NET_IPIP is not set
32507 +# CONFIG_NET_IPGRE is not set
32508 +# CONFIG_ARPD is not set
32509 +# CONFIG_SYN_COOKIES is not set
32510 +# CONFIG_INET_AH is not set
32511 +# CONFIG_INET_ESP is not set
32512 +# CONFIG_INET_IPCOMP is not set
32513 +# CONFIG_INET_XFRM_TUNNEL is not set
32514 +# CONFIG_INET_TUNNEL is not set
32515 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
32516 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
32517 +# CONFIG_INET_XFRM_MODE_BEET is not set
32518 +# CONFIG_INET_LRO is not set
32519 +CONFIG_INET_DIAG=y
32520 +CONFIG_INET_TCP_DIAG=y
32521 +# CONFIG_TCP_CONG_ADVANCED is not set
32522 +CONFIG_TCP_CONG_CUBIC=y
32523 +CONFIG_DEFAULT_TCP_CONG="cubic"
32524 +# CONFIG_TCP_MD5SIG is not set
32525 +# CONFIG_IPV6 is not set
32526 +# CONFIG_INET6_XFRM_TUNNEL is not set
32527 +# CONFIG_INET6_TUNNEL is not set
32528 +# CONFIG_NETWORK_SECMARK is not set
32529 +# CONFIG_NETFILTER is not set
32530 +# CONFIG_IP_DCCP is not set
32531 +# CONFIG_IP_SCTP is not set
32532 +# CONFIG_TIPC is not set
32533 +# CONFIG_ATM is not set
32534 +# CONFIG_BRIDGE is not set
32535 +# CONFIG_VLAN_8021Q is not set
32536 +# CONFIG_DECNET is not set
32537 +# CONFIG_LLC2 is not set
32538 +# CONFIG_IPX is not set
32539 +# CONFIG_ATALK is not set
32540 +# CONFIG_X25 is not set
32541 +# CONFIG_LAPB is not set
32542 +# CONFIG_ECONET is not set
32543 +# CONFIG_WAN_ROUTER is not set
32544 +# CONFIG_NET_SCHED is not set
32545 +
32546 +#
32547 +# Network testing
32548 +#
32549 +# CONFIG_NET_PKTGEN is not set
32550 +# CONFIG_HAMRADIO is not set
32551 +# CONFIG_IRDA is not set
32552 +# CONFIG_BT is not set
32553 +# CONFIG_AF_RXRPC is not set
32554 +
32555 +#
32556 +# Wireless
32557 +#
32558 +# CONFIG_CFG80211 is not set
32559 +# CONFIG_WIRELESS_EXT is not set
32560 +# CONFIG_MAC80211 is not set
32561 +# CONFIG_IEEE80211 is not set
32562 +# CONFIG_RFKILL is not set
32563 +# CONFIG_NET_9P is not set
32564 +
32565 +#
32566 +# Device Drivers
32567 +#
32568 +
32569 +#
32570 +# Generic Driver Options
32571 +#
32572 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
32573 +CONFIG_STANDALONE=y
32574 +CONFIG_PREVENT_FIRMWARE_BUILD=y
32575 +CONFIG_FW_LOADER=y
32576 +# CONFIG_DEBUG_DRIVER is not set
32577 +# CONFIG_DEBUG_DEVRES is not set
32578 +# CONFIG_SYS_HYPERVISOR is not set
32579 +CONFIG_CONNECTOR=y
32580 +CONFIG_PROC_EVENTS=y
32581 +CONFIG_MTD=y
32582 +# CONFIG_MTD_DEBUG is not set
32583 +# CONFIG_MTD_CONCAT is not set
32584 +CONFIG_MTD_PARTITIONS=y
32585 +# CONFIG_MTD_REDBOOT_PARTS is not set
32586 +CONFIG_MTD_CMDLINE_PARTS=y
32587 +
32588 +#
32589 +# User Modules And Translation Layers
32590 +#
32591 +CONFIG_MTD_CHAR=y
32592 +# CONFIG_MTD_BLKDEVS is not set
32593 +# CONFIG_MTD_BLOCK is not set
32594 +# CONFIG_MTD_BLOCK_RO is not set
32595 +# CONFIG_FTL is not set
32596 +# CONFIG_NFTL is not set
32597 +# CONFIG_INFTL is not set
32598 +# CONFIG_RFD_FTL is not set
32599 +# CONFIG_SSFDC is not set
32600 +# CONFIG_MTD_OOPS is not set
32601 +
32602 +#
32603 +# RAM/ROM/Flash chip drivers
32604 +#
32605 +CONFIG_MTD_CFI=y
32606 +CONFIG_MTD_JEDECPROBE=y
32607 +CONFIG_MTD_GEN_PROBE=y
32608 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
32609 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
32610 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
32611 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
32612 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
32613 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
32614 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
32615 +CONFIG_MTD_CFI_I1=y
32616 +CONFIG_MTD_CFI_I2=y
32617 +# CONFIG_MTD_CFI_I4 is not set
32618 +# CONFIG_MTD_CFI_I8 is not set
32619 +CONFIG_MTD_CFI_INTELEXT=y
32620 +CONFIG_MTD_CFI_AMDSTD=y
32621 +# CONFIG_MTD_CFI_STAA is not set
32622 +CONFIG_MTD_CFI_UTIL=y
32623 +# CONFIG_MTD_RAM is not set
32624 +# CONFIG_MTD_ROM is not set
32625 +# CONFIG_MTD_ABSENT is not set
32626 +
32627 +#
32628 +# Mapping drivers for chip access
32629 +#
32630 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
32631 +# CONFIG_MTD_PHYSMAP is not set
32632 +CONFIG_MTD_PHYSMAP_OF=y
32633 +# CONFIG_MTD_INTEL_VR_NOR is not set
32634 +# CONFIG_MTD_PLATRAM is not set
32635 +
32636 +#
32637 +# Self-contained MTD device drivers
32638 +#
32639 +# CONFIG_MTD_PMC551 is not set
32640 +# CONFIG_MTD_SLRAM is not set
32641 +# CONFIG_MTD_PHRAM is not set
32642 +# CONFIG_MTD_MTDRAM is not set
32643 +# CONFIG_MTD_BLOCK2MTD is not set
32644 +
32645 +#
32646 +# Disk-On-Chip Device Drivers
32647 +#
32648 +# CONFIG_MTD_DOC2000 is not set
32649 +# CONFIG_MTD_DOC2001 is not set
32650 +# CONFIG_MTD_DOC2001PLUS is not set
32651 +# CONFIG_MTD_NAND is not set
32652 +# CONFIG_MTD_ONENAND is not set
32653 +
32654 +#
32655 +# UBI - Unsorted block images
32656 +#
32657 +# CONFIG_MTD_UBI is not set
32658 +CONFIG_OF_DEVICE=y
32659 +# CONFIG_PARPORT is not set
32660 +CONFIG_BLK_DEV=y
32661 +# CONFIG_BLK_DEV_FD is not set
32662 +# CONFIG_BLK_CPQ_DA is not set
32663 +# CONFIG_BLK_CPQ_CISS_DA is not set
32664 +# CONFIG_BLK_DEV_DAC960 is not set
32665 +# CONFIG_BLK_DEV_UMEM is not set
32666 +# CONFIG_BLK_DEV_COW_COMMON is not set
32667 +# CONFIG_BLK_DEV_LOOP is not set
32668 +# CONFIG_BLK_DEV_NBD is not set
32669 +# CONFIG_BLK_DEV_SX8 is not set
32670 +CONFIG_BLK_DEV_RAM=y
32671 +CONFIG_BLK_DEV_RAM_COUNT=16
32672 +CONFIG_BLK_DEV_RAM_SIZE=35000
32673 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
32674 +# CONFIG_CDROM_PKTCDVD is not set
32675 +# CONFIG_ATA_OVER_ETH is not set
32676 +# CONFIG_XILINX_SYSACE is not set
32677 +CONFIG_MISC_DEVICES=y
32678 +# CONFIG_PHANTOM is not set
32679 +# CONFIG_EEPROM_93CX6 is not set
32680 +# CONFIG_SGI_IOC4 is not set
32681 +# CONFIG_TIFM_CORE is not set
32682 +# CONFIG_IDE is not set
32683 +
32684 +#
32685 +# SCSI device support
32686 +#
32687 +# CONFIG_RAID_ATTRS is not set
32688 +# CONFIG_SCSI is not set
32689 +# CONFIG_SCSI_DMA is not set
32690 +# CONFIG_SCSI_NETLINK is not set
32691 +# CONFIG_ATA is not set
32692 +# CONFIG_MD is not set
32693 +# CONFIG_FUSION is not set
32694 +
32695 +#
32696 +# IEEE 1394 (FireWire) support
32697 +#
32698 +# CONFIG_FIREWIRE is not set
32699 +# CONFIG_IEEE1394 is not set
32700 +# CONFIG_I2O is not set
32701 +CONFIG_MACINTOSH_DRIVERS=y
32702 +# CONFIG_MAC_EMUMOUSEBTN is not set
32703 +# CONFIG_WINDFARM is not set
32704 +CONFIG_NETDEVICES=y
32705 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
32706 +# CONFIG_DUMMY is not set
32707 +# CONFIG_BONDING is not set
32708 +# CONFIG_MACVLAN is not set
32709 +# CONFIG_EQUALIZER is not set
32710 +# CONFIG_TUN is not set
32711 +# CONFIG_VETH is not set
32712 +# CONFIG_IP1000 is not set
32713 +# CONFIG_ARCNET is not set
32714 +# CONFIG_NET_ETHERNET is not set
32715 +CONFIG_IBM_NEW_EMAC_ZMII=y
32716 +CONFIG_IBM_NEW_EMAC_RGMII=y
32717 +CONFIG_IBM_NEW_EMAC_EMAC4=y
32718 +CONFIG_NETDEV_1000=y
32719 +# CONFIG_ACENIC is not set
32720 +# CONFIG_DL2K is not set
32721 +# CONFIG_E1000 is not set
32722 +# CONFIG_E1000E is not set
32723 +# CONFIG_NS83820 is not set
32724 +# CONFIG_HAMACHI is not set
32725 +# CONFIG_YELLOWFIN is not set
32726 +# CONFIG_R8169 is not set
32727 +# CONFIG_SIS190 is not set
32728 +# CONFIG_SKGE is not set
32729 +# CONFIG_SKY2 is not set
32730 +# CONFIG_SK98LIN is not set
32731 +# CONFIG_VIA_VELOCITY is not set
32732 +# CONFIG_TIGON3 is not set
32733 +# CONFIG_BNX2 is not set
32734 +# CONFIG_QLA3XXX is not set
32735 +# CONFIG_ATL1 is not set
32736 +CONFIG_NETDEV_10000=y
32737 +# CONFIG_CHELSIO_T1 is not set
32738 +# CONFIG_CHELSIO_T3 is not set
32739 +# CONFIG_IXGBE is not set
32740 +# CONFIG_IXGB is not set
32741 +# CONFIG_S2IO is not set
32742 +# CONFIG_MYRI10GE is not set
32743 +# CONFIG_NETXEN_NIC is not set
32744 +# CONFIG_NIU is not set
32745 +# CONFIG_MLX4_CORE is not set
32746 +# CONFIG_TEHUTI is not set
32747 +# CONFIG_TR is not set
32748 +
32749 +#
32750 +# Wireless LAN
32751 +#
32752 +# CONFIG_WLAN_PRE80211 is not set
32753 +# CONFIG_WLAN_80211 is not set
32754 +# CONFIG_WAN is not set
32755 +# CONFIG_FDDI is not set
32756 +# CONFIG_HIPPI is not set
32757 +# CONFIG_PPP is not set
32758 +# CONFIG_SLIP is not set
32759 +# CONFIG_SHAPER is not set
32760 +# CONFIG_NETCONSOLE is not set
32761 +# CONFIG_NETPOLL is not set
32762 +# CONFIG_NET_POLL_CONTROLLER is not set
32763 +# CONFIG_ISDN is not set
32764 +# CONFIG_PHONE is not set
32765 +
32766 +#
32767 +# Input device support
32768 +#
32769 +# CONFIG_INPUT is not set
32770 +
32771 +#
32772 +# Hardware I/O ports
32773 +#
32774 +# CONFIG_SERIO is not set
32775 +# CONFIG_GAMEPORT is not set
32776 +
32777 +#
32778 +# Character devices
32779 +#
32780 +# CONFIG_VT is not set
32781 +# CONFIG_SERIAL_NONSTANDARD is not set
32782 +
32783 +#
32784 +# Serial drivers
32785 +#
32786 +CONFIG_SERIAL_8250=y
32787 +CONFIG_SERIAL_8250_CONSOLE=y
32788 +# CONFIG_SERIAL_8250_PCI is not set
32789 +CONFIG_SERIAL_8250_NR_UARTS=4
32790 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
32791 +CONFIG_SERIAL_8250_EXTENDED=y
32792 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
32793 +CONFIG_SERIAL_8250_SHARE_IRQ=y
32794 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
32795 +# CONFIG_SERIAL_8250_RSA is not set
32796 +
32797 +#
32798 +# Non-8250 serial port support
32799 +#
32800 +# CONFIG_SERIAL_UARTLITE is not set
32801 +CONFIG_SERIAL_CORE=y
32802 +CONFIG_SERIAL_CORE_CONSOLE=y
32803 +# CONFIG_SERIAL_JSM is not set
32804 +CONFIG_SERIAL_OF_PLATFORM=y
32805 +CONFIG_UNIX98_PTYS=y
32806 +CONFIG_LEGACY_PTYS=y
32807 +CONFIG_LEGACY_PTY_COUNT=256
32808 +# CONFIG_IPMI_HANDLER is not set
32809 +# CONFIG_HW_RANDOM is not set
32810 +# CONFIG_NVRAM is not set
32811 +# CONFIG_GEN_RTC is not set
32812 +# CONFIG_R3964 is not set
32813 +# CONFIG_APPLICOM is not set
32814 +# CONFIG_RAW_DRIVER is not set
32815 +# CONFIG_TCG_TPM is not set
32816 +CONFIG_DEVPORT=y
32817 +# CONFIG_I2C is not set
32818 +
32819 +#
32820 +# SPI support
32821 +#
32822 +# CONFIG_SPI is not set
32823 +# CONFIG_SPI_MASTER is not set
32824 +# CONFIG_W1 is not set
32825 +# CONFIG_POWER_SUPPLY is not set
32826 +# CONFIG_HWMON is not set
32827 +# CONFIG_WATCHDOG is not set
32828 +
32829 +#
32830 +# Sonics Silicon Backplane
32831 +#
32832 +CONFIG_SSB_POSSIBLE=y
32833 +# CONFIG_SSB is not set
32834 +
32835 +#
32836 +# Multifunction device drivers
32837 +#
32838 +# CONFIG_MFD_SM501 is not set
32839 +
32840 +#
32841 +# Multimedia devices
32842 +#
32843 +# CONFIG_VIDEO_DEV is not set
32844 +# CONFIG_DVB_CORE is not set
32845 +CONFIG_DAB=y
32846 +
32847 +#
32848 +# Graphics support
32849 +#
32850 +# CONFIG_AGP is not set
32851 +# CONFIG_DRM is not set
32852 +# CONFIG_VGASTATE is not set
32853 +CONFIG_VIDEO_OUTPUT_CONTROL=m
32854 +# CONFIG_FB is not set
32855 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
32856 +
32857 +#
32858 +# Display device support
32859 +#
32860 +# CONFIG_DISPLAY_SUPPORT is not set
32861 +
32862 +#
32863 +# Sound
32864 +#
32865 +# CONFIG_SOUND is not set
32866 +CONFIG_USB_SUPPORT=y
32867 +CONFIG_USB_ARCH_HAS_HCD=y
32868 +CONFIG_USB_ARCH_HAS_OHCI=y
32869 +CONFIG_USB_ARCH_HAS_EHCI=y
32870 +# CONFIG_USB is not set
32871 +
32872 +#
32873 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
32874 +#
32875 +
32876 +#
32877 +# USB Gadget Support
32878 +#
32879 +# CONFIG_USB_GADGET is not set
32880 +# CONFIG_MMC is not set
32881 +# CONFIG_NEW_LEDS is not set
32882 +# CONFIG_INFINIBAND is not set
32883 +# CONFIG_EDAC is not set
32884 +# CONFIG_RTC_CLASS is not set
32885 +
32886 +#
32887 +# Userspace I/O
32888 +#
32889 +# CONFIG_UIO is not set
32890 +
32891 +#
32892 +# File systems
32893 +#
32894 +CONFIG_EXT2_FS=y
32895 +# CONFIG_EXT2_FS_XATTR is not set
32896 +# CONFIG_EXT2_FS_XIP is not set
32897 +# CONFIG_EXT3_FS is not set
32898 +# CONFIG_EXT4DEV_FS is not set
32899 +# CONFIG_REISERFS_FS is not set
32900 +# CONFIG_JFS_FS is not set
32901 +# CONFIG_FS_POSIX_ACL is not set
32902 +# CONFIG_XFS_FS is not set
32903 +# CONFIG_GFS2_FS is not set
32904 +# CONFIG_OCFS2_FS is not set
32905 +# CONFIG_MINIX_FS is not set
32906 +# CONFIG_ROMFS_FS is not set
32907 +CONFIG_INOTIFY=y
32908 +CONFIG_INOTIFY_USER=y
32909 +# CONFIG_QUOTA is not set
32910 +CONFIG_DNOTIFY=y
32911 +# CONFIG_AUTOFS_FS is not set
32912 +# CONFIG_AUTOFS4_FS is not set
32913 +# CONFIG_FUSE_FS is not set
32914 +
32915 +#
32916 +# CD-ROM/DVD Filesystems
32917 +#
32918 +# CONFIG_ISO9660_FS is not set
32919 +# CONFIG_UDF_FS is not set
32920 +
32921 +#
32922 +# DOS/FAT/NT Filesystems
32923 +#
32924 +# CONFIG_MSDOS_FS is not set
32925 +# CONFIG_VFAT_FS is not set
32926 +# CONFIG_NTFS_FS is not set
32927 +
32928 +#
32929 +# Pseudo filesystems
32930 +#
32931 +CONFIG_PROC_FS=y
32932 +CONFIG_PROC_KCORE=y
32933 +CONFIG_PROC_SYSCTL=y
32934 +CONFIG_SYSFS=y
32935 +CONFIG_TMPFS=y
32936 +# CONFIG_TMPFS_POSIX_ACL is not set
32937 +# CONFIG_HUGETLB_PAGE is not set
32938 +# CONFIG_CONFIGFS_FS is not set
32939 +
32940 +#
32941 +# Miscellaneous filesystems
32942 +#
32943 +# CONFIG_ADFS_FS is not set
32944 +# CONFIG_AFFS_FS is not set
32945 +# CONFIG_HFS_FS is not set
32946 +# CONFIG_HFSPLUS_FS is not set
32947 +# CONFIG_BEFS_FS is not set
32948 +# CONFIG_BFS_FS is not set
32949 +# CONFIG_EFS_FS is not set
32950 +CONFIG_JFFS2_FS=y
32951 +CONFIG_JFFS2_FS_DEBUG=0
32952 +CONFIG_JFFS2_FS_WRITEBUFFER=y
32953 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
32954 +# CONFIG_JFFS2_SUMMARY is not set
32955 +# CONFIG_JFFS2_FS_XATTR is not set
32956 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
32957 +CONFIG_JFFS2_ZLIB=y
32958 +# CONFIG_JFFS2_LZO is not set
32959 +CONFIG_JFFS2_RTIME=y
32960 +# CONFIG_JFFS2_RUBIN is not set
32961 +CONFIG_CRAMFS=y
32962 +# CONFIG_VXFS_FS is not set
32963 +# CONFIG_HPFS_FS is not set
32964 +# CONFIG_QNX4FS_FS is not set
32965 +# CONFIG_SYSV_FS is not set
32966 +# CONFIG_UFS_FS is not set
32967 +CONFIG_NETWORK_FILESYSTEMS=y
32968 +CONFIG_NFS_FS=y
32969 +CONFIG_NFS_V3=y
32970 +# CONFIG_NFS_V3_ACL is not set
32971 +# CONFIG_NFS_V4 is not set
32972 +# CONFIG_NFS_DIRECTIO is not set
32973 +# CONFIG_NFSD is not set
32974 +CONFIG_ROOT_NFS=y
32975 +CONFIG_LOCKD=y
32976 +CONFIG_LOCKD_V4=y
32977 +CONFIG_NFS_COMMON=y
32978 +CONFIG_SUNRPC=y
32979 +# CONFIG_SUNRPC_BIND34 is not set
32980 +# CONFIG_RPCSEC_GSS_KRB5 is not set
32981 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
32982 +# CONFIG_SMB_FS is not set
32983 +# CONFIG_CIFS is not set
32984 +# CONFIG_NCP_FS is not set
32985 +# CONFIG_CODA_FS is not set
32986 +# CONFIG_AFS_FS is not set
32987 +
32988 +#
32989 +# Partition Types
32990 +#
32991 +# CONFIG_PARTITION_ADVANCED is not set
32992 +CONFIG_MSDOS_PARTITION=y
32993 +# CONFIG_NLS is not set
32994 +# CONFIG_DLM is not set
32995 +# CONFIG_UCC_SLOW is not set
32996 +
32997 +#
32998 +# Library routines
32999 +#
33000 +CONFIG_BITREVERSE=y
33001 +# CONFIG_CRC_CCITT is not set
33002 +# CONFIG_CRC16 is not set
33003 +# CONFIG_CRC_ITU_T is not set
33004 +CONFIG_CRC32=y
33005 +# CONFIG_CRC7 is not set
33006 +# CONFIG_LIBCRC32C is not set
33007 +CONFIG_ZLIB_INFLATE=y
33008 +CONFIG_ZLIB_DEFLATE=y
33009 +CONFIG_PLIST=y
33010 +CONFIG_HAS_IOMEM=y
33011 +CONFIG_HAS_IOPORT=y
33012 +CONFIG_HAS_DMA=y
33013 +CONFIG_INSTRUMENTATION=y
33014 +# CONFIG_PROFILING is not set
33015 +# CONFIG_KPROBES is not set
33016 +# CONFIG_MARKERS is not set
33017 +
33018 +#
33019 +# Kernel hacking
33020 +#
33021 +# CONFIG_PRINTK_TIME is not set
33022 +CONFIG_ENABLE_WARN_DEPRECATED=y
33023 +CONFIG_ENABLE_MUST_CHECK=y
33024 +CONFIG_MAGIC_SYSRQ=y
33025 +# CONFIG_UNUSED_SYMBOLS is not set
33026 +# CONFIG_DEBUG_FS is not set
33027 +# CONFIG_HEADERS_CHECK is not set
33028 +CONFIG_DEBUG_KERNEL=y
33029 +# CONFIG_DEBUG_SHIRQ is not set
33030 +CONFIG_DETECT_SOFTLOCKUP=y
33031 +CONFIG_SCHED_DEBUG=y
33032 +# CONFIG_SCHEDSTATS is not set
33033 +# CONFIG_TIMER_STATS is not set
33034 +# CONFIG_SLUB_DEBUG_ON is not set
33035 +# CONFIG_DEBUG_RT_MUTEXES is not set
33036 +# CONFIG_RT_MUTEX_TESTER is not set
33037 +# CONFIG_DEBUG_SPINLOCK is not set
33038 +# CONFIG_DEBUG_MUTEXES is not set
33039 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
33040 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
33041 +# CONFIG_DEBUG_KOBJECT is not set
33042 +# CONFIG_DEBUG_BUGVERBOSE is not set
33043 +# CONFIG_DEBUG_INFO is not set
33044 +# CONFIG_DEBUG_VM is not set
33045 +# CONFIG_DEBUG_LIST is not set
33046 +# CONFIG_DEBUG_SG is not set
33047 +CONFIG_FORCED_INLINING=y
33048 +# CONFIG_BOOT_PRINTK_DELAY is not set
33049 +# CONFIG_RCU_TORTURE_TEST is not set
33050 +# CONFIG_FAULT_INJECTION is not set
33051 +# CONFIG_SAMPLES is not set
33052 +# CONFIG_DEBUG_STACKOVERFLOW is not set
33053 +# CONFIG_DEBUG_STACK_USAGE is not set
33054 +# CONFIG_DEBUG_PAGEALLOC is not set
33055 +CONFIG_DEBUGGER=y
33056 +# CONFIG_KGDB is not set
33057 +# CONFIG_XMON is not set
33058 +# CONFIG_BDI_SWITCH is not set
33059 +CONFIG_PPC_EARLY_DEBUG=y
33060 +# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
33061 +# CONFIG_PPC_EARLY_DEBUG_G5 is not set
33062 +# CONFIG_PPC_EARLY_DEBUG_RTAS_PANEL is not set
33063 +# CONFIG_PPC_EARLY_DEBUG_RTAS_CONSOLE is not set
33064 +# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
33065 +# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
33066 +# CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
33067 +# CONFIG_PPC_EARLY_DEBUG_BEAT is not set
33068 +CONFIG_PPC_EARLY_DEBUG_44x=y
33069 +# CONFIG_PPC_EARLY_DEBUG_40x is not set
33070 +# CONFIG_PPC_EARLY_DEBUG_CPM is not set
33071 +CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
33072 +CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x1
33073 +
33074 +#
33075 +# Security options
33076 +#
33077 +# CONFIG_KEYS is not set
33078 +# CONFIG_SECURITY is not set
33079 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
33080 +CONFIG_CRYPTO=y
33081 +CONFIG_CRYPTO_ALGAPI=y
33082 +CONFIG_CRYPTO_BLKCIPHER=y
33083 +CONFIG_CRYPTO_MANAGER=y
33084 +# CONFIG_CRYPTO_HMAC is not set
33085 +# CONFIG_CRYPTO_XCBC is not set
33086 +# CONFIG_CRYPTO_NULL is not set
33087 +# CONFIG_CRYPTO_MD4 is not set
33088 +CONFIG_CRYPTO_MD5=y
33089 +# CONFIG_CRYPTO_SHA1 is not set
33090 +# CONFIG_CRYPTO_SHA256 is not set
33091 +# CONFIG_CRYPTO_SHA512 is not set
33092 +# CONFIG_CRYPTO_WP512 is not set
33093 +# CONFIG_CRYPTO_TGR192 is not set
33094 +# CONFIG_CRYPTO_GF128MUL is not set
33095 +CONFIG_CRYPTO_ECB=y
33096 +CONFIG_CRYPTO_CBC=y
33097 +CONFIG_CRYPTO_PCBC=y
33098 +# CONFIG_CRYPTO_LRW is not set
33099 +# CONFIG_CRYPTO_XTS is not set
33100 +# CONFIG_CRYPTO_CRYPTD is not set
33101 +CONFIG_CRYPTO_DES=y
33102 +# CONFIG_CRYPTO_FCRYPT is not set
33103 +# CONFIG_CRYPTO_BLOWFISH is not set
33104 +# CONFIG_CRYPTO_TWOFISH is not set
33105 +# CONFIG_CRYPTO_SERPENT is not set
33106 +# CONFIG_CRYPTO_AES is not set
33107 +# CONFIG_CRYPTO_CAST5 is not set
33108 +# CONFIG_CRYPTO_CAST6 is not set
33109 +# CONFIG_CRYPTO_TEA is not set
33110 +# CONFIG_CRYPTO_ARC4 is not set
33111 +# CONFIG_CRYPTO_KHAZAD is not set
33112 +# CONFIG_CRYPTO_ANUBIS is not set
33113 +# CONFIG_CRYPTO_SEED is not set
33114 +# CONFIG_CRYPTO_DEFLATE is not set
33115 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
33116 +# CONFIG_CRYPTO_CRC32C is not set
33117 +# CONFIG_CRYPTO_CAMELLIA is not set
33118 +# CONFIG_CRYPTO_TEST is not set
33119 +# CONFIG_CRYPTO_AUTHENC is not set
33120 +CONFIG_CRYPTO_HW=y
33121 +# CONFIG_PPC_CLOCK is not set
33122 --- a/arch/powerpc/configs/sequoia_defconfig
33123 +++ b/arch/powerpc/configs/sequoia_defconfig
33124 @@ -1,7 +1,7 @@
33125  #
33126  # Automatically generated make config: don't edit
33127 -# Linux kernel version: 2.6.24-rc4
33128 -# Thu Dec  6 16:49:17 2007
33129 +# Linux kernel version: 2.6.24-rc6
33130 +# Mon Dec 24 11:23:22 2007
33131  #
33132  # CONFIG_PPC64 is not set
33133  
33134 @@ -129,6 +129,7 @@
33135  # CONFIG_DEFAULT_CFQ is not set
33136  # CONFIG_DEFAULT_NOOP is not set
33137  CONFIG_DEFAULT_IOSCHED="anticipatory"
33138 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
33139  
33140  #
33141  # Platform support
33142 @@ -141,8 +142,10 @@
33143  # CONFIG_BAMBOO is not set
33144  # CONFIG_EBONY is not set
33145  CONFIG_SEQUOIA=y
33146 +# CONFIG_TAISHAN is not set
33147 +# CONFIG_KATMAI is not set
33148 +# CONFIG_RAINIER is not set
33149  CONFIG_440EPX=y
33150 -CONFIG_440A=y
33151  # CONFIG_MPIC is not set
33152  # CONFIG_MPIC_WEIRD is not set
33153  # CONFIG_PPC_I8259 is not set
33154 @@ -446,9 +449,7 @@
33155  # CONFIG_FIREWIRE is not set
33156  # CONFIG_IEEE1394 is not set
33157  # CONFIG_I2O is not set
33158 -CONFIG_MACINTOSH_DRIVERS=y
33159 -# CONFIG_MAC_EMUMOUSEBTN is not set
33160 -# CONFIG_WINDFARM is not set
33161 +# CONFIG_MACINTOSH_DRIVERS is not set
33162  CONFIG_NETDEVICES=y
33163  # CONFIG_NETDEVICES_MULTIQUEUE is not set
33164  # CONFIG_DUMMY is not set
33165 @@ -459,10 +460,28 @@
33166  # CONFIG_VETH is not set
33167  # CONFIG_IP1000 is not set
33168  # CONFIG_ARCNET is not set
33169 -# CONFIG_NET_ETHERNET is not set
33170 +# CONFIG_PHYLIB is not set
33171 +CONFIG_NET_ETHERNET=y
33172 +# CONFIG_MII is not set
33173 +# CONFIG_HAPPYMEAL is not set
33174 +# CONFIG_SUNGEM is not set
33175 +# CONFIG_CASSINI is not set
33176 +# CONFIG_NET_VENDOR_3COM is not set
33177 +# CONFIG_NET_TULIP is not set
33178 +# CONFIG_HP100 is not set
33179 +CONFIG_IBM_NEW_EMAC=y
33180 +CONFIG_IBM_NEW_EMAC_RXB=128
33181 +CONFIG_IBM_NEW_EMAC_TXB=64
33182 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
33183 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
33184 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
33185 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
33186  CONFIG_IBM_NEW_EMAC_ZMII=y
33187  CONFIG_IBM_NEW_EMAC_RGMII=y
33188 +# CONFIG_IBM_NEW_EMAC_TAH is not set
33189  CONFIG_IBM_NEW_EMAC_EMAC4=y
33190 +# CONFIG_NET_PCI is not set
33191 +# CONFIG_B44 is not set
33192  CONFIG_NETDEV_1000=y
33193  # CONFIG_ACENIC is not set
33194  # CONFIG_DL2K is not set
33195 @@ -811,6 +830,7 @@
33196  # CONFIG_PPC_EARLY_DEBUG_PAS_REALMODE is not set
33197  # CONFIG_PPC_EARLY_DEBUG_BEAT is not set
33198  CONFIG_PPC_EARLY_DEBUG_44x=y
33199 +# CONFIG_PPC_EARLY_DEBUG_40x is not set
33200  # CONFIG_PPC_EARLY_DEBUG_CPM is not set
33201  CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
33202  CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x1
33203 --- /dev/null
33204 +++ b/arch/powerpc/configs/storcenter_defconfig
33205 @@ -0,0 +1,1174 @@
33206 +#
33207 +# Automatically generated make config: don't edit
33208 +# Linux kernel version: 2.6.24-rc6
33209 +# Tue Jan  8 09:33:54 2008
33210 +#
33211 +# CONFIG_PPC64 is not set
33212 +
33213 +#
33214 +# Processor support
33215 +#
33216 +CONFIG_6xx=y
33217 +# CONFIG_PPC_85xx is not set
33218 +# CONFIG_PPC_8xx is not set
33219 +# CONFIG_40x is not set
33220 +# CONFIG_44x is not set
33221 +# CONFIG_E200 is not set
33222 +CONFIG_PPC_FPU=y
33223 +# CONFIG_ALTIVEC is not set
33224 +CONFIG_PPC_STD_MMU=y
33225 +CONFIG_PPC_STD_MMU_32=y
33226 +# CONFIG_PPC_MM_SLICES is not set
33227 +# CONFIG_SMP is not set
33228 +CONFIG_PPC32=y
33229 +CONFIG_WORD_SIZE=32
33230 +CONFIG_PPC_MERGE=y
33231 +CONFIG_MMU=y
33232 +CONFIG_GENERIC_CMOS_UPDATE=y
33233 +CONFIG_GENERIC_TIME=y
33234 +CONFIG_GENERIC_TIME_VSYSCALL=y
33235 +CONFIG_GENERIC_CLOCKEVENTS=y
33236 +CONFIG_GENERIC_HARDIRQS=y
33237 +CONFIG_IRQ_PER_CPU=y
33238 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
33239 +CONFIG_ARCH_HAS_ILOG2_U32=y
33240 +CONFIG_GENERIC_HWEIGHT=y
33241 +CONFIG_GENERIC_CALIBRATE_DELAY=y
33242 +CONFIG_GENERIC_FIND_NEXT_BIT=y
33243 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
33244 +CONFIG_PPC=y
33245 +CONFIG_EARLY_PRINTK=y
33246 +CONFIG_GENERIC_NVRAM=y
33247 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
33248 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
33249 +CONFIG_PPC_OF=y
33250 +CONFIG_OF=y
33251 +CONFIG_PPC_UDBG_16550=y
33252 +# CONFIG_GENERIC_TBSYNC is not set
33253 +CONFIG_AUDIT_ARCH=y
33254 +CONFIG_GENERIC_BUG=y
33255 +# CONFIG_DEFAULT_UIMAGE is not set
33256 +# CONFIG_PPC_DCR_NATIVE is not set
33257 +# CONFIG_PPC_DCR_MMIO is not set
33258 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
33259 +
33260 +#
33261 +# General setup
33262 +#
33263 +CONFIG_EXPERIMENTAL=y
33264 +CONFIG_BROKEN_ON_SMP=y
33265 +CONFIG_INIT_ENV_ARG_LIMIT=32
33266 +CONFIG_LOCALVERSION=""
33267 +CONFIG_LOCALVERSION_AUTO=y
33268 +CONFIG_SWAP=y
33269 +CONFIG_SYSVIPC=y
33270 +CONFIG_SYSVIPC_SYSCTL=y
33271 +# CONFIG_POSIX_MQUEUE is not set
33272 +# CONFIG_BSD_PROCESS_ACCT is not set
33273 +# CONFIG_TASKSTATS is not set
33274 +# CONFIG_USER_NS is not set
33275 +# CONFIG_PID_NS is not set
33276 +# CONFIG_AUDIT is not set
33277 +# CONFIG_IKCONFIG is not set
33278 +CONFIG_LOG_BUF_SHIFT=14
33279 +# CONFIG_CGROUPS is not set
33280 +CONFIG_FAIR_GROUP_SCHED=y
33281 +CONFIG_FAIR_USER_SCHED=y
33282 +# CONFIG_FAIR_CGROUP_SCHED is not set
33283 +CONFIG_SYSFS_DEPRECATED=y
33284 +# CONFIG_RELAY is not set
33285 +# CONFIG_BLK_DEV_INITRD is not set
33286 +CONFIG_CC_OPTIMIZE_FOR_SIZE=y
33287 +CONFIG_SYSCTL=y
33288 +CONFIG_EMBEDDED=y
33289 +CONFIG_SYSCTL_SYSCALL=y
33290 +# CONFIG_KALLSYMS is not set
33291 +CONFIG_HOTPLUG=y
33292 +CONFIG_PRINTK=y
33293 +CONFIG_BUG=y
33294 +CONFIG_ELF_CORE=y
33295 +CONFIG_BASE_FULL=y
33296 +CONFIG_FUTEX=y
33297 +CONFIG_ANON_INODES=y
33298 +CONFIG_EPOLL=y
33299 +CONFIG_SIGNALFD=y
33300 +CONFIG_EVENTFD=y
33301 +CONFIG_SHMEM=y
33302 +CONFIG_VM_EVENT_COUNTERS=y
33303 +CONFIG_SLUB_DEBUG=y
33304 +# CONFIG_SLAB is not set
33305 +CONFIG_SLUB=y
33306 +# CONFIG_SLOB is not set
33307 +CONFIG_RT_MUTEXES=y
33308 +# CONFIG_TINY_SHMEM is not set
33309 +CONFIG_BASE_SMALL=0
33310 +CONFIG_MODULES=y
33311 +CONFIG_MODULE_UNLOAD=y
33312 +# CONFIG_MODULE_FORCE_UNLOAD is not set
33313 +# CONFIG_MODVERSIONS is not set
33314 +# CONFIG_MODULE_SRCVERSION_ALL is not set
33315 +CONFIG_KMOD=y
33316 +CONFIG_BLOCK=y
33317 +CONFIG_LBD=y
33318 +# CONFIG_BLK_DEV_IO_TRACE is not set
33319 +# CONFIG_LSF is not set
33320 +# CONFIG_BLK_DEV_BSG is not set
33321 +
33322 +#
33323 +# IO Schedulers
33324 +#
33325 +CONFIG_IOSCHED_NOOP=y
33326 +CONFIG_IOSCHED_AS=y
33327 +CONFIG_IOSCHED_DEADLINE=y
33328 +CONFIG_IOSCHED_CFQ=y
33329 +# CONFIG_DEFAULT_AS is not set
33330 +# CONFIG_DEFAULT_DEADLINE is not set
33331 +CONFIG_DEFAULT_CFQ=y
33332 +# CONFIG_DEFAULT_NOOP is not set
33333 +CONFIG_DEFAULT_IOSCHED="cfq"
33334 +
33335 +#
33336 +# Platform support
33337 +#
33338 +CONFIG_PPC_MULTIPLATFORM=y
33339 +# CONFIG_PPC_82xx is not set
33340 +# CONFIG_PPC_83xx is not set
33341 +# CONFIG_PPC_86xx is not set
33342 +CONFIG_CLASSIC32=y
33343 +# CONFIG_PPC_CHRP is not set
33344 +# CONFIG_PPC_MPC52xx is not set
33345 +# CONFIG_PPC_MPC5200 is not set
33346 +# CONFIG_PPC_EFIKA is not set
33347 +# CONFIG_PPC_LITE5200 is not set
33348 +# CONFIG_PPC_PMAC is not set
33349 +# CONFIG_PPC_CELL is not set
33350 +# CONFIG_PPC_CELL_NATIVE is not set
33351 +# CONFIG_PQ2ADS is not set
33352 +CONFIG_EMBEDDED6xx=y
33353 +# CONFIG_LINKSTATION is not set
33354 +CONFIG_STORCENTER=y
33355 +# CONFIG_MPC7448HPC2 is not set
33356 +# CONFIG_PPC_HOLLY is not set
33357 +# CONFIG_PPC_PRPMC2800 is not set
33358 +CONFIG_MPC10X_BRIDGE=y
33359 +CONFIG_MPC10X_OPENPIC=y
33360 +# CONFIG_MPC10X_STORE_GATHERING is not set
33361 +CONFIG_MPIC=y
33362 +# CONFIG_MPIC_WEIRD is not set
33363 +# CONFIG_PPC_I8259 is not set
33364 +# CONFIG_PPC_RTAS is not set
33365 +# CONFIG_MMIO_NVRAM is not set
33366 +# CONFIG_PPC_MPC106 is not set
33367 +# CONFIG_PPC_970_NAP is not set
33368 +# CONFIG_PPC_INDIRECT_IO is not set
33369 +# CONFIG_GENERIC_IOMAP is not set
33370 +# CONFIG_CPU_FREQ is not set
33371 +# CONFIG_TAU is not set
33372 +# CONFIG_CPM2 is not set
33373 +# CONFIG_FSL_ULI1575 is not set
33374 +
33375 +#
33376 +# Kernel options
33377 +#
33378 +# CONFIG_HIGHMEM is not set
33379 +# CONFIG_TICK_ONESHOT is not set
33380 +# CONFIG_NO_HZ is not set
33381 +# CONFIG_HIGH_RES_TIMERS is not set
33382 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
33383 +CONFIG_HZ_100=y
33384 +# CONFIG_HZ_250 is not set
33385 +# CONFIG_HZ_300 is not set
33386 +# CONFIG_HZ_1000 is not set
33387 +CONFIG_HZ=100
33388 +CONFIG_PREEMPT_NONE=y
33389 +# CONFIG_PREEMPT_VOLUNTARY is not set
33390 +# CONFIG_PREEMPT is not set
33391 +CONFIG_BINFMT_ELF=y
33392 +CONFIG_BINFMT_MISC=y
33393 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
33394 +# CONFIG_KEXEC is not set
33395 +CONFIG_ARCH_FLATMEM_ENABLE=y
33396 +CONFIG_ARCH_POPULATES_NODE_MAP=y
33397 +CONFIG_SELECT_MEMORY_MODEL=y
33398 +CONFIG_FLATMEM_MANUAL=y
33399 +# CONFIG_DISCONTIGMEM_MANUAL is not set
33400 +# CONFIG_SPARSEMEM_MANUAL is not set
33401 +CONFIG_FLATMEM=y
33402 +CONFIG_FLAT_NODE_MEM_MAP=y
33403 +# CONFIG_SPARSEMEM_STATIC is not set
33404 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
33405 +CONFIG_SPLIT_PTLOCK_CPUS=4
33406 +# CONFIG_RESOURCES_64BIT is not set
33407 +CONFIG_ZONE_DMA_FLAG=1
33408 +CONFIG_BOUNCE=y
33409 +CONFIG_VIRT_TO_BUS=y
33410 +CONFIG_PROC_DEVICETREE=y
33411 +CONFIG_CMDLINE_BOOL=y
33412 +CONFIG_CMDLINE="console=ttyS0,115200"
33413 +# CONFIG_PM is not set
33414 +CONFIG_SUSPEND_UP_POSSIBLE=y
33415 +CONFIG_HIBERNATION_UP_POSSIBLE=y
33416 +# CONFIG_SECCOMP is not set
33417 +CONFIG_WANT_DEVICE_TREE=y
33418 +CONFIG_DEVICE_TREE="storcenter.dts"
33419 +CONFIG_ISA_DMA_API=y
33420 +
33421 +#
33422 +# Bus options
33423 +#
33424 +CONFIG_ZONE_DMA=y
33425 +CONFIG_GENERIC_ISA_DMA=y
33426 +CONFIG_PPC_INDIRECT_PCI=y
33427 +CONFIG_FSL_SOC=y
33428 +CONFIG_PCI=y
33429 +CONFIG_PCI_DOMAINS=y
33430 +CONFIG_PCI_SYSCALL=y
33431 +# CONFIG_PCIEPORTBUS is not set
33432 +CONFIG_ARCH_SUPPORTS_MSI=y
33433 +# CONFIG_PCI_MSI is not set
33434 +CONFIG_PCI_LEGACY=y
33435 +# CONFIG_PCCARD is not set
33436 +# CONFIG_HOTPLUG_PCI is not set
33437 +
33438 +#
33439 +# Advanced setup
33440 +#
33441 +# CONFIG_ADVANCED_OPTIONS is not set
33442 +
33443 +#
33444 +# Default settings for advanced configuration options are used
33445 +#
33446 +CONFIG_HIGHMEM_START=0xfe000000
33447 +CONFIG_LOWMEM_SIZE=0x30000000
33448 +CONFIG_KERNEL_START=0xc0000000
33449 +CONFIG_TASK_SIZE=0xc0000000
33450 +CONFIG_BOOT_LOAD=0x00800000
33451 +
33452 +#
33453 +# Networking
33454 +#
33455 +CONFIG_NET=y
33456 +
33457 +#
33458 +# Networking options
33459 +#
33460 +CONFIG_PACKET=m
33461 +# CONFIG_PACKET_MMAP is not set
33462 +CONFIG_UNIX=y
33463 +# CONFIG_NET_KEY is not set
33464 +CONFIG_INET=y
33465 +CONFIG_IP_MULTICAST=y
33466 +# CONFIG_IP_ADVANCED_ROUTER is not set
33467 +CONFIG_IP_FIB_HASH=y
33468 +CONFIG_IP_PNP=y
33469 +CONFIG_IP_PNP_DHCP=y
33470 +# CONFIG_IP_PNP_BOOTP is not set
33471 +# CONFIG_IP_PNP_RARP is not set
33472 +# CONFIG_NET_IPIP is not set
33473 +# CONFIG_NET_IPGRE is not set
33474 +# CONFIG_IP_MROUTE is not set
33475 +# CONFIG_ARPD is not set
33476 +# CONFIG_SYN_COOKIES is not set
33477 +# CONFIG_INET_AH is not set
33478 +# CONFIG_INET_ESP is not set
33479 +# CONFIG_INET_IPCOMP is not set
33480 +# CONFIG_INET_XFRM_TUNNEL is not set
33481 +# CONFIG_INET_TUNNEL is not set
33482 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
33483 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
33484 +# CONFIG_INET_XFRM_MODE_BEET is not set
33485 +# CONFIG_INET_LRO is not set
33486 +CONFIG_INET_DIAG=y
33487 +CONFIG_INET_TCP_DIAG=y
33488 +# CONFIG_TCP_CONG_ADVANCED is not set
33489 +CONFIG_TCP_CONG_CUBIC=y
33490 +CONFIG_DEFAULT_TCP_CONG="cubic"
33491 +# CONFIG_TCP_MD5SIG is not set
33492 +# CONFIG_IPV6 is not set
33493 +# CONFIG_INET6_XFRM_TUNNEL is not set
33494 +# CONFIG_INET6_TUNNEL is not set
33495 +# CONFIG_NETWORK_SECMARK is not set
33496 +# CONFIG_NETFILTER is not set
33497 +# CONFIG_IP_DCCP is not set
33498 +# CONFIG_IP_SCTP is not set
33499 +# CONFIG_TIPC is not set
33500 +# CONFIG_ATM is not set
33501 +# CONFIG_BRIDGE is not set
33502 +# CONFIG_VLAN_8021Q is not set
33503 +# CONFIG_DECNET is not set
33504 +# CONFIG_LLC2 is not set
33505 +# CONFIG_IPX is not set
33506 +# CONFIG_ATALK is not set
33507 +# CONFIG_X25 is not set
33508 +# CONFIG_LAPB is not set
33509 +# CONFIG_ECONET is not set
33510 +# CONFIG_WAN_ROUTER is not set
33511 +# CONFIG_NET_SCHED is not set
33512 +
33513 +#
33514 +# Network testing
33515 +#
33516 +# CONFIG_NET_PKTGEN is not set
33517 +# CONFIG_HAMRADIO is not set
33518 +# CONFIG_IRDA is not set
33519 +# CONFIG_BT is not set
33520 +# CONFIG_AF_RXRPC is not set
33521 +
33522 +#
33523 +# Wireless
33524 +#
33525 +# CONFIG_CFG80211 is not set
33526 +# CONFIG_WIRELESS_EXT is not set
33527 +# CONFIG_MAC80211 is not set
33528 +# CONFIG_IEEE80211 is not set
33529 +# CONFIG_RFKILL is not set
33530 +# CONFIG_NET_9P is not set
33531 +
33532 +#
33533 +# Device Drivers
33534 +#
33535 +
33536 +#
33537 +# Generic Driver Options
33538 +#
33539 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
33540 +CONFIG_STANDALONE=y
33541 +CONFIG_PREVENT_FIRMWARE_BUILD=y
33542 +# CONFIG_FW_LOADER is not set
33543 +# CONFIG_SYS_HYPERVISOR is not set
33544 +# CONFIG_CONNECTOR is not set
33545 +CONFIG_MTD=y
33546 +# CONFIG_MTD_DEBUG is not set
33547 +# CONFIG_MTD_CONCAT is not set
33548 +CONFIG_MTD_PARTITIONS=y
33549 +# CONFIG_MTD_REDBOOT_PARTS is not set
33550 +# CONFIG_MTD_CMDLINE_PARTS is not set
33551 +
33552 +#
33553 +# User Modules And Translation Layers
33554 +#
33555 +CONFIG_MTD_CHAR=y
33556 +CONFIG_MTD_BLKDEVS=y
33557 +CONFIG_MTD_BLOCK=y
33558 +CONFIG_FTL=y
33559 +CONFIG_NFTL=y
33560 +CONFIG_NFTL_RW=y
33561 +# CONFIG_INFTL is not set
33562 +# CONFIG_RFD_FTL is not set
33563 +# CONFIG_SSFDC is not set
33564 +# CONFIG_MTD_OOPS is not set
33565 +
33566 +#
33567 +# RAM/ROM/Flash chip drivers
33568 +#
33569 +CONFIG_MTD_CFI=y
33570 +# CONFIG_MTD_JEDECPROBE is not set
33571 +CONFIG_MTD_GEN_PROBE=y
33572 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
33573 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
33574 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
33575 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
33576 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
33577 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
33578 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
33579 +CONFIG_MTD_CFI_I1=y
33580 +CONFIG_MTD_CFI_I2=y
33581 +# CONFIG_MTD_CFI_I4 is not set
33582 +# CONFIG_MTD_CFI_I8 is not set
33583 +# CONFIG_MTD_CFI_INTELEXT is not set
33584 +CONFIG_MTD_CFI_AMDSTD=y
33585 +# CONFIG_MTD_CFI_STAA is not set
33586 +CONFIG_MTD_CFI_UTIL=y
33587 +# CONFIG_MTD_RAM is not set
33588 +# CONFIG_MTD_ROM is not set
33589 +# CONFIG_MTD_ABSENT is not set
33590 +
33591 +#
33592 +# Mapping drivers for chip access
33593 +#
33594 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
33595 +CONFIG_MTD_PHYSMAP=y
33596 +CONFIG_MTD_PHYSMAP_START=0xFF800000
33597 +CONFIG_MTD_PHYSMAP_LEN=0x00800000
33598 +CONFIG_MTD_PHYSMAP_BANKWIDTH=1
33599 +# CONFIG_MTD_PHYSMAP_OF is not set
33600 +# CONFIG_MTD_INTEL_VR_NOR is not set
33601 +# CONFIG_MTD_PLATRAM is not set
33602 +
33603 +#
33604 +# Self-contained MTD device drivers
33605 +#
33606 +# CONFIG_MTD_PMC551 is not set
33607 +# CONFIG_MTD_SLRAM is not set
33608 +# CONFIG_MTD_PHRAM is not set
33609 +# CONFIG_MTD_MTDRAM is not set
33610 +# CONFIG_MTD_BLOCK2MTD is not set
33611 +
33612 +#
33613 +# Disk-On-Chip Device Drivers
33614 +#
33615 +# CONFIG_MTD_DOC2000 is not set
33616 +# CONFIG_MTD_DOC2001 is not set
33617 +# CONFIG_MTD_DOC2001PLUS is not set
33618 +# CONFIG_MTD_NAND is not set
33619 +# CONFIG_MTD_ONENAND is not set
33620 +
33621 +#
33622 +# UBI - Unsorted block images
33623 +#
33624 +# CONFIG_MTD_UBI is not set
33625 +CONFIG_OF_DEVICE=y
33626 +# CONFIG_PARPORT is not set
33627 +CONFIG_BLK_DEV=y
33628 +# CONFIG_BLK_DEV_FD is not set
33629 +# CONFIG_BLK_CPQ_DA is not set
33630 +# CONFIG_BLK_CPQ_CISS_DA is not set
33631 +# CONFIG_BLK_DEV_DAC960 is not set
33632 +# CONFIG_BLK_DEV_UMEM is not set
33633 +# CONFIG_BLK_DEV_COW_COMMON is not set
33634 +# CONFIG_BLK_DEV_LOOP is not set
33635 +# CONFIG_BLK_DEV_NBD is not set
33636 +# CONFIG_BLK_DEV_SX8 is not set
33637 +# CONFIG_BLK_DEV_UB is not set
33638 +# CONFIG_BLK_DEV_RAM is not set
33639 +# CONFIG_CDROM_PKTCDVD is not set
33640 +# CONFIG_ATA_OVER_ETH is not set
33641 +CONFIG_MISC_DEVICES=y
33642 +# CONFIG_PHANTOM is not set
33643 +# CONFIG_EEPROM_93CX6 is not set
33644 +# CONFIG_SGI_IOC4 is not set
33645 +# CONFIG_TIFM_CORE is not set
33646 +CONFIG_IDE=y
33647 +CONFIG_IDE_MAX_HWIFS=4
33648 +CONFIG_BLK_DEV_IDE=y
33649 +
33650 +#
33651 +# Please see Documentation/ide.txt for help/info on IDE drives
33652 +#
33653 +# CONFIG_BLK_DEV_IDE_SATA is not set
33654 +CONFIG_BLK_DEV_IDEDISK=y
33655 +CONFIG_IDEDISK_MULTI_MODE=y
33656 +# CONFIG_BLK_DEV_IDECD is not set
33657 +# CONFIG_BLK_DEV_IDETAPE is not set
33658 +# CONFIG_BLK_DEV_IDEFLOPPY is not set
33659 +# CONFIG_BLK_DEV_IDESCSI is not set
33660 +# CONFIG_IDE_TASK_IOCTL is not set
33661 +CONFIG_IDE_PROC_FS=y
33662 +
33663 +#
33664 +# IDE chipset support/bugfixes
33665 +#
33666 +CONFIG_IDE_GENERIC=y
33667 +# CONFIG_BLK_DEV_PLATFORM is not set
33668 +
33669 +#
33670 +# PCI IDE chipsets support
33671 +#
33672 +CONFIG_BLK_DEV_IDEPCI=y
33673 +# CONFIG_IDEPCI_SHARE_IRQ is not set
33674 +CONFIG_IDEPCI_PCIBUS_ORDER=y
33675 +# CONFIG_BLK_DEV_GENERIC is not set
33676 +# CONFIG_BLK_DEV_OPTI621 is not set
33677 +CONFIG_BLK_DEV_IDEDMA_PCI=y
33678 +# CONFIG_BLK_DEV_AEC62XX is not set
33679 +# CONFIG_BLK_DEV_ALI15X3 is not set
33680 +# CONFIG_BLK_DEV_AMD74XX is not set
33681 +# CONFIG_BLK_DEV_CMD64X is not set
33682 +# CONFIG_BLK_DEV_TRIFLEX is not set
33683 +# CONFIG_BLK_DEV_CY82C693 is not set
33684 +# CONFIG_BLK_DEV_CS5520 is not set
33685 +# CONFIG_BLK_DEV_CS5530 is not set
33686 +# CONFIG_BLK_DEV_HPT34X is not set
33687 +# CONFIG_BLK_DEV_HPT366 is not set
33688 +# CONFIG_BLK_DEV_JMICRON is not set
33689 +# CONFIG_BLK_DEV_SC1200 is not set
33690 +# CONFIG_BLK_DEV_PIIX is not set
33691 +# CONFIG_BLK_DEV_IT8213 is not set
33692 +# CONFIG_BLK_DEV_IT821X is not set
33693 +# CONFIG_BLK_DEV_NS87415 is not set
33694 +# CONFIG_BLK_DEV_PDC202XX_OLD is not set
33695 +# CONFIG_BLK_DEV_PDC202XX_NEW is not set
33696 +# CONFIG_BLK_DEV_SVWKS is not set
33697 +# CONFIG_BLK_DEV_SIIMAGE is not set
33698 +# CONFIG_BLK_DEV_SL82C105 is not set
33699 +# CONFIG_BLK_DEV_SLC90E66 is not set
33700 +# CONFIG_BLK_DEV_TRM290 is not set
33701 +CONFIG_BLK_DEV_VIA82CXXX=y
33702 +# CONFIG_BLK_DEV_TC86C001 is not set
33703 +# CONFIG_IDE_ARM is not set
33704 +CONFIG_BLK_DEV_IDEDMA=y
33705 +CONFIG_IDE_ARCH_OBSOLETE_INIT=y
33706 +# CONFIG_BLK_DEV_HD is not set
33707 +
33708 +#
33709 +# SCSI device support
33710 +#
33711 +# CONFIG_RAID_ATTRS is not set
33712 +CONFIG_SCSI=y
33713 +CONFIG_SCSI_DMA=y
33714 +# CONFIG_SCSI_TGT is not set
33715 +# CONFIG_SCSI_NETLINK is not set
33716 +CONFIG_SCSI_PROC_FS=y
33717 +
33718 +#
33719 +# SCSI support type (disk, tape, CD-ROM)
33720 +#
33721 +CONFIG_BLK_DEV_SD=y
33722 +# CONFIG_CHR_DEV_ST is not set
33723 +# CONFIG_CHR_DEV_OSST is not set
33724 +CONFIG_BLK_DEV_SR=y
33725 +# CONFIG_BLK_DEV_SR_VENDOR is not set
33726 +# CONFIG_CHR_DEV_SG is not set
33727 +# CONFIG_CHR_DEV_SCH is not set
33728 +
33729 +#
33730 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
33731 +#
33732 +# CONFIG_SCSI_MULTI_LUN is not set
33733 +# CONFIG_SCSI_CONSTANTS is not set
33734 +# CONFIG_SCSI_LOGGING is not set
33735 +# CONFIG_SCSI_SCAN_ASYNC is not set
33736 +CONFIG_SCSI_WAIT_SCAN=m
33737 +
33738 +#
33739 +# SCSI Transports
33740 +#
33741 +CONFIG_SCSI_SPI_ATTRS=y
33742 +# CONFIG_SCSI_FC_ATTRS is not set
33743 +# CONFIG_SCSI_ISCSI_ATTRS is not set
33744 +# CONFIG_SCSI_SAS_LIBSAS is not set
33745 +# CONFIG_SCSI_SRP_ATTRS is not set
33746 +CONFIG_SCSI_LOWLEVEL=y
33747 +# CONFIG_ISCSI_TCP is not set
33748 +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
33749 +# CONFIG_SCSI_3W_9XXX is not set
33750 +# CONFIG_SCSI_ACARD is not set
33751 +# CONFIG_SCSI_AACRAID is not set
33752 +# CONFIG_SCSI_AIC7XXX is not set
33753 +# CONFIG_SCSI_AIC7XXX_OLD is not set
33754 +# CONFIG_SCSI_AIC79XX is not set
33755 +# CONFIG_SCSI_AIC94XX is not set
33756 +# CONFIG_SCSI_DPT_I2O is not set
33757 +# CONFIG_SCSI_ADVANSYS is not set
33758 +# CONFIG_SCSI_ARCMSR is not set
33759 +# CONFIG_MEGARAID_NEWGEN is not set
33760 +# CONFIG_MEGARAID_LEGACY is not set
33761 +# CONFIG_MEGARAID_SAS is not set
33762 +# CONFIG_SCSI_HPTIOP is not set
33763 +# CONFIG_SCSI_BUSLOGIC is not set
33764 +# CONFIG_SCSI_DMX3191D is not set
33765 +# CONFIG_SCSI_EATA is not set
33766 +# CONFIG_SCSI_FUTURE_DOMAIN is not set
33767 +# CONFIG_SCSI_GDTH is not set
33768 +# CONFIG_SCSI_IPS is not set
33769 +# CONFIG_SCSI_INITIO is not set
33770 +# CONFIG_SCSI_INIA100 is not set
33771 +# CONFIG_SCSI_STEX is not set
33772 +# CONFIG_SCSI_SYM53C8XX_2 is not set
33773 +# CONFIG_SCSI_QLOGIC_1280 is not set
33774 +# CONFIG_SCSI_QLA_FC is not set
33775 +# CONFIG_SCSI_QLA_ISCSI is not set
33776 +# CONFIG_SCSI_LPFC is not set
33777 +# CONFIG_SCSI_DC395x is not set
33778 +# CONFIG_SCSI_DC390T is not set
33779 +# CONFIG_SCSI_NSP32 is not set
33780 +# CONFIG_SCSI_DEBUG is not set
33781 +# CONFIG_SCSI_SRP is not set
33782 +# CONFIG_ATA is not set
33783 +CONFIG_MD=y
33784 +CONFIG_BLK_DEV_MD=y
33785 +CONFIG_MD_LINEAR=y
33786 +CONFIG_MD_RAID0=y
33787 +CONFIG_MD_RAID1=y
33788 +# CONFIG_MD_RAID10 is not set
33789 +CONFIG_MD_RAID456=y
33790 +CONFIG_MD_RAID5_RESHAPE=y
33791 +# CONFIG_MD_MULTIPATH is not set
33792 +# CONFIG_MD_FAULTY is not set
33793 +# CONFIG_BLK_DEV_DM is not set
33794 +# CONFIG_FUSION is not set
33795 +
33796 +#
33797 +# IEEE 1394 (FireWire) support
33798 +#
33799 +# CONFIG_FIREWIRE is not set
33800 +# CONFIG_IEEE1394 is not set
33801 +# CONFIG_I2O is not set
33802 +# CONFIG_MACINTOSH_DRIVERS is not set
33803 +CONFIG_NETDEVICES=y
33804 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
33805 +CONFIG_DUMMY=m
33806 +# CONFIG_BONDING is not set
33807 +# CONFIG_MACVLAN is not set
33808 +# CONFIG_EQUALIZER is not set
33809 +# CONFIG_TUN is not set
33810 +# CONFIG_VETH is not set
33811 +# CONFIG_IP1000 is not set
33812 +# CONFIG_ARCNET is not set
33813 +# CONFIG_NET_ETHERNET is not set
33814 +CONFIG_NETDEV_1000=y
33815 +# CONFIG_ACENIC is not set
33816 +# CONFIG_DL2K is not set
33817 +# CONFIG_E1000 is not set
33818 +# CONFIG_E1000E is not set
33819 +# CONFIG_NS83820 is not set
33820 +# CONFIG_HAMACHI is not set
33821 +# CONFIG_YELLOWFIN is not set
33822 +CONFIG_R8169=y
33823 +# CONFIG_R8169_NAPI is not set
33824 +# CONFIG_SIS190 is not set
33825 +# CONFIG_SKGE is not set
33826 +# CONFIG_SKY2 is not set
33827 +# CONFIG_SK98LIN is not set
33828 +# CONFIG_VIA_VELOCITY is not set
33829 +# CONFIG_TIGON3 is not set
33830 +# CONFIG_BNX2 is not set
33831 +# CONFIG_MV643XX_ETH is not set
33832 +# CONFIG_QLA3XXX is not set
33833 +# CONFIG_ATL1 is not set
33834 +# CONFIG_NETDEV_10000 is not set
33835 +# CONFIG_TR is not set
33836 +
33837 +#
33838 +# Wireless LAN
33839 +#
33840 +# CONFIG_WLAN_PRE80211 is not set
33841 +# CONFIG_WLAN_80211 is not set
33842 +
33843 +#
33844 +# USB Network Adapters
33845 +#
33846 +# CONFIG_USB_CATC is not set
33847 +# CONFIG_USB_KAWETH is not set
33848 +# CONFIG_USB_PEGASUS is not set
33849 +# CONFIG_USB_RTL8150 is not set
33850 +# CONFIG_USB_USBNET is not set
33851 +# CONFIG_WAN is not set
33852 +# CONFIG_FDDI is not set
33853 +# CONFIG_HIPPI is not set
33854 +# CONFIG_PPP is not set
33855 +# CONFIG_SLIP is not set
33856 +# CONFIG_NET_FC is not set
33857 +# CONFIG_SHAPER is not set
33858 +# CONFIG_NETCONSOLE is not set
33859 +# CONFIG_NETPOLL is not set
33860 +# CONFIG_NET_POLL_CONTROLLER is not set
33861 +# CONFIG_ISDN is not set
33862 +# CONFIG_PHONE is not set
33863 +
33864 +#
33865 +# Input device support
33866 +#
33867 +# CONFIG_INPUT is not set
33868 +
33869 +#
33870 +# Hardware I/O ports
33871 +#
33872 +# CONFIG_SERIO is not set
33873 +# CONFIG_GAMEPORT is not set
33874 +
33875 +#
33876 +# Character devices
33877 +#
33878 +# CONFIG_VT is not set
33879 +# CONFIG_SERIAL_NONSTANDARD is not set
33880 +
33881 +#
33882 +# Serial drivers
33883 +#
33884 +CONFIG_SERIAL_8250=y
33885 +CONFIG_SERIAL_8250_CONSOLE=y
33886 +# CONFIG_SERIAL_8250_PCI is not set
33887 +CONFIG_SERIAL_8250_NR_UARTS=2
33888 +CONFIG_SERIAL_8250_RUNTIME_UARTS=2
33889 +# CONFIG_SERIAL_8250_EXTENDED is not set
33890 +
33891 +#
33892 +# Non-8250 serial port support
33893 +#
33894 +# CONFIG_SERIAL_UARTLITE is not set
33895 +CONFIG_SERIAL_CORE=y
33896 +CONFIG_SERIAL_CORE_CONSOLE=y
33897 +# CONFIG_SERIAL_JSM is not set
33898 +# CONFIG_SERIAL_OF_PLATFORM is not set
33899 +CONFIG_UNIX98_PTYS=y
33900 +CONFIG_LEGACY_PTYS=y
33901 +CONFIG_LEGACY_PTY_COUNT=256
33902 +# CONFIG_IPMI_HANDLER is not set
33903 +CONFIG_HW_RANDOM=m
33904 +CONFIG_NVRAM=y
33905 +CONFIG_GEN_RTC=y
33906 +# CONFIG_GEN_RTC_X is not set
33907 +# CONFIG_R3964 is not set
33908 +# CONFIG_APPLICOM is not set
33909 +# CONFIG_RAW_DRIVER is not set
33910 +# CONFIG_TCG_TPM is not set
33911 +CONFIG_DEVPORT=y
33912 +CONFIG_I2C=y
33913 +CONFIG_I2C_BOARDINFO=y
33914 +CONFIG_I2C_CHARDEV=y
33915 +
33916 +#
33917 +# I2C Algorithms
33918 +#
33919 +# CONFIG_I2C_ALGOBIT is not set
33920 +# CONFIG_I2C_ALGOPCF is not set
33921 +# CONFIG_I2C_ALGOPCA is not set
33922 +
33923 +#
33924 +# I2C Hardware Bus support
33925 +#
33926 +# CONFIG_I2C_ALI1535 is not set
33927 +# CONFIG_I2C_ALI1563 is not set
33928 +# CONFIG_I2C_ALI15X3 is not set
33929 +# CONFIG_I2C_AMD756 is not set
33930 +# CONFIG_I2C_AMD8111 is not set
33931 +# CONFIG_I2C_I801 is not set
33932 +# CONFIG_I2C_I810 is not set
33933 +# CONFIG_I2C_PIIX4 is not set
33934 +CONFIG_I2C_MPC=y
33935 +# CONFIG_I2C_NFORCE2 is not set
33936 +# CONFIG_I2C_OCORES is not set
33937 +# CONFIG_I2C_PARPORT_LIGHT is not set
33938 +# CONFIG_I2C_PROSAVAGE is not set
33939 +# CONFIG_I2C_SAVAGE4 is not set
33940 +# CONFIG_I2C_SIMTEC is not set
33941 +# CONFIG_I2C_SIS5595 is not set
33942 +# CONFIG_I2C_SIS630 is not set
33943 +# CONFIG_I2C_SIS96X is not set
33944 +# CONFIG_I2C_TAOS_EVM is not set
33945 +# CONFIG_I2C_STUB is not set
33946 +# CONFIG_I2C_TINY_USB is not set
33947 +# CONFIG_I2C_VIA is not set
33948 +# CONFIG_I2C_VIAPRO is not set
33949 +# CONFIG_I2C_VOODOO3 is not set
33950 +
33951 +#
33952 +# Miscellaneous I2C Chip support
33953 +#
33954 +# CONFIG_SENSORS_DS1337 is not set
33955 +# CONFIG_SENSORS_DS1374 is not set
33956 +# CONFIG_DS1682 is not set
33957 +# CONFIG_SENSORS_EEPROM is not set
33958 +# CONFIG_SENSORS_PCF8574 is not set
33959 +# CONFIG_SENSORS_PCA9539 is not set
33960 +# CONFIG_SENSORS_PCF8591 is not set
33961 +# CONFIG_SENSORS_M41T00 is not set
33962 +# CONFIG_SENSORS_MAX6875 is not set
33963 +# CONFIG_SENSORS_TSL2550 is not set
33964 +# CONFIG_I2C_DEBUG_CORE is not set
33965 +# CONFIG_I2C_DEBUG_ALGO is not set
33966 +# CONFIG_I2C_DEBUG_BUS is not set
33967 +# CONFIG_I2C_DEBUG_CHIP is not set
33968 +
33969 +#
33970 +# SPI support
33971 +#
33972 +# CONFIG_SPI is not set
33973 +# CONFIG_SPI_MASTER is not set
33974 +# CONFIG_W1 is not set
33975 +# CONFIG_POWER_SUPPLY is not set
33976 +# CONFIG_HWMON is not set
33977 +# CONFIG_WATCHDOG is not set
33978 +
33979 +#
33980 +# Sonics Silicon Backplane
33981 +#
33982 +CONFIG_SSB_POSSIBLE=y
33983 +# CONFIG_SSB is not set
33984 +
33985 +#
33986 +# Multifunction device drivers
33987 +#
33988 +# CONFIG_MFD_SM501 is not set
33989 +
33990 +#
33991 +# Multimedia devices
33992 +#
33993 +# CONFIG_VIDEO_DEV is not set
33994 +# CONFIG_DVB_CORE is not set
33995 +# CONFIG_DAB is not set
33996 +
33997 +#
33998 +# Graphics support
33999 +#
34000 +# CONFIG_AGP is not set
34001 +# CONFIG_DRM is not set
34002 +# CONFIG_VGASTATE is not set
34003 +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
34004 +# CONFIG_FB is not set
34005 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
34006 +
34007 +#
34008 +# Display device support
34009 +#
34010 +# CONFIG_DISPLAY_SUPPORT is not set
34011 +
34012 +#
34013 +# Sound
34014 +#
34015 +# CONFIG_SOUND is not set
34016 +CONFIG_USB_SUPPORT=y
34017 +CONFIG_USB_ARCH_HAS_HCD=y
34018 +CONFIG_USB_ARCH_HAS_OHCI=y
34019 +CONFIG_USB_ARCH_HAS_EHCI=y
34020 +CONFIG_USB=y
34021 +# CONFIG_USB_DEBUG is not set
34022 +
34023 +#
34024 +# Miscellaneous USB options
34025 +#
34026 +CONFIG_USB_DEVICEFS=y
34027 +CONFIG_USB_DEVICE_CLASS=y
34028 +# CONFIG_USB_DYNAMIC_MINORS is not set
34029 +# CONFIG_USB_OTG is not set
34030 +
34031 +#
34032 +# USB Host Controller Drivers
34033 +#
34034 +CONFIG_USB_EHCI_HCD=y
34035 +# CONFIG_USB_EHCI_SPLIT_ISO is not set
34036 +# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
34037 +# CONFIG_USB_EHCI_TT_NEWSCHED is not set
34038 +# CONFIG_USB_ISP116X_HCD is not set
34039 +CONFIG_USB_OHCI_HCD=y
34040 +# CONFIG_USB_OHCI_HCD_PPC_OF is not set
34041 +# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
34042 +# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
34043 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
34044 +# CONFIG_USB_UHCI_HCD is not set
34045 +# CONFIG_USB_SL811_HCD is not set
34046 +# CONFIG_USB_R8A66597_HCD is not set
34047 +
34048 +#
34049 +# USB Device Class drivers
34050 +#
34051 +# CONFIG_USB_ACM is not set
34052 +# CONFIG_USB_PRINTER is not set
34053 +
34054 +#
34055 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
34056 +#
34057 +
34058 +#
34059 +# may also be needed; see USB_STORAGE Help for more information
34060 +#
34061 +CONFIG_USB_STORAGE=y
34062 +# CONFIG_USB_STORAGE_DEBUG is not set
34063 +# CONFIG_USB_STORAGE_DATAFAB is not set
34064 +# CONFIG_USB_STORAGE_FREECOM is not set
34065 +# CONFIG_USB_STORAGE_ISD200 is not set
34066 +# CONFIG_USB_STORAGE_DPCM is not set
34067 +# CONFIG_USB_STORAGE_USBAT is not set
34068 +# CONFIG_USB_STORAGE_SDDR09 is not set
34069 +# CONFIG_USB_STORAGE_SDDR55 is not set
34070 +# CONFIG_USB_STORAGE_JUMPSHOT is not set
34071 +# CONFIG_USB_STORAGE_ALAUDA is not set
34072 +# CONFIG_USB_STORAGE_KARMA is not set
34073 +# CONFIG_USB_LIBUSUAL is not set
34074 +
34075 +#
34076 +# USB Imaging devices
34077 +#
34078 +# CONFIG_USB_MDC800 is not set
34079 +# CONFIG_USB_MICROTEK is not set
34080 +# CONFIG_USB_MON is not set
34081 +
34082 +#
34083 +# USB port drivers
34084 +#
34085 +
34086 +#
34087 +# USB Serial Converter support
34088 +#
34089 +# CONFIG_USB_SERIAL is not set
34090 +
34091 +#
34092 +# USB Miscellaneous drivers
34093 +#
34094 +# CONFIG_USB_EMI62 is not set
34095 +# CONFIG_USB_EMI26 is not set
34096 +# CONFIG_USB_ADUTUX is not set
34097 +# CONFIG_USB_AUERSWALD is not set
34098 +# CONFIG_USB_RIO500 is not set
34099 +# CONFIG_USB_LEGOTOWER is not set
34100 +# CONFIG_USB_LCD is not set
34101 +# CONFIG_USB_BERRY_CHARGE is not set
34102 +# CONFIG_USB_LED is not set
34103 +# CONFIG_USB_CYPRESS_CY7C63 is not set
34104 +# CONFIG_USB_CYTHERM is not set
34105 +# CONFIG_USB_PHIDGET is not set
34106 +# CONFIG_USB_IDMOUSE is not set
34107 +# CONFIG_USB_FTDI_ELAN is not set
34108 +# CONFIG_USB_APPLEDISPLAY is not set
34109 +# CONFIG_USB_SISUSBVGA is not set
34110 +# CONFIG_USB_LD is not set
34111 +# CONFIG_USB_TRANCEVIBRATOR is not set
34112 +# CONFIG_USB_IOWARRIOR is not set
34113 +# CONFIG_USB_TEST is not set
34114 +
34115 +#
34116 +# USB DSL modem support
34117 +#
34118 +
34119 +#
34120 +# USB Gadget Support
34121 +#
34122 +# CONFIG_USB_GADGET is not set
34123 +# CONFIG_MMC is not set
34124 +# CONFIG_NEW_LEDS is not set
34125 +# CONFIG_INFINIBAND is not set
34126 +# CONFIG_EDAC is not set
34127 +CONFIG_RTC_LIB=y
34128 +CONFIG_RTC_CLASS=y
34129 +CONFIG_RTC_HCTOSYS=y
34130 +CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
34131 +# CONFIG_RTC_DEBUG is not set
34132 +
34133 +#
34134 +# RTC interfaces
34135 +#
34136 +CONFIG_RTC_INTF_SYSFS=y
34137 +CONFIG_RTC_INTF_PROC=y
34138 +CONFIG_RTC_INTF_DEV=y
34139 +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
34140 +# CONFIG_RTC_DRV_TEST is not set
34141 +
34142 +#
34143 +# I2C RTC drivers
34144 +#
34145 +CONFIG_RTC_DRV_DS1307=y
34146 +# CONFIG_RTC_DRV_DS1374 is not set
34147 +# CONFIG_RTC_DRV_DS1672 is not set
34148 +# CONFIG_RTC_DRV_MAX6900 is not set
34149 +# CONFIG_RTC_DRV_RS5C372 is not set
34150 +# CONFIG_RTC_DRV_ISL1208 is not set
34151 +# CONFIG_RTC_DRV_X1205 is not set
34152 +# CONFIG_RTC_DRV_PCF8563 is not set
34153 +# CONFIG_RTC_DRV_PCF8583 is not set
34154 +# CONFIG_RTC_DRV_M41T80 is not set
34155 +
34156 +#
34157 +# SPI RTC drivers
34158 +#
34159 +
34160 +#
34161 +# Platform RTC drivers
34162 +#
34163 +# CONFIG_RTC_DRV_CMOS is not set
34164 +# CONFIG_RTC_DRV_DS1553 is not set
34165 +# CONFIG_RTC_DRV_STK17TA8 is not set
34166 +# CONFIG_RTC_DRV_DS1742 is not set
34167 +# CONFIG_RTC_DRV_M48T86 is not set
34168 +# CONFIG_RTC_DRV_M48T59 is not set
34169 +# CONFIG_RTC_DRV_V3020 is not set
34170 +
34171 +#
34172 +# on-CPU RTC drivers
34173 +#
34174 +
34175 +#
34176 +# Userspace I/O
34177 +#
34178 +# CONFIG_UIO is not set
34179 +
34180 +#
34181 +# File systems
34182 +#
34183 +CONFIG_EXT2_FS=y
34184 +# CONFIG_EXT2_FS_XATTR is not set
34185 +# CONFIG_EXT2_FS_XIP is not set
34186 +CONFIG_EXT3_FS=y
34187 +CONFIG_EXT3_FS_XATTR=y
34188 +# CONFIG_EXT3_FS_POSIX_ACL is not set
34189 +# CONFIG_EXT3_FS_SECURITY is not set
34190 +# CONFIG_EXT4DEV_FS is not set
34191 +CONFIG_JBD=y
34192 +CONFIG_FS_MBCACHE=y
34193 +# CONFIG_REISERFS_FS is not set
34194 +# CONFIG_JFS_FS is not set
34195 +# CONFIG_FS_POSIX_ACL is not set
34196 +CONFIG_XFS_FS=m
34197 +# CONFIG_XFS_QUOTA is not set
34198 +# CONFIG_XFS_SECURITY is not set
34199 +# CONFIG_XFS_POSIX_ACL is not set
34200 +# CONFIG_XFS_RT is not set
34201 +# CONFIG_GFS2_FS is not set
34202 +# CONFIG_OCFS2_FS is not set
34203 +# CONFIG_MINIX_FS is not set
34204 +# CONFIG_ROMFS_FS is not set
34205 +CONFIG_INOTIFY=y
34206 +CONFIG_INOTIFY_USER=y
34207 +# CONFIG_QUOTA is not set
34208 +CONFIG_DNOTIFY=y
34209 +# CONFIG_AUTOFS_FS is not set
34210 +# CONFIG_AUTOFS4_FS is not set
34211 +# CONFIG_FUSE_FS is not set
34212 +
34213 +#
34214 +# CD-ROM/DVD Filesystems
34215 +#
34216 +# CONFIG_ISO9660_FS is not set
34217 +# CONFIG_UDF_FS is not set
34218 +
34219 +#
34220 +# DOS/FAT/NT Filesystems
34221 +#
34222 +# CONFIG_MSDOS_FS is not set
34223 +# CONFIG_VFAT_FS is not set
34224 +# CONFIG_NTFS_FS is not set
34225 +
34226 +#
34227 +# Pseudo filesystems
34228 +#
34229 +CONFIG_PROC_FS=y
34230 +CONFIG_PROC_KCORE=y
34231 +CONFIG_PROC_SYSCTL=y
34232 +CONFIG_SYSFS=y
34233 +CONFIG_TMPFS=y
34234 +# CONFIG_TMPFS_POSIX_ACL is not set
34235 +# CONFIG_HUGETLB_PAGE is not set
34236 +# CONFIG_CONFIGFS_FS is not set
34237 +
34238 +#
34239 +# Miscellaneous filesystems
34240 +#
34241 +# CONFIG_ADFS_FS is not set
34242 +# CONFIG_AFFS_FS is not set
34243 +# CONFIG_HFS_FS is not set
34244 +# CONFIG_HFSPLUS_FS is not set
34245 +# CONFIG_BEFS_FS is not set
34246 +# CONFIG_BFS_FS is not set
34247 +# CONFIG_EFS_FS is not set
34248 +CONFIG_JFFS2_FS=y
34249 +CONFIG_JFFS2_FS_DEBUG=0
34250 +CONFIG_JFFS2_FS_WRITEBUFFER=y
34251 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
34252 +# CONFIG_JFFS2_SUMMARY is not set
34253 +# CONFIG_JFFS2_FS_XATTR is not set
34254 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
34255 +CONFIG_JFFS2_ZLIB=y
34256 +# CONFIG_JFFS2_LZO is not set
34257 +CONFIG_JFFS2_RTIME=y
34258 +# CONFIG_JFFS2_RUBIN is not set
34259 +# CONFIG_CRAMFS is not set
34260 +# CONFIG_VXFS_FS is not set
34261 +# CONFIG_HPFS_FS is not set
34262 +# CONFIG_QNX4FS_FS is not set
34263 +# CONFIG_SYSV_FS is not set
34264 +# CONFIG_UFS_FS is not set
34265 +# CONFIG_NETWORK_FILESYSTEMS is not set
34266 +
34267 +#
34268 +# Partition Types
34269 +#
34270 +CONFIG_PARTITION_ADVANCED=y
34271 +# CONFIG_ACORN_PARTITION is not set
34272 +# CONFIG_OSF_PARTITION is not set
34273 +# CONFIG_AMIGA_PARTITION is not set
34274 +# CONFIG_ATARI_PARTITION is not set
34275 +# CONFIG_MAC_PARTITION is not set
34276 +CONFIG_MSDOS_PARTITION=y
34277 +# CONFIG_BSD_DISKLABEL is not set
34278 +# CONFIG_MINIX_SUBPARTITION is not set
34279 +# CONFIG_SOLARIS_X86_PARTITION is not set
34280 +# CONFIG_UNIXWARE_DISKLABEL is not set
34281 +# CONFIG_LDM_PARTITION is not set
34282 +# CONFIG_SGI_PARTITION is not set
34283 +# CONFIG_ULTRIX_PARTITION is not set
34284 +# CONFIG_SUN_PARTITION is not set
34285 +# CONFIG_KARMA_PARTITION is not set
34286 +# CONFIG_EFI_PARTITION is not set
34287 +# CONFIG_SYSV68_PARTITION is not set
34288 +CONFIG_NLS=y
34289 +CONFIG_NLS_DEFAULT="utf8"
34290 +CONFIG_NLS_CODEPAGE_437=y
34291 +# CONFIG_NLS_CODEPAGE_737 is not set
34292 +# CONFIG_NLS_CODEPAGE_775 is not set
34293 +# CONFIG_NLS_CODEPAGE_850 is not set
34294 +# CONFIG_NLS_CODEPAGE_852 is not set
34295 +# CONFIG_NLS_CODEPAGE_855 is not set
34296 +# CONFIG_NLS_CODEPAGE_857 is not set
34297 +# CONFIG_NLS_CODEPAGE_860 is not set
34298 +# CONFIG_NLS_CODEPAGE_861 is not set
34299 +# CONFIG_NLS_CODEPAGE_862 is not set
34300 +# CONFIG_NLS_CODEPAGE_863 is not set
34301 +# CONFIG_NLS_CODEPAGE_864 is not set
34302 +# CONFIG_NLS_CODEPAGE_865 is not set
34303 +# CONFIG_NLS_CODEPAGE_866 is not set
34304 +# CONFIG_NLS_CODEPAGE_869 is not set
34305 +# CONFIG_NLS_CODEPAGE_936 is not set
34306 +# CONFIG_NLS_CODEPAGE_950 is not set
34307 +# CONFIG_NLS_CODEPAGE_932 is not set
34308 +# CONFIG_NLS_CODEPAGE_949 is not set
34309 +# CONFIG_NLS_CODEPAGE_874 is not set
34310 +# CONFIG_NLS_ISO8859_8 is not set
34311 +# CONFIG_NLS_CODEPAGE_1250 is not set
34312 +# CONFIG_NLS_CODEPAGE_1251 is not set
34313 +# CONFIG_NLS_ASCII is not set
34314 +CONFIG_NLS_ISO8859_1=y
34315 +# CONFIG_NLS_ISO8859_2 is not set
34316 +# CONFIG_NLS_ISO8859_3 is not set
34317 +# CONFIG_NLS_ISO8859_4 is not set
34318 +# CONFIG_NLS_ISO8859_5 is not set
34319 +# CONFIG_NLS_ISO8859_6 is not set
34320 +# CONFIG_NLS_ISO8859_7 is not set
34321 +# CONFIG_NLS_ISO8859_9 is not set
34322 +# CONFIG_NLS_ISO8859_13 is not set
34323 +# CONFIG_NLS_ISO8859_14 is not set
34324 +# CONFIG_NLS_ISO8859_15 is not set
34325 +# CONFIG_NLS_KOI8_R is not set
34326 +# CONFIG_NLS_KOI8_U is not set
34327 +CONFIG_NLS_UTF8=y
34328 +# CONFIG_DLM is not set
34329 +# CONFIG_UCC_SLOW is not set
34330 +
34331 +#
34332 +# Library routines
34333 +#
34334 +CONFIG_BITREVERSE=y
34335 +# CONFIG_CRC_CCITT is not set
34336 +# CONFIG_CRC16 is not set
34337 +# CONFIG_CRC_ITU_T is not set
34338 +CONFIG_CRC32=y
34339 +# CONFIG_CRC7 is not set
34340 +# CONFIG_LIBCRC32C is not set
34341 +CONFIG_ZLIB_INFLATE=y
34342 +CONFIG_ZLIB_DEFLATE=y
34343 +CONFIG_PLIST=y
34344 +CONFIG_HAS_IOMEM=y
34345 +CONFIG_HAS_IOPORT=y
34346 +CONFIG_HAS_DMA=y
34347 +CONFIG_INSTRUMENTATION=y
34348 +# CONFIG_PROFILING is not set
34349 +# CONFIG_MARKERS is not set
34350 +
34351 +#
34352 +# Kernel hacking
34353 +#
34354 +# CONFIG_PRINTK_TIME is not set
34355 +# CONFIG_ENABLE_WARN_DEPRECATED is not set
34356 +# CONFIG_ENABLE_MUST_CHECK is not set
34357 +# CONFIG_MAGIC_SYSRQ is not set
34358 +# CONFIG_UNUSED_SYMBOLS is not set
34359 +# CONFIG_DEBUG_FS is not set
34360 +# CONFIG_HEADERS_CHECK is not set
34361 +# CONFIG_DEBUG_KERNEL is not set
34362 +# CONFIG_SLUB_DEBUG_ON is not set
34363 +# CONFIG_DEBUG_BUGVERBOSE is not set
34364 +# CONFIG_SAMPLES is not set
34365 +# CONFIG_BOOTX_TEXT is not set
34366 +# CONFIG_PPC_EARLY_DEBUG is not set
34367 +
34368 +#
34369 +# Security options
34370 +#
34371 +# CONFIG_KEYS is not set
34372 +# CONFIG_SECURITY is not set
34373 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
34374 +CONFIG_XOR_BLOCKS=y
34375 +CONFIG_ASYNC_CORE=y
34376 +CONFIG_ASYNC_MEMCPY=y
34377 +CONFIG_ASYNC_XOR=y
34378 +# CONFIG_CRYPTO is not set
34379 +# CONFIG_PPC_CLOCK is not set
34380 --- /dev/null
34381 +++ b/arch/powerpc/configs/taishan_defconfig
34382 @@ -0,0 +1,790 @@
34383 +#
34384 +# Automatically generated make config: don't edit
34385 +# Linux kernel version: 2.6.24-rc6
34386 +# Mon Dec 24 11:23:39 2007
34387 +#
34388 +# CONFIG_PPC64 is not set
34389 +
34390 +#
34391 +# Processor support
34392 +#
34393 +# CONFIG_6xx is not set
34394 +# CONFIG_PPC_85xx is not set
34395 +# CONFIG_PPC_8xx is not set
34396 +# CONFIG_40x is not set
34397 +CONFIG_44x=y
34398 +# CONFIG_E200 is not set
34399 +CONFIG_4xx=y
34400 +CONFIG_BOOKE=y
34401 +CONFIG_PTE_64BIT=y
34402 +CONFIG_PHYS_64BIT=y
34403 +# CONFIG_PPC_MM_SLICES is not set
34404 +CONFIG_NOT_COHERENT_CACHE=y
34405 +CONFIG_PPC32=y
34406 +CONFIG_WORD_SIZE=32
34407 +CONFIG_PPC_MERGE=y
34408 +CONFIG_MMU=y
34409 +CONFIG_GENERIC_CMOS_UPDATE=y
34410 +CONFIG_GENERIC_TIME=y
34411 +CONFIG_GENERIC_TIME_VSYSCALL=y
34412 +CONFIG_GENERIC_CLOCKEVENTS=y
34413 +CONFIG_GENERIC_HARDIRQS=y
34414 +CONFIG_IRQ_PER_CPU=y
34415 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
34416 +CONFIG_ARCH_HAS_ILOG2_U32=y
34417 +CONFIG_GENERIC_HWEIGHT=y
34418 +CONFIG_GENERIC_CALIBRATE_DELAY=y
34419 +CONFIG_GENERIC_FIND_NEXT_BIT=y
34420 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
34421 +CONFIG_PPC=y
34422 +CONFIG_EARLY_PRINTK=y
34423 +CONFIG_GENERIC_NVRAM=y
34424 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
34425 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
34426 +CONFIG_PPC_OF=y
34427 +CONFIG_OF=y
34428 +CONFIG_PPC_UDBG_16550=y
34429 +# CONFIG_GENERIC_TBSYNC is not set
34430 +CONFIG_AUDIT_ARCH=y
34431 +CONFIG_GENERIC_BUG=y
34432 +# CONFIG_DEFAULT_UIMAGE is not set
34433 +CONFIG_PPC_DCR_NATIVE=y
34434 +# CONFIG_PPC_DCR_MMIO is not set
34435 +CONFIG_PPC_DCR=y
34436 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
34437 +
34438 +#
34439 +# General setup
34440 +#
34441 +CONFIG_EXPERIMENTAL=y
34442 +CONFIG_BROKEN_ON_SMP=y
34443 +CONFIG_INIT_ENV_ARG_LIMIT=32
34444 +CONFIG_LOCALVERSION=""
34445 +CONFIG_LOCALVERSION_AUTO=y
34446 +CONFIG_SWAP=y
34447 +CONFIG_SYSVIPC=y
34448 +CONFIG_SYSVIPC_SYSCTL=y
34449 +CONFIG_POSIX_MQUEUE=y
34450 +# CONFIG_BSD_PROCESS_ACCT is not set
34451 +# CONFIG_TASKSTATS is not set
34452 +# CONFIG_USER_NS is not set
34453 +# CONFIG_PID_NS is not set
34454 +# CONFIG_AUDIT is not set
34455 +# CONFIG_IKCONFIG is not set
34456 +CONFIG_LOG_BUF_SHIFT=14
34457 +# CONFIG_CGROUPS is not set
34458 +CONFIG_FAIR_GROUP_SCHED=y
34459 +CONFIG_FAIR_USER_SCHED=y
34460 +# CONFIG_FAIR_CGROUP_SCHED is not set
34461 +CONFIG_SYSFS_DEPRECATED=y
34462 +# CONFIG_RELAY is not set
34463 +CONFIG_BLK_DEV_INITRD=y
34464 +CONFIG_INITRAMFS_SOURCE=""
34465 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
34466 +CONFIG_SYSCTL=y
34467 +CONFIG_EMBEDDED=y
34468 +CONFIG_SYSCTL_SYSCALL=y
34469 +CONFIG_KALLSYMS=y
34470 +# CONFIG_KALLSYMS_ALL is not set
34471 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
34472 +CONFIG_HOTPLUG=y
34473 +CONFIG_PRINTK=y
34474 +CONFIG_BUG=y
34475 +CONFIG_ELF_CORE=y
34476 +CONFIG_BASE_FULL=y
34477 +CONFIG_FUTEX=y
34478 +CONFIG_ANON_INODES=y
34479 +CONFIG_EPOLL=y
34480 +CONFIG_SIGNALFD=y
34481 +CONFIG_EVENTFD=y
34482 +CONFIG_SHMEM=y
34483 +CONFIG_VM_EVENT_COUNTERS=y
34484 +CONFIG_SLUB_DEBUG=y
34485 +# CONFIG_SLAB is not set
34486 +CONFIG_SLUB=y
34487 +# CONFIG_SLOB is not set
34488 +CONFIG_RT_MUTEXES=y
34489 +# CONFIG_TINY_SHMEM is not set
34490 +CONFIG_BASE_SMALL=0
34491 +CONFIG_MODULES=y
34492 +CONFIG_MODULE_UNLOAD=y
34493 +# CONFIG_MODULE_FORCE_UNLOAD is not set
34494 +# CONFIG_MODVERSIONS is not set
34495 +# CONFIG_MODULE_SRCVERSION_ALL is not set
34496 +CONFIG_KMOD=y
34497 +CONFIG_BLOCK=y
34498 +CONFIG_LBD=y
34499 +# CONFIG_BLK_DEV_IO_TRACE is not set
34500 +# CONFIG_LSF is not set
34501 +# CONFIG_BLK_DEV_BSG is not set
34502 +
34503 +#
34504 +# IO Schedulers
34505 +#
34506 +CONFIG_IOSCHED_NOOP=y
34507 +CONFIG_IOSCHED_AS=y
34508 +CONFIG_IOSCHED_DEADLINE=y
34509 +CONFIG_IOSCHED_CFQ=y
34510 +CONFIG_DEFAULT_AS=y
34511 +# CONFIG_DEFAULT_DEADLINE is not set
34512 +# CONFIG_DEFAULT_CFQ is not set
34513 +# CONFIG_DEFAULT_NOOP is not set
34514 +CONFIG_DEFAULT_IOSCHED="anticipatory"
34515 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
34516 +
34517 +#
34518 +# Platform support
34519 +#
34520 +# CONFIG_PPC_MPC52xx is not set
34521 +# CONFIG_PPC_MPC5200 is not set
34522 +# CONFIG_PPC_CELL is not set
34523 +# CONFIG_PPC_CELL_NATIVE is not set
34524 +# CONFIG_PQ2ADS is not set
34525 +# CONFIG_BAMBOO is not set
34526 +# CONFIG_EBONY is not set
34527 +# CONFIG_SEQUOIA is not set
34528 +CONFIG_TAISHAN=y
34529 +# CONFIG_KATMAI is not set
34530 +# CONFIG_RAINIER is not set
34531 +CONFIG_440GX=y
34532 +# CONFIG_MPIC is not set
34533 +# CONFIG_MPIC_WEIRD is not set
34534 +# CONFIG_PPC_I8259 is not set
34535 +# CONFIG_PPC_RTAS is not set
34536 +# CONFIG_MMIO_NVRAM is not set
34537 +# CONFIG_PPC_MPC106 is not set
34538 +# CONFIG_PPC_970_NAP is not set
34539 +# CONFIG_PPC_INDIRECT_IO is not set
34540 +# CONFIG_GENERIC_IOMAP is not set
34541 +# CONFIG_CPU_FREQ is not set
34542 +# CONFIG_CPM2 is not set
34543 +# CONFIG_FSL_ULI1575 is not set
34544 +
34545 +#
34546 +# Kernel options
34547 +#
34548 +# CONFIG_HIGHMEM is not set
34549 +# CONFIG_TICK_ONESHOT is not set
34550 +# CONFIG_NO_HZ is not set
34551 +# CONFIG_HIGH_RES_TIMERS is not set
34552 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
34553 +# CONFIG_HZ_100 is not set
34554 +CONFIG_HZ_250=y
34555 +# CONFIG_HZ_300 is not set
34556 +# CONFIG_HZ_1000 is not set
34557 +CONFIG_HZ=250
34558 +CONFIG_PREEMPT_NONE=y
34559 +# CONFIG_PREEMPT_VOLUNTARY is not set
34560 +# CONFIG_PREEMPT is not set
34561 +CONFIG_BINFMT_ELF=y
34562 +# CONFIG_BINFMT_MISC is not set
34563 +# CONFIG_MATH_EMULATION is not set
34564 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
34565 +CONFIG_ARCH_FLATMEM_ENABLE=y
34566 +CONFIG_ARCH_POPULATES_NODE_MAP=y
34567 +CONFIG_SELECT_MEMORY_MODEL=y
34568 +CONFIG_FLATMEM_MANUAL=y
34569 +# CONFIG_DISCONTIGMEM_MANUAL is not set
34570 +# CONFIG_SPARSEMEM_MANUAL is not set
34571 +CONFIG_FLATMEM=y
34572 +CONFIG_FLAT_NODE_MEM_MAP=y
34573 +# CONFIG_SPARSEMEM_STATIC is not set
34574 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
34575 +CONFIG_SPLIT_PTLOCK_CPUS=4
34576 +CONFIG_RESOURCES_64BIT=y
34577 +CONFIG_ZONE_DMA_FLAG=1
34578 +CONFIG_BOUNCE=y
34579 +CONFIG_VIRT_TO_BUS=y
34580 +CONFIG_PROC_DEVICETREE=y
34581 +CONFIG_CMDLINE_BOOL=y
34582 +CONFIG_CMDLINE=""
34583 +CONFIG_SECCOMP=y
34584 +CONFIG_WANT_DEVICE_TREE=y
34585 +CONFIG_DEVICE_TREE="taishan.dts"
34586 +CONFIG_ISA_DMA_API=y
34587 +
34588 +#
34589 +# Bus options
34590 +#
34591 +CONFIG_ZONE_DMA=y
34592 +CONFIG_PPC_INDIRECT_PCI=y
34593 +CONFIG_PCI=y
34594 +CONFIG_PCI_DOMAINS=y
34595 +CONFIG_PCI_SYSCALL=y
34596 +# CONFIG_PCIEPORTBUS is not set
34597 +CONFIG_ARCH_SUPPORTS_MSI=y
34598 +# CONFIG_PCI_MSI is not set
34599 +CONFIG_PCI_LEGACY=y
34600 +# CONFIG_PCI_DEBUG is not set
34601 +# CONFIG_PCCARD is not set
34602 +# CONFIG_HOTPLUG_PCI is not set
34603 +
34604 +#
34605 +# Advanced setup
34606 +#
34607 +# CONFIG_ADVANCED_OPTIONS is not set
34608 +
34609 +#
34610 +# Default settings for advanced configuration options are used
34611 +#
34612 +CONFIG_HIGHMEM_START=0xfe000000
34613 +CONFIG_LOWMEM_SIZE=0x30000000
34614 +CONFIG_KERNEL_START=0xc0000000
34615 +CONFIG_TASK_SIZE=0xc0000000
34616 +CONFIG_CONSISTENT_START=0xff100000
34617 +CONFIG_CONSISTENT_SIZE=0x00200000
34618 +CONFIG_BOOT_LOAD=0x01000000
34619 +
34620 +#
34621 +# Networking
34622 +#
34623 +CONFIG_NET=y
34624 +
34625 +#
34626 +# Networking options
34627 +#
34628 +CONFIG_PACKET=y
34629 +# CONFIG_PACKET_MMAP is not set
34630 +CONFIG_UNIX=y
34631 +# CONFIG_NET_KEY is not set
34632 +CONFIG_INET=y
34633 +# CONFIG_IP_MULTICAST is not set
34634 +# CONFIG_IP_ADVANCED_ROUTER is not set
34635 +CONFIG_IP_FIB_HASH=y
34636 +CONFIG_IP_PNP=y
34637 +CONFIG_IP_PNP_DHCP=y
34638 +CONFIG_IP_PNP_BOOTP=y
34639 +# CONFIG_IP_PNP_RARP is not set
34640 +# CONFIG_NET_IPIP is not set
34641 +# CONFIG_NET_IPGRE is not set
34642 +# CONFIG_ARPD is not set
34643 +# CONFIG_SYN_COOKIES is not set
34644 +# CONFIG_INET_AH is not set
34645 +# CONFIG_INET_ESP is not set
34646 +# CONFIG_INET_IPCOMP is not set
34647 +# CONFIG_INET_XFRM_TUNNEL is not set
34648 +# CONFIG_INET_TUNNEL is not set
34649 +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
34650 +# CONFIG_INET_XFRM_MODE_TUNNEL is not set
34651 +# CONFIG_INET_XFRM_MODE_BEET is not set
34652 +# CONFIG_INET_LRO is not set
34653 +CONFIG_INET_DIAG=y
34654 +CONFIG_INET_TCP_DIAG=y
34655 +# CONFIG_TCP_CONG_ADVANCED is not set
34656 +CONFIG_TCP_CONG_CUBIC=y
34657 +CONFIG_DEFAULT_TCP_CONG="cubic"
34658 +# CONFIG_TCP_MD5SIG is not set
34659 +# CONFIG_IPV6 is not set
34660 +# CONFIG_INET6_XFRM_TUNNEL is not set
34661 +# CONFIG_INET6_TUNNEL is not set
34662 +# CONFIG_NETWORK_SECMARK is not set
34663 +# CONFIG_NETFILTER is not set
34664 +# CONFIG_IP_DCCP is not set
34665 +# CONFIG_IP_SCTP is not set
34666 +# CONFIG_TIPC is not set
34667 +# CONFIG_ATM is not set
34668 +# CONFIG_BRIDGE is not set
34669 +# CONFIG_VLAN_8021Q is not set
34670 +# CONFIG_DECNET is not set
34671 +# CONFIG_LLC2 is not set
34672 +# CONFIG_IPX is not set
34673 +# CONFIG_ATALK is not set
34674 +# CONFIG_X25 is not set
34675 +# CONFIG_LAPB is not set
34676 +# CONFIG_ECONET is not set
34677 +# CONFIG_WAN_ROUTER is not set
34678 +# CONFIG_NET_SCHED is not set
34679 +
34680 +#
34681 +# Network testing
34682 +#
34683 +# CONFIG_NET_PKTGEN is not set
34684 +# CONFIG_HAMRADIO is not set
34685 +# CONFIG_IRDA is not set
34686 +# CONFIG_BT is not set
34687 +# CONFIG_AF_RXRPC is not set
34688 +
34689 +#
34690 +# Wireless
34691 +#
34692 +# CONFIG_CFG80211 is not set
34693 +# CONFIG_WIRELESS_EXT is not set
34694 +# CONFIG_MAC80211 is not set
34695 +# CONFIG_IEEE80211 is not set
34696 +# CONFIG_RFKILL is not set
34697 +# CONFIG_NET_9P is not set
34698 +
34699 +#
34700 +# Device Drivers
34701 +#
34702 +
34703 +#
34704 +# Generic Driver Options
34705 +#
34706 +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
34707 +CONFIG_STANDALONE=y
34708 +CONFIG_PREVENT_FIRMWARE_BUILD=y
34709 +CONFIG_FW_LOADER=y
34710 +# CONFIG_DEBUG_DRIVER is not set
34711 +# CONFIG_DEBUG_DEVRES is not set
34712 +# CONFIG_SYS_HYPERVISOR is not set
34713 +CONFIG_CONNECTOR=y
34714 +CONFIG_PROC_EVENTS=y
34715 +# CONFIG_MTD is not set
34716 +CONFIG_OF_DEVICE=y
34717 +# CONFIG_PARPORT is not set
34718 +CONFIG_BLK_DEV=y
34719 +# CONFIG_BLK_DEV_FD is not set
34720 +# CONFIG_BLK_CPQ_DA is not set
34721 +# CONFIG_BLK_CPQ_CISS_DA is not set
34722 +# CONFIG_BLK_DEV_DAC960 is not set
34723 +# CONFIG_BLK_DEV_UMEM is not set
34724 +# CONFIG_BLK_DEV_COW_COMMON is not set
34725 +# CONFIG_BLK_DEV_LOOP is not set
34726 +# CONFIG_BLK_DEV_NBD is not set
34727 +# CONFIG_BLK_DEV_SX8 is not set
34728 +CONFIG_BLK_DEV_RAM=y
34729 +CONFIG_BLK_DEV_RAM_COUNT=16
34730 +CONFIG_BLK_DEV_RAM_SIZE=35000
34731 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
34732 +# CONFIG_CDROM_PKTCDVD is not set
34733 +# CONFIG_ATA_OVER_ETH is not set
34734 +# CONFIG_XILINX_SYSACE is not set
34735 +CONFIG_MISC_DEVICES=y
34736 +# CONFIG_PHANTOM is not set
34737 +# CONFIG_EEPROM_93CX6 is not set
34738 +# CONFIG_SGI_IOC4 is not set
34739 +# CONFIG_TIFM_CORE is not set
34740 +# CONFIG_IDE is not set
34741 +
34742 +#
34743 +# SCSI device support
34744 +#
34745 +# CONFIG_RAID_ATTRS is not set
34746 +# CONFIG_SCSI is not set
34747 +# CONFIG_SCSI_DMA is not set
34748 +# CONFIG_SCSI_NETLINK is not set
34749 +# CONFIG_ATA is not set
34750 +# CONFIG_MD is not set
34751 +# CONFIG_FUSION is not set
34752 +
34753 +#
34754 +# IEEE 1394 (FireWire) support
34755 +#
34756 +# CONFIG_FIREWIRE is not set
34757 +# CONFIG_IEEE1394 is not set
34758 +# CONFIG_I2O is not set
34759 +CONFIG_MACINTOSH_DRIVERS=y
34760 +# CONFIG_MAC_EMUMOUSEBTN is not set
34761 +# CONFIG_WINDFARM is not set
34762 +CONFIG_NETDEVICES=y
34763 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
34764 +# CONFIG_DUMMY is not set
34765 +# CONFIG_BONDING is not set
34766 +# CONFIG_MACVLAN is not set
34767 +# CONFIG_EQUALIZER is not set
34768 +# CONFIG_TUN is not set
34769 +# CONFIG_VETH is not set
34770 +# CONFIG_IP1000 is not set
34771 +# CONFIG_ARCNET is not set
34772 +# CONFIG_PHYLIB is not set
34773 +CONFIG_NET_ETHERNET=y
34774 +# CONFIG_MII is not set
34775 +# CONFIG_HAPPYMEAL is not set
34776 +# CONFIG_SUNGEM is not set
34777 +# CONFIG_CASSINI is not set
34778 +# CONFIG_NET_VENDOR_3COM is not set
34779 +# CONFIG_NET_TULIP is not set
34780 +# CONFIG_HP100 is not set
34781 +CONFIG_IBM_NEW_EMAC=y
34782 +CONFIG_IBM_NEW_EMAC_RXB=128
34783 +CONFIG_IBM_NEW_EMAC_TXB=64
34784 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
34785 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
34786 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
34787 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
34788 +CONFIG_IBM_NEW_EMAC_ZMII=y
34789 +CONFIG_IBM_NEW_EMAC_RGMII=y
34790 +CONFIG_IBM_NEW_EMAC_TAH=y
34791 +CONFIG_IBM_NEW_EMAC_EMAC4=y
34792 +# CONFIG_NET_PCI is not set
34793 +# CONFIG_B44 is not set
34794 +CONFIG_NETDEV_1000=y
34795 +# CONFIG_ACENIC is not set
34796 +# CONFIG_DL2K is not set
34797 +# CONFIG_E1000 is not set
34798 +# CONFIG_E1000E is not set
34799 +# CONFIG_NS83820 is not set
34800 +# CONFIG_HAMACHI is not set
34801 +# CONFIG_YELLOWFIN is not set
34802 +# CONFIG_R8169 is not set
34803 +# CONFIG_SIS190 is not set
34804 +# CONFIG_SKGE is not set
34805 +# CONFIG_SKY2 is not set
34806 +# CONFIG_SK98LIN is not set
34807 +# CONFIG_VIA_VELOCITY is not set
34808 +# CONFIG_TIGON3 is not set
34809 +# CONFIG_BNX2 is not set
34810 +# CONFIG_QLA3XXX is not set
34811 +# CONFIG_ATL1 is not set
34812 +CONFIG_NETDEV_10000=y
34813 +# CONFIG_CHELSIO_T1 is not set
34814 +# CONFIG_CHELSIO_T3 is not set
34815 +# CONFIG_IXGBE is not set
34816 +# CONFIG_IXGB is not set
34817 +# CONFIG_S2IO is not set
34818 +# CONFIG_MYRI10GE is not set
34819 +# CONFIG_NETXEN_NIC is not set
34820 +# CONFIG_NIU is not set
34821 +# CONFIG_MLX4_CORE is not set
34822 +# CONFIG_TEHUTI is not set
34823 +# CONFIG_TR is not set
34824 +
34825 +#
34826 +# Wireless LAN
34827 +#
34828 +# CONFIG_WLAN_PRE80211 is not set
34829 +# CONFIG_WLAN_80211 is not set
34830 +# CONFIG_WAN is not set
34831 +# CONFIG_FDDI is not set
34832 +# CONFIG_HIPPI is not set
34833 +# CONFIG_PPP is not set
34834 +# CONFIG_SLIP is not set
34835 +# CONFIG_SHAPER is not set
34836 +# CONFIG_NETCONSOLE is not set
34837 +# CONFIG_NETPOLL is not set
34838 +# CONFIG_NET_POLL_CONTROLLER is not set
34839 +# CONFIG_ISDN is not set
34840 +# CONFIG_PHONE is not set
34841 +
34842 +#
34843 +# Input device support
34844 +#
34845 +# CONFIG_INPUT is not set
34846 +
34847 +#
34848 +# Hardware I/O ports
34849 +#
34850 +# CONFIG_SERIO is not set
34851 +# CONFIG_GAMEPORT is not set
34852 +
34853 +#
34854 +# Character devices
34855 +#
34856 +# CONFIG_VT is not set
34857 +# CONFIG_SERIAL_NONSTANDARD is not set
34858 +
34859 +#
34860 +# Serial drivers
34861 +#
34862 +CONFIG_SERIAL_8250=y
34863 +CONFIG_SERIAL_8250_CONSOLE=y
34864 +# CONFIG_SERIAL_8250_PCI is not set
34865 +CONFIG_SERIAL_8250_NR_UARTS=4
34866 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
34867 +CONFIG_SERIAL_8250_EXTENDED=y
34868 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
34869 +CONFIG_SERIAL_8250_SHARE_IRQ=y
34870 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
34871 +# CONFIG_SERIAL_8250_RSA is not set
34872 +
34873 +#
34874 +# Non-8250 serial port support
34875 +#
34876 +# CONFIG_SERIAL_UARTLITE is not set
34877 +CONFIG_SERIAL_CORE=y
34878 +CONFIG_SERIAL_CORE_CONSOLE=y
34879 +# CONFIG_SERIAL_JSM is not set
34880 +CONFIG_SERIAL_OF_PLATFORM=y
34881 +CONFIG_UNIX98_PTYS=y
34882 +CONFIG_LEGACY_PTYS=y
34883 +CONFIG_LEGACY_PTY_COUNT=256
34884 +# CONFIG_IPMI_HANDLER is not set
34885 +# CONFIG_HW_RANDOM is not set
34886 +# CONFIG_NVRAM is not set
34887 +# CONFIG_GEN_RTC is not set
34888 +# CONFIG_R3964 is not set
34889 +# CONFIG_APPLICOM is not set
34890 +# CONFIG_RAW_DRIVER is not set
34891 +# CONFIG_TCG_TPM is not set
34892 +CONFIG_DEVPORT=y
34893 +# CONFIG_I2C is not set
34894 +
34895 +#
34896 +# SPI support
34897 +#
34898 +# CONFIG_SPI is not set
34899 +# CONFIG_SPI_MASTER is not set
34900 +# CONFIG_W1 is not set
34901 +# CONFIG_POWER_SUPPLY is not set
34902 +# CONFIG_HWMON is not set
34903 +# CONFIG_WATCHDOG is not set
34904 +
34905 +#
34906 +# Sonics Silicon Backplane
34907 +#
34908 +CONFIG_SSB_POSSIBLE=y
34909 +# CONFIG_SSB is not set
34910 +
34911 +#
34912 +# Multifunction device drivers
34913 +#
34914 +# CONFIG_MFD_SM501 is not set
34915 +
34916 +#
34917 +# Multimedia devices
34918 +#
34919 +# CONFIG_VIDEO_DEV is not set
34920 +# CONFIG_DVB_CORE is not set
34921 +CONFIG_DAB=y
34922 +
34923 +#
34924 +# Graphics support
34925 +#
34926 +# CONFIG_AGP is not set
34927 +# CONFIG_DRM is not set
34928 +# CONFIG_VGASTATE is not set
34929 +CONFIG_VIDEO_OUTPUT_CONTROL=m
34930 +# CONFIG_FB is not set
34931 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
34932 +
34933 +#
34934 +# Display device support
34935 +#
34936 +# CONFIG_DISPLAY_SUPPORT is not set
34937 +
34938 +#
34939 +# Sound
34940 +#
34941 +# CONFIG_SOUND is not set
34942 +CONFIG_USB_SUPPORT=y
34943 +CONFIG_USB_ARCH_HAS_HCD=y
34944 +CONFIG_USB_ARCH_HAS_OHCI=y
34945 +CONFIG_USB_ARCH_HAS_EHCI=y
34946 +# CONFIG_USB is not set
34947 +
34948 +#
34949 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
34950 +#
34951 +
34952 +#
34953 +# USB Gadget Support
34954 +#
34955 +# CONFIG_USB_GADGET is not set
34956 +# CONFIG_MMC is not set
34957 +# CONFIG_NEW_LEDS is not set
34958 +# CONFIG_INFINIBAND is not set
34959 +# CONFIG_EDAC is not set
34960 +# CONFIG_RTC_CLASS is not set
34961 +
34962 +#
34963 +# Userspace I/O
34964 +#
34965 +# CONFIG_UIO is not set
34966 +
34967 +#
34968 +# File systems
34969 +#
34970 +CONFIG_EXT2_FS=y
34971 +# CONFIG_EXT2_FS_XATTR is not set
34972 +# CONFIG_EXT2_FS_XIP is not set
34973 +# CONFIG_EXT3_FS is not set
34974 +# CONFIG_EXT4DEV_FS is not set
34975 +# CONFIG_REISERFS_FS is not set
34976 +# CONFIG_JFS_FS is not set
34977 +# CONFIG_FS_POSIX_ACL is not set
34978 +# CONFIG_XFS_FS is not set
34979 +# CONFIG_GFS2_FS is not set
34980 +# CONFIG_OCFS2_FS is not set
34981 +# CONFIG_MINIX_FS is not set
34982 +# CONFIG_ROMFS_FS is not set
34983 +CONFIG_INOTIFY=y
34984 +CONFIG_INOTIFY_USER=y
34985 +# CONFIG_QUOTA is not set
34986 +CONFIG_DNOTIFY=y
34987 +# CONFIG_AUTOFS_FS is not set
34988 +# CONFIG_AUTOFS4_FS is not set
34989 +# CONFIG_FUSE_FS is not set
34990 +
34991 +#
34992 +# CD-ROM/DVD Filesystems
34993 +#
34994 +# CONFIG_ISO9660_FS is not set
34995 +# CONFIG_UDF_FS is not set
34996 +
34997 +#
34998 +# DOS/FAT/NT Filesystems
34999 +#
35000 +# CONFIG_MSDOS_FS is not set
35001 +# CONFIG_VFAT_FS is not set
35002 +# CONFIG_NTFS_FS is not set
35003 +
35004 +#
35005 +# Pseudo filesystems
35006 +#
35007 +CONFIG_PROC_FS=y
35008 +CONFIG_PROC_KCORE=y
35009 +CONFIG_PROC_SYSCTL=y
35010 +CONFIG_SYSFS=y
35011 +CONFIG_TMPFS=y
35012 +# CONFIG_TMPFS_POSIX_ACL is not set
35013 +# CONFIG_HUGETLB_PAGE is not set
35014 +# CONFIG_CONFIGFS_FS is not set
35015 +
35016 +#
35017 +# Miscellaneous filesystems
35018 +#
35019 +# CONFIG_ADFS_FS is not set
35020 +# CONFIG_AFFS_FS is not set
35021 +# CONFIG_HFS_FS is not set
35022 +# CONFIG_HFSPLUS_FS is not set
35023 +# CONFIG_BEFS_FS is not set
35024 +# CONFIG_BFS_FS is not set
35025 +# CONFIG_EFS_FS is not set
35026 +CONFIG_CRAMFS=y
35027 +# CONFIG_VXFS_FS is not set
35028 +# CONFIG_HPFS_FS is not set
35029 +# CONFIG_QNX4FS_FS is not set
35030 +# CONFIG_SYSV_FS is not set
35031 +# CONFIG_UFS_FS is not set
35032 +CONFIG_NETWORK_FILESYSTEMS=y
35033 +CONFIG_NFS_FS=y
35034 +CONFIG_NFS_V3=y
35035 +# CONFIG_NFS_V3_ACL is not set
35036 +# CONFIG_NFS_V4 is not set
35037 +# CONFIG_NFS_DIRECTIO is not set
35038 +# CONFIG_NFSD is not set
35039 +CONFIG_ROOT_NFS=y
35040 +CONFIG_LOCKD=y
35041 +CONFIG_LOCKD_V4=y
35042 +CONFIG_NFS_COMMON=y
35043 +CONFIG_SUNRPC=y
35044 +# CONFIG_SUNRPC_BIND34 is not set
35045 +# CONFIG_RPCSEC_GSS_KRB5 is not set
35046 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
35047 +# CONFIG_SMB_FS is not set
35048 +# CONFIG_CIFS is not set
35049 +# CONFIG_NCP_FS is not set
35050 +# CONFIG_CODA_FS is not set
35051 +# CONFIG_AFS_FS is not set
35052 +
35053 +#
35054 +# Partition Types
35055 +#
35056 +# CONFIG_PARTITION_ADVANCED is not set
35057 +CONFIG_MSDOS_PARTITION=y
35058 +# CONFIG_NLS is not set
35059 +# CONFIG_DLM is not set
35060 +# CONFIG_UCC_SLOW is not set
35061 +
35062 +#
35063 +# Library routines
35064 +#
35065 +CONFIG_BITREVERSE=y
35066 +# CONFIG_CRC_CCITT is not set
35067 +# CONFIG_CRC16 is not set
35068 +# CONFIG_CRC_ITU_T is not set
35069 +CONFIG_CRC32=y
35070 +# CONFIG_CRC7 is not set
35071 +# CONFIG_LIBCRC32C is not set
35072 +CONFIG_ZLIB_INFLATE=y
35073 +CONFIG_PLIST=y
35074 +CONFIG_HAS_IOMEM=y
35075 +CONFIG_HAS_IOPORT=y
35076 +CONFIG_HAS_DMA=y
35077 +CONFIG_INSTRUMENTATION=y
35078 +# CONFIG_PROFILING is not set
35079 +# CONFIG_KPROBES is not set
35080 +# CONFIG_MARKERS is not set
35081 +
35082 +#
35083 +# Kernel hacking
35084 +#
35085 +# CONFIG_PRINTK_TIME is not set
35086 +CONFIG_ENABLE_WARN_DEPRECATED=y
35087 +CONFIG_ENABLE_MUST_CHECK=y
35088 +CONFIG_MAGIC_SYSRQ=y
35089 +# CONFIG_UNUSED_SYMBOLS is not set
35090 +# CONFIG_DEBUG_FS is not set
35091 +# CONFIG_HEADERS_CHECK is not set
35092 +CONFIG_DEBUG_KERNEL=y
35093 +# CONFIG_DEBUG_SHIRQ is not set
35094 +CONFIG_DETECT_SOFTLOCKUP=y
35095 +CONFIG_SCHED_DEBUG=y
35096 +# CONFIG_SCHEDSTATS is not set
35097 +# CONFIG_TIMER_STATS is not set
35098 +# CONFIG_SLUB_DEBUG_ON is not set
35099 +# CONFIG_DEBUG_RT_MUTEXES is not set
35100 +# CONFIG_RT_MUTEX_TESTER is not set
35101 +# CONFIG_DEBUG_SPINLOCK is not set
35102 +# CONFIG_DEBUG_MUTEXES is not set
35103 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
35104 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
35105 +# CONFIG_DEBUG_KOBJECT is not set
35106 +# CONFIG_DEBUG_BUGVERBOSE is not set
35107 +# CONFIG_DEBUG_INFO is not set
35108 +# CONFIG_DEBUG_VM is not set
35109 +# CONFIG_DEBUG_LIST is not set
35110 +# CONFIG_DEBUG_SG is not set
35111 +CONFIG_FORCED_INLINING=y
35112 +# CONFIG_BOOT_PRINTK_DELAY is not set
35113 +# CONFIG_RCU_TORTURE_TEST is not set
35114 +# CONFIG_FAULT_INJECTION is not set
35115 +# CONFIG_SAMPLES is not set
35116 +# CONFIG_DEBUG_STACKOVERFLOW is not set
35117 +# CONFIG_DEBUG_STACK_USAGE is not set
35118 +# CONFIG_DEBUG_PAGEALLOC is not set
35119 +CONFIG_DEBUGGER=y
35120 +# CONFIG_KGDB is not set
35121 +# CONFIG_XMON is not set
35122 +# CONFIG_BDI_SWITCH is not set
35123 +# CONFIG_PPC_EARLY_DEBUG is not set
35124 +
35125 +#
35126 +# Security options
35127 +#
35128 +# CONFIG_KEYS is not set
35129 +# CONFIG_SECURITY is not set
35130 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
35131 +CONFIG_CRYPTO=y
35132 +CONFIG_CRYPTO_ALGAPI=y
35133 +CONFIG_CRYPTO_BLKCIPHER=y
35134 +CONFIG_CRYPTO_MANAGER=y
35135 +# CONFIG_CRYPTO_HMAC is not set
35136 +# CONFIG_CRYPTO_XCBC is not set
35137 +# CONFIG_CRYPTO_NULL is not set
35138 +# CONFIG_CRYPTO_MD4 is not set
35139 +CONFIG_CRYPTO_MD5=y
35140 +# CONFIG_CRYPTO_SHA1 is not set
35141 +# CONFIG_CRYPTO_SHA256 is not set
35142 +# CONFIG_CRYPTO_SHA512 is not set
35143 +# CONFIG_CRYPTO_WP512 is not set
35144 +# CONFIG_CRYPTO_TGR192 is not set
35145 +# CONFIG_CRYPTO_GF128MUL is not set
35146 +CONFIG_CRYPTO_ECB=y
35147 +CONFIG_CRYPTO_CBC=y
35148 +CONFIG_CRYPTO_PCBC=y
35149 +# CONFIG_CRYPTO_LRW is not set
35150 +# CONFIG_CRYPTO_XTS is not set
35151 +# CONFIG_CRYPTO_CRYPTD is not set
35152 +CONFIG_CRYPTO_DES=y
35153 +# CONFIG_CRYPTO_FCRYPT is not set
35154 +# CONFIG_CRYPTO_BLOWFISH is not set
35155 +# CONFIG_CRYPTO_TWOFISH is not set
35156 +# CONFIG_CRYPTO_SERPENT is not set
35157 +# CONFIG_CRYPTO_AES is not set
35158 +# CONFIG_CRYPTO_CAST5 is not set
35159 +# CONFIG_CRYPTO_CAST6 is not set
35160 +# CONFIG_CRYPTO_TEA is not set
35161 +# CONFIG_CRYPTO_ARC4 is not set
35162 +# CONFIG_CRYPTO_KHAZAD is not set
35163 +# CONFIG_CRYPTO_ANUBIS is not set
35164 +# CONFIG_CRYPTO_SEED is not set
35165 +# CONFIG_CRYPTO_DEFLATE is not set
35166 +# CONFIG_CRYPTO_MICHAEL_MIC is not set
35167 +# CONFIG_CRYPTO_CRC32C is not set
35168 +# CONFIG_CRYPTO_CAMELLIA is not set
35169 +# CONFIG_CRYPTO_TEST is not set
35170 +# CONFIG_CRYPTO_AUTHENC is not set
35171 +CONFIG_CRYPTO_HW=y
35172 +# CONFIG_PPC_CLOCK is not set
35173 --- a/arch/powerpc/configs/walnut_defconfig
35174 +++ b/arch/powerpc/configs/walnut_defconfig
35175 @@ -1,7 +1,7 @@
35176  #
35177  # Automatically generated make config: don't edit
35178 -# Linux kernel version: 2.6.24-rc4
35179 -# Thu Dec  6 16:49:33 2007
35180 +# Linux kernel version: 2.6.24-rc6
35181 +# Mon Dec 24 11:23:58 2007
35182  #
35183  # CONFIG_PPC64 is not set
35184  
35185 @@ -40,7 +40,7 @@
35186  CONFIG_ARCH_MAY_HAVE_PC_FDC=y
35187  CONFIG_PPC_OF=y
35188  CONFIG_OF=y
35189 -# CONFIG_PPC_UDBG_16550 is not set
35190 +CONFIG_PPC_UDBG_16550=y
35191  # CONFIG_GENERIC_TBSYNC is not set
35192  CONFIG_AUDIT_ARCH=y
35193  CONFIG_GENERIC_BUG=y
35194 @@ -127,6 +127,7 @@
35195  # CONFIG_DEFAULT_CFQ is not set
35196  # CONFIG_DEFAULT_NOOP is not set
35197  CONFIG_DEFAULT_IOSCHED="anticipatory"
35198 +# CONFIG_PPC4xx_PCI_EXPRESS is not set
35199  
35200  #
35201  # Platform support
35202 @@ -136,7 +137,9 @@
35203  # CONFIG_PPC_CELL is not set
35204  # CONFIG_PPC_CELL_NATIVE is not set
35205  # CONFIG_PQ2ADS is not set
35206 +# CONFIG_EP405 is not set
35207  # CONFIG_KILAUEA is not set
35208 +# CONFIG_MAKALU is not set
35209  CONFIG_WALNUT=y
35210  # CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
35211  CONFIG_405GP=y
35212 @@ -204,11 +207,17 @@
35213  # Bus options
35214  #
35215  CONFIG_ZONE_DMA=y
35216 -# CONFIG_PCI is not set
35217 -# CONFIG_PCI_DOMAINS is not set
35218 -# CONFIG_PCI_SYSCALL is not set
35219 -# CONFIG_ARCH_SUPPORTS_MSI is not set
35220 +CONFIG_PPC_INDIRECT_PCI=y
35221 +CONFIG_PCI=y
35222 +CONFIG_PCI_DOMAINS=y
35223 +CONFIG_PCI_SYSCALL=y
35224 +# CONFIG_PCIEPORTBUS is not set
35225 +CONFIG_ARCH_SUPPORTS_MSI=y
35226 +# CONFIG_PCI_MSI is not set
35227 +# CONFIG_PCI_LEGACY is not set
35228 +# CONFIG_PCI_DEBUG is not set
35229  # CONFIG_PCCARD is not set
35230 +# CONFIG_HOTPLUG_PCI is not set
35231  
35232  #
35233  # Advanced setup
35234 @@ -373,11 +382,13 @@
35235  # CONFIG_MTD_COMPLEX_MAPPINGS is not set
35236  # CONFIG_MTD_PHYSMAP is not set
35237  CONFIG_MTD_PHYSMAP_OF=y
35238 +# CONFIG_MTD_INTEL_VR_NOR is not set
35239  # CONFIG_MTD_PLATRAM is not set
35240  
35241  #
35242  # Self-contained MTD device drivers
35243  #
35244 +# CONFIG_MTD_PMC551 is not set
35245  # CONFIG_MTD_SLRAM is not set
35246  # CONFIG_MTD_PHRAM is not set
35247  # CONFIG_MTD_MTDRAM is not set
35248 @@ -400,9 +411,14 @@
35249  # CONFIG_PARPORT is not set
35250  CONFIG_BLK_DEV=y
35251  # CONFIG_BLK_DEV_FD is not set
35252 +# CONFIG_BLK_CPQ_DA is not set
35253 +# CONFIG_BLK_CPQ_CISS_DA is not set
35254 +# CONFIG_BLK_DEV_DAC960 is not set
35255 +# CONFIG_BLK_DEV_UMEM is not set
35256  # CONFIG_BLK_DEV_COW_COMMON is not set
35257  # CONFIG_BLK_DEV_LOOP is not set
35258  # CONFIG_BLK_DEV_NBD is not set
35259 +# CONFIG_BLK_DEV_SX8 is not set
35260  CONFIG_BLK_DEV_RAM=y
35261  CONFIG_BLK_DEV_RAM_COUNT=16
35262  CONFIG_BLK_DEV_RAM_SIZE=35000
35263 @@ -411,7 +427,10 @@
35264  # CONFIG_ATA_OVER_ETH is not set
35265  # CONFIG_XILINX_SYSACE is not set
35266  CONFIG_MISC_DEVICES=y
35267 +# CONFIG_PHANTOM is not set
35268  # CONFIG_EEPROM_93CX6 is not set
35269 +# CONFIG_SGI_IOC4 is not set
35270 +# CONFIG_TIFM_CORE is not set
35271  # CONFIG_IDE is not set
35272  
35273  #
35274 @@ -423,6 +442,14 @@
35275  # CONFIG_SCSI_NETLINK is not set
35276  # CONFIG_ATA is not set
35277  # CONFIG_MD is not set
35278 +# CONFIG_FUSION is not set
35279 +
35280 +#
35281 +# IEEE 1394 (FireWire) support
35282 +#
35283 +# CONFIG_FIREWIRE is not set
35284 +# CONFIG_IEEE1394 is not set
35285 +# CONFIG_I2O is not set
35286  # CONFIG_MACINTOSH_DRIVERS is not set
35287  CONFIG_NETDEVICES=y
35288  # CONFIG_NETDEVICES_MULTIQUEUE is not set
35289 @@ -432,9 +459,17 @@
35290  # CONFIG_EQUALIZER is not set
35291  # CONFIG_TUN is not set
35292  # CONFIG_VETH is not set
35293 +# CONFIG_IP1000 is not set
35294 +# CONFIG_ARCNET is not set
35295  # CONFIG_PHYLIB is not set
35296  CONFIG_NET_ETHERNET=y
35297  # CONFIG_MII is not set
35298 +# CONFIG_HAPPYMEAL is not set
35299 +# CONFIG_SUNGEM is not set
35300 +# CONFIG_CASSINI is not set
35301 +# CONFIG_NET_VENDOR_3COM is not set
35302 +# CONFIG_NET_TULIP is not set
35303 +# CONFIG_HP100 is not set
35304  CONFIG_IBM_NEW_EMAC=y
35305  CONFIG_IBM_NEW_EMAC_RXB=128
35306  CONFIG_IBM_NEW_EMAC_TXB=64
35307 @@ -446,9 +481,38 @@
35308  # CONFIG_IBM_NEW_EMAC_RGMII is not set
35309  # CONFIG_IBM_NEW_EMAC_TAH is not set
35310  # CONFIG_IBM_NEW_EMAC_EMAC4 is not set
35311 +# CONFIG_NET_PCI is not set
35312  # CONFIG_B44 is not set
35313  CONFIG_NETDEV_1000=y
35314 +# CONFIG_ACENIC is not set
35315 +# CONFIG_DL2K is not set
35316 +# CONFIG_E1000 is not set
35317 +# CONFIG_E1000E is not set
35318 +# CONFIG_NS83820 is not set
35319 +# CONFIG_HAMACHI is not set
35320 +# CONFIG_YELLOWFIN is not set
35321 +# CONFIG_R8169 is not set
35322 +# CONFIG_SIS190 is not set
35323 +# CONFIG_SKGE is not set
35324 +# CONFIG_SKY2 is not set
35325 +# CONFIG_SK98LIN is not set
35326 +# CONFIG_VIA_VELOCITY is not set
35327 +# CONFIG_TIGON3 is not set
35328 +# CONFIG_BNX2 is not set
35329 +# CONFIG_QLA3XXX is not set
35330 +# CONFIG_ATL1 is not set
35331  CONFIG_NETDEV_10000=y
35332 +# CONFIG_CHELSIO_T1 is not set
35333 +# CONFIG_CHELSIO_T3 is not set
35334 +# CONFIG_IXGBE is not set
35335 +# CONFIG_IXGB is not set
35336 +# CONFIG_S2IO is not set
35337 +# CONFIG_MYRI10GE is not set
35338 +# CONFIG_NETXEN_NIC is not set
35339 +# CONFIG_NIU is not set
35340 +# CONFIG_MLX4_CORE is not set
35341 +# CONFIG_TEHUTI is not set
35342 +# CONFIG_TR is not set
35343  
35344  #
35345  # Wireless LAN
35346 @@ -456,6 +520,8 @@
35347  # CONFIG_WLAN_PRE80211 is not set
35348  # CONFIG_WLAN_80211 is not set
35349  # CONFIG_WAN is not set
35350 +# CONFIG_FDDI is not set
35351 +# CONFIG_HIPPI is not set
35352  # CONFIG_PPP is not set
35353  # CONFIG_SLIP is not set
35354  # CONFIG_SHAPER is not set
35355 @@ -487,6 +553,7 @@
35356  #
35357  CONFIG_SERIAL_8250=y
35358  CONFIG_SERIAL_8250_CONSOLE=y
35359 +CONFIG_SERIAL_8250_PCI=y
35360  CONFIG_SERIAL_8250_NR_UARTS=4
35361  CONFIG_SERIAL_8250_RUNTIME_UARTS=4
35362  CONFIG_SERIAL_8250_EXTENDED=y
35363 @@ -501,6 +568,7 @@
35364  # CONFIG_SERIAL_UARTLITE is not set
35365  CONFIG_SERIAL_CORE=y
35366  CONFIG_SERIAL_CORE_CONSOLE=y
35367 +# CONFIG_SERIAL_JSM is not set
35368  CONFIG_SERIAL_OF_PLATFORM=y
35369  CONFIG_UNIX98_PTYS=y
35370  CONFIG_LEGACY_PTYS=y
35371 @@ -510,8 +578,10 @@
35372  # CONFIG_NVRAM is not set
35373  # CONFIG_GEN_RTC is not set
35374  # CONFIG_R3964 is not set
35375 +# CONFIG_APPLICOM is not set
35376  # CONFIG_RAW_DRIVER is not set
35377  # CONFIG_TCG_TPM is not set
35378 +CONFIG_DEVPORT=y
35379  # CONFIG_I2C is not set
35380  
35381  #
35382 @@ -545,6 +615,8 @@
35383  #
35384  # Graphics support
35385  #
35386 +# CONFIG_AGP is not set
35387 +# CONFIG_DRM is not set
35388  # CONFIG_VGASTATE is not set
35389  CONFIG_VIDEO_OUTPUT_CONTROL=m
35390  # CONFIG_FB is not set
35391 @@ -560,9 +632,10 @@
35392  #
35393  # CONFIG_SOUND is not set
35394  CONFIG_USB_SUPPORT=y
35395 -# CONFIG_USB_ARCH_HAS_HCD is not set
35396 -# CONFIG_USB_ARCH_HAS_OHCI is not set
35397 -# CONFIG_USB_ARCH_HAS_EHCI is not set
35398 +CONFIG_USB_ARCH_HAS_HCD=y
35399 +CONFIG_USB_ARCH_HAS_OHCI=y
35400 +CONFIG_USB_ARCH_HAS_EHCI=y
35401 +# CONFIG_USB is not set
35402  
35403  #
35404  # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
35405 @@ -574,6 +647,7 @@
35406  # CONFIG_USB_GADGET is not set
35407  # CONFIG_MMC is not set
35408  # CONFIG_NEW_LEDS is not set
35409 +# CONFIG_INFINIBAND is not set
35410  # CONFIG_EDAC is not set
35411  # CONFIG_RTC_CLASS is not set
35412  
35413 --- /dev/null
35414 +++ b/arch/powerpc/configs/warp_defconfig
35415 @@ -0,0 +1,1057 @@
35416 +#
35417 +# Automatically generated make config: don't edit
35418 +# Linux kernel version: 2.6.24-rc6
35419 +# Tue Jan  8 12:23:23 2008
35420 +#
35421 +# CONFIG_PPC64 is not set
35422 +
35423 +#
35424 +# Processor support
35425 +#
35426 +# CONFIG_6xx is not set
35427 +# CONFIG_PPC_85xx is not set
35428 +# CONFIG_PPC_8xx is not set
35429 +# CONFIG_40x is not set
35430 +CONFIG_44x=y
35431 +# CONFIG_E200 is not set
35432 +CONFIG_PPC_FPU=y
35433 +CONFIG_4xx=y
35434 +CONFIG_BOOKE=y
35435 +CONFIG_PTE_64BIT=y
35436 +CONFIG_PHYS_64BIT=y
35437 +# CONFIG_PPC_MM_SLICES is not set
35438 +CONFIG_NOT_COHERENT_CACHE=y
35439 +CONFIG_PPC32=y
35440 +CONFIG_WORD_SIZE=32
35441 +CONFIG_PPC_MERGE=y
35442 +CONFIG_MMU=y
35443 +CONFIG_GENERIC_CMOS_UPDATE=y
35444 +CONFIG_GENERIC_TIME=y
35445 +CONFIG_GENERIC_TIME_VSYSCALL=y
35446 +CONFIG_GENERIC_CLOCKEVENTS=y
35447 +CONFIG_GENERIC_HARDIRQS=y
35448 +CONFIG_IRQ_PER_CPU=y
35449 +CONFIG_RWSEM_XCHGADD_ALGORITHM=y
35450 +CONFIG_ARCH_HAS_ILOG2_U32=y
35451 +CONFIG_GENERIC_HWEIGHT=y
35452 +CONFIG_GENERIC_CALIBRATE_DELAY=y
35453 +CONFIG_GENERIC_FIND_NEXT_BIT=y
35454 +# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
35455 +CONFIG_PPC=y
35456 +CONFIG_EARLY_PRINTK=y
35457 +CONFIG_GENERIC_NVRAM=y
35458 +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
35459 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y
35460 +CONFIG_PPC_OF=y
35461 +CONFIG_OF=y
35462 +CONFIG_PPC_UDBG_16550=y
35463 +# CONFIG_GENERIC_TBSYNC is not set
35464 +CONFIG_AUDIT_ARCH=y
35465 +CONFIG_GENERIC_BUG=y
35466 +# CONFIG_DEFAULT_UIMAGE is not set
35467 +CONFIG_PPC_DCR_NATIVE=y
35468 +# CONFIG_PPC_DCR_MMIO is not set
35469 +CONFIG_PPC_DCR=y
35470 +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
35471 +
35472 +#
35473 +# General setup
35474 +#
35475 +CONFIG_EXPERIMENTAL=y
35476 +CONFIG_BROKEN_ON_SMP=y
35477 +CONFIG_INIT_ENV_ARG_LIMIT=32
35478 +CONFIG_LOCALVERSION="-pika"
35479 +# CONFIG_LOCALVERSION_AUTO is not set
35480 +CONFIG_SWAP=y
35481 +CONFIG_SYSVIPC=y
35482 +CONFIG_SYSVIPC_SYSCTL=y
35483 +# CONFIG_POSIX_MQUEUE is not set
35484 +# CONFIG_BSD_PROCESS_ACCT is not set
35485 +# CONFIG_TASKSTATS is not set
35486 +# CONFIG_USER_NS is not set
35487 +# CONFIG_PID_NS is not set
35488 +# CONFIG_AUDIT is not set
35489 +# CONFIG_IKCONFIG is not set
35490 +CONFIG_LOG_BUF_SHIFT=14
35491 +# CONFIG_CGROUPS is not set
35492 +CONFIG_FAIR_GROUP_SCHED=y
35493 +CONFIG_FAIR_USER_SCHED=y
35494 +# CONFIG_FAIR_CGROUP_SCHED is not set
35495 +CONFIG_SYSFS_DEPRECATED=y
35496 +# CONFIG_RELAY is not set
35497 +CONFIG_BLK_DEV_INITRD=y
35498 +CONFIG_INITRAMFS_SOURCE=""
35499 +# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
35500 +CONFIG_SYSCTL=y
35501 +CONFIG_EMBEDDED=y
35502 +CONFIG_SYSCTL_SYSCALL=y
35503 +CONFIG_KALLSYMS=y
35504 +# CONFIG_KALLSYMS_ALL is not set
35505 +# CONFIG_KALLSYMS_EXTRA_PASS is not set
35506 +# CONFIG_HOTPLUG is not set
35507 +CONFIG_PRINTK=y
35508 +CONFIG_BUG=y
35509 +CONFIG_ELF_CORE=y
35510 +CONFIG_BASE_FULL=y
35511 +CONFIG_FUTEX=y
35512 +CONFIG_ANON_INODES=y
35513 +CONFIG_EPOLL=y
35514 +CONFIG_SIGNALFD=y
35515 +CONFIG_EVENTFD=y
35516 +CONFIG_SHMEM=y
35517 +CONFIG_VM_EVENT_COUNTERS=y
35518 +CONFIG_SLAB=y
35519 +# CONFIG_SLUB is not set
35520 +# CONFIG_SLOB is not set
35521 +CONFIG_RT_MUTEXES=y
35522 +# CONFIG_TINY_SHMEM is not set
35523 +CONFIG_BASE_SMALL=0
35524 +CONFIG_MODULES=y
35525 +CONFIG_MODULE_UNLOAD=y
35526 +# CONFIG_MODULE_FORCE_UNLOAD is not set
35527 +# CONFIG_MODVERSIONS is not set
35528 +# CONFIG_MODULE_SRCVERSION_ALL is not set
35529 +CONFIG_KMOD=y
35530 +CONFIG_BLOCK=y
35531 +# CONFIG_LBD is not set
35532 +# CONFIG_BLK_DEV_IO_TRACE is not set
35533 +# CONFIG_LSF is not set
35534 +# CONFIG_BLK_DEV_BSG is not set
35535 +
35536 +#
35537 +# IO Schedulers
35538 +#
35539 +CONFIG_IOSCHED_NOOP=y
35540 +CONFIG_IOSCHED_AS=y
35541 +CONFIG_IOSCHED_DEADLINE=y
35542 +CONFIG_IOSCHED_CFQ=y
35543 +CONFIG_DEFAULT_AS=y
35544 +# CONFIG_DEFAULT_DEADLINE is not set
35545 +# CONFIG_DEFAULT_CFQ is not set
35546 +# CONFIG_DEFAULT_NOOP is not set
35547 +CONFIG_DEFAULT_IOSCHED="anticipatory"
35548 +
35549 +#
35550 +# Platform support
35551 +#
35552 +# CONFIG_PPC_MPC52xx is not set
35553 +# CONFIG_PPC_MPC5200 is not set
35554 +# CONFIG_PPC_CELL is not set
35555 +# CONFIG_PPC_CELL_NATIVE is not set
35556 +# CONFIG_PQ2ADS is not set
35557 +# CONFIG_BAMBOO is not set
35558 +# CONFIG_EBONY is not set
35559 +# CONFIG_SEQUOIA is not set
35560 +# CONFIG_TAISHAN is not set
35561 +# CONFIG_KATMAI is not set
35562 +# CONFIG_RAINIER is not set
35563 +CONFIG_WARP=y
35564 +CONFIG_440EP=y
35565 +CONFIG_IBM440EP_ERR42=y
35566 +# CONFIG_MPIC is not set
35567 +# CONFIG_MPIC_WEIRD is not set
35568 +# CONFIG_PPC_I8259 is not set
35569 +# CONFIG_PPC_RTAS is not set
35570 +# CONFIG_MMIO_NVRAM is not set
35571 +# CONFIG_PPC_MPC106 is not set
35572 +# CONFIG_PPC_970_NAP is not set
35573 +# CONFIG_PPC_INDIRECT_IO is not set
35574 +# CONFIG_GENERIC_IOMAP is not set
35575 +# CONFIG_CPU_FREQ is not set
35576 +# CONFIG_CPM2 is not set
35577 +# CONFIG_FSL_ULI1575 is not set
35578 +
35579 +#
35580 +# Kernel options
35581 +#
35582 +# CONFIG_HIGHMEM is not set
35583 +# CONFIG_TICK_ONESHOT is not set
35584 +# CONFIG_NO_HZ is not set
35585 +# CONFIG_HIGH_RES_TIMERS is not set
35586 +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
35587 +# CONFIG_HZ_100 is not set
35588 +# CONFIG_HZ_250 is not set
35589 +# CONFIG_HZ_300 is not set
35590 +CONFIG_HZ_1000=y
35591 +CONFIG_HZ=1000
35592 +CONFIG_PREEMPT_NONE=y
35593 +# CONFIG_PREEMPT_VOLUNTARY is not set
35594 +# CONFIG_PREEMPT is not set
35595 +CONFIG_BINFMT_ELF=y
35596 +# CONFIG_BINFMT_MISC is not set
35597 +# CONFIG_MATH_EMULATION is not set
35598 +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
35599 +CONFIG_ARCH_FLATMEM_ENABLE=y
35600 +CONFIG_ARCH_POPULATES_NODE_MAP=y
35601 +CONFIG_SELECT_MEMORY_MODEL=y
35602 +CONFIG_FLATMEM_MANUAL=y
35603 +# CONFIG_DISCONTIGMEM_MANUAL is not set
35604 +# CONFIG_SPARSEMEM_MANUAL is not set
35605 +CONFIG_FLATMEM=y
35606 +CONFIG_FLAT_NODE_MEM_MAP=y
35607 +# CONFIG_SPARSEMEM_STATIC is not set
35608 +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
35609 +CONFIG_SPLIT_PTLOCK_CPUS=4
35610 +CONFIG_RESOURCES_64BIT=y
35611 +CONFIG_ZONE_DMA_FLAG=1
35612 +CONFIG_BOUNCE=y
35613 +CONFIG_VIRT_TO_BUS=y
35614 +CONFIG_PROC_DEVICETREE=y
35615 +CONFIG_CMDLINE_BOOL=y
35616 +CONFIG_CMDLINE="ip=on"
35617 +CONFIG_SECCOMP=y
35618 +CONFIG_WANT_DEVICE_TREE=y
35619 +CONFIG_DEVICE_TREE="warp.dts"
35620 +CONFIG_ISA_DMA_API=y
35621 +
35622 +#
35623 +# Bus options
35624 +#
35625 +CONFIG_ZONE_DMA=y
35626 +# CONFIG_PCI is not set
35627 +# CONFIG_PCI_DOMAINS is not set
35628 +# CONFIG_PCI_SYSCALL is not set
35629 +# CONFIG_ARCH_SUPPORTS_MSI is not set
35630 +
35631 +#
35632 +# Advanced setup
35633 +#
35634 +# CONFIG_ADVANCED_OPTIONS is not set
35635 +
35636 +#
35637 +# Default settings for advanced configuration options are used
35638 +#
35639 +CONFIG_HIGHMEM_START=0xfe000000
35640 +CONFIG_LOWMEM_SIZE=0x30000000
35641 +CONFIG_KERNEL_START=0xc0000000
35642 +CONFIG_TASK_SIZE=0xc0000000
35643 +CONFIG_CONSISTENT_START=0xff100000
35644 +CONFIG_CONSISTENT_SIZE=0x00200000
35645 +CONFIG_BOOT_LOAD=0x01000000
35646 +
35647 +#
35648 +# Networking
35649 +#
35650 +CONFIG_NET=y
35651 +
35652 +#
35653 +# Networking options
35654 +#
35655 +CONFIG_PACKET=y
35656 +# CONFIG_PACKET_MMAP is not set
35657 +CONFIG_UNIX=y
35658 +CONFIG_XFRM=y
35659 +# CONFIG_XFRM_USER is not set
35660 +# CONFIG_XFRM_SUB_POLICY is not set
35661 +# CONFIG_XFRM_MIGRATE is not set
35662 +# CONFIG_NET_KEY is not set
35663 +CONFIG_INET=y
35664 +# CONFIG_IP_MULTICAST is not set
35665 +# CONFIG_IP_ADVANCED_ROUTER is not set
35666 +CONFIG_IP_FIB_HASH=y
35667 +CONFIG_IP_PNP=y
35668 +CONFIG_IP_PNP_DHCP=y
35669 +# CONFIG_IP_PNP_BOOTP is not set
35670 +# CONFIG_IP_PNP_RARP is not set
35671 +# CONFIG_NET_IPIP is not set
35672 +# CONFIG_NET_IPGRE is not set
35673 +# CONFIG_ARPD is not set
35674 +# CONFIG_SYN_COOKIES is not set
35675 +# CONFIG_INET_AH is not set
35676 +# CONFIG_INET_ESP is not set
35677 +# CONFIG_INET_IPCOMP is not set
35678 +# CONFIG_INET_XFRM_TUNNEL is not set
35679 +# CONFIG_INET_TUNNEL is not set
35680 +CONFIG_INET_XFRM_MODE_TRANSPORT=y
35681 +CONFIG_INET_XFRM_MODE_TUNNEL=y
35682 +CONFIG_INET_XFRM_MODE_BEET=y
35683 +# CONFIG_INET_LRO is not set
35684 +CONFIG_INET_DIAG=y
35685 +CONFIG_INET_TCP_DIAG=y
35686 +# CONFIG_TCP_CONG_ADVANCED is not set
35687 +CONFIG_TCP_CONG_CUBIC=y
35688 +CONFIG_DEFAULT_TCP_CONG="cubic"
35689 +# CONFIG_TCP_MD5SIG is not set
35690 +# CONFIG_IP_VS is not set
35691 +# CONFIG_IPV6 is not set
35692 +# CONFIG_INET6_XFRM_TUNNEL is not set
35693 +# CONFIG_INET6_TUNNEL is not set
35694 +# CONFIG_NETWORK_SECMARK is not set
35695 +CONFIG_NETFILTER=y
35696 +# CONFIG_NETFILTER_DEBUG is not set
35697 +
35698 +#
35699 +# Core Netfilter Configuration
35700 +#
35701 +# CONFIG_NETFILTER_NETLINK is not set
35702 +# CONFIG_NF_CONNTRACK_ENABLED is not set
35703 +# CONFIG_NF_CONNTRACK is not set
35704 +# CONFIG_NETFILTER_XTABLES is not set
35705 +
35706 +#
35707 +# IP: Netfilter Configuration
35708 +#
35709 +# CONFIG_IP_NF_QUEUE is not set
35710 +# CONFIG_IP_NF_IPTABLES is not set
35711 +# CONFIG_IP_NF_ARPTABLES is not set
35712 +# CONFIG_IP_DCCP is not set
35713 +# CONFIG_IP_SCTP is not set
35714 +# CONFIG_TIPC is not set
35715 +# CONFIG_ATM is not set
35716 +# CONFIG_BRIDGE is not set
35717 +CONFIG_VLAN_8021Q=y
35718 +# CONFIG_DECNET is not set
35719 +# CONFIG_LLC2 is not set
35720 +# CONFIG_IPX is not set
35721 +# CONFIG_ATALK is not set
35722 +# CONFIG_X25 is not set
35723 +# CONFIG_LAPB is not set
35724 +# CONFIG_ECONET is not set
35725 +# CONFIG_WAN_ROUTER is not set
35726 +# CONFIG_NET_SCHED is not set
35727 +
35728 +#
35729 +# Network testing
35730 +#
35731 +# CONFIG_NET_PKTGEN is not set
35732 +# CONFIG_HAMRADIO is not set
35733 +# CONFIG_IRDA is not set
35734 +# CONFIG_BT is not set
35735 +# CONFIG_AF_RXRPC is not set
35736 +
35737 +#
35738 +# Wireless
35739 +#
35740 +# CONFIG_CFG80211 is not set
35741 +# CONFIG_WIRELESS_EXT is not set
35742 +# CONFIG_MAC80211 is not set
35743 +# CONFIG_IEEE80211 is not set
35744 +# CONFIG_RFKILL is not set
35745 +# CONFIG_NET_9P is not set
35746 +
35747 +#
35748 +# Device Drivers
35749 +#
35750 +
35751 +#
35752 +# Generic Driver Options
35753 +#
35754 +# CONFIG_STANDALONE is not set
35755 +CONFIG_PREVENT_FIRMWARE_BUILD=y
35756 +# CONFIG_DEBUG_DRIVER is not set
35757 +# CONFIG_DEBUG_DEVRES is not set
35758 +# CONFIG_SYS_HYPERVISOR is not set
35759 +# CONFIG_CONNECTOR is not set
35760 +CONFIG_MTD=y
35761 +# CONFIG_MTD_DEBUG is not set
35762 +# CONFIG_MTD_CONCAT is not set
35763 +CONFIG_MTD_PARTITIONS=y
35764 +# CONFIG_MTD_REDBOOT_PARTS is not set
35765 +# CONFIG_MTD_CMDLINE_PARTS is not set
35766 +
35767 +#
35768 +# User Modules And Translation Layers
35769 +#
35770 +CONFIG_MTD_CHAR=y
35771 +CONFIG_MTD_BLKDEVS=y
35772 +CONFIG_MTD_BLOCK=y
35773 +# CONFIG_FTL is not set
35774 +# CONFIG_NFTL is not set
35775 +# CONFIG_INFTL is not set
35776 +# CONFIG_RFD_FTL is not set
35777 +# CONFIG_SSFDC is not set
35778 +CONFIG_MTD_OOPS=m
35779 +
35780 +#
35781 +# RAM/ROM/Flash chip drivers
35782 +#
35783 +CONFIG_MTD_CFI=y
35784 +# CONFIG_MTD_JEDECPROBE is not set
35785 +CONFIG_MTD_GEN_PROBE=y
35786 +# CONFIG_MTD_CFI_ADV_OPTIONS is not set
35787 +CONFIG_MTD_MAP_BANK_WIDTH_1=y
35788 +CONFIG_MTD_MAP_BANK_WIDTH_2=y
35789 +CONFIG_MTD_MAP_BANK_WIDTH_4=y
35790 +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
35791 +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
35792 +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
35793 +CONFIG_MTD_CFI_I1=y
35794 +CONFIG_MTD_CFI_I2=y
35795 +# CONFIG_MTD_CFI_I4 is not set
35796 +# CONFIG_MTD_CFI_I8 is not set
35797 +# CONFIG_MTD_CFI_INTELEXT is not set
35798 +CONFIG_MTD_CFI_AMDSTD=y
35799 +# CONFIG_MTD_CFI_STAA is not set
35800 +CONFIG_MTD_CFI_UTIL=y
35801 +# CONFIG_MTD_RAM is not set
35802 +# CONFIG_MTD_ROM is not set
35803 +# CONFIG_MTD_ABSENT is not set
35804 +
35805 +#
35806 +# Mapping drivers for chip access
35807 +#
35808 +# CONFIG_MTD_COMPLEX_MAPPINGS is not set
35809 +# CONFIG_MTD_PHYSMAP is not set
35810 +CONFIG_MTD_PHYSMAP_OF=y
35811 +# CONFIG_MTD_PLATRAM is not set
35812 +
35813 +#
35814 +# Self-contained MTD device drivers
35815 +#
35816 +# CONFIG_MTD_SLRAM is not set
35817 +# CONFIG_MTD_PHRAM is not set
35818 +# CONFIG_MTD_MTDRAM is not set
35819 +# CONFIG_MTD_BLOCK2MTD is not set
35820 +
35821 +#
35822 +# Disk-On-Chip Device Drivers
35823 +#
35824 +# CONFIG_MTD_DOC2000 is not set
35825 +# CONFIG_MTD_DOC2001 is not set
35826 +# CONFIG_MTD_DOC2001PLUS is not set
35827 +CONFIG_MTD_NAND=y
35828 +# CONFIG_MTD_NAND_VERIFY_WRITE is not set
35829 +CONFIG_MTD_NAND_ECC_SMC=y
35830 +# CONFIG_MTD_NAND_MUSEUM_IDS is not set
35831 +CONFIG_MTD_NAND_IDS=y
35832 +CONFIG_MTD_NAND_NDFC=y
35833 +# CONFIG_MTD_NAND_DISKONCHIP is not set
35834 +# CONFIG_MTD_NAND_NANDSIM is not set
35835 +# CONFIG_MTD_NAND_PLATFORM is not set
35836 +# CONFIG_MTD_ALAUDA is not set
35837 +# CONFIG_MTD_ONENAND is not set
35838 +
35839 +#
35840 +# UBI - Unsorted block images
35841 +#
35842 +# CONFIG_MTD_UBI is not set
35843 +CONFIG_OF_DEVICE=y
35844 +# CONFIG_PARPORT is not set
35845 +CONFIG_BLK_DEV=y
35846 +# CONFIG_BLK_DEV_FD is not set
35847 +# CONFIG_BLK_DEV_COW_COMMON is not set
35848 +# CONFIG_BLK_DEV_LOOP is not set
35849 +# CONFIG_BLK_DEV_NBD is not set
35850 +# CONFIG_BLK_DEV_UB is not set
35851 +CONFIG_BLK_DEV_RAM=y
35852 +CONFIG_BLK_DEV_RAM_COUNT=16
35853 +CONFIG_BLK_DEV_RAM_SIZE=4096
35854 +CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
35855 +# CONFIG_CDROM_PKTCDVD is not set
35856 +# CONFIG_ATA_OVER_ETH is not set
35857 +# CONFIG_XILINX_SYSACE is not set
35858 +CONFIG_MISC_DEVICES=y
35859 +# CONFIG_EEPROM_93CX6 is not set
35860 +# CONFIG_IDE is not set
35861 +
35862 +#
35863 +# SCSI device support
35864 +#
35865 +# CONFIG_RAID_ATTRS is not set
35866 +CONFIG_SCSI=y
35867 +CONFIG_SCSI_DMA=y
35868 +# CONFIG_SCSI_TGT is not set
35869 +# CONFIG_SCSI_NETLINK is not set
35870 +CONFIG_SCSI_PROC_FS=y
35871 +
35872 +#
35873 +# SCSI support type (disk, tape, CD-ROM)
35874 +#
35875 +CONFIG_BLK_DEV_SD=y
35876 +# CONFIG_CHR_DEV_ST is not set
35877 +# CONFIG_CHR_DEV_OSST is not set
35878 +# CONFIG_BLK_DEV_SR is not set
35879 +# CONFIG_CHR_DEV_SG is not set
35880 +# CONFIG_CHR_DEV_SCH is not set
35881 +
35882 +#
35883 +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
35884 +#
35885 +# CONFIG_SCSI_MULTI_LUN is not set
35886 +# CONFIG_SCSI_CONSTANTS is not set
35887 +# CONFIG_SCSI_LOGGING is not set
35888 +# CONFIG_SCSI_SCAN_ASYNC is not set
35889 +# CONFIG_SCSI_WAIT_SCAN is not set
35890 +
35891 +#
35892 +# SCSI Transports
35893 +#
35894 +CONFIG_SCSI_SPI_ATTRS=y
35895 +# CONFIG_SCSI_FC_ATTRS is not set
35896 +# CONFIG_SCSI_ISCSI_ATTRS is not set
35897 +# CONFIG_SCSI_SAS_LIBSAS is not set
35898 +# CONFIG_SCSI_SRP_ATTRS is not set
35899 +# CONFIG_SCSI_LOWLEVEL is not set
35900 +# CONFIG_ATA is not set
35901 +# CONFIG_MD is not set
35902 +# CONFIG_MACINTOSH_DRIVERS is not set
35903 +CONFIG_NETDEVICES=y
35904 +# CONFIG_NETDEVICES_MULTIQUEUE is not set
35905 +# CONFIG_DUMMY is not set
35906 +# CONFIG_BONDING is not set
35907 +# CONFIG_MACVLAN is not set
35908 +# CONFIG_EQUALIZER is not set
35909 +# CONFIG_TUN is not set
35910 +# CONFIG_VETH is not set
35911 +# CONFIG_PHYLIB is not set
35912 +CONFIG_NET_ETHERNET=y
35913 +CONFIG_MII=y
35914 +CONFIG_IBM_NEW_EMAC=y
35915 +CONFIG_IBM_NEW_EMAC_RXB=128
35916 +CONFIG_IBM_NEW_EMAC_TXB=64
35917 +CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
35918 +CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
35919 +CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
35920 +# CONFIG_IBM_NEW_EMAC_DEBUG is not set
35921 +CONFIG_IBM_NEW_EMAC_ZMII=y
35922 +# CONFIG_IBM_NEW_EMAC_RGMII is not set
35923 +# CONFIG_IBM_NEW_EMAC_TAH is not set
35924 +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
35925 +# CONFIG_B44 is not set
35926 +# CONFIG_NETDEV_1000 is not set
35927 +# CONFIG_NETDEV_10000 is not set
35928 +
35929 +#
35930 +# Wireless LAN
35931 +#
35932 +# CONFIG_WLAN_PRE80211 is not set
35933 +# CONFIG_WLAN_80211 is not set
35934 +
35935 +#
35936 +# USB Network Adapters
35937 +#
35938 +# CONFIG_USB_CATC is not set
35939 +# CONFIG_USB_KAWETH is not set
35940 +# CONFIG_USB_PEGASUS is not set
35941 +# CONFIG_USB_RTL8150 is not set
35942 +# CONFIG_USB_USBNET is not set
35943 +# CONFIG_WAN is not set
35944 +# CONFIG_PPP is not set
35945 +# CONFIG_SLIP is not set
35946 +# CONFIG_SHAPER is not set
35947 +# CONFIG_NETCONSOLE is not set
35948 +# CONFIG_NETPOLL is not set
35949 +# CONFIG_NET_POLL_CONTROLLER is not set
35950 +# CONFIG_ISDN is not set
35951 +# CONFIG_PHONE is not set
35952 +
35953 +#
35954 +# Input device support
35955 +#
35956 +# CONFIG_INPUT is not set
35957 +
35958 +#
35959 +# Hardware I/O ports
35960 +#
35961 +# CONFIG_SERIO is not set
35962 +# CONFIG_GAMEPORT is not set
35963 +
35964 +#
35965 +# Character devices
35966 +#
35967 +# CONFIG_VT is not set
35968 +# CONFIG_SERIAL_NONSTANDARD is not set
35969 +
35970 +#
35971 +# Serial drivers
35972 +#
35973 +CONFIG_SERIAL_8250=y
35974 +CONFIG_SERIAL_8250_CONSOLE=y
35975 +CONFIG_SERIAL_8250_NR_UARTS=4
35976 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4
35977 +CONFIG_SERIAL_8250_EXTENDED=y
35978 +# CONFIG_SERIAL_8250_MANY_PORTS is not set
35979 +CONFIG_SERIAL_8250_SHARE_IRQ=y
35980 +# CONFIG_SERIAL_8250_DETECT_IRQ is not set
35981 +# CONFIG_SERIAL_8250_RSA is not set
35982 +
35983 +#
35984 +# Non-8250 serial port support
35985 +#
35986 +# CONFIG_SERIAL_UARTLITE is not set
35987 +CONFIG_SERIAL_CORE=y
35988 +CONFIG_SERIAL_CORE_CONSOLE=y
35989 +# CONFIG_SERIAL_OF_PLATFORM is not set
35990 +CONFIG_UNIX98_PTYS=y
35991 +CONFIG_LEGACY_PTYS=y
35992 +CONFIG_LEGACY_PTY_COUNT=256
35993 +# CONFIG_IPMI_HANDLER is not set
35994 +CONFIG_HW_RANDOM=y
35995 +# CONFIG_NVRAM is not set
35996 +# CONFIG_GEN_RTC is not set
35997 +# CONFIG_R3964 is not set
35998 +# CONFIG_RAW_DRIVER is not set
35999 +# CONFIG_TCG_TPM is not set
36000 +CONFIG_I2C=y
36001 +CONFIG_I2C_BOARDINFO=y
36002 +# CONFIG_I2C_CHARDEV is not set
36003 +
36004 +#
36005 +# I2C Algorithms
36006 +#
36007 +# CONFIG_I2C_ALGOBIT is not set
36008 +# CONFIG_I2C_ALGOPCF is not set
36009 +# CONFIG_I2C_ALGOPCA is not set
36010 +
36011 +#
36012 +# I2C Hardware Bus support
36013 +#
36014 +CONFIG_I2C_IBM_IIC=y
36015 +# CONFIG_I2C_MPC is not set
36016 +# CONFIG_I2C_OCORES is not set
36017 +# CONFIG_I2C_PARPORT_LIGHT is not set
36018 +# CONFIG_I2C_SIMTEC is not set
36019 +# CONFIG_I2C_TAOS_EVM is not set
36020 +# CONFIG_I2C_STUB is not set
36021 +# CONFIG_I2C_TINY_USB is not set
36022 +
36023 +#
36024 +# Miscellaneous I2C Chip support
36025 +#
36026 +# CONFIG_SENSORS_DS1337 is not set
36027 +# CONFIG_SENSORS_DS1374 is not set
36028 +# CONFIG_DS1682 is not set
36029 +CONFIG_SENSORS_EEPROM=y
36030 +# CONFIG_SENSORS_PCF8574 is not set
36031 +# CONFIG_SENSORS_PCA9539 is not set
36032 +# CONFIG_SENSORS_PCF8591 is not set
36033 +# CONFIG_SENSORS_M41T00 is not set
36034 +# CONFIG_SENSORS_MAX6875 is not set
36035 +# CONFIG_SENSORS_TSL2550 is not set
36036 +# CONFIG_I2C_DEBUG_CORE is not set
36037 +# CONFIG_I2C_DEBUG_ALGO is not set
36038 +# CONFIG_I2C_DEBUG_BUS is not set
36039 +# CONFIG_I2C_DEBUG_CHIP is not set
36040 +
36041 +#
36042 +# SPI support
36043 +#
36044 +# CONFIG_SPI is not set
36045 +# CONFIG_SPI_MASTER is not set
36046 +# CONFIG_W1 is not set
36047 +# CONFIG_POWER_SUPPLY is not set
36048 +CONFIG_HWMON=y
36049 +# CONFIG_HWMON_VID is not set
36050 +CONFIG_SENSORS_AD7414=y
36051 +# CONFIG_SENSORS_AD7418 is not set
36052 +# CONFIG_SENSORS_ADM1021 is not set
36053 +# CONFIG_SENSORS_ADM1025 is not set
36054 +# CONFIG_SENSORS_ADM1026 is not set
36055 +# CONFIG_SENSORS_ADM1029 is not set
36056 +# CONFIG_SENSORS_ADM1031 is not set
36057 +# CONFIG_SENSORS_ADM9240 is not set
36058 +# CONFIG_SENSORS_ADT7470 is not set
36059 +# CONFIG_SENSORS_ATXP1 is not set
36060 +# CONFIG_SENSORS_DS1621 is not set
36061 +# CONFIG_SENSORS_F71805F is not set
36062 +# CONFIG_SENSORS_F71882FG is not set
36063 +# CONFIG_SENSORS_F75375S is not set
36064 +# CONFIG_SENSORS_GL518SM is not set
36065 +# CONFIG_SENSORS_GL520SM is not set
36066 +# CONFIG_SENSORS_IT87 is not set
36067 +# CONFIG_SENSORS_LM63 is not set
36068 +# CONFIG_SENSORS_LM75 is not set
36069 +# CONFIG_SENSORS_LM77 is not set
36070 +# CONFIG_SENSORS_LM78 is not set
36071 +# CONFIG_SENSORS_LM80 is not set
36072 +# CONFIG_SENSORS_LM83 is not set
36073 +# CONFIG_SENSORS_LM85 is not set
36074 +# CONFIG_SENSORS_LM87 is not set
36075 +# CONFIG_SENSORS_LM90 is not set
36076 +# CONFIG_SENSORS_LM92 is not set
36077 +# CONFIG_SENSORS_LM93 is not set
36078 +# CONFIG_SENSORS_MAX1619 is not set
36079 +# CONFIG_SENSORS_MAX6650 is not set
36080 +# CONFIG_SENSORS_PC87360 is not set
36081 +# CONFIG_SENSORS_PC87427 is not set
36082 +# CONFIG_SENSORS_DME1737 is not set
36083 +# CONFIG_SENSORS_SMSC47M1 is not set
36084 +# CONFIG_SENSORS_SMSC47M192 is not set
36085 +# CONFIG_SENSORS_SMSC47B397 is not set
36086 +# CONFIG_SENSORS_THMC50 is not set
36087 +# CONFIG_SENSORS_VT1211 is not set
36088 +# CONFIG_SENSORS_W83781D is not set
36089 +# CONFIG_SENSORS_W83791D is not set
36090 +# CONFIG_SENSORS_W83792D is not set
36091 +# CONFIG_SENSORS_W83793 is not set
36092 +# CONFIG_SENSORS_W83L785TS is not set
36093 +# CONFIG_SENSORS_W83627HF is not set
36094 +# CONFIG_SENSORS_W83627EHF is not set
36095 +# CONFIG_HWMON_DEBUG_CHIP is not set
36096 +# CONFIG_WATCHDOG is not set
36097 +
36098 +#
36099 +# Sonics Silicon Backplane
36100 +#
36101 +CONFIG_SSB_POSSIBLE=y
36102 +# CONFIG_SSB is not set
36103 +
36104 +#
36105 +# Multifunction device drivers
36106 +#
36107 +# CONFIG_MFD_SM501 is not set
36108 +
36109 +#
36110 +# Multimedia devices
36111 +#
36112 +# CONFIG_VIDEO_DEV is not set
36113 +# CONFIG_DVB_CORE is not set
36114 +# CONFIG_DAB is not set
36115 +
36116 +#
36117 +# Graphics support
36118 +#
36119 +# CONFIG_VGASTATE is not set
36120 +# CONFIG_VIDEO_OUTPUT_CONTROL is not set
36121 +# CONFIG_FB is not set
36122 +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
36123 +
36124 +#
36125 +# Display device support
36126 +#
36127 +# CONFIG_DISPLAY_SUPPORT is not set
36128 +
36129 +#
36130 +# Sound
36131 +#
36132 +# CONFIG_SOUND is not set
36133 +CONFIG_USB_SUPPORT=y
36134 +CONFIG_USB_ARCH_HAS_HCD=y
36135 +CONFIG_USB_ARCH_HAS_OHCI=y
36136 +# CONFIG_USB_ARCH_HAS_EHCI is not set
36137 +CONFIG_USB=y
36138 +# CONFIG_USB_DEBUG is not set
36139 +
36140 +#
36141 +# Miscellaneous USB options
36142 +#
36143 +# CONFIG_USB_DEVICEFS is not set
36144 +CONFIG_USB_DEVICE_CLASS=y
36145 +# CONFIG_USB_DYNAMIC_MINORS is not set
36146 +# CONFIG_USB_OTG is not set
36147 +
36148 +#
36149 +# USB Host Controller Drivers
36150 +#
36151 +# CONFIG_USB_ISP116X_HCD is not set
36152 +CONFIG_USB_OHCI_HCD=y
36153 +CONFIG_USB_OHCI_HCD_PPC_OF=y
36154 +CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
36155 +# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
36156 +CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
36157 +CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
36158 +CONFIG_USB_OHCI_LITTLE_ENDIAN=y
36159 +# CONFIG_USB_SL811_HCD is not set
36160 +# CONFIG_USB_R8A66597_HCD is not set
36161 +
36162 +#
36163 +# USB Device Class drivers
36164 +#
36165 +# CONFIG_USB_ACM is not set
36166 +# CONFIG_USB_PRINTER is not set
36167 +
36168 +#
36169 +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
36170 +#
36171 +
36172 +#
36173 +# may also be needed; see USB_STORAGE Help for more information
36174 +#
36175 +CONFIG_USB_STORAGE=y
36176 +# CONFIG_USB_STORAGE_DEBUG is not set
36177 +# CONFIG_USB_STORAGE_DATAFAB is not set
36178 +# CONFIG_USB_STORAGE_FREECOM is not set
36179 +# CONFIG_USB_STORAGE_ISD200 is not set
36180 +# CONFIG_USB_STORAGE_DPCM is not set
36181 +# CONFIG_USB_STORAGE_USBAT is not set
36182 +# CONFIG_USB_STORAGE_SDDR09 is not set
36183 +# CONFIG_USB_STORAGE_SDDR55 is not set
36184 +# CONFIG_USB_STORAGE_JUMPSHOT is not set
36185 +# CONFIG_USB_STORAGE_ALAUDA is not set
36186 +# CONFIG_USB_STORAGE_KARMA is not set
36187 +# CONFIG_USB_LIBUSUAL is not set
36188 +
36189 +#
36190 +# USB Imaging devices
36191 +#
36192 +# CONFIG_USB_MDC800 is not set
36193 +# CONFIG_USB_MICROTEK is not set
36194 +CONFIG_USB_MON=y
36195 +
36196 +#
36197 +# USB port drivers
36198 +#
36199 +
36200 +#
36201 +# USB Serial Converter support
36202 +#
36203 +# CONFIG_USB_SERIAL is not set
36204 +
36205 +#
36206 +# USB Miscellaneous drivers
36207 +#
36208 +# CONFIG_USB_EMI62 is not set
36209 +# CONFIG_USB_EMI26 is not set
36210 +# CONFIG_USB_ADUTUX is not set
36211 +# CONFIG_USB_AUERSWALD is not set
36212 +# CONFIG_USB_RIO500 is not set
36213 +# CONFIG_USB_LEGOTOWER is not set
36214 +# CONFIG_USB_LCD is not set
36215 +# CONFIG_USB_BERRY_CHARGE is not set
36216 +# CONFIG_USB_LED is not set
36217 +# CONFIG_USB_CYPRESS_CY7C63 is not set
36218 +# CONFIG_USB_CYTHERM is not set
36219 +# CONFIG_USB_PHIDGET is not set
36220 +# CONFIG_USB_IDMOUSE is not set
36221 +# CONFIG_USB_FTDI_ELAN is not set
36222 +# CONFIG_USB_APPLEDISPLAY is not set
36223 +# CONFIG_USB_LD is not set
36224 +# CONFIG_USB_TRANCEVIBRATOR is not set
36225 +# CONFIG_USB_IOWARRIOR is not set
36226 +
36227 +#
36228 +# USB DSL modem support
36229 +#
36230 +
36231 +#
36232 +# USB Gadget Support
36233 +#
36234 +# CONFIG_USB_GADGET is not set
36235 +CONFIG_MMC=m
36236 +# CONFIG_MMC_DEBUG is not set
36237 +# CONFIG_MMC_UNSAFE_RESUME is not set
36238 +
36239 +#
36240 +# MMC/SD Card Drivers
36241 +#
36242 +CONFIG_MMC_BLOCK=m
36243 +CONFIG_MMC_BLOCK_BOUNCE=y
36244 +# CONFIG_SDIO_UART is not set
36245 +
36246 +#
36247 +# MMC/SD Host Controller Drivers
36248 +#
36249 +# CONFIG_MMC_WBSD is not set
36250 +# CONFIG_NEW_LEDS is not set
36251 +# CONFIG_EDAC is not set
36252 +# CONFIG_RTC_CLASS is not set
36253 +
36254 +#
36255 +# Userspace I/O
36256 +#
36257 +# CONFIG_UIO is not set
36258 +
36259 +#
36260 +# File systems
36261 +#
36262 +CONFIG_EXT2_FS=y
36263 +# CONFIG_EXT2_FS_XATTR is not set
36264 +# CONFIG_EXT2_FS_XIP is not set
36265 +# CONFIG_EXT3_FS is not set
36266 +# CONFIG_EXT4DEV_FS is not set
36267 +# CONFIG_REISERFS_FS is not set
36268 +# CONFIG_JFS_FS is not set
36269 +# CONFIG_FS_POSIX_ACL is not set
36270 +# CONFIG_XFS_FS is not set
36271 +# CONFIG_GFS2_FS is not set
36272 +# CONFIG_OCFS2_FS is not set
36273 +# CONFIG_MINIX_FS is not set
36274 +# CONFIG_ROMFS_FS is not set
36275 +CONFIG_INOTIFY=y
36276 +CONFIG_INOTIFY_USER=y
36277 +# CONFIG_QUOTA is not set
36278 +CONFIG_DNOTIFY=y
36279 +# CONFIG_AUTOFS_FS is not set
36280 +# CONFIG_AUTOFS4_FS is not set
36281 +# CONFIG_FUSE_FS is not set
36282 +
36283 +#
36284 +# CD-ROM/DVD Filesystems
36285 +#
36286 +# CONFIG_ISO9660_FS is not set
36287 +# CONFIG_UDF_FS is not set
36288 +
36289 +#
36290 +# DOS/FAT/NT Filesystems
36291 +#
36292 +CONFIG_FAT_FS=y
36293 +CONFIG_MSDOS_FS=y
36294 +CONFIG_VFAT_FS=y
36295 +CONFIG_FAT_DEFAULT_CODEPAGE=437
36296 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
36297 +# CONFIG_NTFS_FS is not set
36298 +
36299 +#
36300 +# Pseudo filesystems
36301 +#
36302 +CONFIG_PROC_FS=y
36303 +CONFIG_PROC_KCORE=y
36304 +CONFIG_PROC_SYSCTL=y
36305 +CONFIG_SYSFS=y
36306 +# CONFIG_TMPFS is not set
36307 +# CONFIG_HUGETLB_PAGE is not set
36308 +# CONFIG_CONFIGFS_FS is not set
36309 +
36310 +#
36311 +# Miscellaneous filesystems
36312 +#
36313 +# CONFIG_ADFS_FS is not set
36314 +# CONFIG_AFFS_FS is not set
36315 +# CONFIG_HFS_FS is not set
36316 +# CONFIG_HFSPLUS_FS is not set
36317 +# CONFIG_BEFS_FS is not set
36318 +# CONFIG_BFS_FS is not set
36319 +# CONFIG_EFS_FS is not set
36320 +CONFIG_JFFS2_FS=y
36321 +CONFIG_JFFS2_FS_DEBUG=0
36322 +CONFIG_JFFS2_FS_WRITEBUFFER=y
36323 +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
36324 +# CONFIG_JFFS2_SUMMARY is not set
36325 +# CONFIG_JFFS2_FS_XATTR is not set
36326 +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
36327 +CONFIG_JFFS2_ZLIB=y
36328 +# CONFIG_JFFS2_LZO is not set
36329 +CONFIG_JFFS2_RTIME=y
36330 +# CONFIG_JFFS2_RUBIN is not set
36331 +CONFIG_CRAMFS=y
36332 +# CONFIG_VXFS_FS is not set
36333 +# CONFIG_HPFS_FS is not set
36334 +# CONFIG_QNX4FS_FS is not set
36335 +# CONFIG_SYSV_FS is not set
36336 +# CONFIG_UFS_FS is not set
36337 +CONFIG_NETWORK_FILESYSTEMS=y
36338 +CONFIG_NFS_FS=y
36339 +CONFIG_NFS_V3=y
36340 +# CONFIG_NFS_V3_ACL is not set
36341 +# CONFIG_NFS_V4 is not set
36342 +# CONFIG_NFS_DIRECTIO is not set
36343 +# CONFIG_NFSD is not set
36344 +CONFIG_ROOT_NFS=y
36345 +CONFIG_LOCKD=y
36346 +CONFIG_LOCKD_V4=y
36347 +CONFIG_NFS_COMMON=y
36348 +CONFIG_SUNRPC=y
36349 +# CONFIG_SUNRPC_BIND34 is not set
36350 +# CONFIG_RPCSEC_GSS_KRB5 is not set
36351 +# CONFIG_RPCSEC_GSS_SPKM3 is not set
36352 +# CONFIG_SMB_FS is not set
36353 +# CONFIG_CIFS is not set
36354 +# CONFIG_NCP_FS is not set
36355 +# CONFIG_CODA_FS is not set
36356 +# CONFIG_AFS_FS is not set
36357 +
36358 +#
36359 +# Partition Types
36360 +#
36361 +# CONFIG_PARTITION_ADVANCED is not set
36362 +CONFIG_MSDOS_PARTITION=y
36363 +CONFIG_NLS=y
36364 +CONFIG_NLS_DEFAULT="iso8859-1"
36365 +CONFIG_NLS_CODEPAGE_437=y
36366 +# CONFIG_NLS_CODEPAGE_737 is not set
36367 +# CONFIG_NLS_CODEPAGE_775 is not set
36368 +CONFIG_NLS_CODEPAGE_850=y
36369 +# CONFIG_NLS_CODEPAGE_852 is not set
36370 +# CONFIG_NLS_CODEPAGE_855 is not set
36371 +# CONFIG_NLS_CODEPAGE_857 is not set
36372 +# CONFIG_NLS_CODEPAGE_860 is not set
36373 +# CONFIG_NLS_CODEPAGE_861 is not set
36374 +# CONFIG_NLS_CODEPAGE_862 is not set
36375 +# CONFIG_NLS_CODEPAGE_863 is not set
36376 +# CONFIG_NLS_CODEPAGE_864 is not set
36377 +# CONFIG_NLS_CODEPAGE_865 is not set
36378 +# CONFIG_NLS_CODEPAGE_866 is not set
36379 +# CONFIG_NLS_CODEPAGE_869 is not set
36380 +# CONFIG_NLS_CODEPAGE_936 is not set
36381 +# CONFIG_NLS_CODEPAGE_950 is not set
36382 +# CONFIG_NLS_CODEPAGE_932 is not set
36383 +# CONFIG_NLS_CODEPAGE_949 is not set
36384 +# CONFIG_NLS_CODEPAGE_874 is not set
36385 +# CONFIG_NLS_ISO8859_8 is not set
36386 +# CONFIG_NLS_CODEPAGE_1250 is not set
36387 +# CONFIG_NLS_CODEPAGE_1251 is not set
36388 +CONFIG_NLS_ASCII=y
36389 +CONFIG_NLS_ISO8859_1=y
36390 +# CONFIG_NLS_ISO8859_2 is not set
36391 +# CONFIG_NLS_ISO8859_3 is not set
36392 +# CONFIG_NLS_ISO8859_4 is not set
36393 +# CONFIG_NLS_ISO8859_5 is not set
36394 +# CONFIG_NLS_ISO8859_6 is not set
36395 +# CONFIG_NLS_ISO8859_7 is not set
36396 +# CONFIG_NLS_ISO8859_9 is not set
36397 +# CONFIG_NLS_ISO8859_13 is not set
36398 +# CONFIG_NLS_ISO8859_14 is not set
36399 +CONFIG_NLS_ISO8859_15=y
36400 +# CONFIG_NLS_KOI8_R is not set
36401 +# CONFIG_NLS_KOI8_U is not set
36402 +CONFIG_NLS_UTF8=y
36403 +# CONFIG_DLM is not set
36404 +# CONFIG_UCC_SLOW is not set
36405 +
36406 +#
36407 +# Library routines
36408 +#
36409 +CONFIG_BITREVERSE=y
36410 +CONFIG_CRC_CCITT=y
36411 +# CONFIG_CRC16 is not set
36412 +# CONFIG_CRC_ITU_T is not set
36413 +CONFIG_CRC32=y
36414 +# CONFIG_CRC7 is not set
36415 +# CONFIG_LIBCRC32C is not set
36416 +CONFIG_ZLIB_INFLATE=y
36417 +CONFIG_ZLIB_DEFLATE=y
36418 +CONFIG_PLIST=y
36419 +CONFIG_HAS_IOMEM=y
36420 +CONFIG_HAS_IOPORT=y
36421 +CONFIG_HAS_DMA=y
36422 +# CONFIG_INSTRUMENTATION is not set
36423 +
36424 +#
36425 +# Kernel hacking
36426 +#
36427 +# CONFIG_PRINTK_TIME is not set
36428 +CONFIG_ENABLE_WARN_DEPRECATED=y
36429 +CONFIG_ENABLE_MUST_CHECK=y
36430 +CONFIG_MAGIC_SYSRQ=y
36431 +# CONFIG_UNUSED_SYMBOLS is not set
36432 +# CONFIG_DEBUG_FS is not set
36433 +# CONFIG_HEADERS_CHECK is not set
36434 +CONFIG_DEBUG_KERNEL=y
36435 +# CONFIG_DEBUG_SHIRQ is not set
36436 +CONFIG_DETECT_SOFTLOCKUP=y
36437 +# CONFIG_SCHED_DEBUG is not set
36438 +# CONFIG_SCHEDSTATS is not set
36439 +# CONFIG_TIMER_STATS is not set
36440 +# CONFIG_DEBUG_SLAB is not set
36441 +# CONFIG_DEBUG_RT_MUTEXES is not set
36442 +# CONFIG_RT_MUTEX_TESTER is not set
36443 +# CONFIG_DEBUG_SPINLOCK is not set
36444 +# CONFIG_DEBUG_MUTEXES is not set
36445 +# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
36446 +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
36447 +# CONFIG_DEBUG_KOBJECT is not set
36448 +# CONFIG_DEBUG_BUGVERBOSE is not set
36449 +CONFIG_DEBUG_INFO=y
36450 +# CONFIG_DEBUG_VM is not set
36451 +# CONFIG_DEBUG_LIST is not set
36452 +# CONFIG_DEBUG_SG is not set
36453 +CONFIG_FORCED_INLINING=y
36454 +# CONFIG_BOOT_PRINTK_DELAY is not set
36455 +# CONFIG_RCU_TORTURE_TEST is not set
36456 +# CONFIG_FAULT_INJECTION is not set
36457 +# CONFIG_SAMPLES is not set
36458 +# CONFIG_DEBUG_STACKOVERFLOW is not set
36459 +# CONFIG_DEBUG_STACK_USAGE is not set
36460 +# CONFIG_DEBUG_PAGEALLOC is not set
36461 +# CONFIG_DEBUGGER is not set
36462 +CONFIG_BDI_SWITCH=y
36463 +# CONFIG_PPC_EARLY_DEBUG is not set
36464 +
36465 +#
36466 +# Security options
36467 +#
36468 +# CONFIG_KEYS is not set
36469 +# CONFIG_SECURITY is not set
36470 +# CONFIG_SECURITY_FILE_CAPABILITIES is not set
36471 +# CONFIG_CRYPTO is not set
36472 +# CONFIG_PPC_CLOCK is not set
36473 --- a/arch/powerpc/kernel/Makefile
36474 +++ b/arch/powerpc/kernel/Makefile
36475 @@ -3,7 +3,7 @@
36476  #
36477  
36478  ifeq ($(CONFIG_PPC64),y)
36479 -EXTRA_CFLAGS   += -mno-minimal-toc
36480 +CFLAGS_prom_init.o     += -mno-minimal-toc
36481  endif
36482  ifeq ($(CONFIG_PPC32),y)
36483  CFLAGS_prom_init.o      += -fPIC
36484 @@ -70,6 +70,7 @@
36485  obj-$(CONFIG_PCI)              += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \
36486                                    pci-common.o
36487  obj-$(CONFIG_PCI_MSI)          += msi.o
36488 +obj-$(CONFIG_RAPIDIO)          += rio.o
36489  obj-$(CONFIG_KEXEC)            += machine_kexec.o crash.o \
36490                                    machine_kexec_$(CONFIG_WORD_SIZE).o
36491  obj-$(CONFIG_AUDIT)            += audit.o
36492 @@ -91,3 +92,13 @@
36493  
36494  extra-$(CONFIG_PPC_FPU)                += fpu.o
36495  extra-$(CONFIG_PPC64)          += entry_64.o
36496 +
36497 +extra-y                                += systbl_chk.i
36498 +$(obj)/systbl.o:               systbl_chk
36499 +
36500 +quiet_cmd_systbl_chk = CALL    $<
36501 +      cmd_systbl_chk = $(CONFIG_SHELL) $< $(obj)/systbl_chk.i
36502 +
36503 +PHONY += systbl_chk
36504 +systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i
36505 +       $(call cmd,systbl_chk)
36506 --- a/arch/powerpc/kernel/btext.c
36507 +++ b/arch/powerpc/kernel/btext.c
36508 @@ -236,7 +236,7 @@
36509         if (rc == 0 || !allow_nonstdout)
36510                 return rc;
36511  
36512 -       for (np = NULL; (np = of_find_node_by_type(np, "display"));) {
36513 +       for_each_node_by_type(np, "display") {
36514                 if (of_get_property(np, "linux,opened", NULL)) {
36515                         printk("trying %s ...\n", np->full_name);
36516                         rc = btext_initialize(np);
36517 --- a/arch/powerpc/kernel/cpu_setup_44x.S
36518 +++ b/arch/powerpc/kernel/cpu_setup_44x.S
36519 @@ -23,11 +23,24 @@
36520         mflr    r4
36521         bl      __init_fpu_44x
36522         bl      __plb_disable_wrp
36523 +       bl      __fixup_440A_mcheck
36524         mtlr    r4
36525         blr
36526  _GLOBAL(__setup_cpu_440grx)
36527 -       b       __plb_disable_wrp
36528 +       mflr    r4
36529 +       bl      __plb_disable_wrp
36530 +       bl      __fixup_440A_mcheck
36531 +       mtlr    r4
36532 +       blr
36533 +_GLOBAL(__setup_cpu_440gx)
36534 +_GLOBAL(__setup_cpu_440spe)
36535 +       b       __fixup_440A_mcheck
36536  
36537 + /* Temporary fixup for arch/ppc until we kill the whole thing */
36538 +#ifndef CONFIG_PPC_MERGE
36539 +_GLOBAL(__fixup_440A_mcheck)
36540 +       blr
36541 +#endif
36542  
36543  /* enable APU between CPU and FPU */
36544  _GLOBAL(__init_fpu_44x)
36545 --- a/arch/powerpc/kernel/cputable.c
36546 +++ b/arch/powerpc/kernel/cputable.c
36547 @@ -33,7 +33,9 @@
36548  #ifdef CONFIG_PPC32
36549  extern void __setup_cpu_440ep(unsigned long offset, struct cpu_spec* spec);
36550  extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec);
36551 +extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec);
36552  extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
36553 +extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec);
36554  extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
36555  extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
36556  extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
36557 @@ -85,6 +87,7 @@
36558                 .pmc_type               = PPC_PMC_IBM,
36559                 .oprofile_cpu_type      = "ppc64/power3",
36560                 .oprofile_type          = PPC_OPROFILE_RS64,
36561 +               .machine_check          = machine_check_generic,
36562                 .platform               = "power3",
36563         },
36564         {       /* Power3+ */
36565 @@ -99,6 +102,7 @@
36566                 .pmc_type               = PPC_PMC_IBM,
36567                 .oprofile_cpu_type      = "ppc64/power3",
36568                 .oprofile_type          = PPC_OPROFILE_RS64,
36569 +               .machine_check          = machine_check_generic,
36570                 .platform               = "power3",
36571         },
36572         {       /* Northstar */
36573 @@ -113,6 +117,7 @@
36574                 .pmc_type               = PPC_PMC_IBM,
36575                 .oprofile_cpu_type      = "ppc64/rs64",
36576                 .oprofile_type          = PPC_OPROFILE_RS64,
36577 +               .machine_check          = machine_check_generic,
36578                 .platform               = "rs64",
36579         },
36580         {       /* Pulsar */
36581 @@ -127,6 +132,7 @@
36582                 .pmc_type               = PPC_PMC_IBM,
36583                 .oprofile_cpu_type      = "ppc64/rs64",
36584                 .oprofile_type          = PPC_OPROFILE_RS64,
36585 +               .machine_check          = machine_check_generic,
36586                 .platform               = "rs64",
36587         },
36588         {       /* I-star */
36589 @@ -141,6 +147,7 @@
36590                 .pmc_type               = PPC_PMC_IBM,
36591                 .oprofile_cpu_type      = "ppc64/rs64",
36592                 .oprofile_type          = PPC_OPROFILE_RS64,
36593 +               .machine_check          = machine_check_generic,
36594                 .platform               = "rs64",
36595         },
36596         {       /* S-star */
36597 @@ -155,6 +162,7 @@
36598                 .pmc_type               = PPC_PMC_IBM,
36599                 .oprofile_cpu_type      = "ppc64/rs64",
36600                 .oprofile_type          = PPC_OPROFILE_RS64,
36601 +               .machine_check          = machine_check_generic,
36602                 .platform               = "rs64",
36603         },
36604         {       /* Power4 */
36605 @@ -169,6 +177,7 @@
36606                 .pmc_type               = PPC_PMC_IBM,
36607                 .oprofile_cpu_type      = "ppc64/power4",
36608                 .oprofile_type          = PPC_OPROFILE_POWER4,
36609 +               .machine_check          = machine_check_generic,
36610                 .platform               = "power4",
36611         },
36612         {       /* Power4+ */
36613 @@ -183,6 +192,7 @@
36614                 .pmc_type               = PPC_PMC_IBM,
36615                 .oprofile_cpu_type      = "ppc64/power4",
36616                 .oprofile_type          = PPC_OPROFILE_POWER4,
36617 +               .machine_check          = machine_check_generic,
36618                 .platform               = "power4",
36619         },
36620         {       /* PPC970 */
36621 @@ -200,6 +210,7 @@
36622                 .cpu_restore            = __restore_cpu_ppc970,
36623                 .oprofile_cpu_type      = "ppc64/970",
36624                 .oprofile_type          = PPC_OPROFILE_POWER4,
36625 +               .machine_check          = machine_check_generic,
36626                 .platform               = "ppc970",
36627         },
36628         {       /* PPC970FX */
36629 @@ -217,6 +228,7 @@
36630                 .cpu_restore            = __restore_cpu_ppc970,
36631                 .oprofile_cpu_type      = "ppc64/970",
36632                 .oprofile_type          = PPC_OPROFILE_POWER4,
36633 +               .machine_check          = machine_check_generic,
36634                 .platform               = "ppc970",
36635         },
36636         {       /* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */
36637 @@ -234,6 +246,7 @@
36638                 .cpu_restore            = __restore_cpu_ppc970,
36639                 .oprofile_cpu_type      = "ppc64/970MP",
36640                 .oprofile_type          = PPC_OPROFILE_POWER4,
36641 +               .machine_check          = machine_check_generic,
36642                 .platform               = "ppc970",
36643         },
36644         {       /* PPC970MP */
36645 @@ -251,6 +264,7 @@
36646                 .cpu_restore            = __restore_cpu_ppc970,
36647                 .oprofile_cpu_type      = "ppc64/970MP",
36648                 .oprofile_type          = PPC_OPROFILE_POWER4,
36649 +               .machine_check          = machine_check_generic,
36650                 .platform               = "ppc970",
36651         },
36652         {       /* PPC970GX */
36653 @@ -267,6 +281,7 @@
36654                 .cpu_setup              = __setup_cpu_ppc970,
36655                 .oprofile_cpu_type      = "ppc64/970",
36656                 .oprofile_type          = PPC_OPROFILE_POWER4,
36657 +               .machine_check          = machine_check_generic,
36658                 .platform               = "ppc970",
36659         },
36660         {       /* Power5 GR */
36661 @@ -286,6 +301,7 @@
36662                  */
36663                 .oprofile_mmcra_sihv    = MMCRA_SIHV,
36664                 .oprofile_mmcra_sipr    = MMCRA_SIPR,
36665 +               .machine_check          = machine_check_generic,
36666                 .platform               = "power5",
36667         },
36668         {       /* Power5++ */
36669 @@ -301,6 +317,7 @@
36670                 .oprofile_type          = PPC_OPROFILE_POWER4,
36671                 .oprofile_mmcra_sihv    = MMCRA_SIHV,
36672                 .oprofile_mmcra_sipr    = MMCRA_SIPR,
36673 +               .machine_check          = machine_check_generic,
36674                 .platform               = "power5+",
36675         },
36676         {       /* Power5 GS */
36677 @@ -317,6 +334,7 @@
36678                 .oprofile_type          = PPC_OPROFILE_POWER4,
36679                 .oprofile_mmcra_sihv    = MMCRA_SIHV,
36680                 .oprofile_mmcra_sipr    = MMCRA_SIPR,
36681 +               .machine_check          = machine_check_generic,
36682                 .platform               = "power5+",
36683         },
36684         {       /* POWER6 in P5+ mode; 2.04-compliant processor */
36685 @@ -327,6 +345,7 @@
36686                 .cpu_user_features      = COMMON_USER_POWER5_PLUS,
36687                 .icache_bsize           = 128,
36688                 .dcache_bsize           = 128,
36689 +               .machine_check          = machine_check_generic,
36690                 .platform               = "power5+",
36691         },
36692         {       /* Power6 */
36693 @@ -346,6 +365,7 @@
36694                 .oprofile_mmcra_sipr    = POWER6_MMCRA_SIPR,
36695                 .oprofile_mmcra_clear   = POWER6_MMCRA_THRM |
36696                         POWER6_MMCRA_OTHER,
36697 +               .machine_check          = machine_check_generic,
36698                 .platform               = "power6x",
36699         },
36700         {       /* 2.05-compliant processor, i.e. Power6 "architected" mode */
36701 @@ -356,6 +376,7 @@
36702                 .cpu_user_features      = COMMON_USER_POWER6,
36703                 .icache_bsize           = 128,
36704                 .dcache_bsize           = 128,
36705 +               .machine_check          = machine_check_generic,
36706                 .platform               = "power6",
36707         },
36708         {       /* Cell Broadband Engine */
36709 @@ -372,6 +393,7 @@
36710                 .pmc_type               = PPC_PMC_IBM,
36711                 .oprofile_cpu_type      = "ppc64/cell-be",
36712                 .oprofile_type          = PPC_OPROFILE_CELL,
36713 +               .machine_check          = machine_check_generic,
36714                 .platform               = "ppc-cell-be",
36715         },
36716         {       /* PA Semi PA6T */
36717 @@ -388,6 +410,7 @@
36718                 .cpu_restore            = __restore_cpu_pa6t,
36719                 .oprofile_cpu_type      = "ppc64/pa6t",
36720                 .oprofile_type          = PPC_OPROFILE_PA6T,
36721 +               .machine_check          = machine_check_generic,
36722                 .platform               = "pa6t",
36723         },
36724         {       /* default match */
36725 @@ -400,6 +423,7 @@
36726                 .dcache_bsize           = 128,
36727                 .num_pmcs               = 6,
36728                 .pmc_type               = PPC_PMC_IBM,
36729 +               .machine_check          = machine_check_generic,
36730                 .platform               = "power4",
36731         }
36732  #endif /* CONFIG_PPC64 */
36733 @@ -414,6 +438,7 @@
36734                         PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
36735                 .icache_bsize           = 32,
36736                 .dcache_bsize           = 32,
36737 +               .machine_check          = machine_check_generic,
36738                 .platform               = "ppc601",
36739         },
36740         {       /* 603 */
36741 @@ -425,6 +450,7 @@
36742                 .icache_bsize           = 32,
36743                 .dcache_bsize           = 32,
36744                 .cpu_setup              = __setup_cpu_603,
36745 +               .machine_check          = machine_check_generic,
36746                 .platform               = "ppc603",
36747         },
36748         {       /* 603e */
36749 @@ -436,6 +462,7 @@
36750                 .icache_bsize           = 32,
36751                 .dcache_bsize           = 32,
36752                 .cpu_setup              = __setup_cpu_603,
36753 +               .machine_check          = machine_check_generic,
36754                 .platform               = "ppc603",
36755         },
36756         {       /* 603ev */
36757 @@ -447,6 +474,7 @@
36758                 .icache_bsize           = 32,
36759                 .dcache_bsize           = 32,
36760                 .cpu_setup              = __setup_cpu_603,
36761 +               .machine_check          = machine_check_generic,
36762                 .platform               = "ppc603",
36763         },
36764         {       /* 604 */
36765 @@ -459,6 +487,7 @@
36766                 .dcache_bsize           = 32,
36767                 .num_pmcs               = 2,
36768                 .cpu_setup              = __setup_cpu_604,
36769 +               .machine_check          = machine_check_generic,
36770                 .platform               = "ppc604",
36771         },
36772         {       /* 604e */
36773 @@ -471,6 +500,7 @@
36774                 .dcache_bsize           = 32,
36775                 .num_pmcs               = 4,
36776                 .cpu_setup              = __setup_cpu_604,
36777 +               .machine_check          = machine_check_generic,
36778                 .platform               = "ppc604",
36779         },
36780         {       /* 604r */
36781 @@ -483,6 +513,7 @@
36782                 .dcache_bsize           = 32,
36783                 .num_pmcs               = 4,
36784                 .cpu_setup              = __setup_cpu_604,
36785 +               .machine_check          = machine_check_generic,
36786                 .platform               = "ppc604",
36787         },
36788         {       /* 604ev */
36789 @@ -495,6 +526,7 @@
36790                 .dcache_bsize           = 32,
36791                 .num_pmcs               = 4,
36792                 .cpu_setup              = __setup_cpu_604,
36793 +               .machine_check          = machine_check_generic,
36794                 .platform               = "ppc604",
36795         },
36796         {       /* 740/750 (0x4202, don't support TAU ?) */
36797 @@ -507,6 +539,7 @@
36798                 .dcache_bsize           = 32,
36799                 .num_pmcs               = 4,
36800                 .cpu_setup              = __setup_cpu_750,
36801 +               .machine_check          = machine_check_generic,
36802                 .platform               = "ppc750",
36803         },
36804         {       /* 750CX (80100 and 8010x?) */
36805 @@ -519,6 +552,7 @@
36806                 .dcache_bsize           = 32,
36807                 .num_pmcs               = 4,
36808                 .cpu_setup              = __setup_cpu_750cx,
36809 +               .machine_check          = machine_check_generic,
36810                 .platform               = "ppc750",
36811         },
36812         {       /* 750CX (82201 and 82202) */
36813 @@ -531,6 +565,7 @@
36814                 .dcache_bsize           = 32,
36815                 .num_pmcs               = 4,
36816                 .cpu_setup              = __setup_cpu_750cx,
36817 +               .machine_check          = machine_check_generic,
36818                 .platform               = "ppc750",
36819         },
36820         {       /* 750CXe (82214) */
36821 @@ -543,6 +578,7 @@
36822                 .dcache_bsize           = 32,
36823                 .num_pmcs               = 4,
36824                 .cpu_setup              = __setup_cpu_750cx,
36825 +               .machine_check          = machine_check_generic,
36826                 .platform               = "ppc750",
36827         },
36828         {       /* 750CXe "Gekko" (83214) */
36829 @@ -555,6 +591,7 @@
36830                 .dcache_bsize           = 32,
36831                 .num_pmcs               = 4,
36832                 .cpu_setup              = __setup_cpu_750cx,
36833 +               .machine_check          = machine_check_generic,
36834                 .platform               = "ppc750",
36835         },
36836         {       /* 750CL */
36837 @@ -567,6 +604,7 @@
36838                 .dcache_bsize           = 32,
36839                 .num_pmcs               = 4,
36840                 .cpu_setup              = __setup_cpu_750,
36841 +               .machine_check          = machine_check_generic,
36842                 .platform               = "ppc750",
36843         },
36844         {       /* 745/755 */
36845 @@ -579,6 +617,7 @@
36846                 .dcache_bsize           = 32,
36847                 .num_pmcs               = 4,
36848                 .cpu_setup              = __setup_cpu_750,
36849 +               .machine_check          = machine_check_generic,
36850                 .platform               = "ppc750",
36851         },
36852         {       /* 750FX rev 1.x */
36853 @@ -591,6 +630,7 @@
36854                 .dcache_bsize           = 32,
36855                 .num_pmcs               = 4,
36856                 .cpu_setup              = __setup_cpu_750,
36857 +               .machine_check          = machine_check_generic,
36858                 .platform               = "ppc750",
36859         },
36860         {       /* 750FX rev 2.0 must disable HID0[DPM] */
36861 @@ -603,6 +643,7 @@
36862                 .dcache_bsize           = 32,
36863                 .num_pmcs               = 4,
36864                 .cpu_setup              = __setup_cpu_750,
36865 +               .machine_check          = machine_check_generic,
36866                 .platform               = "ppc750",
36867         },
36868         {       /* 750FX (All revs except 2.0) */
36869 @@ -615,6 +656,7 @@
36870                 .dcache_bsize           = 32,
36871                 .num_pmcs               = 4,
36872                 .cpu_setup              = __setup_cpu_750fx,
36873 +               .machine_check          = machine_check_generic,
36874                 .platform               = "ppc750",
36875         },
36876         {       /* 750GX */
36877 @@ -627,6 +669,7 @@
36878                 .dcache_bsize           = 32,
36879                 .num_pmcs               = 4,
36880                 .cpu_setup              = __setup_cpu_750fx,
36881 +               .machine_check          = machine_check_generic,
36882                 .platform               = "ppc750",
36883         },
36884         {       /* 740/750 (L2CR bit need fixup for 740) */
36885 @@ -639,6 +682,7 @@
36886                 .dcache_bsize           = 32,
36887                 .num_pmcs               = 4,
36888                 .cpu_setup              = __setup_cpu_750,
36889 +               .machine_check          = machine_check_generic,
36890                 .platform               = "ppc750",
36891         },
36892         {       /* 7400 rev 1.1 ? (no TAU) */
36893 @@ -652,6 +696,7 @@
36894                 .dcache_bsize           = 32,
36895                 .num_pmcs               = 4,
36896                 .cpu_setup              = __setup_cpu_7400,
36897 +               .machine_check          = machine_check_generic,
36898                 .platform               = "ppc7400",
36899         },
36900         {       /* 7400 */
36901 @@ -665,6 +710,7 @@
36902                 .dcache_bsize           = 32,
36903                 .num_pmcs               = 4,
36904                 .cpu_setup              = __setup_cpu_7400,
36905 +               .machine_check          = machine_check_generic,
36906                 .platform               = "ppc7400",
36907         },
36908         {       /* 7410 */
36909 @@ -678,6 +724,7 @@
36910                 .dcache_bsize           = 32,
36911                 .num_pmcs               = 4,
36912                 .cpu_setup              = __setup_cpu_7410,
36913 +               .machine_check          = machine_check_generic,
36914                 .platform               = "ppc7400",
36915         },
36916         {       /* 7450 2.0 - no doze/nap */
36917 @@ -693,6 +740,7 @@
36918                 .cpu_setup              = __setup_cpu_745x,
36919                 .oprofile_cpu_type      = "ppc/7450",
36920                 .oprofile_type          = PPC_OPROFILE_G4,
36921 +               .machine_check          = machine_check_generic,
36922                 .platform               = "ppc7450",
36923         },
36924         {       /* 7450 2.1 */
36925 @@ -708,6 +756,7 @@
36926                 .cpu_setup              = __setup_cpu_745x,
36927                 .oprofile_cpu_type      = "ppc/7450",
36928                 .oprofile_type          = PPC_OPROFILE_G4,
36929 +               .machine_check          = machine_check_generic,
36930                 .platform               = "ppc7450",
36931         },
36932         {       /* 7450 2.3 and newer */
36933 @@ -723,6 +772,7 @@
36934                 .cpu_setup              = __setup_cpu_745x,
36935                 .oprofile_cpu_type      = "ppc/7450",
36936                 .oprofile_type          = PPC_OPROFILE_G4,
36937 +               .machine_check          = machine_check_generic,
36938                 .platform               = "ppc7450",
36939         },
36940         {       /* 7455 rev 1.x */
36941 @@ -738,6 +788,7 @@
36942                 .cpu_setup              = __setup_cpu_745x,
36943                 .oprofile_cpu_type      = "ppc/7450",
36944                 .oprofile_type          = PPC_OPROFILE_G4,
36945 +               .machine_check          = machine_check_generic,
36946                 .platform               = "ppc7450",
36947         },
36948         {       /* 7455 rev 2.0 */
36949 @@ -753,6 +804,7 @@
36950                 .cpu_setup              = __setup_cpu_745x,
36951                 .oprofile_cpu_type      = "ppc/7450",
36952                 .oprofile_type          = PPC_OPROFILE_G4,
36953 +               .machine_check          = machine_check_generic,
36954                 .platform               = "ppc7450",
36955         },
36956         {       /* 7455 others */
36957 @@ -768,6 +820,7 @@
36958                 .cpu_setup              = __setup_cpu_745x,
36959                 .oprofile_cpu_type      = "ppc/7450",
36960                 .oprofile_type          = PPC_OPROFILE_G4,
36961 +               .machine_check          = machine_check_generic,
36962                 .platform               = "ppc7450",
36963         },
36964         {       /* 7447/7457 Rev 1.0 */
36965 @@ -783,6 +836,7 @@
36966                 .cpu_setup              = __setup_cpu_745x,
36967                 .oprofile_cpu_type      = "ppc/7450",
36968                 .oprofile_type          = PPC_OPROFILE_G4,
36969 +               .machine_check          = machine_check_generic,
36970                 .platform               = "ppc7450",
36971         },
36972         {       /* 7447/7457 Rev 1.1 */
36973 @@ -798,6 +852,7 @@
36974                 .cpu_setup              = __setup_cpu_745x,
36975                 .oprofile_cpu_type      = "ppc/7450",
36976                 .oprofile_type          = PPC_OPROFILE_G4,
36977 +               .machine_check          = machine_check_generic,
36978                 .platform               = "ppc7450",
36979         },
36980         {       /* 7447/7457 Rev 1.2 and later */
36981 @@ -812,6 +867,7 @@
36982                 .cpu_setup              = __setup_cpu_745x,
36983                 .oprofile_cpu_type      = "ppc/7450",
36984                 .oprofile_type          = PPC_OPROFILE_G4,
36985 +               .machine_check          = machine_check_generic,
36986                 .platform               = "ppc7450",
36987         },
36988         {       /* 7447A */
36989 @@ -827,6 +883,7 @@
36990                 .cpu_setup              = __setup_cpu_745x,
36991                 .oprofile_cpu_type      = "ppc/7450",
36992                 .oprofile_type          = PPC_OPROFILE_G4,
36993 +               .machine_check          = machine_check_generic,
36994                 .platform               = "ppc7450",
36995         },
36996         {       /* 7448 */
36997 @@ -842,6 +899,7 @@
36998                 .cpu_setup              = __setup_cpu_745x,
36999                 .oprofile_cpu_type      = "ppc/7450",
37000                 .oprofile_type          = PPC_OPROFILE_G4,
37001 +               .machine_check          = machine_check_generic,
37002                 .platform               = "ppc7450",
37003         },
37004         {       /* 82xx (8240, 8245, 8260 are all 603e cores) */
37005 @@ -853,6 +911,7 @@
37006                 .icache_bsize           = 32,
37007                 .dcache_bsize           = 32,
37008                 .cpu_setup              = __setup_cpu_603,
37009 +               .machine_check          = machine_check_generic,
37010                 .platform               = "ppc603",
37011         },
37012         {       /* All G2_LE (603e core, plus some) have the same pvr */
37013 @@ -864,6 +923,7 @@
37014                 .icache_bsize           = 32,
37015                 .dcache_bsize           = 32,
37016                 .cpu_setup              = __setup_cpu_603,
37017 +               .machine_check          = machine_check_generic,
37018                 .platform               = "ppc603",
37019         },
37020         {       /* e300c1 (a 603e core, plus some) on 83xx */
37021 @@ -875,6 +935,7 @@
37022                 .icache_bsize           = 32,
37023                 .dcache_bsize           = 32,
37024                 .cpu_setup              = __setup_cpu_603,
37025 +               .machine_check          = machine_check_generic,
37026                 .platform               = "ppc603",
37027         },
37028         {       /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
37029 @@ -886,9 +947,10 @@
37030                 .icache_bsize           = 32,
37031                 .dcache_bsize           = 32,
37032                 .cpu_setup              = __setup_cpu_603,
37033 +               .machine_check          = machine_check_generic,
37034                 .platform               = "ppc603",
37035         },
37036 -       {       /* e300c3 on 83xx  */
37037 +       {       /* e300c3 (e300c1, plus one IU, half cache size) on 83xx */
37038                 .pvr_mask               = 0x7fff0000,
37039                 .pvr_value              = 0x00850000,
37040                 .cpu_name               = "e300c3",
37041 @@ -899,6 +961,18 @@
37042                 .cpu_setup              = __setup_cpu_603,
37043                 .platform               = "ppc603",
37044         },
37045 +       {       /* e300c4 (e300c1, plus one IU) */
37046 +               .pvr_mask               = 0x7fff0000,
37047 +               .pvr_value              = 0x00860000,
37048 +               .cpu_name               = "e300c4",
37049 +               .cpu_features           = CPU_FTRS_E300,
37050 +               .cpu_user_features      = COMMON_USER,
37051 +               .icache_bsize           = 32,
37052 +               .dcache_bsize           = 32,
37053 +               .cpu_setup              = __setup_cpu_603,
37054 +               .machine_check          = machine_check_generic,
37055 +               .platform               = "ppc603",
37056 +       },
37057         {       /* default match, we assume split I/D cache & TB (non-601)... */
37058                 .pvr_mask               = 0x00000000,
37059                 .pvr_value              = 0x00000000,
37060 @@ -907,6 +981,7 @@
37061                 .cpu_user_features      = COMMON_USER,
37062                 .icache_bsize           = 32,
37063                 .dcache_bsize           = 32,
37064 +               .machine_check          = machine_check_generic,
37065                 .platform               = "ppc603",
37066         },
37067  #endif /* CLASSIC_PPC */
37068 @@ -933,6 +1008,7 @@
37069                 .cpu_user_features      = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
37070                 .icache_bsize           = 16,
37071                 .dcache_bsize           = 16,
37072 +               .machine_check          = machine_check_4xx,
37073                 .platform               = "ppc403",
37074         },
37075         {       /* 403GCX */
37076 @@ -944,6 +1020,7 @@
37077                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
37078                 .icache_bsize           = 16,
37079                 .dcache_bsize           = 16,
37080 +               .machine_check          = machine_check_4xx,
37081                 .platform               = "ppc403",
37082         },
37083         {       /* 403G ?? */
37084 @@ -954,6 +1031,7 @@
37085                 .cpu_user_features      = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
37086                 .icache_bsize           = 16,
37087                 .dcache_bsize           = 16,
37088 +               .machine_check          = machine_check_4xx,
37089                 .platform               = "ppc403",
37090         },
37091         {       /* 405GP */
37092 @@ -965,6 +1043,7 @@
37093                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37094                 .icache_bsize           = 32,
37095                 .dcache_bsize           = 32,
37096 +               .machine_check          = machine_check_4xx,
37097                 .platform               = "ppc405",
37098         },
37099         {       /* STB 03xxx */
37100 @@ -976,6 +1055,7 @@
37101                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37102                 .icache_bsize           = 32,
37103                 .dcache_bsize           = 32,
37104 +               .machine_check          = machine_check_4xx,
37105                 .platform               = "ppc405",
37106         },
37107         {       /* STB 04xxx */
37108 @@ -987,6 +1067,7 @@
37109                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37110                 .icache_bsize           = 32,
37111                 .dcache_bsize           = 32,
37112 +               .machine_check          = machine_check_4xx,
37113                 .platform               = "ppc405",
37114         },
37115         {       /* NP405L */
37116 @@ -998,6 +1079,7 @@
37117                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37118                 .icache_bsize           = 32,
37119                 .dcache_bsize           = 32,
37120 +               .machine_check          = machine_check_4xx,
37121                 .platform               = "ppc405",
37122         },
37123         {       /* NP4GS3 */
37124 @@ -1009,6 +1091,7 @@
37125                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37126                 .icache_bsize           = 32,
37127                 .dcache_bsize           = 32,
37128 +               .machine_check          = machine_check_4xx,
37129                 .platform               = "ppc405",
37130         },
37131         {   /* NP405H */
37132 @@ -1020,6 +1103,7 @@
37133                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37134                 .icache_bsize           = 32,
37135                 .dcache_bsize           = 32,
37136 +               .machine_check          = machine_check_4xx,
37137                 .platform               = "ppc405",
37138         },
37139         {       /* 405GPr */
37140 @@ -1031,6 +1115,7 @@
37141                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37142                 .icache_bsize           = 32,
37143                 .dcache_bsize           = 32,
37144 +               .machine_check          = machine_check_4xx,
37145                 .platform               = "ppc405",
37146         },
37147         {   /* STBx25xx */
37148 @@ -1042,6 +1127,7 @@
37149                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37150                 .icache_bsize           = 32,
37151                 .dcache_bsize           = 32,
37152 +               .machine_check          = machine_check_4xx,
37153                 .platform               = "ppc405",
37154         },
37155         {       /* 405LP */
37156 @@ -1052,6 +1138,7 @@
37157                 .cpu_user_features      = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
37158                 .icache_bsize           = 32,
37159                 .dcache_bsize           = 32,
37160 +               .machine_check          = machine_check_4xx,
37161                 .platform               = "ppc405",
37162         },
37163         {       /* Xilinx Virtex-II Pro  */
37164 @@ -1063,6 +1150,7 @@
37165                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37166                 .icache_bsize           = 32,
37167                 .dcache_bsize           = 32,
37168 +               .machine_check          = machine_check_4xx,
37169                 .platform               = "ppc405",
37170         },
37171         {       /* Xilinx Virtex-4 FX */
37172 @@ -1074,6 +1162,7 @@
37173                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37174                 .icache_bsize           = 32,
37175                 .dcache_bsize           = 32,
37176 +               .machine_check          = machine_check_4xx,
37177                 .platform               = "ppc405",
37178         },
37179         {       /* 405EP */
37180 @@ -1085,17 +1174,31 @@
37181                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37182                 .icache_bsize           = 32,
37183                 .dcache_bsize           = 32,
37184 +               .machine_check          = machine_check_4xx,
37185                 .platform               = "ppc405",
37186         },
37187         {       /* 405EX */
37188 -               .pvr_mask               = 0xffff0000,
37189 -               .pvr_value              = 0x12910000,
37190 +               .pvr_mask               = 0xffff0004,
37191 +               .pvr_value              = 0x12910004,
37192                 .cpu_name               = "405EX",
37193                 .cpu_features           = CPU_FTRS_40X,
37194                 .cpu_user_features      = PPC_FEATURE_32 |
37195                         PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37196                 .icache_bsize           = 32,
37197                 .dcache_bsize           = 32,
37198 +               .machine_check          = machine_check_4xx,
37199 +               .platform               = "ppc405",
37200 +       },
37201 +       {       /* 405EXr */
37202 +               .pvr_mask               = 0xffff0004,
37203 +               .pvr_value              = 0x12910000,
37204 +               .cpu_name               = "405EXr",
37205 +               .cpu_features           = CPU_FTRS_40X,
37206 +               .cpu_user_features      = PPC_FEATURE_32 |
37207 +                       PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
37208 +               .icache_bsize           = 32,
37209 +               .dcache_bsize           = 32,
37210 +               .machine_check          = machine_check_4xx,
37211                 .platform               = "ppc405",
37212         },
37213  
37214 @@ -1109,6 +1212,7 @@
37215                 .cpu_user_features      = COMMON_USER_BOOKE,
37216                 .icache_bsize           = 32,
37217                 .dcache_bsize           = 32,
37218 +               .machine_check          = machine_check_4xx,
37219                 .platform               = "ppc440",
37220         },
37221         { /* Use logical PVR for 440EP (logical pvr = pvr | 0x8) */
37222 @@ -1120,6 +1224,7 @@
37223                 .icache_bsize           = 32,
37224                 .dcache_bsize           = 32,
37225                 .cpu_setup              = __setup_cpu_440ep,
37226 +               .machine_check          = machine_check_4xx,
37227                 .platform               = "ppc440",
37228         },
37229         {
37230 @@ -1130,6 +1235,19 @@
37231                 .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
37232                 .icache_bsize           = 32,
37233                 .dcache_bsize           = 32,
37234 +               .machine_check          = machine_check_4xx,
37235 +               .platform               = "ppc440",
37236 +       },
37237 +       { /* Matches both physical and logical PVR for 440EP (logical pvr = pvr | 0x8) */
37238 +               .pvr_mask               = 0xf0000ff7,
37239 +               .pvr_value              = 0x400008d4,
37240 +               .cpu_name               = "440EP Rev. C",
37241 +               .cpu_features           = CPU_FTRS_44X,
37242 +               .cpu_user_features      = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
37243 +               .icache_bsize           = 32,
37244 +               .dcache_bsize           = 32,
37245 +               .cpu_setup              = __setup_cpu_440ep,
37246 +               .machine_check          = machine_check_4xx,
37247                 .platform               = "ppc440",
37248         },
37249         { /* Use logical PVR for 440EP (logical pvr = pvr | 0x8) */
37250 @@ -1141,6 +1259,7 @@
37251                 .icache_bsize           = 32,
37252                 .dcache_bsize           = 32,
37253                 .cpu_setup              = __setup_cpu_440ep,
37254 +               .machine_check          = machine_check_4xx,
37255                 .platform               = "ppc440",
37256         },
37257         { /* 440GRX */
37258 @@ -1152,6 +1271,7 @@
37259                 .icache_bsize           = 32,
37260                 .dcache_bsize           = 32,
37261                 .cpu_setup              = __setup_cpu_440grx,
37262 +               .machine_check          = machine_check_440A,
37263                 .platform               = "ppc440",
37264         },
37265         { /* Use logical PVR for 440EPx (logical pvr = pvr | 0x8) */
37266 @@ -1163,6 +1283,7 @@
37267                 .icache_bsize           = 32,
37268                 .dcache_bsize           = 32,
37269                 .cpu_setup              = __setup_cpu_440epx,
37270 +               .machine_check          = machine_check_440A,
37271                 .platform               = "ppc440",
37272         },
37273         {       /* 440GP Rev. B */
37274 @@ -1173,6 +1294,7 @@
37275                 .cpu_user_features      = COMMON_USER_BOOKE,
37276                 .icache_bsize           = 32,
37277                 .dcache_bsize           = 32,
37278 +               .machine_check          = machine_check_4xx,
37279                 .platform               = "ppc440gp",
37280         },
37281         {       /* 440GP Rev. C */
37282 @@ -1183,6 +1305,7 @@
37283                 .cpu_user_features      = COMMON_USER_BOOKE,
37284                 .icache_bsize           = 32,
37285                 .dcache_bsize           = 32,
37286 +               .machine_check          = machine_check_4xx,
37287                 .platform               = "ppc440gp",
37288         },
37289         { /* 440GX Rev. A */
37290 @@ -1193,6 +1316,8 @@
37291                 .cpu_user_features      = COMMON_USER_BOOKE,
37292                 .icache_bsize           = 32,
37293                 .dcache_bsize           = 32,
37294 +               .cpu_setup              = __setup_cpu_440gx,
37295 +               .machine_check          = machine_check_440A,
37296                 .platform               = "ppc440",
37297         },
37298         { /* 440GX Rev. B */
37299 @@ -1203,6 +1328,8 @@
37300                 .cpu_user_features      = COMMON_USER_BOOKE,
37301                 .icache_bsize           = 32,
37302                 .dcache_bsize           = 32,
37303 +               .cpu_setup              = __setup_cpu_440gx,
37304 +               .machine_check          = machine_check_440A,
37305                 .platform               = "ppc440",
37306         },
37307         { /* 440GX Rev. C */
37308 @@ -1213,6 +1340,8 @@
37309                 .cpu_user_features      = COMMON_USER_BOOKE,
37310                 .icache_bsize           = 32,
37311                 .dcache_bsize           = 32,
37312 +               .cpu_setup              = __setup_cpu_440gx,
37313 +               .machine_check          = machine_check_440A,
37314                 .platform               = "ppc440",
37315         },
37316         { /* 440GX Rev. F */
37317 @@ -1223,6 +1352,8 @@
37318                 .cpu_user_features      = COMMON_USER_BOOKE,
37319                 .icache_bsize           = 32,
37320                 .dcache_bsize           = 32,
37321 +               .cpu_setup              = __setup_cpu_440gx,
37322 +               .machine_check          = machine_check_440A,
37323                 .platform               = "ppc440",
37324         },
37325         { /* 440SP Rev. A */
37326 @@ -1233,6 +1364,7 @@
37327                 .cpu_user_features      = COMMON_USER_BOOKE,
37328                 .icache_bsize           = 32,
37329                 .dcache_bsize           = 32,
37330 +               .machine_check          = machine_check_4xx,
37331                 .platform               = "ppc440",
37332         },
37333         { /* 440SPe Rev. A */
37334 @@ -1243,6 +1375,8 @@
37335                 .cpu_user_features      = COMMON_USER_BOOKE,
37336                 .icache_bsize           = 32,
37337                 .dcache_bsize           = 32,
37338 +               .cpu_setup              = __setup_cpu_440spe,
37339 +               .machine_check          = machine_check_440A,
37340                 .platform               = "ppc440",
37341         },
37342         { /* 440SPe Rev. B */
37343 @@ -1253,10 +1387,13 @@
37344                 .cpu_user_features      = COMMON_USER_BOOKE,
37345                 .icache_bsize           = 32,
37346                 .dcache_bsize           = 32,
37347 +               .cpu_setup              = __setup_cpu_440spe,
37348 +               .machine_check          = machine_check_440A,
37349                 .platform               = "ppc440",
37350         },
37351  #endif /* CONFIG_44x */
37352  #ifdef CONFIG_FSL_BOOKE
37353 +#ifdef CONFIG_E200
37354         {       /* e200z5 */
37355                 .pvr_mask               = 0xfff00000,
37356                 .pvr_value              = 0x81000000,
37357 @@ -1267,6 +1404,7 @@
37358                         PPC_FEATURE_HAS_EFP_SINGLE |
37359                         PPC_FEATURE_UNIFIED_CACHE,
37360                 .dcache_bsize           = 32,
37361 +               .machine_check          = machine_check_e200,
37362                 .platform               = "ppc5554",
37363         },
37364         {       /* e200z6 */
37365 @@ -1280,8 +1418,10 @@
37366                         PPC_FEATURE_HAS_EFP_SINGLE_COMP |
37367                         PPC_FEATURE_UNIFIED_CACHE,
37368                 .dcache_bsize           = 32,
37369 +               .machine_check          = machine_check_e200,
37370                 .platform               = "ppc5554",
37371         },
37372 +#elif defined(CONFIG_E500)
37373         {       /* e500 */
37374                 .pvr_mask               = 0xffff0000,
37375                 .pvr_value              = 0x80200000,
37376 @@ -1296,6 +1436,7 @@
37377                 .num_pmcs               = 4,
37378                 .oprofile_cpu_type      = "ppc/e500",
37379                 .oprofile_type          = PPC_OPROFILE_BOOKE,
37380 +               .machine_check          = machine_check_e500,
37381                 .platform               = "ppc8540",
37382         },
37383         {       /* e500v2 */
37384 @@ -1313,9 +1454,11 @@
37385                 .num_pmcs               = 4,
37386                 .oprofile_cpu_type      = "ppc/e500",
37387                 .oprofile_type          = PPC_OPROFILE_BOOKE,
37388 +               .machine_check          = machine_check_e500,
37389                 .platform               = "ppc8548",
37390         },
37391  #endif
37392 +#endif
37393  #if !CLASSIC_PPC
37394         {       /* default match */
37395                 .pvr_mask               = 0x00000000,
37396 --- a/arch/powerpc/kernel/crash.c
37397 +++ b/arch/powerpc/kernel/crash.c
37398 @@ -32,6 +32,8 @@
37399  #include <asm/lmb.h>
37400  #include <asm/firmware.h>
37401  #include <asm/smp.h>
37402 +#include <asm/system.h>
37403 +#include <asm/setjmp.h>
37404  
37405  #ifdef DEBUG
37406  #include <asm/udbg.h>
37407 @@ -45,6 +47,11 @@
37408  static cpumask_t cpus_in_crash = CPU_MASK_NONE;
37409  cpumask_t cpus_in_sr = CPU_MASK_NONE;
37410  
37411 +#define CRASH_HANDLER_MAX 1
37412 +/* NULL terminated list of shutdown handles */
37413 +static crash_shutdown_t crash_shutdown_handles[CRASH_HANDLER_MAX+1];
37414 +static DEFINE_SPINLOCK(crash_handlers_lock);
37415 +
37416  #ifdef CONFIG_SMP
37417  static atomic_t enter_on_soft_reset = ATOMIC_INIT(0);
37418  
37419 @@ -285,9 +292,72 @@
37420  }
37421  #endif /* CONFIG_SPU_BASE */
37422  
37423 +/*
37424 + * Register a function to be called on shutdown.  Only use this if you
37425 + * can't reset your device in the second kernel.
37426 + */
37427 +int crash_shutdown_register(crash_shutdown_t handler)
37428 +{
37429 +       unsigned int i, rc;
37430 +
37431 +       spin_lock(&crash_handlers_lock);
37432 +       for (i = 0 ; i < CRASH_HANDLER_MAX; i++)
37433 +               if (!crash_shutdown_handles[i]) {
37434 +                       /* Insert handle at first empty entry */
37435 +                       crash_shutdown_handles[i] = handler;
37436 +                       rc = 0;
37437 +                       break;
37438 +               }
37439 +
37440 +       if (i == CRASH_HANDLER_MAX) {
37441 +               printk(KERN_ERR "Crash shutdown handles full, "
37442 +                      "not registered.\n");
37443 +               rc = 1;
37444 +       }
37445 +
37446 +       spin_unlock(&crash_handlers_lock);
37447 +       return rc;
37448 +}
37449 +EXPORT_SYMBOL(crash_shutdown_register);
37450 +
37451 +int crash_shutdown_unregister(crash_shutdown_t handler)
37452 +{
37453 +       unsigned int i, rc;
37454 +
37455 +       spin_lock(&crash_handlers_lock);
37456 +       for (i = 0 ; i < CRASH_HANDLER_MAX; i++)
37457 +               if (crash_shutdown_handles[i] == handler)
37458 +                       break;
37459 +
37460 +       if (i == CRASH_HANDLER_MAX) {
37461 +               printk(KERN_ERR "Crash shutdown handle not found\n");
37462 +               rc = 1;
37463 +       } else {
37464 +               /* Shift handles down */
37465 +               for (; crash_shutdown_handles[i]; i++)
37466 +                       crash_shutdown_handles[i] =
37467 +                               crash_shutdown_handles[i+1];
37468 +               rc = 0;
37469 +       }
37470 +
37471 +       spin_unlock(&crash_handlers_lock);
37472 +       return rc;
37473 +}
37474 +EXPORT_SYMBOL(crash_shutdown_unregister);
37475 +
37476 +static unsigned long crash_shutdown_buf[JMP_BUF_LEN];
37477 +
37478 +static int handle_fault(struct pt_regs *regs)
37479 +{
37480 +       longjmp(crash_shutdown_buf, 1);
37481 +       return 0;
37482 +}
37483 +
37484  void default_machine_crash_shutdown(struct pt_regs *regs)
37485  {
37486 -       unsigned int irq;
37487 +       unsigned int i;
37488 +       int (*old_handler)(struct pt_regs *regs);
37489 +
37490  
37491         /*
37492          * This function is only called after the system
37493 @@ -301,15 +371,36 @@
37494          */
37495         hard_irq_disable();
37496  
37497 -       for_each_irq(irq) {
37498 -               struct irq_desc *desc = irq_desc + irq;
37499 +       for_each_irq(i) {
37500 +               struct irq_desc *desc = irq_desc + i;
37501  
37502                 if (desc->status & IRQ_INPROGRESS)
37503 -                       desc->chip->eoi(irq);
37504 +                       desc->chip->eoi(i);
37505  
37506                 if (!(desc->status & IRQ_DISABLED))
37507 -                       desc->chip->disable(irq);
37508 +                       desc->chip->disable(i);
37509 +       }
37510 +
37511 +       /*
37512 +        * Call registered shutdown routines savely.  Swap out
37513 +        * __debugger_fault_handler, and replace on exit.
37514 +        */
37515 +       old_handler = __debugger_fault_handler;
37516 +       __debugger_fault_handler = handle_fault;
37517 +       for (i = 0; crash_shutdown_handles[i]; i++) {
37518 +               if (setjmp(crash_shutdown_buf) == 0) {
37519 +                       /*
37520 +                        * Insert syncs and delay to ensure
37521 +                        * instructions in the dangerous region don't
37522 +                        * leak away from this protected region.
37523 +                        */
37524 +                       asm volatile("sync; isync");
37525 +                       /* dangerous region */
37526 +                       crash_shutdown_handles[i]();
37527 +                       asm volatile("sync; isync");
37528 +               }
37529         }
37530 +       __debugger_fault_handler = old_handler;
37531  
37532         /*
37533          * Make a note of crashing cpu. Will be used in machine_kexec
37534 --- a/arch/powerpc/kernel/dma_64.c
37535 +++ b/arch/powerpc/kernel/dma_64.c
37536 @@ -112,10 +112,16 @@
37537  /*
37538   * Generic direct DMA implementation
37539   *
37540 - * This implementation supports a global offset that can be applied if
37541 - * the address at which memory is visible to devices is not 0.
37542 + * This implementation supports a per-device offset that can be applied if
37543 + * the address at which memory is visible to devices is not 0. Platform code
37544 + * can set archdata.dma_data to an unsigned long holding the offset. By
37545 + * default the offset is zero.
37546   */
37547 -unsigned long dma_direct_offset;
37548 +
37549 +static unsigned long get_dma_direct_offset(struct device *dev)
37550 +{
37551 +       return (unsigned long)dev->archdata.dma_data;
37552 +}
37553  
37554  static void *dma_direct_alloc_coherent(struct device *dev, size_t size,
37555                                        dma_addr_t *dma_handle, gfp_t flag)
37556 @@ -124,13 +130,12 @@
37557         void *ret;
37558         int node = dev->archdata.numa_node;
37559  
37560 -       /* TODO: Maybe use the numa node here too ? */
37561         page = alloc_pages_node(node, flag, get_order(size));
37562         if (page == NULL)
37563                 return NULL;
37564         ret = page_address(page);
37565         memset(ret, 0, size);
37566 -       *dma_handle = virt_to_abs(ret) | dma_direct_offset;
37567 +       *dma_handle = virt_to_abs(ret) + get_dma_direct_offset(dev);
37568  
37569         return ret;
37570  }
37571 @@ -145,7 +150,7 @@
37572                                         size_t size,
37573                                         enum dma_data_direction direction)
37574  {
37575 -       return virt_to_abs(ptr) | dma_direct_offset;
37576 +       return virt_to_abs(ptr) + get_dma_direct_offset(dev);
37577  }
37578  
37579  static void dma_direct_unmap_single(struct device *dev, dma_addr_t dma_addr,
37580 @@ -161,7 +166,7 @@
37581         int i;
37582  
37583         for_each_sg(sgl, sg, nents, i) {
37584 -               sg->dma_address = sg_phys(sg) | dma_direct_offset;
37585 +               sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev);
37586                 sg->dma_length = sg->length;
37587         }
37588  
37589 --- a/arch/powerpc/kernel/head_44x.S
37590 +++ b/arch/powerpc/kernel/head_44x.S
37591 @@ -289,11 +289,8 @@
37592         CRITICAL_EXCEPTION(0x0100, CriticalInput, unknown_exception)
37593  
37594         /* Machine Check Interrupt */
37595 -#ifdef CONFIG_440A
37596 -       MCHECK_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
37597 -#else
37598         CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception)
37599 -#endif
37600 +       MCHECK_EXCEPTION(0x0210, MachineCheckA, machine_check_exception)
37601  
37602         /* Data Storage Interrupt */
37603         START_EXCEPTION(DataStorage)
37604 @@ -674,6 +671,15 @@
37605   */
37606  
37607  /*
37608 + * Adjust the machine check IVOR on 440A cores
37609 + */
37610 +_GLOBAL(__fixup_440A_mcheck)
37611 +       li      r3,MachineCheckA@l
37612 +       mtspr   SPRN_IVOR1,r3
37613 +       sync
37614 +       blr
37615 +
37616 +/*
37617   * extern void giveup_altivec(struct task_struct *prev)
37618   *
37619   * The 44x core does not have an AltiVec unit.
37620 --- a/arch/powerpc/kernel/head_booke.h
37621 +++ b/arch/powerpc/kernel/head_booke.h
37622 @@ -166,7 +166,7 @@
37623         mfspr   r5,SPRN_ESR;                                    \
37624         stw     r5,_ESR(r11);                                   \
37625         addi    r3,r1,STACK_FRAME_OVERHEAD;                     \
37626 -       EXC_XFER_TEMPLATE(hdlr, n+2, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
37627 +       EXC_XFER_TEMPLATE(hdlr, n+4, (MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)), \
37628                           NOCOPY, mcheck_transfer_to_handler,   \
37629                           ret_from_mcheck_exc)
37630  
37631 --- a/arch/powerpc/kernel/head_fsl_booke.S
37632 +++ b/arch/powerpc/kernel/head_fsl_booke.S
37633 @@ -73,8 +73,8 @@
37634  /* We try to not make any assumptions about how the boot loader
37635   * setup or used the TLBs.  We invalidate all mappings from the
37636   * boot loader and load a single entry in TLB1[0] to map the
37637 - * first 16M of kernel memory.  Any boot info passed from the
37638 - * bootloader needs to live in this first 16M.
37639 + * first 64M of kernel memory.  Any boot info passed from the
37640 + * bootloader needs to live in this first 64M.
37641   *
37642   * Requirement on bootloader:
37643   *  - The page we're executing in needs to reside in TLB1 and
37644 @@ -167,7 +167,7 @@
37645         mtspr   SPRN_MAS0,r7
37646         tlbre
37647  
37648 -       /* Just modify the entry ID and EPN for the temp mapping */
37649 +       /* Just modify the entry ID, EPN and RPN for the temp mapping */
37650         lis     r7,0x1000       /* Set MAS0(TLBSEL) = 1 */
37651         rlwimi  r7,r5,16,4,15   /* Setup MAS0 = TLBSEL | ESEL(r5) */
37652         mtspr   SPRN_MAS0,r7
37653 @@ -177,9 +177,12 @@
37654         ori     r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_4K))@l
37655         mtspr   SPRN_MAS1,r6
37656         mfspr   r6,SPRN_MAS2
37657 -       li      r7,0            /* temp EPN = 0 */
37658 +       lis     r7,PHYSICAL_START@h
37659         rlwimi  r7,r6,0,20,31
37660         mtspr   SPRN_MAS2,r7
37661 +       mfspr   r6,SPRN_MAS3
37662 +       rlwimi  r7,r6,0,20,31
37663 +       mtspr   SPRN_MAS3,r7
37664         tlbwe
37665  
37666         xori    r6,r4,1
37667 @@ -222,11 +225,11 @@
37668         lis     r6,0x1000               /* Set MAS0(TLBSEL) = TLB1(1), ESEL = 0 */
37669         mtspr   SPRN_MAS0,r6
37670         lis     r6,(MAS1_VALID|MAS1_IPROT)@h
37671 -       ori     r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_16M))@l
37672 +       ori     r6,r6,(MAS1_TSIZE(BOOKE_PAGESZ_64M))@l
37673         mtspr   SPRN_MAS1,r6
37674         li      r7,0
37675 -       lis     r6,KERNELBASE@h
37676 -       ori     r6,r6,KERNELBASE@l
37677 +       lis     r6,PAGE_OFFSET@h
37678 +       ori     r6,r6,PAGE_OFFSET@l
37679         rlwimi  r6,r7,0,20,31
37680         mtspr   SPRN_MAS2,r6
37681         li      r7,(MAS3_SX|MAS3_SW|MAS3_SR)
37682 @@ -234,6 +237,9 @@
37683         tlbwe
37684  
37685  /* 7. Jump to KERNELBASE mapping */
37686 +       lis     r6,KERNELBASE@h
37687 +       ori     r6,r6,KERNELBASE@l
37688 +       rlwimi  r6,r7,0,20,31
37689         lis     r7,MSR_KERNEL@h
37690         ori     r7,r7,MSR_KERNEL@l
37691         bl      1f                      /* Find our address */
37692 --- a/arch/powerpc/kernel/ibmebus.c
37693 +++ b/arch/powerpc/kernel/ibmebus.c
37694 @@ -41,6 +41,7 @@
37695  #include <linux/kobject.h>
37696  #include <linux/dma-mapping.h>
37697  #include <linux/interrupt.h>
37698 +#include <linux/of.h>
37699  #include <linux/of_platform.h>
37700  #include <asm/ibmebus.h>
37701  #include <asm/abs_addr.h>
37702 @@ -52,7 +53,7 @@
37703  struct bus_type ibmebus_bus_type;
37704  
37705  /* These devices will automatically be added to the bus during init */
37706 -static struct of_device_id builtin_matches[] = {
37707 +static struct of_device_id __initdata builtin_matches[] = {
37708         { .compatible = "IBM,lhca" },
37709         { .compatible = "IBM,lhea" },
37710         {},
37711 @@ -171,7 +172,7 @@
37712  
37713         root = of_find_node_by_path("/");
37714  
37715 -       for (child = NULL; (child = of_get_next_child(root, child)); ) {
37716 +       for_each_child_of_node(root, child) {
37717                 if (!of_match_node(matches, child))
37718                         continue;
37719  
37720 @@ -197,16 +198,13 @@
37721         /* If the driver uses devices that ibmebus doesn't know, add them */
37722         ibmebus_create_devices(drv->match_table);
37723  
37724 -       drv->driver.name   = drv->name;
37725 -       drv->driver.bus    = &ibmebus_bus_type;
37726 -
37727 -       return driver_register(&drv->driver);
37728 +       return of_register_driver(drv, &ibmebus_bus_type);
37729  }
37730  EXPORT_SYMBOL(ibmebus_register_driver);
37731  
37732  void ibmebus_unregister_driver(struct of_platform_driver *drv)
37733  {
37734 -       driver_unregister(&drv->driver);
37735 +       of_unregister_driver(drv);
37736  }
37737  EXPORT_SYMBOL(ibmebus_unregister_driver);
37738  
37739 --- a/arch/powerpc/kernel/iommu.c
37740 +++ b/arch/powerpc/kernel/iommu.c
37741 @@ -532,16 +532,14 @@
37742         return tbl;
37743  }
37744  
37745 -void iommu_free_table(struct device_node *dn)
37746 +void iommu_free_table(struct iommu_table *tbl, const char *node_name)
37747  {
37748 -       struct pci_dn *pdn = dn->data;
37749 -       struct iommu_table *tbl = pdn->iommu_table;
37750         unsigned long bitmap_sz, i;
37751         unsigned int order;
37752  
37753         if (!tbl || !tbl->it_map) {
37754                 printk(KERN_ERR "%s: expected TCE map for %s\n", __FUNCTION__,
37755 -                               dn->full_name);
37756 +                               node_name);
37757                 return;
37758         }
37759  
37760 @@ -550,7 +548,7 @@
37761         for (i = 0; i < (tbl->it_size/64); i++) {
37762                 if (tbl->it_map[i] != 0) {
37763                         printk(KERN_WARNING "%s: Unexpected TCEs for %s\n",
37764 -                               __FUNCTION__, dn->full_name);
37765 +                               __FUNCTION__, node_name);
37766                         break;
37767                 }
37768         }
37769 --- a/arch/powerpc/kernel/isa-bridge.c
37770 +++ b/arch/powerpc/kernel/isa-bridge.c
37771 @@ -108,7 +108,7 @@
37772         if (size > 0x10000)
37773                 size = 0x10000;
37774  
37775 -       printk(KERN_ERR "no ISA IO ranges or unexpected isa range,"
37776 +       printk(KERN_ERR "no ISA IO ranges or unexpected isa range, "
37777                "mapping 64k\n");
37778  
37779         __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
37780 @@ -116,7 +116,7 @@
37781         return;
37782  
37783  inval_range:
37784 -       printk(KERN_ERR "no ISA IO ranges or unexpected isa range,"
37785 +       printk(KERN_ERR "no ISA IO ranges or unexpected isa range, "
37786                "mapping 64k\n");
37787         __ioremap_at(phb_io_base_phys, (void *)ISA_IO_BASE,
37788                      0x10000, _PAGE_NO_CACHE|_PAGE_GUARDED);
37789 @@ -145,7 +145,7 @@
37790         for_each_node_by_type(np, "isa") {
37791                 /* Look for our hose being a parent */
37792                 for (parent = of_get_parent(np); parent;) {
37793 -                       if (parent == hose->arch_data) {
37794 +                       if (parent == hose->dn) {
37795                                 of_node_put(parent);
37796                                 break;
37797                         }
37798 --- a/arch/powerpc/kernel/legacy_serial.c
37799 +++ b/arch/powerpc/kernel/legacy_serial.c
37800 @@ -307,7 +307,7 @@
37801         }
37802  
37803         /* First fill our array with SOC ports */
37804 -       for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) {
37805 +       for_each_compatible_node(np, "serial", "ns16550") {
37806                 struct device_node *soc = of_get_parent(np);
37807                 if (soc && !strcmp(soc->type, "soc")) {
37808                         index = add_legacy_soc_port(np, np);
37809 @@ -318,7 +318,7 @@
37810         }
37811  
37812         /* First fill our array with ISA ports */
37813 -       for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
37814 +       for_each_node_by_type(np, "serial") {
37815                 struct device_node *isa = of_get_parent(np);
37816                 if (isa && !strcmp(isa->name, "isa")) {
37817                         index = add_legacy_isa_port(np, isa);
37818 @@ -329,7 +329,7 @@
37819         }
37820  
37821         /* First fill our array with tsi-bridge ports */
37822 -       for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) {
37823 +       for_each_compatible_node(np, "serial", "ns16550") {
37824                 struct device_node *tsi = of_get_parent(np);
37825                 if (tsi && !strcmp(tsi->type, "tsi-bridge")) {
37826                         index = add_legacy_soc_port(np, np);
37827 @@ -340,7 +340,7 @@
37828         }
37829  
37830         /* First fill our array with opb bus ports */
37831 -       for (np = NULL; (np = of_find_compatible_node(np, "serial", "ns16550")) != NULL;) {
37832 +       for_each_compatible_node(np, "serial", "ns16550") {
37833                 struct device_node *opb = of_get_parent(np);
37834                 if (opb && (!strcmp(opb->type, "opb") ||
37835                             of_device_is_compatible(opb, "ibm,opb"))) {
37836 @@ -474,7 +474,7 @@
37837  
37838         /*
37839          * Before we register the platfrom serial devices, we need
37840 -        * to fixup their interrutps and their IO ports.
37841 +        * to fixup their interrupts and their IO ports.
37842          */
37843         DBG("Fixing serial ports interrupts and IO ports ...\n");
37844  
37845 --- a/arch/powerpc/kernel/lparcfg.c
37846 +++ b/arch/powerpc/kernel/lparcfg.c
37847 @@ -41,7 +41,6 @@
37848  /* #define LPARCFG_DEBUG */
37849  
37850  static struct proc_dir_entry *proc_ppc64_lparcfg;
37851 -#define LPARCFG_BUFF_SIZE 4096
37852  
37853  /*
37854   * Track sum of all purrs across all processors. This is used to further
37855 @@ -595,13 +594,6 @@
37856         ent = create_proc_entry("ppc64/lparcfg", mode, NULL);
37857         if (ent) {
37858                 ent->proc_fops = &lparcfg_fops;
37859 -               ent->data = kmalloc(LPARCFG_BUFF_SIZE, GFP_KERNEL);
37860 -               if (!ent->data) {
37861 -                       printk(KERN_ERR
37862 -                              "Failed to allocate buffer for lparcfg\n");
37863 -                       remove_proc_entry("lparcfg", ent->parent);
37864 -                       return -ENOMEM;
37865 -               }
37866         } else {
37867                 printk(KERN_ERR "Failed to create ppc64/lparcfg\n");
37868                 return -EIO;
37869 @@ -613,10 +605,8 @@
37870  
37871  void __exit lparcfg_cleanup(void)
37872  {
37873 -       if (proc_ppc64_lparcfg) {
37874 -               kfree(proc_ppc64_lparcfg->data);
37875 +       if (proc_ppc64_lparcfg)
37876                 remove_proc_entry("lparcfg", proc_ppc64_lparcfg->parent);
37877 -       }
37878  }
37879  
37880  module_init(lparcfg_init);
37881 --- a/arch/powerpc/kernel/misc.S
37882 +++ b/arch/powerpc/kernel/misc.S
37883 @@ -8,12 +8,17 @@
37884   * Adapted for iSeries by Mike Corrigan (mikejc@us.ibm.com)
37885   * PPC64 updates by Dave Engebretsen (engebret@us.ibm.com)
37886   *
37887 + * setjmp/longjmp code by Paul Mackerras.
37888 + *
37889   * This program is free software; you can redistribute it and/or
37890   * modify it under the terms of the GNU General Public License
37891   * as published by the Free Software Foundation; either version
37892   * 2 of the License, or (at your option) any later version.
37893   */
37894  #include <asm/ppc_asm.h>
37895 +#include <asm/unistd.h>
37896 +#include <asm/asm-compat.h>
37897 +#include <asm/asm-offsets.h>
37898  
37899         .text
37900  
37901 @@ -43,3 +48,71 @@
37902         add     r3,r3,r5
37903         mtlr    r0
37904         blr
37905 +
37906 +_GLOBAL(kernel_execve)
37907 +       li      r0,__NR_execve
37908 +       sc
37909 +       bnslr
37910 +       neg     r3,r3
37911 +       blr
37912 +
37913 +_GLOBAL(setjmp)
37914 +       mflr    r0
37915 +       PPC_STL r0,0(r3)
37916 +       PPC_STL r1,SZL(r3)
37917 +       PPC_STL r2,2*SZL(r3)
37918 +       mfcr    r0
37919 +       PPC_STL r0,3*SZL(r3)
37920 +       PPC_STL r13,4*SZL(r3)
37921 +       PPC_STL r14,5*SZL(r3)
37922 +       PPC_STL r15,6*SZL(r3)
37923 +       PPC_STL r16,7*SZL(r3)
37924 +       PPC_STL r17,8*SZL(r3)
37925 +       PPC_STL r18,9*SZL(r3)
37926 +       PPC_STL r19,10*SZL(r3)
37927 +       PPC_STL r20,11*SZL(r3)
37928 +       PPC_STL r21,12*SZL(r3)
37929 +       PPC_STL r22,13*SZL(r3)
37930 +       PPC_STL r23,14*SZL(r3)
37931 +       PPC_STL r24,15*SZL(r3)
37932 +       PPC_STL r25,16*SZL(r3)
37933 +       PPC_STL r26,17*SZL(r3)
37934 +       PPC_STL r27,18*SZL(r3)
37935 +       PPC_STL r28,19*SZL(r3)
37936 +       PPC_STL r29,20*SZL(r3)
37937 +       PPC_STL r30,21*SZL(r3)
37938 +       PPC_STL r31,22*SZL(r3)
37939 +       li      r3,0
37940 +       blr
37941 +
37942 +_GLOBAL(longjmp)
37943 +       PPC_LCMPI r4,0
37944 +       bne     1f
37945 +       li      r4,1
37946 +1:     PPC_LL  r13,4*SZL(r3)
37947 +       PPC_LL  r14,5*SZL(r3)
37948 +       PPC_LL  r15,6*SZL(r3)
37949 +       PPC_LL  r16,7*SZL(r3)
37950 +       PPC_LL  r17,8*SZL(r3)
37951 +       PPC_LL  r18,9*SZL(r3)
37952 +       PPC_LL  r19,10*SZL(r3)
37953 +       PPC_LL  r20,11*SZL(r3)
37954 +       PPC_LL  r21,12*SZL(r3)
37955 +       PPC_LL  r22,13*SZL(r3)
37956 +       PPC_LL  r23,14*SZL(r3)
37957 +       PPC_LL  r24,15*SZL(r3)
37958 +       PPC_LL  r25,16*SZL(r3)
37959 +       PPC_LL  r26,17*SZL(r3)
37960 +       PPC_LL  r27,18*SZL(r3)
37961 +       PPC_LL  r28,19*SZL(r3)
37962 +       PPC_LL  r29,20*SZL(r3)
37963 +       PPC_LL  r30,21*SZL(r3)
37964 +       PPC_LL  r31,22*SZL(r3)
37965 +       PPC_LL  r0,3*SZL(r3)
37966 +       mtcrf   0x38,r0
37967 +       PPC_LL  r0,0(r3)
37968 +       PPC_LL  r1,SZL(r3)
37969 +       PPC_LL  r2,2*SZL(r3)
37970 +       mtlr    r0
37971 +       mr      r3,r4
37972 +       blr
37973 --- a/arch/powerpc/kernel/misc_32.S
37974 +++ b/arch/powerpc/kernel/misc_32.S
37975 @@ -206,6 +206,45 @@
37976         isync
37977         blr                     /* Done */
37978  
37979 +#ifdef CONFIG_40x
37980 +
37981 +/*
37982 + * Do an IO access in real mode
37983 + */
37984 +_GLOBAL(real_readb)
37985 +       mfmsr   r7
37986 +       ori     r0,r7,MSR_DR
37987 +       xori    r0,r0,MSR_DR
37988 +       sync
37989 +       mtmsr   r0
37990 +       sync
37991 +       isync
37992 +       lbz     r3,0(r3)
37993 +       sync
37994 +       mtmsr   r7
37995 +       sync
37996 +       isync
37997 +       blr
37998 +
37999 +       /*
38000 + * Do an IO access in real mode
38001 + */
38002 +_GLOBAL(real_writeb)
38003 +       mfmsr   r7
38004 +       ori     r0,r7,MSR_DR
38005 +       xori    r0,r0,MSR_DR
38006 +       sync
38007 +       mtmsr   r0
38008 +       sync
38009 +       isync
38010 +       stb     r3,0(r4)
38011 +       sync
38012 +       mtmsr   r7
38013 +       sync
38014 +       isync
38015 +       blr
38016 +
38017 +#endif /* CONFIG_40x */
38018  
38019  /*
38020   * Flush MMU TLB
38021 @@ -793,13 +832,6 @@
38022         addi    r1,r1,16
38023         blr
38024  
38025 -_GLOBAL(kernel_execve)
38026 -       li      r0,__NR_execve
38027 -       sc
38028 -       bnslr
38029 -       neg     r3,r3
38030 -       blr
38031 -
38032  /*
38033   * This routine is just here to keep GCC happy - sigh...
38034   */
38035 --- a/arch/powerpc/kernel/misc_64.S
38036 +++ b/arch/powerpc/kernel/misc_64.S
38037 @@ -518,13 +518,6 @@
38038  
38039  #endif /* CONFIG_ALTIVEC */
38040  
38041 -_GLOBAL(kernel_execve)
38042 -       li      r0,__NR_execve
38043 -       sc
38044 -       bnslr
38045 -       neg     r3,r3
38046 -       blr
38047 -
38048  /* kexec_wait(phys_cpu)
38049   *
38050   * wait for the flag to change, indicating this kernel is going away but
38051 --- a/arch/powerpc/kernel/module_32.c
38052 +++ b/arch/powerpc/kernel/module_32.c
38053 @@ -24,6 +24,7 @@
38054  #include <linux/kernel.h>
38055  #include <linux/cache.h>
38056  #include <linux/bug.h>
38057 +#include <linux/sort.h>
38058  
38059  #include "setup.h"
38060  
38061 @@ -54,22 +55,60 @@
38062     addend) */
38063  static unsigned int count_relocs(const Elf32_Rela *rela, unsigned int num)
38064  {
38065 -       unsigned int i, j, ret = 0;
38066 +       unsigned int i, r_info, r_addend, _count_relocs;
38067  
38068 -       /* Sure, this is order(n^2), but it's usually short, and not
38069 -           time critical */
38070 -       for (i = 0; i < num; i++) {
38071 -               for (j = 0; j < i; j++) {
38072 -                       /* If this addend appeared before, it's
38073 -                           already been counted */
38074 -                       if (ELF32_R_SYM(rela[i].r_info)
38075 -                           == ELF32_R_SYM(rela[j].r_info)
38076 -                           && rela[i].r_addend == rela[j].r_addend)
38077 -                               break;
38078 +       _count_relocs = 0;
38079 +       r_info = 0;
38080 +       r_addend = 0;
38081 +       for (i = 0; i < num; i++)
38082 +               /* Only count 24-bit relocs, others don't need stubs */
38083 +               if (ELF32_R_TYPE(rela[i].r_info) == R_PPC_REL24 &&
38084 +                   (r_info != ELF32_R_SYM(rela[i].r_info) ||
38085 +                    r_addend != rela[i].r_addend)) {
38086 +                       _count_relocs++;
38087 +                       r_info = ELF32_R_SYM(rela[i].r_info);
38088 +                       r_addend = rela[i].r_addend;
38089                 }
38090 -               if (j == i) ret++;
38091 +
38092 +       return _count_relocs;
38093 +}
38094 +
38095 +static int relacmp(const void *_x, const void *_y)
38096 +{
38097 +       const Elf32_Rela *x, *y;
38098 +
38099 +       y = (Elf32_Rela *)_x;
38100 +       x = (Elf32_Rela *)_y;
38101 +
38102 +       /* Compare the entire r_info (as opposed to ELF32_R_SYM(r_info) only) to
38103 +        * make the comparison cheaper/faster. It won't affect the sorting or
38104 +        * the counting algorithms' performance
38105 +        */
38106 +       if (x->r_info < y->r_info)
38107 +               return -1;
38108 +       else if (x->r_info > y->r_info)
38109 +               return 1;
38110 +       else if (x->r_addend < y->r_addend)
38111 +               return -1;
38112 +       else if (x->r_addend > y->r_addend)
38113 +               return 1;
38114 +       else
38115 +               return 0;
38116 +}
38117 +
38118 +static void relaswap(void *_x, void *_y, int size)
38119 +{
38120 +       uint32_t *x, *y, tmp;
38121 +       int i;
38122 +
38123 +       y = (uint32_t *)_x;
38124 +       x = (uint32_t *)_y;
38125 +
38126 +       for (i = 0; i < sizeof(Elf32_Rela) / sizeof(uint32_t); i++) {
38127 +               tmp = x[i];
38128 +               x[i] = y[i];
38129 +               y[i] = tmp;
38130         }
38131 -       return ret;
38132  }
38133  
38134  /* Get the potential trampolines size required of the init and
38135 @@ -100,6 +139,16 @@
38136                         DEBUGP("Ptr: %p.  Number: %u\n",
38137                                (void *)hdr + sechdrs[i].sh_offset,
38138                                sechdrs[i].sh_size / sizeof(Elf32_Rela));
38139 +
38140 +                       /* Sort the relocation information based on a symbol and
38141 +                        * addend key. This is a stable O(n*log n) complexity
38142 +                        * alogrithm but it will reduce the complexity of
38143 +                        * count_relocs() to linear complexity O(n)
38144 +                        */
38145 +                       sort((void *)hdr + sechdrs[i].sh_offset,
38146 +                            sechdrs[i].sh_size / sizeof(Elf32_Rela),
38147 +                            sizeof(Elf32_Rela), relacmp, relaswap);
38148 +
38149                         ret += count_relocs((void *)hdr
38150                                              + sechdrs[i].sh_offset,
38151                                              sechdrs[i].sh_size
38152 --- a/arch/powerpc/kernel/module_64.c
38153 +++ b/arch/powerpc/kernel/module_64.c
38154 @@ -24,6 +24,7 @@
38155  #include <asm/module.h>
38156  #include <asm/uaccess.h>
38157  #include <asm/firmware.h>
38158 +#include <linux/sort.h>
38159  
38160  #include "setup.h"
38161  
38162 @@ -81,25 +82,23 @@
38163     different addend) */
38164  static unsigned int count_relocs(const Elf64_Rela *rela, unsigned int num)
38165  {
38166 -       unsigned int i, j, ret = 0;
38167 +       unsigned int i, r_info, r_addend, _count_relocs;
38168  
38169         /* FIXME: Only count external ones --RR */
38170 -       /* Sure, this is order(n^2), but it's usually short, and not
38171 -           time critical */
38172 -       for (i = 0; i < num; i++) {
38173 +       _count_relocs = 0;
38174 +       r_info = 0;
38175 +       r_addend = 0;
38176 +       for (i = 0; i < num; i++)
38177                 /* Only count 24-bit relocs, others don't need stubs */
38178 -               if (ELF64_R_TYPE(rela[i].r_info) != R_PPC_REL24)
38179 -                       continue;
38180 -               for (j = 0; j < i; j++) {
38181 -                       /* If this addend appeared before, it's
38182 -                           already been counted */
38183 -                       if (rela[i].r_info == rela[j].r_info
38184 -                           && rela[i].r_addend == rela[j].r_addend)
38185 -                               break;
38186 +               if (ELF64_R_TYPE(rela[i].r_info) == R_PPC_REL24 &&
38187 +                   (r_info != ELF64_R_SYM(rela[i].r_info) ||
38188 +                    r_addend != rela[i].r_addend)) {
38189 +                       _count_relocs++;
38190 +                       r_info = ELF64_R_SYM(rela[i].r_info);
38191 +                       r_addend = rela[i].r_addend;
38192                 }
38193 -               if (j == i) ret++;
38194 -       }
38195 -       return ret;
38196 +
38197 +       return _count_relocs;
38198  }
38199  
38200  void *module_alloc(unsigned long size)
38201 @@ -118,6 +117,44 @@
38202             table entries. */
38203  }
38204  
38205 +static int relacmp(const void *_x, const void *_y)
38206 +{
38207 +       const Elf64_Rela *x, *y;
38208 +
38209 +       y = (Elf64_Rela *)_x;
38210 +       x = (Elf64_Rela *)_y;
38211 +
38212 +       /* Compare the entire r_info (as opposed to ELF64_R_SYM(r_info) only) to
38213 +        * make the comparison cheaper/faster. It won't affect the sorting or
38214 +        * the counting algorithms' performance
38215 +        */
38216 +       if (x->r_info < y->r_info)
38217 +               return -1;
38218 +       else if (x->r_info > y->r_info)
38219 +               return 1;
38220 +       else if (x->r_addend < y->r_addend)
38221 +               return -1;
38222 +       else if (x->r_addend > y->r_addend)
38223 +               return 1;
38224 +       else
38225 +               return 0;
38226 +}
38227 +
38228 +static void relaswap(void *_x, void *_y, int size)
38229 +{
38230 +       uint64_t *x, *y, tmp;
38231 +       int i;
38232 +
38233 +       y = (uint64_t *)_x;
38234 +       x = (uint64_t *)_y;
38235 +
38236 +       for (i = 0; i < sizeof(Elf64_Rela) / sizeof(uint64_t); i++) {
38237 +               tmp = x[i];
38238 +               x[i] = y[i];
38239 +               y[i] = tmp;
38240 +       }
38241 +}
38242 +
38243  /* Get size of potential trampolines required. */
38244  static unsigned long get_stubs_size(const Elf64_Ehdr *hdr,
38245                                     const Elf64_Shdr *sechdrs)
38246 @@ -133,6 +170,16 @@
38247                         DEBUGP("Ptr: %p.  Number: %lu\n",
38248                                (void *)sechdrs[i].sh_addr,
38249                                sechdrs[i].sh_size / sizeof(Elf64_Rela));
38250 +
38251 +                       /* Sort the relocation information based on a symbol and
38252 +                        * addend key. This is a stable O(n*log n) complexity
38253 +                        * alogrithm but it will reduce the complexity of
38254 +                        * count_relocs() to linear complexity O(n)
38255 +                        */
38256 +                       sort((void *)sechdrs[i].sh_addr,
38257 +                            sechdrs[i].sh_size / sizeof(Elf64_Rela),
38258 +                            sizeof(Elf64_Rela), relacmp, relaswap);
38259 +
38260                         relocs += count_relocs((void *)sechdrs[i].sh_addr,
38261                                                sechdrs[i].sh_size
38262                                                / sizeof(Elf64_Rela));
38263 @@ -343,7 +390,7 @@
38264                         /* Simply set it */
38265                         *(u32 *)location = value;
38266                         break;
38267 -                       
38268 +
38269                 case R_PPC64_ADDR64:
38270                         /* Simply set it */
38271                         *(unsigned long *)location = value;
38272 @@ -399,7 +446,7 @@
38273                         }
38274  
38275                         /* Only replace bits 2 through 26 */
38276 -                       *(uint32_t *)location 
38277 +                       *(uint32_t *)location
38278                                 = (*(uint32_t *)location & ~0x03fffffc)
38279                                 | (value & 0x03fffffc);
38280                         break;
38281 --- a/arch/powerpc/kernel/of_device.c
38282 +++ b/arch/powerpc/kernel/of_device.c
38283 @@ -5,10 +5,10 @@
38284  #include <linux/module.h>
38285  #include <linux/mod_devicetable.h>
38286  #include <linux/slab.h>
38287 +#include <linux/of_device.h>
38288  
38289  #include <asm/errno.h>
38290  #include <asm/dcr.h>
38291 -#include <asm/of_device.h>
38292  
38293  static void of_device_make_bus_id(struct of_device *dev)
38294  {
38295 --- a/arch/powerpc/kernel/of_platform.c
38296 +++ b/arch/powerpc/kernel/of_platform.c
38297 @@ -19,6 +19,7 @@
38298  #include <linux/mod_devicetable.h>
38299  #include <linux/slab.h>
38300  #include <linux/pci.h>
38301 +#include <linux/of.h>
38302  #include <linux/of_device.h>
38303  #include <linux/of_platform.h>
38304  
38305 @@ -40,7 +41,7 @@
38306   * a bus type in the list
38307   */
38308  
38309 -static struct of_device_id of_default_bus_ids[] = {
38310 +static const struct of_device_id of_default_bus_ids[] = {
38311         { .type = "soc", },
38312         { .compatible = "soc", },
38313         { .type = "spider", },
38314 @@ -64,26 +65,6 @@
38315  
38316  postcore_initcall(of_bus_driver_init);
38317  
38318 -int of_register_platform_driver(struct of_platform_driver *drv)
38319 -{
38320 -       /* initialize common driver fields */
38321 -       if (!drv->driver.name)
38322 -               drv->driver.name = drv->name;
38323 -       if (!drv->driver.owner)
38324 -               drv->driver.owner = drv->owner;
38325 -       drv->driver.bus = &of_platform_bus_type;
38326 -
38327 -       /* register with core */
38328 -       return driver_register(&drv->driver);
38329 -}
38330 -EXPORT_SYMBOL(of_register_platform_driver);
38331 -
38332 -void of_unregister_platform_driver(struct of_platform_driver *drv)
38333 -{
38334 -       driver_unregister(&drv->driver);
38335 -}
38336 -EXPORT_SYMBOL(of_unregister_platform_driver);
38337 -
38338  struct of_device* of_platform_device_create(struct device_node *np,
38339                                             const char *bus_id,
38340                                             struct device *parent)
38341 @@ -120,15 +101,15 @@
38342   * @matches: match table, NULL to use the default, OF_NO_DEEP_PROBE to
38343   * disallow recursive creation of child busses
38344   */
38345 -static int of_platform_bus_create(struct device_node *bus,
38346 -                                 struct of_device_id *matches,
38347 +static int of_platform_bus_create(const struct device_node *bus,
38348 +                                 const struct of_device_id *matches,
38349                                   struct device *parent)
38350  {
38351         struct device_node *child;
38352         struct of_device *dev;
38353         int rc = 0;
38354  
38355 -       for (child = NULL; (child = of_get_next_child(bus, child)); ) {
38356 +       for_each_child_of_node(bus, child) {
38357                 pr_debug("   create child: %s\n", child->full_name);
38358                 dev = of_platform_device_create(child, NULL, parent);
38359                 if (dev == NULL)
38360 @@ -157,7 +138,7 @@
38361   */
38362  
38363  int of_platform_bus_probe(struct device_node *root,
38364 -                         struct of_device_id *matches,
38365 +                         const struct of_device_id *matches,
38366                           struct device *parent)
38367  {
38368         struct device_node *child;
38369 @@ -190,7 +171,7 @@
38370                 rc = of_platform_bus_create(root, matches, &dev->dev);
38371                 goto bail;
38372         }
38373 -       for (child = NULL; (child = of_get_next_child(root, child)); ) {
38374 +       for_each_child_of_node(root, child) {
38375                 if (!of_match_node(matches, child))
38376                         continue;
38377  
38378 --- a/arch/powerpc/kernel/pci-common.c
38379 +++ b/arch/powerpc/kernel/pci-common.c
38380 @@ -48,32 +48,26 @@
38381  static DEFINE_SPINLOCK(hose_spinlock);
38382  
38383  /* XXX kill that some day ... */
38384 -int global_phb_number;         /* Global phb counter */
38385 +static int global_phb_number;          /* Global phb counter */
38386  
38387 -extern struct list_head hose_list;
38388 +/* ISA Memory physical address */
38389 +resource_size_t isa_mem_base;
38390  
38391 -/*
38392 - * pci_controller(phb) initialized common variables.
38393 - */
38394 -static void __devinit pci_setup_pci_controller(struct pci_controller *hose)
38395 -{
38396 -       memset(hose, 0, sizeof(struct pci_controller));
38397 -
38398 -       spin_lock(&hose_spinlock);
38399 -       hose->global_number = global_phb_number++;
38400 -       list_add_tail(&hose->list_node, &hose_list);
38401 -       spin_unlock(&hose_spinlock);
38402 -}
38403 +/* Default PCI flags is 0 */
38404 +unsigned int ppc_pci_flags;
38405  
38406 -struct pci_controller * pcibios_alloc_controller(struct device_node *dev)
38407 +struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
38408  {
38409         struct pci_controller *phb;
38410  
38411 -       phb = alloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
38412 +       phb = zalloc_maybe_bootmem(sizeof(struct pci_controller), GFP_KERNEL);
38413         if (phb == NULL)
38414                 return NULL;
38415 -       pci_setup_pci_controller(phb);
38416 -       phb->arch_data = dev;
38417 +       spin_lock(&hose_spinlock);
38418 +       phb->global_number = global_phb_number++;
38419 +       list_add_tail(&phb->list_node, &hose_list);
38420 +       spin_unlock(&hose_spinlock);
38421 +       phb->dn = dev;
38422         phb->is_dynamic = mem_init_done;
38423  #ifdef CONFIG_PPC64
38424         if (dev) {
38425 @@ -126,15 +120,10 @@
38426   */
38427  int pci_domain_nr(struct pci_bus *bus)
38428  {
38429 -       if (firmware_has_feature(FW_FEATURE_ISERIES))
38430 -               return 0;
38431 -       else {
38432 -               struct pci_controller *hose = pci_bus_to_host(bus);
38433 +       struct pci_controller *hose = pci_bus_to_host(bus);
38434  
38435 -               return hose->global_number;
38436 -       }
38437 +       return hose->global_number;
38438  }
38439 -
38440  EXPORT_SYMBOL(pci_domain_nr);
38441  
38442  #ifdef CONFIG_PPC_OF
38443 @@ -153,7 +142,7 @@
38444         while(node) {
38445                 struct pci_controller *hose, *tmp;
38446                 list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
38447 -                       if (hose->arch_data == node)
38448 +                       if (hose->dn == node)
38449                                 return hose;
38450                 node = node->parent;
38451         }
38452 @@ -201,6 +190,20 @@
38453         struct of_irq oirq;
38454         unsigned int virq;
38455  
38456 +       /* The current device-tree that iSeries generates from the HV
38457 +        * PCI informations doesn't contain proper interrupt routing,
38458 +        * and all the fallback would do is print out crap, so we
38459 +        * don't attempt to resolve the interrupts here at all, some
38460 +        * iSeries specific fixup does it.
38461 +        *
38462 +        * In the long run, we will hopefully fix the generated device-tree
38463 +        * instead.
38464 +        */
38465 +#ifdef CONFIG_PPC_ISERIES
38466 +       if (firmware_has_feature(FW_FEATURE_ISERIES))
38467 +               return -1;
38468 +#endif
38469 +
38470         DBG("Try to map irq for %s...\n", pci_name(pci_dev));
38471  
38472  #ifdef DEBUG
38473 @@ -222,10 +225,11 @@
38474                 if (pin == 0)
38475                         return -1;
38476                 if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
38477 -                   line == 0xff) {
38478 +                   line == 0xff || line == 0) {
38479                         return -1;
38480                 }
38481 -               DBG(" -> no map ! Using irq line %d from PCI config\n", line);
38482 +               DBG(" -> no map ! Using line %d (pin %d) from PCI config\n",
38483 +                   line, pin);
38484  
38485                 virq = irq_create_mapping(NULL, line);
38486                 if (virq != NO_IRQ)
38487 @@ -475,3 +479,717 @@
38488         *start = rsrc->start - offset;
38489         *end = rsrc->end - offset;
38490  }
38491 +
38492 +/**
38493 + * pci_process_bridge_OF_ranges - Parse PCI bridge resources from device tree
38494 + * @hose: newly allocated pci_controller to be setup
38495 + * @dev: device node of the host bridge
38496 + * @primary: set if primary bus (32 bits only, soon to be deprecated)
38497 + *
38498 + * This function will parse the "ranges" property of a PCI host bridge device
38499 + * node and setup the resource mapping of a pci controller based on its
38500 + * content.
38501 + *
38502 + * Life would be boring if it wasn't for a few issues that we have to deal
38503 + * with here:
38504 + *
38505 + *   - We can only cope with one IO space range and up to 3 Memory space
38506 + *     ranges. However, some machines (thanks Apple !) tend to split their
38507 + *     space into lots of small contiguous ranges. So we have to coalesce.
38508 + *
38509 + *   - We can only cope with all memory ranges having the same offset
38510 + *     between CPU addresses and PCI addresses. Unfortunately, some bridges
38511 + *     are setup for a large 1:1 mapping along with a small "window" which
38512 + *     maps PCI address 0 to some arbitrary high address of the CPU space in
38513 + *     order to give access to the ISA memory hole.
38514 + *     The way out of here that I've chosen for now is to always set the
38515 + *     offset based on the first resource found, then override it if we
38516 + *     have a different offset and the previous was set by an ISA hole.
38517 + *
38518 + *   - Some busses have IO space not starting at 0, which causes trouble with
38519 + *     the way we do our IO resource renumbering. The code somewhat deals with
38520 + *     it for 64 bits but I would expect problems on 32 bits.
38521 + *
38522 + *   - Some 32 bits platforms such as 4xx can have physical space larger than
38523 + *     32 bits so we need to use 64 bits values for the parsing
38524 + */
38525 +void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
38526 +                                           struct device_node *dev,
38527 +                                           int primary)
38528 +{
38529 +       const u32 *ranges;
38530 +       int rlen;
38531 +       int pna = of_n_addr_cells(dev);
38532 +       int np = pna + 5;
38533 +       int memno = 0, isa_hole = -1;
38534 +       u32 pci_space;
38535 +       unsigned long long pci_addr, cpu_addr, pci_next, cpu_next, size;
38536 +       unsigned long long isa_mb = 0;
38537 +       struct resource *res;
38538 +
38539 +       printk(KERN_INFO "PCI host bridge %s %s ranges:\n",
38540 +              dev->full_name, primary ? "(primary)" : "");
38541 +
38542 +       /* Get ranges property */
38543 +       ranges = of_get_property(dev, "ranges", &rlen);
38544 +       if (ranges == NULL)
38545 +               return;
38546 +
38547 +       /* Parse it */
38548 +       while ((rlen -= np * 4) >= 0) {
38549 +               /* Read next ranges element */
38550 +               pci_space = ranges[0];
38551 +               pci_addr = of_read_number(ranges + 1, 2);
38552 +               cpu_addr = of_translate_address(dev, ranges + 3);
38553 +               size = of_read_number(ranges + pna + 3, 2);
38554 +               ranges += np;
38555 +               if (cpu_addr == OF_BAD_ADDR || size == 0)
38556 +                       continue;
38557 +
38558 +               /* Now consume following elements while they are contiguous */
38559 +               for (; rlen >= np * sizeof(u32);
38560 +                    ranges += np, rlen -= np * 4) {
38561 +                       if (ranges[0] != pci_space)
38562 +                               break;
38563 +                       pci_next = of_read_number(ranges + 1, 2);
38564 +                       cpu_next = of_translate_address(dev, ranges + 3);
38565 +                       if (pci_next != pci_addr + size ||
38566 +                           cpu_next != cpu_addr + size)
38567 +                               break;
38568 +                       size += of_read_number(ranges + pna + 3, 2);
38569 +               }
38570 +
38571 +               /* Act based on address space type */
38572 +               res = NULL;
38573 +               switch ((pci_space >> 24) & 0x3) {
38574 +               case 1:         /* PCI IO space */
38575 +                       printk(KERN_INFO
38576 +                              "  IO 0x%016llx..0x%016llx -> 0x%016llx\n",
38577 +                              cpu_addr, cpu_addr + size - 1, pci_addr);
38578 +
38579 +                       /* We support only one IO range */
38580 +                       if (hose->pci_io_size) {
38581 +                               printk(KERN_INFO
38582 +                                      " \\--> Skipped (too many) !\n");
38583 +                               continue;
38584 +                       }
38585 +#ifdef CONFIG_PPC32
38586 +                       /* On 32 bits, limit I/O space to 16MB */
38587 +                       if (size > 0x01000000)
38588 +                               size = 0x01000000;
38589 +
38590 +                       /* 32 bits needs to map IOs here */
38591 +                       hose->io_base_virt = ioremap(cpu_addr, size);
38592 +
38593 +                       /* Expect trouble if pci_addr is not 0 */
38594 +                       if (primary)
38595 +                               isa_io_base =
38596 +                                       (unsigned long)hose->io_base_virt;
38597 +#endif /* CONFIG_PPC32 */
38598 +                       /* pci_io_size and io_base_phys always represent IO
38599 +                        * space starting at 0 so we factor in pci_addr
38600 +                        */
38601 +                       hose->pci_io_size = pci_addr + size;
38602 +                       hose->io_base_phys = cpu_addr - pci_addr;
38603 +
38604 +                       /* Build resource */
38605 +                       res = &hose->io_resource;
38606 +                       res->flags = IORESOURCE_IO;
38607 +                       res->start = pci_addr;
38608 +                       break;
38609 +               case 2:         /* PCI Memory space */
38610 +                       printk(KERN_INFO
38611 +                              " MEM 0x%016llx..0x%016llx -> 0x%016llx %s\n",
38612 +                              cpu_addr, cpu_addr + size - 1, pci_addr,
38613 +                              (pci_space & 0x40000000) ? "Prefetch" : "");
38614 +
38615 +                       /* We support only 3 memory ranges */
38616 +                       if (memno >= 3) {
38617 +                               printk(KERN_INFO
38618 +                                      " \\--> Skipped (too many) !\n");
38619 +                               continue;
38620 +                       }
38621 +                       /* Handles ISA memory hole space here */
38622 +                       if (pci_addr == 0) {
38623 +                               isa_mb = cpu_addr;
38624 +                               isa_hole = memno;
38625 +                               if (primary || isa_mem_base == 0)
38626 +                                       isa_mem_base = cpu_addr;
38627 +                       }
38628 +
38629 +                       /* We get the PCI/Mem offset from the first range or
38630 +                        * the, current one if the offset came from an ISA
38631 +                        * hole. If they don't match, bugger.
38632 +                        */
38633 +                       if (memno == 0 ||
38634 +                           (isa_hole >= 0 && pci_addr != 0 &&
38635 +                            hose->pci_mem_offset == isa_mb))
38636 +                               hose->pci_mem_offset = cpu_addr - pci_addr;
38637 +                       else if (pci_addr != 0 &&
38638 +                                hose->pci_mem_offset != cpu_addr - pci_addr) {
38639 +                               printk(KERN_INFO
38640 +                                      " \\--> Skipped (offset mismatch) !\n");
38641 +                               continue;
38642 +                       }
38643 +
38644 +                       /* Build resource */
38645 +                       res = &hose->mem_resources[memno++];
38646 +                       res->flags = IORESOURCE_MEM;
38647 +                       if (pci_space & 0x40000000)
38648 +                               res->flags |= IORESOURCE_PREFETCH;
38649 +                       res->start = cpu_addr;
38650 +                       break;
38651 +               }
38652 +               if (res != NULL) {
38653 +                       res->name = dev->full_name;
38654 +                       res->end = res->start + size - 1;
38655 +                       res->parent = NULL;
38656 +                       res->sibling = NULL;
38657 +                       res->child = NULL;
38658 +               }
38659 +       }
38660 +
38661 +       /* Out of paranoia, let's put the ISA hole last if any */
38662 +       if (isa_hole >= 0 && memno > 0 && isa_hole != (memno-1)) {
38663 +               struct resource tmp = hose->mem_resources[isa_hole];
38664 +               hose->mem_resources[isa_hole] = hose->mem_resources[memno-1];
38665 +               hose->mem_resources[memno-1] = tmp;
38666 +       }
38667 +}
38668 +
38669 +/* Decide whether to display the domain number in /proc */
38670 +int pci_proc_domain(struct pci_bus *bus)
38671 +{
38672 +       struct pci_controller *hose = pci_bus_to_host(bus);
38673 +#ifdef CONFIG_PPC64
38674 +       return hose->buid != 0;
38675 +#else
38676 +       if (!(ppc_pci_flags & PPC_PCI_ENABLE_PROC_DOMAINS))
38677 +               return 0;
38678 +       if (ppc_pci_flags & PPC_PCI_COMPAT_DOMAIN_0)
38679 +               return hose->global_number != 0;
38680 +       return 1;
38681 +#endif
38682 +}
38683 +
38684 +void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
38685 +                            struct resource *res)
38686 +{
38687 +       resource_size_t offset = 0, mask = (resource_size_t)-1;
38688 +       struct pci_controller *hose = pci_bus_to_host(dev->bus);
38689 +
38690 +       if (!hose)
38691 +               return;
38692 +       if (res->flags & IORESOURCE_IO) {
38693 +               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
38694 +               mask = 0xffffffffu;
38695 +       } else if (res->flags & IORESOURCE_MEM)
38696 +               offset = hose->pci_mem_offset;
38697 +
38698 +       region->start = (res->start - offset) & mask;
38699 +       region->end = (res->end - offset) & mask;
38700 +}
38701 +EXPORT_SYMBOL(pcibios_resource_to_bus);
38702 +
38703 +void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
38704 +                            struct pci_bus_region *region)
38705 +{
38706 +       resource_size_t offset = 0, mask = (resource_size_t)-1;
38707 +       struct pci_controller *hose = pci_bus_to_host(dev->bus);
38708 +
38709 +       if (!hose)
38710 +               return;
38711 +       if (res->flags & IORESOURCE_IO) {
38712 +               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
38713 +               mask = 0xffffffffu;
38714 +       } else if (res->flags & IORESOURCE_MEM)
38715 +               offset = hose->pci_mem_offset;
38716 +       res->start = (region->start + offset) & mask;
38717 +       res->end = (region->end + offset) & mask;
38718 +}
38719 +EXPORT_SYMBOL(pcibios_bus_to_resource);
38720 +
38721 +/* Fixup a bus resource into a linux resource */
38722 +static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev)
38723 +{
38724 +       struct pci_controller *hose = pci_bus_to_host(dev->bus);
38725 +       resource_size_t offset = 0, mask = (resource_size_t)-1;
38726 +
38727 +       if (res->flags & IORESOURCE_IO) {
38728 +               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
38729 +               mask = 0xffffffffu;
38730 +       } else if (res->flags & IORESOURCE_MEM)
38731 +               offset = hose->pci_mem_offset;
38732 +
38733 +       res->start = (res->start + offset) & mask;
38734 +       res->end = (res->end + offset) & mask;
38735 +
38736 +       pr_debug("PCI:%s            %016llx-%016llx\n",
38737 +                pci_name(dev),
38738 +                (unsigned long long)res->start,
38739 +                (unsigned long long)res->end);
38740 +}
38741 +
38742 +
38743 +/* This header fixup will do the resource fixup for all devices as they are
38744 + * probed, but not for bridge ranges
38745 + */
38746 +static void __devinit pcibios_fixup_resources(struct pci_dev *dev)
38747 +{
38748 +       struct pci_controller *hose = pci_bus_to_host(dev->bus);
38749 +       int i;
38750 +
38751 +       if (!hose) {
38752 +               printk(KERN_ERR "No host bridge for PCI dev %s !\n",
38753 +                      pci_name(dev));
38754 +               return;
38755 +       }
38756 +       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
38757 +               struct resource *res = dev->resource + i;
38758 +               if (!res->flags)
38759 +                       continue;
38760 +               if (res->end == 0xffffffff) {
38761 +                       pr_debug("PCI:%s Resource %d %016llx-%016llx [%x] is unassigned\n",
38762 +                                pci_name(dev), i,
38763 +                                (unsigned long long)res->start,
38764 +                                (unsigned long long)res->end,
38765 +                                (unsigned int)res->flags);
38766 +                       res->end -= res->start;
38767 +                       res->start = 0;
38768 +                       res->flags |= IORESOURCE_UNSET;
38769 +                       continue;
38770 +               }
38771 +
38772 +               pr_debug("PCI:%s Resource %d %016llx-%016llx [%x] fixup...\n",
38773 +                        pci_name(dev), i,
38774 +                        (unsigned long long)res->start,\
38775 +                        (unsigned long long)res->end,
38776 +                        (unsigned int)res->flags);
38777 +
38778 +               fixup_resource(res, dev);
38779 +       }
38780 +
38781 +       /* Call machine specific resource fixup */
38782 +       if (ppc_md.pcibios_fixup_resources)
38783 +               ppc_md.pcibios_fixup_resources(dev);
38784 +}
38785 +DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, pcibios_fixup_resources);
38786 +
38787 +static void __devinit __pcibios_fixup_bus(struct pci_bus *bus)
38788 +{
38789 +       struct pci_controller *hose = pci_bus_to_host(bus);
38790 +       struct pci_dev *dev = bus->self;
38791 +
38792 +       pr_debug("PCI: Fixup bus %d (%s)\n", bus->number, dev ? pci_name(dev) : "PHB");
38793 +
38794 +       /* Fixup PCI<->PCI bridges. Host bridges are handled separately, for
38795 +        * now differently between 32 and 64 bits.
38796 +        */
38797 +       if (dev != NULL) {
38798 +               struct resource *res;
38799 +               int i;
38800 +
38801 +               for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
38802 +                       if ((res = bus->resource[i]) == NULL)
38803 +                               continue;
38804 +                       if (!res->flags)
38805 +                               continue;
38806 +                       if (i >= 3 && bus->self->transparent)
38807 +                               continue;
38808 +                       /* On PowerMac, Apple leaves bridge windows open over
38809 +                        * an inaccessible region of memory space (0...fffff)
38810 +                        * which is somewhat bogus, but that's what they think
38811 +                        * means disabled...
38812 +                        *
38813 +                        * We clear those to force them to be reallocated later
38814 +                        *
38815 +                        * We detect such regions by the fact that the base is
38816 +                        * equal to the pci_mem_offset of the host bridge and
38817 +                        * their size is smaller than 1M.
38818 +                        */
38819 +                       if (res->flags & IORESOURCE_MEM &&
38820 +                           res->start == hose->pci_mem_offset &&
38821 +                           res->end < 0x100000) {
38822 +                               printk(KERN_INFO
38823 +                                      "PCI: Closing bogus Apple Firmware"
38824 +                                      " region %d on bus 0x%02x\n",
38825 +                                      i, bus->number);
38826 +                               res->flags = 0;
38827 +                               continue;
38828 +                       }
38829 +
38830 +                       pr_debug("PCI:%s Bus rsrc %d %016llx-%016llx [%x] fixup...\n",
38831 +                                pci_name(dev), i,
38832 +                                (unsigned long long)res->start,\
38833 +                                (unsigned long long)res->end,
38834 +                                (unsigned int)res->flags);
38835 +
38836 +                       fixup_resource(res, dev);
38837 +               }
38838 +       }
38839 +
38840 +       /* Additional setup that is different between 32 and 64 bits for now */
38841 +       pcibios_do_bus_setup(bus);
38842 +
38843 +       /* Platform specific bus fixups */
38844 +       if (ppc_md.pcibios_fixup_bus)
38845 +               ppc_md.pcibios_fixup_bus(bus);
38846 +
38847 +       /* Read default IRQs and fixup if necessary */
38848 +       list_for_each_entry(dev, &bus->devices, bus_list) {
38849 +               pci_read_irq_line(dev);
38850 +               if (ppc_md.pci_irq_fixup)
38851 +                       ppc_md.pci_irq_fixup(dev);
38852 +       }
38853 +}
38854 +
38855 +void __devinit pcibios_fixup_bus(struct pci_bus *bus)
38856 +{
38857 +       /* When called from the generic PCI probe, read PCI<->PCI bridge
38858 +        * bases before proceeding
38859 +        */
38860 +       if (bus->self != NULL)
38861 +               pci_read_bridge_bases(bus);
38862 +       __pcibios_fixup_bus(bus);
38863 +}
38864 +EXPORT_SYMBOL(pcibios_fixup_bus);
38865 +
38866 +/* When building a bus from the OF tree rather than probing, we need a
38867 + * slightly different version of the fixup which doesn't read the
38868 + * bridge bases using config space accesses
38869 + */
38870 +void __devinit pcibios_fixup_of_probed_bus(struct pci_bus *bus)
38871 +{
38872 +       __pcibios_fixup_bus(bus);
38873 +}
38874 +
38875 +static int skip_isa_ioresource_align(struct pci_dev *dev)
38876 +{
38877 +       if ((ppc_pci_flags & PPC_PCI_CAN_SKIP_ISA_ALIGN) &&
38878 +           !(dev->bus->bridge_ctl & PCI_BRIDGE_CTL_ISA))
38879 +               return 1;
38880 +       return 0;
38881 +}
38882 +
38883 +/*
38884 + * We need to avoid collisions with `mirrored' VGA ports
38885 + * and other strange ISA hardware, so we always want the
38886 + * addresses to be allocated in the 0x000-0x0ff region
38887 + * modulo 0x400.
38888 + *
38889 + * Why? Because some silly external IO cards only decode
38890 + * the low 10 bits of the IO address. The 0x00-0xff region
38891 + * is reserved for motherboard devices that decode all 16
38892 + * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
38893 + * but we want to try to avoid allocating at 0x2900-0x2bff
38894 + * which might have be mirrored at 0x0100-0x03ff..
38895 + */
38896 +void pcibios_align_resource(void *data, struct resource *res,
38897 +                               resource_size_t size, resource_size_t align)
38898 +{
38899 +       struct pci_dev *dev = data;
38900 +
38901 +       if (res->flags & IORESOURCE_IO) {
38902 +               resource_size_t start = res->start;
38903 +
38904 +               if (skip_isa_ioresource_align(dev))
38905 +                       return;
38906 +               if (start & 0x300) {
38907 +                       start = (start + 0x3ff) & ~0x3ff;
38908 +                       res->start = start;
38909 +               }
38910 +       }
38911 +}
38912 +EXPORT_SYMBOL(pcibios_align_resource);
38913 +
38914 +/*
38915 + * Reparent resource children of pr that conflict with res
38916 + * under res, and make res replace those children.
38917 + */
38918 +static int __init reparent_resources(struct resource *parent,
38919 +                                    struct resource *res)
38920 +{
38921 +       struct resource *p, **pp;
38922 +       struct resource **firstpp = NULL;
38923 +
38924 +       for (pp = &parent->child; (p = *pp) != NULL; pp = &p->sibling) {
38925 +               if (p->end < res->start)
38926 +                       continue;
38927 +               if (res->end < p->start)
38928 +                       break;
38929 +               if (p->start < res->start || p->end > res->end)
38930 +                       return -1;      /* not completely contained */
38931 +               if (firstpp == NULL)
38932 +                       firstpp = pp;
38933 +       }
38934 +       if (firstpp == NULL)
38935 +               return -1;      /* didn't find any conflicting entries? */
38936 +       res->parent = parent;
38937 +       res->child = *firstpp;
38938 +       res->sibling = *pp;
38939 +       *firstpp = res;
38940 +       *pp = NULL;
38941 +       for (p = res->child; p != NULL; p = p->sibling) {
38942 +               p->parent = res;
38943 +               DBG(KERN_INFO "PCI: reparented %s [%llx..%llx] under %s\n",
38944 +                   p->name,
38945 +                   (unsigned long long)p->start,
38946 +                   (unsigned long long)p->end, res->name);
38947 +       }
38948 +       return 0;
38949 +}
38950 +
38951 +/*
38952 + *  Handle resources of PCI devices.  If the world were perfect, we could
38953 + *  just allocate all the resource regions and do nothing more.  It isn't.
38954 + *  On the other hand, we cannot just re-allocate all devices, as it would
38955 + *  require us to know lots of host bridge internals.  So we attempt to
38956 + *  keep as much of the original configuration as possible, but tweak it
38957 + *  when it's found to be wrong.
38958 + *
38959 + *  Known BIOS problems we have to work around:
38960 + *     - I/O or memory regions not configured
38961 + *     - regions configured, but not enabled in the command register
38962 + *     - bogus I/O addresses above 64K used
38963 + *     - expansion ROMs left enabled (this may sound harmless, but given
38964 + *       the fact the PCI specs explicitly allow address decoders to be
38965 + *       shared between expansion ROMs and other resource regions, it's
38966 + *       at least dangerous)
38967 + *
38968 + *  Our solution:
38969 + *     (1) Allocate resources for all buses behind PCI-to-PCI bridges.
38970 + *         This gives us fixed barriers on where we can allocate.
38971 + *     (2) Allocate resources for all enabled devices.  If there is
38972 + *         a collision, just mark the resource as unallocated. Also
38973 + *         disable expansion ROMs during this step.
38974 + *     (3) Try to allocate resources for disabled devices.  If the
38975 + *         resources were assigned correctly, everything goes well,
38976 + *         if they weren't, they won't disturb allocation of other
38977 + *         resources.
38978 + *     (4) Assign new addresses to resources which were either
38979 + *         not configured at all or misconfigured.  If explicitly
38980 + *         requested by the user, configure expansion ROM address
38981 + *         as well.
38982 + */
38983 +
38984 +static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
38985 +{
38986 +       struct pci_bus *bus;
38987 +       int i;
38988 +       struct resource *res, *pr;
38989 +
38990 +       /* Depth-First Search on bus tree */
38991 +       list_for_each_entry(bus, bus_list, node) {
38992 +               for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
38993 +                       if ((res = bus->resource[i]) == NULL || !res->flags
38994 +                           || res->start > res->end)
38995 +                               continue;
38996 +                       if (bus->parent == NULL)
38997 +                               pr = (res->flags & IORESOURCE_IO) ?
38998 +                                       &ioport_resource : &iomem_resource;
38999 +                       else {
39000 +                               /* Don't bother with non-root busses when
39001 +                                * re-assigning all resources. We clear the
39002 +                                * resource flags as if they were colliding
39003 +                                * and as such ensure proper re-allocation
39004 +                                * later.
39005 +                                */
39006 +                               if (ppc_pci_flags & PPC_PCI_REASSIGN_ALL_RSRC)
39007 +                                       goto clear_resource;
39008 +                               pr = pci_find_parent_resource(bus->self, res);
39009 +                               if (pr == res) {
39010 +                                       /* this happens when the generic PCI
39011 +                                        * code (wrongly) decides that this
39012 +                                        * bridge is transparent  -- paulus
39013 +                                        */
39014 +                                       continue;
39015 +                               }
39016 +                       }
39017 +
39018 +                       DBG("PCI: %s (bus %d) bridge rsrc %d: %016llx-%016llx "
39019 +                           "[0x%x], parent %p (%s)\n",
39020 +                           bus->self ? pci_name(bus->self) : "PHB",
39021 +                           bus->number, i,
39022 +                           (unsigned long long)res->start,
39023 +                           (unsigned long long)res->end,
39024 +                           (unsigned int)res->flags,
39025 +                           pr, (pr && pr->name) ? pr->name : "nil");
39026 +
39027 +                       if (pr && !(pr->flags & IORESOURCE_UNSET)) {
39028 +                               if (request_resource(pr, res) == 0)
39029 +                                       continue;
39030 +                               /*
39031 +                                * Must be a conflict with an existing entry.
39032 +                                * Move that entry (or entries) under the
39033 +                                * bridge resource and try again.
39034 +                                */
39035 +                               if (reparent_resources(pr, res) == 0)
39036 +                                       continue;
39037 +                       }
39038 +                       printk(KERN_WARNING
39039 +                              "PCI: Cannot allocate resource region "
39040 +                              "%d of PCI bridge %d, will remap\n",
39041 +                              i, bus->number);
39042 +clear_resource:
39043 +                       res->flags = 0;
39044 +               }
39045 +               pcibios_allocate_bus_resources(&bus->children);
39046 +       }
39047 +}
39048 +
39049 +static inline void __devinit alloc_resource(struct pci_dev *dev, int idx)
39050 +{
39051 +       struct resource *pr, *r = &dev->resource[idx];
39052 +
39053 +       DBG("PCI: Allocating %s: Resource %d: %016llx..%016llx [%x]\n",
39054 +           pci_name(dev), idx,
39055 +           (unsigned long long)r->start,
39056 +           (unsigned long long)r->end,
39057 +           (unsigned int)r->flags);
39058 +
39059 +       pr = pci_find_parent_resource(dev, r);
39060 +       if (!pr || (pr->flags & IORESOURCE_UNSET) ||
39061 +           request_resource(pr, r) < 0) {
39062 +               printk(KERN_WARNING "PCI: Cannot allocate resource region %d"
39063 +                      " of device %s, will remap\n", idx, pci_name(dev));
39064 +               if (pr)
39065 +                       DBG("PCI:  parent is %p: %016llx-%016llx [%x]\n", pr,
39066 +                           (unsigned long long)pr->start,
39067 +                           (unsigned long long)pr->end,
39068 +                           (unsigned int)pr->flags);
39069 +               /* We'll assign a new address later */
39070 +               r->flags |= IORESOURCE_UNSET;
39071 +               r->end -= r->start;
39072 +               r->start = 0;
39073 +       }
39074 +}
39075 +
39076 +static void __init pcibios_allocate_resources(int pass)
39077 +{
39078 +       struct pci_dev *dev = NULL;
39079 +       int idx, disabled;
39080 +       u16 command;
39081 +       struct resource *r;
39082 +
39083 +       for_each_pci_dev(dev) {
39084 +               pci_read_config_word(dev, PCI_COMMAND, &command);
39085 +               for (idx = 0; idx < 6; idx++) {
39086 +                       r = &dev->resource[idx];
39087 +                       if (r->parent)          /* Already allocated */
39088 +                               continue;
39089 +                       if (!r->flags || (r->flags & IORESOURCE_UNSET))
39090 +                               continue;       /* Not assigned at all */
39091 +                       if (r->flags & IORESOURCE_IO)
39092 +                               disabled = !(command & PCI_COMMAND_IO);
39093 +                       else
39094 +                               disabled = !(command & PCI_COMMAND_MEMORY);
39095 +                       if (pass == disabled)
39096 +                               alloc_resource(dev, idx);
39097 +               }
39098 +               if (pass)
39099 +                       continue;
39100 +               r = &dev->resource[PCI_ROM_RESOURCE];
39101 +               if (r->flags & IORESOURCE_ROM_ENABLE) {
39102 +                       /* Turn the ROM off, leave the resource region,
39103 +                        * but keep it unregistered.
39104 +                        */
39105 +                       u32 reg;
39106 +                       DBG("PCI: Switching off ROM of %s\n", pci_name(dev));
39107 +                       r->flags &= ~IORESOURCE_ROM_ENABLE;
39108 +                       pci_read_config_dword(dev, dev->rom_base_reg, &reg);
39109 +                       pci_write_config_dword(dev, dev->rom_base_reg,
39110 +                                              reg & ~PCI_ROM_ADDRESS_ENABLE);
39111 +               }
39112 +       }
39113 +}
39114 +
39115 +void __init pcibios_resource_survey(void)
39116 +{
39117 +       /* Allocate and assign resources. If we re-assign everything, then
39118 +        * we skip the allocate phase
39119 +        */
39120 +       pcibios_allocate_bus_resources(&pci_root_buses);
39121 +
39122 +       if (!(ppc_pci_flags & PPC_PCI_REASSIGN_ALL_RSRC)) {
39123 +               pcibios_allocate_resources(0);
39124 +               pcibios_allocate_resources(1);
39125 +       }
39126 +
39127 +       if (!(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) {
39128 +               DBG("PCI: Assigning unassigned resouces...\n");
39129 +               pci_assign_unassigned_resources();
39130 +       }
39131 +
39132 +       /* Call machine dependent fixup */
39133 +       if (ppc_md.pcibios_fixup)
39134 +               ppc_md.pcibios_fixup();
39135 +}
39136 +
39137 +#ifdef CONFIG_HOTPLUG
39138 +/* This is used by the pSeries hotplug driver to allocate resource
39139 + * of newly plugged busses. We can try to consolidate with the
39140 + * rest of the code later, for now, keep it as-is
39141 + */
39142 +void __devinit pcibios_claim_one_bus(struct pci_bus *bus)
39143 +{
39144 +       struct pci_dev *dev;
39145 +       struct pci_bus *child_bus;
39146 +
39147 +       list_for_each_entry(dev, &bus->devices, bus_list) {
39148 +               int i;
39149 +
39150 +               for (i = 0; i < PCI_NUM_RESOURCES; i++) {
39151 +                       struct resource *r = &dev->resource[i];
39152 +
39153 +                       if (r->parent || !r->start || !r->flags)
39154 +                               continue;
39155 +                       pci_claim_resource(dev, i);
39156 +               }
39157 +       }
39158 +
39159 +       list_for_each_entry(child_bus, &bus->children, node)
39160 +               pcibios_claim_one_bus(child_bus);
39161 +}
39162 +EXPORT_SYMBOL_GPL(pcibios_claim_one_bus);
39163 +#endif /* CONFIG_HOTPLUG */
39164 +
39165 +int pcibios_enable_device(struct pci_dev *dev, int mask)
39166 +{
39167 +       u16 cmd, old_cmd;
39168 +       int idx;
39169 +       struct resource *r;
39170 +
39171 +       if (ppc_md.pcibios_enable_device_hook)
39172 +               if (ppc_md.pcibios_enable_device_hook(dev))
39173 +                       return -EINVAL;
39174 +
39175 +       pci_read_config_word(dev, PCI_COMMAND, &cmd);
39176 +       old_cmd = cmd;
39177 +       for (idx = 0; idx < PCI_NUM_RESOURCES; idx++) {
39178 +               /* Only set up the requested stuff */
39179 +               if (!(mask & (1 << idx)))
39180 +                       continue;
39181 +               r = &dev->resource[idx];
39182 +               if (!(r->flags & (IORESOURCE_IO | IORESOURCE_MEM)))
39183 +                       continue;
39184 +               if ((idx == PCI_ROM_RESOURCE) &&
39185 +                               (!(r->flags & IORESOURCE_ROM_ENABLE)))
39186 +                       continue;
39187 +               if (r->parent == NULL) {
39188 +                       printk(KERN_ERR "PCI: Device %s not available because"
39189 +                              " of resource collisions\n", pci_name(dev));
39190 +                       return -EINVAL;
39191 +               }
39192 +               if (r->flags & IORESOURCE_IO)
39193 +                       cmd |= PCI_COMMAND_IO;
39194 +               if (r->flags & IORESOURCE_MEM)
39195 +                       cmd |= PCI_COMMAND_MEMORY;
39196 +       }
39197 +       if (cmd != old_cmd) {
39198 +               printk("PCI: Enabling device %s (%04x -> %04x)\n",
39199 +                      pci_name(dev), old_cmd, cmd);
39200 +               pci_write_config_word(dev, PCI_COMMAND, cmd);
39201 +       }
39202 +       return 0;
39203 +}
39204 +
39205 --- a/arch/powerpc/kernel/pci_32.c
39206 +++ b/arch/powerpc/kernel/pci_32.c
39207 @@ -13,6 +13,7 @@
39208  #include <linux/bootmem.h>
39209  #include <linux/irq.h>
39210  #include <linux/list.h>
39211 +#include <linux/of.h>
39212  
39213  #include <asm/processor.h>
39214  #include <asm/io.h>
39215 @@ -32,19 +33,12 @@
39216  #endif
39217  
39218  unsigned long isa_io_base     = 0;
39219 -unsigned long isa_mem_base    = 0;
39220  unsigned long pci_dram_offset = 0;
39221  int pcibios_assign_bus_offset = 1;
39222  
39223  void pcibios_make_OF_bus_map(void);
39224  
39225 -static int pci_relocate_bridge_resource(struct pci_bus *bus, int i);
39226 -static int probe_resource(struct pci_bus *parent, struct resource *pr,
39227 -                         struct resource *res, struct resource **conflict);
39228 -static void update_bridge_base(struct pci_bus *bus, int i);
39229 -static void pcibios_fixup_resources(struct pci_dev* dev);
39230  static void fixup_broken_pcnet32(struct pci_dev* dev);
39231 -static int reparent_resources(struct resource *parent, struct resource *res);
39232  static void fixup_cpc710_pci64(struct pci_dev* dev);
39233  #ifdef CONFIG_PPC_OF
39234  static u8* pci_to_OF_bus_map;
39235 @@ -53,7 +47,7 @@
39236  /* By default, we don't re-assign bus numbers. We do this only on
39237   * some pmacs
39238   */
39239 -int pci_assign_all_buses;
39240 +static int pci_assign_all_buses;
39241  
39242  LIST_HEAD(hose_list);
39243  
39244 @@ -100,505 +94,6 @@
39245  }
39246  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_IBM,    PCI_DEVICE_ID_IBM_CPC710_PCI64, fixup_cpc710_pci64);
39247  
39248 -static void
39249 -pcibios_fixup_resources(struct pci_dev *dev)
39250 -{
39251 -       struct pci_controller* hose = (struct pci_controller *)dev->sysdata;
39252 -       int i;
39253 -       unsigned long offset;
39254 -
39255 -       if (!hose) {
39256 -               printk(KERN_ERR "No hose for PCI dev %s!\n", pci_name(dev));
39257 -               return;
39258 -       }
39259 -       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
39260 -               struct resource *res = dev->resource + i;
39261 -               if (!res->flags)
39262 -                       continue;
39263 -               if (res->end == 0xffffffff) {
39264 -                       DBG("PCI:%s Resource %d [%016llx-%016llx] is unassigned\n",
39265 -                           pci_name(dev), i, (u64)res->start, (u64)res->end);
39266 -                       res->end -= res->start;
39267 -                       res->start = 0;
39268 -                       res->flags |= IORESOURCE_UNSET;
39269 -                       continue;
39270 -               }
39271 -               offset = 0;
39272 -               if (res->flags & IORESOURCE_MEM) {
39273 -                       offset = hose->pci_mem_offset;
39274 -               } else if (res->flags & IORESOURCE_IO) {
39275 -                       offset = (unsigned long) hose->io_base_virt
39276 -                               - isa_io_base;
39277 -               }
39278 -               if (offset != 0) {
39279 -                       res->start += offset;
39280 -                       res->end += offset;
39281 -                       DBG("Fixup res %d (%lx) of dev %s: %llx -> %llx\n",
39282 -                           i, res->flags, pci_name(dev),
39283 -                           (u64)res->start - offset, (u64)res->start);
39284 -               }
39285 -       }
39286 -
39287 -       /* Call machine specific resource fixup */
39288 -       if (ppc_md.pcibios_fixup_resources)
39289 -               ppc_md.pcibios_fixup_resources(dev);
39290 -}
39291 -DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID,           PCI_ANY_ID,                     pcibios_fixup_resources);
39292 -
39293 -void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
39294 -                       struct resource *res)
39295 -{
39296 -       unsigned long offset = 0;
39297 -       struct pci_controller *hose = dev->sysdata;
39298 -
39299 -       if (hose && res->flags & IORESOURCE_IO)
39300 -               offset = (unsigned long)hose->io_base_virt - isa_io_base;
39301 -       else if (hose && res->flags & IORESOURCE_MEM)
39302 -               offset = hose->pci_mem_offset;
39303 -       region->start = res->start - offset;
39304 -       region->end = res->end - offset;
39305 -}
39306 -EXPORT_SYMBOL(pcibios_resource_to_bus);
39307 -
39308 -void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
39309 -                            struct pci_bus_region *region)
39310 -{
39311 -       unsigned long offset = 0;
39312 -       struct pci_controller *hose = dev->sysdata;
39313 -
39314 -       if (hose && res->flags & IORESOURCE_IO)
39315 -               offset = (unsigned long)hose->io_base_virt - isa_io_base;
39316 -       else if (hose && res->flags & IORESOURCE_MEM)
39317 -               offset = hose->pci_mem_offset;
39318 -       res->start = region->start + offset;
39319 -       res->end = region->end + offset;
39320 -}
39321 -EXPORT_SYMBOL(pcibios_bus_to_resource);
39322 -
39323 -/*
39324 - * We need to avoid collisions with `mirrored' VGA ports
39325 - * and other strange ISA hardware, so we always want the
39326 - * addresses to be allocated in the 0x000-0x0ff region
39327 - * modulo 0x400.
39328 - *
39329 - * Why? Because some silly external IO cards only decode
39330 - * the low 10 bits of the IO address. The 0x00-0xff region
39331 - * is reserved for motherboard devices that decode all 16
39332 - * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
39333 - * but we want to try to avoid allocating at 0x2900-0x2bff
39334 - * which might have be mirrored at 0x0100-0x03ff..
39335 - */
39336 -void pcibios_align_resource(void *data, struct resource *res,
39337 -                               resource_size_t size, resource_size_t align)
39338 -{
39339 -       struct pci_dev *dev = data;
39340 -
39341 -       if (res->flags & IORESOURCE_IO) {
39342 -               resource_size_t start = res->start;
39343 -
39344 -               if (size > 0x100) {
39345 -                       printk(KERN_ERR "PCI: I/O Region %s/%d too large"
39346 -                              " (%lld bytes)\n", pci_name(dev),
39347 -                              dev->resource - res, (unsigned long long)size);
39348 -               }
39349 -
39350 -               if (start & 0x300) {
39351 -                       start = (start + 0x3ff) & ~0x3ff;
39352 -                       res->start = start;
39353 -               }
39354 -       }
39355 -}
39356 -EXPORT_SYMBOL(pcibios_align_resource);
39357 -
39358 -/*
39359 - *  Handle resources of PCI devices.  If the world were perfect, we could
39360 - *  just allocate all the resource regions and do nothing more.  It isn't.
39361 - *  On the other hand, we cannot just re-allocate all devices, as it would
39362 - *  require us to know lots of host bridge internals.  So we attempt to
39363 - *  keep as much of the original configuration as possible, but tweak it
39364 - *  when it's found to be wrong.
39365 - *
39366 - *  Known BIOS problems we have to work around:
39367 - *     - I/O or memory regions not configured
39368 - *     - regions configured, but not enabled in the command register
39369 - *     - bogus I/O addresses above 64K used
39370 - *     - expansion ROMs left enabled (this may sound harmless, but given
39371 - *       the fact the PCI specs explicitly allow address decoders to be
39372 - *       shared between expansion ROMs and other resource regions, it's
39373 - *       at least dangerous)
39374 - *
39375 - *  Our solution:
39376 - *     (1) Allocate resources for all buses behind PCI-to-PCI bridges.
39377 - *         This gives us fixed barriers on where we can allocate.
39378 - *     (2) Allocate resources for all enabled devices.  If there is
39379 - *         a collision, just mark the resource as unallocated. Also
39380 - *         disable expansion ROMs during this step.
39381 - *     (3) Try to allocate resources for disabled devices.  If the
39382 - *         resources were assigned correctly, everything goes well,
39383 - *         if they weren't, they won't disturb allocation of other
39384 - *         resources.
39385 - *     (4) Assign new addresses to resources which were either
39386 - *         not configured at all or misconfigured.  If explicitly
39387 - *         requested by the user, configure expansion ROM address
39388 - *         as well.
39389 - */
39390 -
39391 -static void __init
39392 -pcibios_allocate_bus_resources(struct list_head *bus_list)
39393 -{
39394 -       struct pci_bus *bus;
39395 -       int i;
39396 -       struct resource *res, *pr;
39397 -
39398 -       /* Depth-First Search on bus tree */
39399 -       list_for_each_entry(bus, bus_list, node) {
39400 -               for (i = 0; i < 4; ++i) {
39401 -                       if ((res = bus->resource[i]) == NULL || !res->flags
39402 -                           || res->start > res->end)
39403 -                               continue;
39404 -                       if (bus->parent == NULL)
39405 -                               pr = (res->flags & IORESOURCE_IO)?
39406 -                                       &ioport_resource: &iomem_resource;
39407 -                       else {
39408 -                               pr = pci_find_parent_resource(bus->self, res);
39409 -                               if (pr == res) {
39410 -                                       /* this happens when the generic PCI
39411 -                                        * code (wrongly) decides that this
39412 -                                        * bridge is transparent  -- paulus
39413 -                                        */
39414 -                                       continue;
39415 -                               }
39416 -                       }
39417 -
39418 -                       DBG("PCI: bridge rsrc %llx..%llx (%lx), parent %p\n",
39419 -                           (u64)res->start, (u64)res->end, res->flags, pr);
39420 -                       if (pr) {
39421 -                               if (request_resource(pr, res) == 0)
39422 -                                       continue;
39423 -                               /*
39424 -                                * Must be a conflict with an existing entry.
39425 -                                * Move that entry (or entries) under the
39426 -                                * bridge resource and try again.
39427 -                                */
39428 -                               if (reparent_resources(pr, res) == 0)
39429 -                                       continue;
39430 -                       }
39431 -                       printk(KERN_ERR "PCI: Cannot allocate resource region "
39432 -                              "%d of PCI bridge %d\n", i, bus->number);
39433 -                       if (pci_relocate_bridge_resource(bus, i))
39434 -                               bus->resource[i] = NULL;
39435 -               }
39436 -               pcibios_allocate_bus_resources(&bus->children);
39437 -       }
39438 -}
39439 -
39440 -/*
39441 - * Reparent resource children of pr that conflict with res
39442 - * under res, and make res replace those children.
39443 - */
39444 -static int __init
39445 -reparent_resources(struct resource *parent, struct resource *res)
39446 -{
39447 -       struct resource *p, **pp;
39448 -       struct resource **firstpp = NULL;
39449 -
39450 -       for (pp = &parent->child; (p = *pp) != NULL; pp = &p->sibling) {
39451 -               if (p->end < res->start)
39452 -                       continue;
39453 -               if (res->end < p->start)
39454 -                       break;
39455 -               if (p->start < res->start || p->end > res->end)
39456 -                       return -1;      /* not completely contained */
39457 -               if (firstpp == NULL)
39458 -                       firstpp = pp;
39459 -       }
39460 -       if (firstpp == NULL)
39461 -               return -1;      /* didn't find any conflicting entries? */
39462 -       res->parent = parent;
39463 -       res->child = *firstpp;
39464 -       res->sibling = *pp;
39465 -       *firstpp = res;
39466 -       *pp = NULL;
39467 -       for (p = res->child; p != NULL; p = p->sibling) {
39468 -               p->parent = res;
39469 -               DBG(KERN_INFO "PCI: reparented %s [%llx..%llx] under %s\n",
39470 -                   p->name, (u64)p->start, (u64)p->end, res->name);
39471 -       }
39472 -       return 0;
39473 -}
39474 -
39475 -/*
39476 - * A bridge has been allocated a range which is outside the range
39477 - * of its parent bridge, so it needs to be moved.
39478 - */
39479 -static int __init
39480 -pci_relocate_bridge_resource(struct pci_bus *bus, int i)
39481 -{
39482 -       struct resource *res, *pr, *conflict;
39483 -       unsigned long try, size;
39484 -       int j;
39485 -       struct pci_bus *parent = bus->parent;
39486 -
39487 -       if (parent == NULL) {
39488 -               /* shouldn't ever happen */
39489 -               printk(KERN_ERR "PCI: can't move host bridge resource\n");
39490 -               return -1;
39491 -       }
39492 -       res = bus->resource[i];
39493 -       if (res == NULL)
39494 -               return -1;
39495 -       pr = NULL;
39496 -       for (j = 0; j < 4; j++) {
39497 -               struct resource *r = parent->resource[j];
39498 -               if (!r)
39499 -                       continue;
39500 -               if ((res->flags ^ r->flags) & (IORESOURCE_IO | IORESOURCE_MEM))
39501 -                       continue;
39502 -               if (!((res->flags ^ r->flags) & IORESOURCE_PREFETCH)) {
39503 -                       pr = r;
39504 -                       break;
39505 -               }
39506 -               if (res->flags & IORESOURCE_PREFETCH)
39507 -                       pr = r;
39508 -       }
39509 -       if (pr == NULL)
39510 -               return -1;
39511 -       size = res->end - res->start;
39512 -       if (pr->start > pr->end || size > pr->end - pr->start)
39513 -               return -1;
39514 -       try = pr->end;
39515 -       for (;;) {
39516 -               res->start = try - size;
39517 -               res->end = try;
39518 -               if (probe_resource(bus->parent, pr, res, &conflict) == 0)
39519 -                       break;
39520 -               if (conflict->start <= pr->start + size)
39521 -                       return -1;
39522 -               try = conflict->start - 1;
39523 -       }
39524 -       if (request_resource(pr, res)) {
39525 -               DBG(KERN_ERR "PCI: huh? couldn't move to %llx..%llx\n",
39526 -                   (u64)res->start, (u64)res->end);
39527 -               return -1;              /* "can't happen" */
39528 -       }
39529 -       update_bridge_base(bus, i);
39530 -       printk(KERN_INFO "PCI: bridge %d resource %d moved to %llx..%llx\n",
39531 -              bus->number, i, (unsigned long long)res->start,
39532 -              (unsigned long long)res->end);
39533 -       return 0;
39534 -}
39535 -
39536 -static int __init
39537 -probe_resource(struct pci_bus *parent, struct resource *pr,
39538 -              struct resource *res, struct resource **conflict)
39539 -{
39540 -       struct pci_bus *bus;
39541 -       struct pci_dev *dev;
39542 -       struct resource *r;
39543 -       int i;
39544 -
39545 -       for (r = pr->child; r != NULL; r = r->sibling) {
39546 -               if (r->end >= res->start && res->end >= r->start) {
39547 -                       *conflict = r;
39548 -                       return 1;
39549 -               }
39550 -       }
39551 -       list_for_each_entry(bus, &parent->children, node) {
39552 -               for (i = 0; i < 4; ++i) {
39553 -                       if ((r = bus->resource[i]) == NULL)
39554 -                               continue;
39555 -                       if (!r->flags || r->start > r->end || r == res)
39556 -                               continue;
39557 -                       if (pci_find_parent_resource(bus->self, r) != pr)
39558 -                               continue;
39559 -                       if (r->end >= res->start && res->end >= r->start) {
39560 -                               *conflict = r;
39561 -                               return 1;
39562 -                       }
39563 -               }
39564 -       }
39565 -       list_for_each_entry(dev, &parent->devices, bus_list) {
39566 -               for (i = 0; i < 6; ++i) {
39567 -                       r = &dev->resource[i];
39568 -                       if (!r->flags || (r->flags & IORESOURCE_UNSET))
39569 -                               continue;
39570 -                       if (pci_find_parent_resource(dev, r) != pr)
39571 -                               continue;
39572 -                       if (r->end >= res->start && res->end >= r->start) {
39573 -                               *conflict = r;
39574 -                               return 1;
39575 -                       }
39576 -               }
39577 -       }
39578 -       return 0;
39579 -}
39580 -
39581 -void __init
39582 -update_bridge_resource(struct pci_dev *dev, struct resource *res)
39583 -{
39584 -       u8 io_base_lo, io_limit_lo;
39585 -       u16 mem_base, mem_limit;
39586 -       u16 cmd;
39587 -       unsigned long start, end, off;
39588 -       struct pci_controller *hose = dev->sysdata;
39589 -
39590 -       if (!hose) {
39591 -               printk("update_bridge_base: no hose?\n");
39592 -               return;
39593 -       }
39594 -       pci_read_config_word(dev, PCI_COMMAND, &cmd);
39595 -       pci_write_config_word(dev, PCI_COMMAND,
39596 -                             cmd & ~(PCI_COMMAND_IO | PCI_COMMAND_MEMORY));
39597 -       if (res->flags & IORESOURCE_IO) {
39598 -               off = (unsigned long) hose->io_base_virt - isa_io_base;
39599 -               start = res->start - off;
39600 -               end = res->end - off;
39601 -               io_base_lo = (start >> 8) & PCI_IO_RANGE_MASK;
39602 -               io_limit_lo = (end >> 8) & PCI_IO_RANGE_MASK;
39603 -               if (end > 0xffff)
39604 -                       io_base_lo |= PCI_IO_RANGE_TYPE_32;
39605 -               else
39606 -                       io_base_lo |= PCI_IO_RANGE_TYPE_16;
39607 -               pci_write_config_word(dev, PCI_IO_BASE_UPPER16,
39608 -                               start >> 16);
39609 -               pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16,
39610 -                               end >> 16);
39611 -               pci_write_config_byte(dev, PCI_IO_BASE, io_base_lo);
39612 -               pci_write_config_byte(dev, PCI_IO_LIMIT, io_limit_lo);
39613 -
39614 -       } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
39615 -                  == IORESOURCE_MEM) {
39616 -               off = hose->pci_mem_offset;
39617 -               mem_base = ((res->start - off) >> 16) & PCI_MEMORY_RANGE_MASK;
39618 -               mem_limit = ((res->end - off) >> 16) & PCI_MEMORY_RANGE_MASK;
39619 -               pci_write_config_word(dev, PCI_MEMORY_BASE, mem_base);
39620 -               pci_write_config_word(dev, PCI_MEMORY_LIMIT, mem_limit);
39621 -
39622 -       } else if ((res->flags & (IORESOURCE_MEM | IORESOURCE_PREFETCH))
39623 -                  == (IORESOURCE_MEM | IORESOURCE_PREFETCH)) {
39624 -               off = hose->pci_mem_offset;
39625 -               mem_base = ((res->start - off) >> 16) & PCI_PREF_RANGE_MASK;
39626 -               mem_limit = ((res->end - off) >> 16) & PCI_PREF_RANGE_MASK;
39627 -               pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, mem_base);
39628 -               pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, mem_limit);
39629 -
39630 -       } else {
39631 -               DBG(KERN_ERR "PCI: ugh, bridge %s res has flags=%lx\n",
39632 -                   pci_name(dev), res->flags);
39633 -       }
39634 -       pci_write_config_word(dev, PCI_COMMAND, cmd);
39635 -}
39636 -
39637 -static void __init
39638 -update_bridge_base(struct pci_bus *bus, int i)
39639 -{
39640 -       struct resource *res = bus->resource[i];
39641 -       struct pci_dev *dev = bus->self;
39642 -       update_bridge_resource(dev, res);
39643 -}
39644 -
39645 -static inline void alloc_resource(struct pci_dev *dev, int idx)
39646 -{
39647 -       struct resource *pr, *r = &dev->resource[idx];
39648 -
39649 -       DBG("PCI:%s: Resource %d: %016llx-%016llx (f=%lx)\n",
39650 -           pci_name(dev), idx, (u64)r->start, (u64)r->end, r->flags);
39651 -       pr = pci_find_parent_resource(dev, r);
39652 -       if (!pr || request_resource(pr, r) < 0) {
39653 -               printk(KERN_ERR "PCI: Cannot allocate resource region %d"
39654 -                      " of device %s\n", idx, pci_name(dev));
39655 -               if (pr)
39656 -                       DBG("PCI:  parent is %p: %016llx-%016llx (f=%lx)\n",
39657 -                           pr, (u64)pr->start, (u64)pr->end, pr->flags);
39658 -               /* We'll assign a new address later */
39659 -               r->flags |= IORESOURCE_UNSET;
39660 -               r->end -= r->start;
39661 -               r->start = 0;
39662 -       }
39663 -}
39664 -
39665 -static void __init
39666 -pcibios_allocate_resources(int pass)
39667 -{
39668 -       struct pci_dev *dev = NULL;
39669 -       int idx, disabled;
39670 -       u16 command;
39671 -       struct resource *r;
39672 -
39673 -       for_each_pci_dev(dev) {
39674 -               pci_read_config_word(dev, PCI_COMMAND, &command);
39675 -               for (idx = 0; idx < 6; idx++) {
39676 -                       r = &dev->resource[idx];
39677 -                       if (r->parent)          /* Already allocated */
39678 -                               continue;
39679 -                       if (!r->flags || (r->flags & IORESOURCE_UNSET))
39680 -                               continue;       /* Not assigned at all */
39681 -                       if (r->flags & IORESOURCE_IO)
39682 -                               disabled = !(command & PCI_COMMAND_IO);
39683 -                       else
39684 -                               disabled = !(command & PCI_COMMAND_MEMORY);
39685 -                       if (pass == disabled)
39686 -                               alloc_resource(dev, idx);
39687 -               }
39688 -               if (pass)
39689 -                       continue;
39690 -               r = &dev->resource[PCI_ROM_RESOURCE];
39691 -               if (r->flags & IORESOURCE_ROM_ENABLE) {
39692 -                       /* Turn the ROM off, leave the resource region, but keep it unregistered. */
39693 -                       u32 reg;
39694 -                       DBG("PCI: Switching off ROM of %s\n", pci_name(dev));
39695 -                       r->flags &= ~IORESOURCE_ROM_ENABLE;
39696 -                       pci_read_config_dword(dev, dev->rom_base_reg, &reg);
39697 -                       pci_write_config_dword(dev, dev->rom_base_reg,
39698 -                                              reg & ~PCI_ROM_ADDRESS_ENABLE);
39699 -               }
39700 -       }
39701 -}
39702 -
39703 -static void __init
39704 -pcibios_assign_resources(void)
39705 -{
39706 -       struct pci_dev *dev = NULL;
39707 -       int idx;
39708 -       struct resource *r;
39709 -
39710 -       for_each_pci_dev(dev) {
39711 -               int class = dev->class >> 8;
39712 -
39713 -               /* Don't touch classless devices and host bridges */
39714 -               if (!class || class == PCI_CLASS_BRIDGE_HOST)
39715 -                       continue;
39716 -
39717 -               for (idx = 0; idx < 6; idx++) {
39718 -                       r = &dev->resource[idx];
39719 -
39720 -                       /*
39721 -                        * We shall assign a new address to this resource,
39722 -                        * either because the BIOS (sic) forgot to do so
39723 -                        * or because we have decided the old address was
39724 -                        * unusable for some reason.
39725 -                        */
39726 -                       if ((r->flags & IORESOURCE_UNSET) && r->end &&
39727 -                           (!ppc_md.pcibios_enable_device_hook ||
39728 -                            !ppc_md.pcibios_enable_device_hook(dev, 1))) {
39729 -                               int rc;
39730 -
39731 -                               r->flags &= ~IORESOURCE_UNSET;
39732 -                               rc = pci_assign_resource(dev, idx);
39733 -                               BUG_ON(rc);
39734 -                       }
39735 -               }
39736 -
39737 -#if 0 /* don't assign ROMs */
39738 -               r = &dev->resource[PCI_ROM_RESOURCE];
39739 -               r->end -= r->start;
39740 -               r->start = 0;
39741 -               if (r->end)
39742 -                       pci_assign_resource(dev, PCI_ROM_RESOURCE);
39743 -#endif
39744 -       }
39745 -}
39746 -
39747  #ifdef CONFIG_PPC_OF
39748  /*
39749   * Functions below are used on OpenFirmware machines.
39750 @@ -619,7 +114,7 @@
39751         } else
39752                 pci_to_OF_bus_map[pci_bus] = bus_range[0];
39753  
39754 -       for (node=node->child; node != 0;node = node->sibling) {
39755 +       for_each_child_of_node(node, node) {
39756                 struct pci_dev* dev;
39757                 const unsigned int *class_code, *reg;
39758         
39759 @@ -662,8 +157,8 @@
39760  
39761         /* For each hose, we begin searching bridges */
39762         list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
39763 -               struct device_node* node;       
39764 -               node = (struct device_node *)hose->arch_data;
39765 +               struct device_node* node = hose->dn;
39766 +
39767                 if (!node)
39768                         continue;
39769                 make_one_node_map(node, hose->first_busno);
39770 @@ -688,15 +183,18 @@
39771  typedef int (*pci_OF_scan_iterator)(struct device_node* node, void* data);
39772  
39773  static struct device_node*
39774 -scan_OF_pci_childs(struct device_node* node, pci_OF_scan_iterator filter, void* data)
39775 +scan_OF_pci_childs(struct device_node *parent, pci_OF_scan_iterator filter, void* data)
39776  {
39777 +       struct device_node *node;
39778         struct device_node* sub_node;
39779  
39780 -       for (; node != 0;node = node->sibling) {
39781 +       for_each_child_of_node(parent, node) {
39782                 const unsigned int *class_code;
39783         
39784 -               if (filter(node, data))
39785 +               if (filter(node, data)) {
39786 +                       of_node_put(node);
39787                         return node;
39788 +               }
39789  
39790                 /* For PCI<->PCI bridges or CardBus bridges, we go down
39791                  * Note: some OFs create a parent node "multifunc-device" as
39792 @@ -708,9 +206,11 @@
39793                         (*class_code >> 8) != PCI_CLASS_BRIDGE_CARDBUS)) &&
39794                         strcmp(node->name, "multifunc-device"))
39795                         continue;
39796 -               sub_node = scan_OF_pci_childs(node->child, filter, data);
39797 -               if (sub_node)
39798 +               sub_node = scan_OF_pci_childs(node, filter, data);
39799 +               if (sub_node) {
39800 +                       of_node_put(node);
39801                         return sub_node;
39802 +               }
39803         }
39804         return NULL;
39805  }
39806 @@ -718,11 +218,11 @@
39807  static struct device_node *scan_OF_for_pci_dev(struct device_node *parent,
39808                                                unsigned int devfn)
39809  {
39810 -       struct device_node *np = NULL;
39811 +       struct device_node *np;
39812         const u32 *reg;
39813         unsigned int psize;
39814  
39815 -       while ((np = of_get_next_child(parent, np)) != NULL) {
39816 +       for_each_child_of_node(parent, np) {
39817                 reg = of_get_property(np, "reg", &psize);
39818                 if (reg == NULL || psize < 4)
39819                         continue;
39820 @@ -742,7 +242,7 @@
39821                 struct pci_controller *hose = pci_bus_to_host(bus);
39822                 if (hose == NULL)
39823                         return NULL;
39824 -               return of_node_get(hose->arch_data);
39825 +               return of_node_get(hose->dn);
39826         }
39827  
39828         /* not a root bus, we need to get our parent */
39829 @@ -812,9 +312,9 @@
39830                 return -ENODEV;
39831         /* Make sure it's really a PCI device */
39832         hose = pci_find_hose_for_OF_device(node);
39833 -       if (!hose || !hose->arch_data)
39834 +       if (!hose || !hose->dn)
39835                 return -ENODEV;
39836 -       if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child,
39837 +       if (!scan_OF_pci_childs(hose->dn,
39838                         find_OF_pci_device_filter, (void *)node))
39839                 return -ENODEV;
39840         reg = of_get_property(node, "reg", NULL);
39841 @@ -843,120 +343,6 @@
39842  }
39843  EXPORT_SYMBOL(pci_device_from_OF_node);
39844  
39845 -void __init
39846 -pci_process_bridge_OF_ranges(struct pci_controller *hose,
39847 -                          struct device_node *dev, int primary)
39848 -{
39849 -       static unsigned int static_lc_ranges[256] __initdata;
39850 -       const unsigned int *dt_ranges;
39851 -       unsigned int *lc_ranges, *ranges, *prev, size;
39852 -       int rlen = 0, orig_rlen;
39853 -       int memno = 0;
39854 -       struct resource *res;
39855 -       int np, na = of_n_addr_cells(dev);
39856 -       np = na + 5;
39857 -
39858 -       /* First we try to merge ranges to fix a problem with some pmacs
39859 -        * that can have more than 3 ranges, fortunately using contiguous
39860 -        * addresses -- BenH
39861 -        */
39862 -       dt_ranges = of_get_property(dev, "ranges", &rlen);
39863 -       if (!dt_ranges)
39864 -               return;
39865 -       /* Sanity check, though hopefully that never happens */
39866 -       if (rlen > sizeof(static_lc_ranges)) {
39867 -               printk(KERN_WARNING "OF ranges property too large !\n");
39868 -               rlen = sizeof(static_lc_ranges);
39869 -       }
39870 -       lc_ranges = static_lc_ranges;
39871 -       memcpy(lc_ranges, dt_ranges, rlen);
39872 -       orig_rlen = rlen;
39873 -
39874 -       /* Let's work on a copy of the "ranges" property instead of damaging
39875 -        * the device-tree image in memory
39876 -        */
39877 -       ranges = lc_ranges;
39878 -       prev = NULL;
39879 -       while ((rlen -= np * sizeof(unsigned int)) >= 0) {
39880 -               if (prev) {
39881 -                       if (prev[0] == ranges[0] && prev[1] == ranges[1] &&
39882 -                               (prev[2] + prev[na+4]) == ranges[2] &&
39883 -                               (prev[na+2] + prev[na+4]) == ranges[na+2]) {
39884 -                               prev[na+4] += ranges[na+4];
39885 -                               ranges[0] = 0;
39886 -                               ranges += np;
39887 -                               continue;
39888 -                       }
39889 -               }
39890 -               prev = ranges;
39891 -               ranges += np;
39892 -       }
39893 -
39894 -       /*
39895 -        * The ranges property is laid out as an array of elements,
39896 -        * each of which comprises:
39897 -        *   cells 0 - 2:       a PCI address
39898 -        *   cells 3 or 3+4:    a CPU physical address
39899 -        *                      (size depending on dev->n_addr_cells)
39900 -        *   cells 4+5 or 5+6:  the size of the range
39901 -        */
39902 -       ranges = lc_ranges;
39903 -       rlen = orig_rlen;
39904 -       while (ranges && (rlen -= np * sizeof(unsigned int)) >= 0) {
39905 -               res = NULL;
39906 -               size = ranges[na+4];
39907 -               switch ((ranges[0] >> 24) & 0x3) {
39908 -               case 1:         /* I/O space */
39909 -                       if (ranges[2] != 0)
39910 -                               break;
39911 -                       hose->io_base_phys = ranges[na+2];
39912 -                       /* limit I/O space to 16MB */
39913 -                       if (size > 0x01000000)
39914 -                               size = 0x01000000;
39915 -                       hose->io_base_virt = ioremap(ranges[na+2], size);
39916 -                       if (primary)
39917 -                               isa_io_base = (unsigned long) hose->io_base_virt;
39918 -                       res = &hose->io_resource;
39919 -                       res->flags = IORESOURCE_IO;
39920 -                       res->start = ranges[2];
39921 -                       DBG("PCI: IO 0x%llx -> 0x%llx\n",
39922 -                           (u64)res->start, (u64)res->start + size - 1);
39923 -                       break;
39924 -               case 2:         /* memory space */
39925 -                       memno = 0;
39926 -                       if (ranges[1] == 0 && ranges[2] == 0
39927 -                           && ranges[na+4] <= (16 << 20)) {
39928 -                               /* 1st 16MB, i.e. ISA memory area */
39929 -                               if (primary)
39930 -                                       isa_mem_base = ranges[na+2];
39931 -                               memno = 1;
39932 -                       }
39933 -                       while (memno < 3 && hose->mem_resources[memno].flags)
39934 -                               ++memno;
39935 -                       if (memno == 0)
39936 -                               hose->pci_mem_offset = ranges[na+2] - ranges[2];
39937 -                       if (memno < 3) {
39938 -                               res = &hose->mem_resources[memno];
39939 -                               res->flags = IORESOURCE_MEM;
39940 -                               if(ranges[0] & 0x40000000)
39941 -                                       res->flags |= IORESOURCE_PREFETCH;
39942 -                               res->start = ranges[na+2];
39943 -                               DBG("PCI: MEM[%d] 0x%llx -> 0x%llx\n", memno,
39944 -                                   (u64)res->start, (u64)res->start + size - 1);
39945 -                       }
39946 -                       break;
39947 -               }
39948 -               if (res != NULL) {
39949 -                       res->name = dev->full_name;
39950 -                       res->end = res->start + size - 1;
39951 -                       res->parent = NULL;
39952 -                       res->sibling = NULL;
39953 -                       res->child = NULL;
39954 -               }
39955 -               ranges += np;
39956 -       }
39957 -}
39958 -
39959  /* We create the "pci-OF-bus-map" property now so it appears in the
39960   * /proc device tree
39961   */
39962 @@ -986,219 +372,7 @@
39963  }
39964  #endif /* CONFIG_PPC_OF */
39965  
39966 -#ifdef CONFIG_PPC_PMAC
39967 -/*
39968 - * This set of routines checks for PCI<->PCI bridges that have closed
39969 - * IO resources and have child devices. It tries to re-open an IO
39970 - * window on them.
39971 - *
39972 - * This is a _temporary_ fix to workaround a problem with Apple's OF
39973 - * closing IO windows on P2P bridges when the OF drivers of cards
39974 - * below this bridge don't claim any IO range (typically ATI or
39975 - * Adaptec).
39976 - *
39977 - * A more complete fix would be to use drivers/pci/setup-bus.c, which
39978 - * involves a working pcibios_fixup_pbus_ranges(), some more care about
39979 - * ordering when creating the host bus resources, and maybe a few more
39980 - * minor tweaks
39981 - */
39982 -
39983 -/* Initialize bridges with base/limit values we have collected */
39984 -static void __init
39985 -do_update_p2p_io_resource(struct pci_bus *bus, int enable_vga)
39986 -{
39987 -       struct pci_dev *bridge = bus->self;
39988 -       struct pci_controller* hose = (struct pci_controller *)bridge->sysdata;
39989 -       u32 l;
39990 -       u16 w;
39991 -       struct resource res;
39992 -
39993 -       if (bus->resource[0] == NULL)
39994 -               return;
39995 -       res = *(bus->resource[0]);
39996 -
39997 -       DBG("Remapping Bus %d, bridge: %s\n", bus->number, pci_name(bridge));
39998 -       res.start -= ((unsigned long) hose->io_base_virt - isa_io_base);
39999 -       res.end -= ((unsigned long) hose->io_base_virt - isa_io_base);
40000 -       DBG("  IO window: %016llx-%016llx\n", res.start, res.end);
40001 -
40002 -       /* Set up the top and bottom of the PCI I/O segment for this bus. */
40003 -       pci_read_config_dword(bridge, PCI_IO_BASE, &l);
40004 -       l &= 0xffff000f;
40005 -       l |= (res.start >> 8) & 0x00f0;
40006 -       l |= res.end & 0xf000;
40007 -       pci_write_config_dword(bridge, PCI_IO_BASE, l);
40008 -
40009 -       if ((l & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32) {
40010 -               l = (res.start >> 16) | (res.end & 0xffff0000);
40011 -               pci_write_config_dword(bridge, PCI_IO_BASE_UPPER16, l);
40012 -       }
40013 -
40014 -       pci_read_config_word(bridge, PCI_COMMAND, &w);
40015 -       w |= PCI_COMMAND_IO;
40016 -       pci_write_config_word(bridge, PCI_COMMAND, w);
40017 -
40018 -#if 0 /* Enabling this causes XFree 4.2.0 to hang during PCI probe */
40019 -       if (enable_vga) {
40020 -               pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, &w);
40021 -               w |= PCI_BRIDGE_CTL_VGA;
40022 -               pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, w);
40023 -       }
40024 -#endif
40025 -}
40026 -
40027 -/* This function is pretty basic and actually quite broken for the
40028 - * general case, it's enough for us right now though. It's supposed
40029 - * to tell us if we need to open an IO range at all or not and what
40030 - * size.
40031 - */
40032 -static int __init
40033 -check_for_io_childs(struct pci_bus *bus, struct resource* res, int *found_vga)
40034 -{
40035 -       struct pci_dev *dev;
40036 -       int     i;
40037 -       int     rc = 0;
40038 -
40039 -#define push_end(res, mask) do {               \
40040 -       BUG_ON((mask+1) & mask);                \
40041 -       res->end = (res->end + mask) | mask;    \
40042 -} while (0)
40043 -
40044 -       list_for_each_entry(dev, &bus->devices, bus_list) {
40045 -               u16 class = dev->class >> 8;
40046 -
40047 -               if (class == PCI_CLASS_DISPLAY_VGA ||
40048 -                   class == PCI_CLASS_NOT_DEFINED_VGA)
40049 -                       *found_vga = 1;
40050 -               if (class >> 8 == PCI_BASE_CLASS_BRIDGE && dev->subordinate)
40051 -                       rc |= check_for_io_childs(dev->subordinate, res, found_vga);
40052 -               if (class == PCI_CLASS_BRIDGE_CARDBUS)
40053 -                       push_end(res, 0xfff);
40054 -
40055 -               for (i=0; i<PCI_NUM_RESOURCES; i++) {
40056 -                       struct resource *r;
40057 -                       unsigned long r_size;
40058 -
40059 -                       if (dev->class >> 8 == PCI_CLASS_BRIDGE_PCI
40060 -                           && i >= PCI_BRIDGE_RESOURCES)
40061 -                               continue;
40062 -                       r = &dev->resource[i];
40063 -                       r_size = r->end - r->start;
40064 -                       if (r_size < 0xfff)
40065 -                               r_size = 0xfff;
40066 -                       if (r->flags & IORESOURCE_IO && (r_size) != 0) {
40067 -                               rc = 1;
40068 -                               push_end(res, r_size);
40069 -                       }
40070 -               }
40071 -       }
40072 -
40073 -       return rc;
40074 -}
40075 -
40076 -/* Here we scan all P2P bridges of a given level that have a closed
40077 - * IO window. Note that the test for the presence of a VGA card should
40078 - * be improved to take into account already configured P2P bridges,
40079 - * currently, we don't see them and might end up configuring 2 bridges
40080 - * with VGA pass through enabled
40081 - */
40082 -static void __init
40083 -do_fixup_p2p_level(struct pci_bus *bus)
40084 -{
40085 -       struct pci_bus *b;
40086 -       int i, parent_io;
40087 -       int has_vga = 0;
40088 -
40089 -       for (parent_io=0; parent_io<4; parent_io++)
40090 -               if (bus->resource[parent_io]
40091 -                   && bus->resource[parent_io]->flags & IORESOURCE_IO)
40092 -                       break;
40093 -       if (parent_io >= 4)
40094 -               return;
40095 -
40096 -       list_for_each_entry(b, &bus->children, node) {
40097 -               struct pci_dev *d = b->self;
40098 -               struct pci_controller* hose = (struct pci_controller *)d->sysdata;
40099 -               struct resource *res = b->resource[0];
40100 -               struct resource tmp_res;
40101 -               unsigned long max;
40102 -               int found_vga = 0;
40103 -
40104 -               memset(&tmp_res, 0, sizeof(tmp_res));
40105 -               tmp_res.start = bus->resource[parent_io]->start;
40106 -
40107 -               /* We don't let low addresses go through that closed P2P bridge, well,
40108 -                * that may not be necessary but I feel safer that way
40109 -                */
40110 -               if (tmp_res.start == 0)
40111 -                       tmp_res.start = 0x1000;
40112 -       
40113 -               if (!list_empty(&b->devices) && res && res->flags == 0 &&
40114 -                   res != bus->resource[parent_io] &&
40115 -                   (d->class >> 8) == PCI_CLASS_BRIDGE_PCI &&
40116 -                   check_for_io_childs(b, &tmp_res, &found_vga)) {
40117 -                       u8 io_base_lo;
40118 -
40119 -                       printk(KERN_INFO "Fixing up IO bus %s\n", b->name);
40120 -
40121 -                       if (found_vga) {
40122 -                               if (has_vga) {
40123 -                                       printk(KERN_WARNING "Skipping VGA, already active"
40124 -                                           " on bus segment\n");
40125 -                                       found_vga = 0;
40126 -                               } else
40127 -                                       has_vga = 1;
40128 -                       }
40129 -                       pci_read_config_byte(d, PCI_IO_BASE, &io_base_lo);
40130 -
40131 -                       if ((io_base_lo & PCI_IO_RANGE_TYPE_MASK) == PCI_IO_RANGE_TYPE_32)
40132 -                               max = ((unsigned long) hose->io_base_virt
40133 -                                       - isa_io_base) + 0xffffffff;
40134 -                       else
40135 -                               max = ((unsigned long) hose->io_base_virt
40136 -                                       - isa_io_base) + 0xffff;
40137 -
40138 -                       *res = tmp_res;
40139 -                       res->flags = IORESOURCE_IO;
40140 -                       res->name = b->name;
40141 -               
40142 -                       /* Find a resource in the parent where we can allocate */
40143 -                       for (i = 0 ; i < 4; i++) {
40144 -                               struct resource *r = bus->resource[i];
40145 -                               if (!r)
40146 -                                       continue;
40147 -                               if ((r->flags & IORESOURCE_IO) == 0)
40148 -                                       continue;
40149 -                               DBG("Trying to allocate from %016llx, size %016llx from parent"
40150 -                                   " res %d: %016llx -> %016llx\n",
40151 -                                       res->start, res->end, i, r->start, r->end);
40152 -                       
40153 -                               if (allocate_resource(r, res, res->end + 1, res->start, max,
40154 -                                   res->end + 1, NULL, NULL) < 0) {
40155 -                                       DBG("Failed !\n");
40156 -                                       continue;
40157 -                               }
40158 -                               do_update_p2p_io_resource(b, found_vga);
40159 -                               break;
40160 -                       }
40161 -               }
40162 -               do_fixup_p2p_level(b);
40163 -       }
40164 -}
40165 -
40166 -static void
40167 -pcibios_fixup_p2p_bridges(void)
40168 -{
40169 -       struct pci_bus *b;
40170 -
40171 -       list_for_each_entry(b, &pci_root_buses, node)
40172 -               do_fixup_p2p_level(b);
40173 -}
40174 -
40175 -#endif /* CONFIG_PPC_PMAC */
40176 -
40177 -static int __init
40178 -pcibios_init(void)
40179 +static int __init pcibios_init(void)
40180  {
40181         struct pci_controller *hose, *tmp;
40182         struct pci_bus *bus;
40183 @@ -1206,6 +380,9 @@
40184  
40185         printk(KERN_INFO "PCI: Probing PCI hardware\n");
40186  
40187 +       if (ppc_pci_flags & PPC_PCI_REASSIGN_ALL_BUS)
40188 +               pci_assign_all_buses = 1;
40189 +
40190         /* Scan all of the recorded PCI controllers.  */
40191         list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
40192                 if (pci_assign_all_buses)
40193 @@ -1213,9 +390,10 @@
40194                 hose->last_busno = 0xff;
40195                 bus = pci_scan_bus_parented(hose->parent, hose->first_busno,
40196                                             hose->ops, hose);
40197 -               if (bus)
40198 +               if (bus) {
40199                         pci_bus_add_devices(bus);
40200 -               hose->last_busno = bus->subordinate;
40201 +                       hose->last_busno = bus->subordinate;
40202 +               }
40203                 if (pci_assign_all_buses || next_busno <= hose->last_busno)
40204                         next_busno = hose->last_busno + pcibios_assign_bus_offset;
40205         }
40206 @@ -1228,18 +406,8 @@
40207         if (pci_assign_all_buses && have_of)
40208                 pcibios_make_OF_bus_map();
40209  
40210 -       /* Call machine dependent fixup */
40211 -       if (ppc_md.pcibios_fixup)
40212 -               ppc_md.pcibios_fixup();
40213 -
40214 -       /* Allocate and assign resources */
40215 -       pcibios_allocate_bus_resources(&pci_root_buses);
40216 -       pcibios_allocate_resources(0);
40217 -       pcibios_allocate_resources(1);
40218 -#ifdef CONFIG_PPC_PMAC
40219 -       pcibios_fixup_p2p_bridges();
40220 -#endif /* CONFIG_PPC_PMAC */
40221 -       pcibios_assign_resources();
40222 +       /* Call common code to handle resource allocation */
40223 +       pcibios_resource_survey();
40224  
40225         /* Call machine dependent post-init code */
40226         if (ppc_md.pcibios_after_init)
40227 @@ -1250,14 +418,14 @@
40228  
40229  subsys_initcall(pcibios_init);
40230  
40231 -void pcibios_fixup_bus(struct pci_bus *bus)
40232 +void __devinit pcibios_do_bus_setup(struct pci_bus *bus)
40233  {
40234         struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
40235         unsigned long io_offset;
40236         struct resource *res;
40237 -       struct pci_dev *dev;
40238         int i;
40239  
40240 +       /* Hookup PHB resources */
40241         io_offset = (unsigned long)hose->io_base_virt - isa_io_base;
40242         if (bus->parent == NULL) {
40243                 /* This is a host bridge - fill in its resources */
40244 @@ -1272,8 +440,8 @@
40245                         res->end = IO_SPACE_LIMIT;
40246                         res->flags = IORESOURCE_IO;
40247                 }
40248 -               res->start += io_offset;
40249 -               res->end += io_offset;
40250 +               res->start = (res->start + io_offset) & 0xffffffffu;
40251 +               res->end = (res->end + io_offset) & 0xffffffffu;
40252  
40253                 for (i = 0; i < 3; ++i) {
40254                         res = &hose->mem_resources[i];
40255 @@ -1288,35 +456,6 @@
40256                         }
40257                         bus->resource[i+1] = res;
40258                 }
40259 -       } else {
40260 -               /* This is a subordinate bridge */
40261 -               pci_read_bridge_bases(bus);
40262 -
40263 -               for (i = 0; i < 4; ++i) {
40264 -                       if ((res = bus->resource[i]) == NULL)
40265 -                               continue;
40266 -                       if (!res->flags || bus->self->transparent)
40267 -                               continue;
40268 -                       if (io_offset && (res->flags & IORESOURCE_IO)) {
40269 -                               res->start += io_offset;
40270 -                               res->end += io_offset;
40271 -                       } else if (hose->pci_mem_offset
40272 -                                  && (res->flags & IORESOURCE_MEM)) {
40273 -                               res->start += hose->pci_mem_offset;
40274 -                               res->end += hose->pci_mem_offset;
40275 -                       }
40276 -               }
40277 -       }
40278 -
40279 -       /* Platform specific bus fixups */
40280 -       if (ppc_md.pcibios_fixup_bus)
40281 -               ppc_md.pcibios_fixup_bus(bus);
40282 -
40283 -       /* Read default IRQs and fixup if necessary */
40284 -       list_for_each_entry(dev, &bus->devices, bus_list) {
40285 -               pci_read_irq_line(dev);
40286 -               if (ppc_md.pci_irq_fixup)
40287 -                       ppc_md.pci_irq_fixup(dev);
40288         }
40289  }
40290  
40291 @@ -1328,37 +467,6 @@
40292         /* XXX FIXME - update OF device tree node interrupt property */
40293  }
40294  
40295 -int pcibios_enable_device(struct pci_dev *dev, int mask)
40296 -{
40297 -       u16 cmd, old_cmd;
40298 -       int idx;
40299 -       struct resource *r;
40300 -
40301 -       if (ppc_md.pcibios_enable_device_hook)
40302 -               if (ppc_md.pcibios_enable_device_hook(dev, 0))
40303 -                       return -EINVAL;
40304 -               
40305 -       pci_read_config_word(dev, PCI_COMMAND, &cmd);
40306 -       old_cmd = cmd;
40307 -       for (idx=0; idx<6; idx++) {
40308 -               r = &dev->resource[idx];
40309 -               if (r->flags & IORESOURCE_UNSET) {
40310 -                       printk(KERN_ERR "PCI: Device %s not available because of resource collisions\n", pci_name(dev));
40311 -                       return -EINVAL;
40312 -               }
40313 -               if (r->flags & IORESOURCE_IO)
40314 -                       cmd |= PCI_COMMAND_IO;
40315 -               if (r->flags & IORESOURCE_MEM)
40316 -                       cmd |= PCI_COMMAND_MEMORY;
40317 -       }
40318 -       if (cmd != old_cmd) {
40319 -               printk("PCI: Enabling device %s (%04x -> %04x)\n",
40320 -                      pci_name(dev), old_cmd, cmd);
40321 -               pci_write_config_word(dev, PCI_COMMAND, cmd);
40322 -       }
40323 -       return 0;
40324 -}
40325 -
40326  static struct pci_controller*
40327  pci_bus_to_hose(int bus)
40328  {
40329 @@ -1381,17 +489,6 @@
40330         struct pci_controller* hose;
40331         long result = -EOPNOTSUPP;
40332  
40333 -       /* Argh ! Please forgive me for that hack, but that's the
40334 -        * simplest way to get existing XFree to not lockup on some
40335 -        * G5 machines... So when something asks for bus 0 io base
40336 -        * (bus 0 is HT root), we return the AGP one instead.
40337 -        */
40338 -#ifdef CONFIG_PPC_PMAC
40339 -       if (machine_is(powermac) && machine_is_compatible("MacRISC4"))
40340 -               if (bus == 0)
40341 -                       bus = 0xf0;
40342 -#endif /* CONFIG_PPC_PMAC */
40343 -
40344         hose = pci_bus_to_hose(bus);
40345         if (!hose)
40346                 return -ENODEV;
40347 --- a/arch/powerpc/kernel/pci_64.c
40348 +++ b/arch/powerpc/kernel/pci_64.c
40349 @@ -31,7 +31,6 @@
40350  #include <asm/byteorder.h>
40351  #include <asm/machdep.h>
40352  #include <asm/ppc-pci.h>
40353 -#include <asm/firmware.h>
40354  
40355  #ifdef DEBUG
40356  #include <asm/udbg.h>
40357 @@ -41,10 +40,6 @@
40358  #endif
40359  
40360  unsigned long pci_probe_only = 1;
40361 -int pci_assign_all_buses = 0;
40362 -
40363 -static void fixup_resource(struct resource *res, struct pci_dev *dev);
40364 -static void do_bus_setup(struct pci_bus *bus);
40365  
40366  /* pci_io_base -- the base address from which io bars are offsets.
40367   * This is the lowest I/O base address (so bar values are always positive),
40368 @@ -70,139 +65,31 @@
40369  }
40370  EXPORT_SYMBOL(get_pci_dma_ops);
40371  
40372 -static void fixup_broken_pcnet32(struct pci_dev* dev)
40373 -{
40374 -       if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
40375 -               dev->vendor = PCI_VENDOR_ID_AMD;
40376 -               pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
40377 -       }
40378 -}
40379 -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
40380 -
40381 -void  pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
40382 -                             struct resource *res)
40383 -{
40384 -       unsigned long offset = 0;
40385 -       struct pci_controller *hose = pci_bus_to_host(dev->bus);
40386 -
40387 -       if (!hose)
40388 -               return;
40389 -
40390 -       if (res->flags & IORESOURCE_IO)
40391 -               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
40392 -
40393 -       if (res->flags & IORESOURCE_MEM)
40394 -               offset = hose->pci_mem_offset;
40395 -
40396 -       region->start = res->start - offset;
40397 -       region->end = res->end - offset;
40398 -}
40399  
40400 -void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res,
40401 -                             struct pci_bus_region *region)
40402 +int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
40403  {
40404 -       unsigned long offset = 0;
40405 -       struct pci_controller *hose = pci_bus_to_host(dev->bus);
40406 -
40407 -       if (!hose)
40408 -               return;
40409 -
40410 -       if (res->flags & IORESOURCE_IO)
40411 -               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
40412 -
40413 -       if (res->flags & IORESOURCE_MEM)
40414 -               offset = hose->pci_mem_offset;
40415 -
40416 -       res->start = region->start + offset;
40417 -       res->end = region->end + offset;
40418 +       return dma_set_mask(&dev->dev, mask);
40419  }
40420  
40421 -#ifdef CONFIG_HOTPLUG
40422 -EXPORT_SYMBOL(pcibios_resource_to_bus);
40423 -EXPORT_SYMBOL(pcibios_bus_to_resource);
40424 -#endif
40425 -
40426 -/*
40427 - * We need to avoid collisions with `mirrored' VGA ports
40428 - * and other strange ISA hardware, so we always want the
40429 - * addresses to be allocated in the 0x000-0x0ff region
40430 - * modulo 0x400.
40431 - *
40432 - * Why? Because some silly external IO cards only decode
40433 - * the low 10 bits of the IO address. The 0x00-0xff region
40434 - * is reserved for motherboard devices that decode all 16
40435 - * bits, so it's ok to allocate at, say, 0x2800-0x28ff,
40436 - * but we want to try to avoid allocating at 0x2900-0x2bff
40437 - * which might have be mirrored at 0x0100-0x03ff..
40438 - */
40439 -void pcibios_align_resource(void *data, struct resource *res,
40440 -                           resource_size_t size, resource_size_t align)
40441 +int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
40442  {
40443 -       struct pci_dev *dev = data;
40444 -       struct pci_controller *hose = pci_bus_to_host(dev->bus);
40445 -       resource_size_t start = res->start;
40446 -       unsigned long alignto;
40447 -
40448 -       if (res->flags & IORESOURCE_IO) {
40449 -               unsigned long offset = (unsigned long)hose->io_base_virt -
40450 -                                       _IO_BASE;
40451 -               /* Make sure we start at our min on all hoses */
40452 -               if (start - offset < PCIBIOS_MIN_IO)
40453 -                       start = PCIBIOS_MIN_IO + offset;
40454 -
40455 -               /*
40456 -                * Put everything into 0x00-0xff region modulo 0x400
40457 -                */
40458 -               if (start & 0x300)
40459 -                       start = (start + 0x3ff) & ~0x3ff;
40460 +       int rc;
40461  
40462 -       } else if (res->flags & IORESOURCE_MEM) {
40463 -               /* Make sure we start at our min on all hoses */
40464 -               if (start - hose->pci_mem_offset < PCIBIOS_MIN_MEM)
40465 -                       start = PCIBIOS_MIN_MEM + hose->pci_mem_offset;
40466 +       rc = dma_set_mask(&dev->dev, mask);
40467 +       dev->dev.coherent_dma_mask = dev->dma_mask;
40468  
40469 -               /* Align to multiple of size of minimum base.  */
40470 -               alignto = max(0x1000UL, align);
40471 -               start = ALIGN(start, alignto);
40472 -       }
40473 -
40474 -       res->start = start;
40475 +       return rc;
40476  }
40477  
40478 -void __devinit pcibios_claim_one_bus(struct pci_bus *b)
40479 +static void fixup_broken_pcnet32(struct pci_dev* dev)
40480  {
40481 -       struct pci_dev *dev;
40482 -       struct pci_bus *child_bus;
40483 -
40484 -       list_for_each_entry(dev, &b->devices, bus_list) {
40485 -               int i;
40486 -
40487 -               for (i = 0; i < PCI_NUM_RESOURCES; i++) {
40488 -                       struct resource *r = &dev->resource[i];
40489 -
40490 -                       if (r->parent || !r->start || !r->flags)
40491 -                               continue;
40492 -                       pci_claim_resource(dev, i);
40493 -               }
40494 +       if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
40495 +               dev->vendor = PCI_VENDOR_ID_AMD;
40496 +               pci_write_config_word(dev, PCI_VENDOR_ID, PCI_VENDOR_ID_AMD);
40497         }
40498 -
40499 -       list_for_each_entry(child_bus, &b->children, node)
40500 -               pcibios_claim_one_bus(child_bus);
40501  }
40502 -#ifdef CONFIG_HOTPLUG
40503 -EXPORT_SYMBOL_GPL(pcibios_claim_one_bus);
40504 -#endif
40505 -
40506 -static void __init pcibios_claim_of_setup(void)
40507 -{
40508 -       struct pci_bus *b;
40509 -
40510 -       if (firmware_has_feature(FW_FEATURE_ISERIES))
40511 -               return;
40512 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TRIDENT, PCI_ANY_ID, fixup_broken_pcnet32);
40513  
40514 -       list_for_each_entry(b, &pci_root_buses, node)
40515 -               pcibios_claim_one_bus(b);
40516 -}
40517  
40518  static u32 get_int_prop(struct device_node *np, const char *name, u32 def)
40519  {
40520 @@ -270,7 +157,6 @@
40521                 res->end = base + size - 1;
40522                 res->flags = flags;
40523                 res->name = pci_name(dev);
40524 -               fixup_resource(res, dev);
40525         }
40526  }
40527  
40528 @@ -339,16 +225,17 @@
40529  EXPORT_SYMBOL(of_create_pci_dev);
40530  
40531  void __devinit of_scan_bus(struct device_node *node,
40532 -                                 struct pci_bus *bus)
40533 +                          struct pci_bus *bus)
40534  {
40535 -       struct device_node *child = NULL;
40536 +       struct device_node *child;
40537         const u32 *reg;
40538         int reglen, devfn;
40539         struct pci_dev *dev;
40540  
40541         DBG("of_scan_bus(%s) bus no %d... \n", node->full_name, bus->number);
40542  
40543 -       while ((child = of_get_next_child(node, child)) != NULL) {
40544 +       /* Scan direct children */
40545 +       for_each_child_of_node(node, child) {
40546                 DBG("  * %s\n", child->full_name);
40547                 reg = of_get_property(child, "reg", &reglen);
40548                 if (reg == NULL || reglen < 20)
40549 @@ -359,19 +246,26 @@
40550                 dev = of_create_pci_dev(child, bus, devfn);
40551                 if (!dev)
40552                         continue;
40553 -               DBG("dev header type: %x\n", dev->hdr_type);
40554 +               DBG("    dev header type: %x\n", dev->hdr_type);
40555 +       }
40556  
40557 +       /* Ally all fixups */
40558 +       pcibios_fixup_of_probed_bus(bus);
40559 +
40560 +       /* Now scan child busses */
40561 +       list_for_each_entry(dev, &bus->devices, bus_list) {
40562                 if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE ||
40563 -                   dev->hdr_type == PCI_HEADER_TYPE_CARDBUS)
40564 -                       of_scan_pci_bridge(child, dev);
40565 +                   dev->hdr_type == PCI_HEADER_TYPE_CARDBUS) {
40566 +                       struct device_node *child = pci_device_to_OF_node(dev);
40567 +                       if (dev)
40568 +                               of_scan_pci_bridge(child, dev);
40569 +               }
40570         }
40571 -
40572 -       do_bus_setup(bus);
40573  }
40574  EXPORT_SYMBOL(of_scan_bus);
40575  
40576  void __devinit of_scan_pci_bridge(struct device_node *node,
40577 -                               struct pci_dev *dev)
40578 +                                 struct pci_dev *dev)
40579  {
40580         struct pci_bus *bus;
40581         const u32 *busrange, *ranges;
40582 @@ -441,7 +335,6 @@
40583                 res->start = of_read_number(&ranges[1], 2);
40584                 res->end = res->start + size - 1;
40585                 res->flags = flags;
40586 -               fixup_resource(res, dev);
40587         }
40588         sprintf(bus->name, "PCI Bus %04x:%02x", pci_domain_nr(bus),
40589                 bus->number);
40590 @@ -462,12 +355,12 @@
40591  void __devinit scan_phb(struct pci_controller *hose)
40592  {
40593         struct pci_bus *bus;
40594 -       struct device_node *node = hose->arch_data;
40595 +       struct device_node *node = hose->dn;
40596         int i, mode;
40597 -       struct resource *res;
40598  
40599 -       DBG("Scanning PHB %s\n", node ? node->full_name : "<NO NAME>");
40600 +       DBG("PCI: Scanning PHB %s\n", node ? node->full_name : "<NO NAME>");
40601  
40602 +       /* Create an empty bus for the toplevel */
40603         bus = pci_create_bus(hose->parent, hose->first_busno, hose->ops, node);
40604         if (bus == NULL) {
40605                 printk(KERN_ERR "Failed to create bus for PCI domain %04x\n",
40606 @@ -477,27 +370,27 @@
40607         bus->secondary = hose->first_busno;
40608         hose->bus = bus;
40609  
40610 -       if (!firmware_has_feature(FW_FEATURE_ISERIES))
40611 -               pcibios_map_io_space(bus);
40612 -
40613 -       bus->resource[0] = res = &hose->io_resource;
40614 -       if (res->flags && request_resource(&ioport_resource, res)) {
40615 -               printk(KERN_ERR "Failed to request PCI IO region "
40616 -                      "on PCI domain %04x\n", hose->global_number);
40617 -               DBG("res->start = 0x%016lx, res->end = 0x%016lx\n",
40618 -                   res->start, res->end);
40619 -       }
40620 +       /* Get some IO space for the new PHB */
40621 +       pcibios_map_io_space(bus);
40622  
40623 +       /* Wire up PHB bus resources */
40624 +       DBG("PCI: PHB IO resource    = %016lx-%016lx [%lx]\n",
40625 +           hose->io_resource.start, hose->io_resource.end,
40626 +           hose->io_resource.flags);
40627 +       bus->resource[0] = &hose->io_resource;
40628         for (i = 0; i < 3; ++i) {
40629 -               res = &hose->mem_resources[i];
40630 -               bus->resource[i+1] = res;
40631 -               if (res->flags && request_resource(&iomem_resource, res))
40632 -                       printk(KERN_ERR "Failed to request PCI memory region "
40633 -                              "on PCI domain %04x\n", hose->global_number);
40634 -       }
40635 +               DBG("PCI: PHB MEM resource %d = %016lx-%016lx [%lx]\n", i,
40636 +                   hose->mem_resources[i].start,
40637 +                   hose->mem_resources[i].end,
40638 +                   hose->mem_resources[i].flags);
40639 +               bus->resource[i+1] = &hose->mem_resources[i];
40640 +       }
40641 +       DBG("PCI: PHB MEM offset     = %016lx\n", hose->pci_mem_offset);
40642 +       DBG("PCI: PHB IO  offset     = %08lx\n",
40643 +           (unsigned long)hose->io_base_virt - _IO_BASE);
40644  
40645 +       /* Get probe mode and perform scan */
40646         mode = PCI_PROBE_NORMAL;
40647 -
40648         if (node && ppc_md.pci_probe_mode)
40649                 mode = ppc_md.pci_probe_mode(bus);
40650         DBG("    probe mode: %d\n", mode);
40651 @@ -514,15 +407,15 @@
40652  {
40653         struct pci_controller *hose, *tmp;
40654  
40655 +       printk(KERN_INFO "PCI: Probing PCI hardware\n");
40656 +
40657         /* For now, override phys_mem_access_prot. If we need it,
40658          * later, we may move that initialization to each ppc_md
40659          */
40660         ppc_md.phys_mem_access_prot = pci_phys_mem_access_prot;
40661  
40662 -       if (firmware_has_feature(FW_FEATURE_ISERIES))
40663 -               iSeries_pcibios_init();
40664 -
40665 -       printk(KERN_DEBUG "PCI: Probing PCI hardware\n");
40666 +       if (pci_probe_only)
40667 +               ppc_pci_flags |= PPC_PCI_PROBE_ONLY;
40668  
40669         /* Scan all of the recorded PCI controllers.  */
40670         list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
40671 @@ -530,19 +423,8 @@
40672                 pci_bus_add_devices(hose->bus);
40673         }
40674  
40675 -       if (!firmware_has_feature(FW_FEATURE_ISERIES)) {
40676 -               if (pci_probe_only)
40677 -                       pcibios_claim_of_setup();
40678 -               else
40679 -                       /* FIXME: `else' will be removed when
40680 -                          pci_assign_unassigned_resources() is able to work
40681 -                          correctly with [partially] allocated PCI tree. */
40682 -                       pci_assign_unassigned_resources();
40683 -       }
40684 -
40685 -       /* Call machine dependent final fixup */
40686 -       if (ppc_md.pcibios_fixup)
40687 -               ppc_md.pcibios_fixup();
40688 +       /* Call common code to handle resource allocation */
40689 +       pcibios_resource_survey();
40690  
40691         printk(KERN_DEBUG "PCI: Probing PCI hardware done\n");
40692  
40693 @@ -551,141 +433,6 @@
40694  
40695  subsys_initcall(pcibios_init);
40696  
40697 -int pcibios_enable_device(struct pci_dev *dev, int mask)
40698 -{
40699 -       u16 cmd, oldcmd;
40700 -       int i;
40701 -
40702 -       pci_read_config_word(dev, PCI_COMMAND, &cmd);
40703 -       oldcmd = cmd;
40704 -
40705 -       for (i = 0; i < PCI_NUM_RESOURCES; i++) {
40706 -               struct resource *res = &dev->resource[i];
40707 -
40708 -               /* Only set up the requested stuff */
40709 -               if (!(mask & (1<<i)))
40710 -                       continue;
40711 -
40712 -               if (res->flags & IORESOURCE_IO)
40713 -                       cmd |= PCI_COMMAND_IO;
40714 -               if (res->flags & IORESOURCE_MEM)
40715 -                       cmd |= PCI_COMMAND_MEMORY;
40716 -       }
40717 -
40718 -       if (cmd != oldcmd) {
40719 -               printk(KERN_DEBUG "PCI: Enabling device: (%s), cmd %x\n",
40720 -                      pci_name(dev), cmd);
40721 -                /* Enable the appropriate bits in the PCI command register.  */
40722 -               pci_write_config_word(dev, PCI_COMMAND, cmd);
40723 -       }
40724 -       return 0;
40725 -}
40726 -
40727 -/* Decide whether to display the domain number in /proc */
40728 -int pci_proc_domain(struct pci_bus *bus)
40729 -{
40730 -       if (firmware_has_feature(FW_FEATURE_ISERIES))
40731 -               return 0;
40732 -       else {
40733 -               struct pci_controller *hose = pci_bus_to_host(bus);
40734 -               return hose->buid != 0;
40735 -       }
40736 -}
40737 -
40738 -void __devinit pci_process_bridge_OF_ranges(struct pci_controller *hose,
40739 -                                           struct device_node *dev, int prim)
40740 -{
40741 -       const unsigned int *ranges;
40742 -       unsigned int pci_space;
40743 -       unsigned long size;
40744 -       int rlen = 0;
40745 -       int memno = 0;
40746 -       struct resource *res;
40747 -       int np, na = of_n_addr_cells(dev);
40748 -       unsigned long pci_addr, cpu_phys_addr;
40749 -
40750 -       np = na + 5;
40751 -
40752 -       /* From "PCI Binding to 1275"
40753 -        * The ranges property is laid out as an array of elements,
40754 -        * each of which comprises:
40755 -        *   cells 0 - 2:       a PCI address
40756 -        *   cells 3 or 3+4:    a CPU physical address
40757 -        *                      (size depending on dev->n_addr_cells)
40758 -        *   cells 4+5 or 5+6:  the size of the range
40759 -        */
40760 -       ranges = of_get_property(dev, "ranges", &rlen);
40761 -       if (ranges == NULL)
40762 -               return;
40763 -       hose->io_base_phys = 0;
40764 -       while ((rlen -= np * sizeof(unsigned int)) >= 0) {
40765 -               res = NULL;
40766 -               pci_space = ranges[0];
40767 -               pci_addr = ((unsigned long)ranges[1] << 32) | ranges[2];
40768 -               cpu_phys_addr = of_translate_address(dev, &ranges[3]);
40769 -               size = ((unsigned long)ranges[na+3] << 32) | ranges[na+4];
40770 -               ranges += np;
40771 -               if (size == 0)
40772 -                       continue;
40773 -
40774 -               /* Now consume following elements while they are contiguous */
40775 -               while (rlen >= np * sizeof(unsigned int)) {
40776 -                       unsigned long addr, phys;
40777 -
40778 -                       if (ranges[0] != pci_space)
40779 -                               break;
40780 -                       addr = ((unsigned long)ranges[1] << 32) | ranges[2];
40781 -                       phys = ranges[3];
40782 -                       if (na >= 2)
40783 -                               phys = (phys << 32) | ranges[4];
40784 -                       if (addr != pci_addr + size ||
40785 -                           phys != cpu_phys_addr + size)
40786 -                               break;
40787 -
40788 -                       size += ((unsigned long)ranges[na+3] << 32)
40789 -                               | ranges[na+4];
40790 -                       ranges += np;
40791 -                       rlen -= np * sizeof(unsigned int);
40792 -               }
40793 -
40794 -               switch ((pci_space >> 24) & 0x3) {
40795 -               case 1:         /* I/O space */
40796 -                       hose->io_base_phys = cpu_phys_addr - pci_addr;
40797 -                       /* handle from 0 to top of I/O window */
40798 -                       hose->pci_io_size = pci_addr + size;
40799 -
40800 -                       res = &hose->io_resource;
40801 -                       res->flags = IORESOURCE_IO;
40802 -                       res->start = pci_addr;
40803 -                       DBG("phb%d: IO 0x%lx -> 0x%lx\n", hose->global_number,
40804 -                                   res->start, res->start + size - 1);
40805 -                       break;
40806 -               case 2:         /* memory space */
40807 -                       memno = 0;
40808 -                       while (memno < 3 && hose->mem_resources[memno].flags)
40809 -                               ++memno;
40810 -
40811 -                       if (memno == 0)
40812 -                               hose->pci_mem_offset = cpu_phys_addr - pci_addr;
40813 -                       if (memno < 3) {
40814 -                               res = &hose->mem_resources[memno];
40815 -                               res->flags = IORESOURCE_MEM;
40816 -                               res->start = cpu_phys_addr;
40817 -                               DBG("phb%d: MEM 0x%lx -> 0x%lx\n", hose->global_number,
40818 -                                           res->start, res->start + size - 1);
40819 -                       }
40820 -                       break;
40821 -               }
40822 -               if (res != NULL) {
40823 -                       res->name = dev->full_name;
40824 -                       res->end = res->start + size - 1;
40825 -                       res->parent = NULL;
40826 -                       res->sibling = NULL;
40827 -                       res->child = NULL;
40828 -               }
40829 -       }
40830 -}
40831 -
40832  #ifdef CONFIG_HOTPLUG
40833  
40834  int pcibios_unmap_io_space(struct pci_bus *bus)
40835 @@ -719,8 +466,7 @@
40836         if (hose->io_base_alloc == 0)
40837                 return 0;
40838  
40839 -       DBG("IO unmapping for PHB %s\n",
40840 -           ((struct device_node *)hose->arch_data)->full_name);
40841 +       DBG("IO unmapping for PHB %s\n", hose->dn->full_name);
40842         DBG("  alloc=0x%p\n", hose->io_base_alloc);
40843  
40844         /* This is a PHB, we fully unmap the IO area */
40845 @@ -779,8 +525,7 @@
40846         hose->io_base_virt = (void __iomem *)(area->addr +
40847                                               hose->io_base_phys - phys_page);
40848  
40849 -       DBG("IO mapping for PHB %s\n",
40850 -           ((struct device_node *)hose->arch_data)->full_name);
40851 +       DBG("IO mapping for PHB %s\n", hose->dn->full_name);
40852         DBG("  phys=0x%016lx, virt=0x%p (alloc=0x%p)\n",
40853             hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc);
40854         DBG("  size=0x%016lx (alloc=0x%016lx)\n",
40855 @@ -803,51 +548,13 @@
40856  }
40857  EXPORT_SYMBOL_GPL(pcibios_map_io_space);
40858  
40859 -static void __devinit fixup_resource(struct resource *res, struct pci_dev *dev)
40860 -{
40861 -       struct pci_controller *hose = pci_bus_to_host(dev->bus);
40862 -       unsigned long offset;
40863 -
40864 -       if (res->flags & IORESOURCE_IO) {
40865 -               offset = (unsigned long)hose->io_base_virt - _IO_BASE;
40866 -               res->start += offset;
40867 -               res->end += offset;
40868 -       } else if (res->flags & IORESOURCE_MEM) {
40869 -               res->start += hose->pci_mem_offset;
40870 -               res->end += hose->pci_mem_offset;
40871 -       }
40872 -}
40873 -
40874 -void __devinit pcibios_fixup_device_resources(struct pci_dev *dev,
40875 -                                             struct pci_bus *bus)
40876 -{
40877 -       /* Update device resources.  */
40878 -       int i;
40879 -
40880 -       DBG("%s: Fixup resources:\n", pci_name(dev));
40881 -       for (i = 0; i < PCI_NUM_RESOURCES; i++) {
40882 -               struct resource *res = &dev->resource[i];
40883 -               if (!res->flags)
40884 -                       continue;
40885 -
40886 -               DBG("  0x%02x < %08lx:0x%016lx...0x%016lx\n",
40887 -                   i, res->flags, res->start, res->end);
40888 -
40889 -               fixup_resource(res, dev);
40890 -
40891 -               DBG("       > %08lx:0x%016lx...0x%016lx\n",
40892 -                   res->flags, res->start, res->end);
40893 -       }
40894 -}
40895 -EXPORT_SYMBOL(pcibios_fixup_device_resources);
40896 -
40897  void __devinit pcibios_setup_new_device(struct pci_dev *dev)
40898  {
40899         struct dev_archdata *sd = &dev->dev.archdata;
40900  
40901         sd->of_node = pci_device_to_OF_node(dev);
40902  
40903 -       DBG("PCI device %s OF node: %s\n", pci_name(dev),
40904 +       DBG("PCI: device %s OF node: %s\n", pci_name(dev),
40905             sd->of_node ? sd->of_node->full_name : "<none>");
40906  
40907         sd->dma_ops = pci_dma_ops;
40908 @@ -861,7 +568,7 @@
40909  }
40910  EXPORT_SYMBOL(pcibios_setup_new_device);
40911  
40912 -static void __devinit do_bus_setup(struct pci_bus *bus)
40913 +void __devinit pcibios_do_bus_setup(struct pci_bus *bus)
40914  {
40915         struct pci_dev *dev;
40916  
40917 @@ -870,42 +577,7 @@
40918  
40919         list_for_each_entry(dev, &bus->devices, bus_list)
40920                 pcibios_setup_new_device(dev);
40921 -
40922 -       /* Read default IRQs and fixup if necessary */
40923 -       list_for_each_entry(dev, &bus->devices, bus_list) {
40924 -               pci_read_irq_line(dev);
40925 -               if (ppc_md.pci_irq_fixup)
40926 -                       ppc_md.pci_irq_fixup(dev);
40927 -       }
40928 -}
40929 -
40930 -void __devinit pcibios_fixup_bus(struct pci_bus *bus)
40931 -{
40932 -       struct pci_dev *dev = bus->self;
40933 -       struct device_node *np;
40934 -
40935 -       np = pci_bus_to_OF_node(bus);
40936 -
40937 -       DBG("pcibios_fixup_bus(%s)\n", np ? np->full_name : "<???>");
40938 -
40939 -       if (dev && pci_probe_only &&
40940 -           (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
40941 -               /* This is a subordinate bridge */
40942 -
40943 -               pci_read_bridge_bases(bus);
40944 -               pcibios_fixup_device_resources(dev, bus);
40945 -       }
40946 -
40947 -       do_bus_setup(bus);
40948 -
40949 -       if (!pci_probe_only)
40950 -               return;
40951 -
40952 -       list_for_each_entry(dev, &bus->devices, bus_list)
40953 -               if ((dev->class >> 8) != PCI_CLASS_BRIDGE_PCI)
40954 -                       pcibios_fixup_device_resources(dev, bus);
40955  }
40956 -EXPORT_SYMBOL(pcibios_fixup_bus);
40957  
40958  unsigned long pci_address_to_pio(phys_addr_t address)
40959  {
40960 --- a/arch/powerpc/kernel/pci_dn.c
40961 +++ b/arch/powerpc/kernel/pci_dn.c
40962 @@ -56,11 +56,6 @@
40963                 pdn->busno = (regs[0] >> 16) & 0xff;
40964                 pdn->devfn = (regs[0] >> 8) & 0xff;
40965         }
40966 -       if (firmware_has_feature(FW_FEATURE_ISERIES)) {
40967 -               const u32 *busp = of_get_property(dn, "linux,subbus", NULL);
40968 -               if (busp)
40969 -                       pdn->bussubno = *busp;
40970 -       }
40971  
40972         pdn->pci_ext_config_space = (type && *type == 1);
40973         return NULL;
40974 @@ -133,7 +128,7 @@
40975   */
40976  void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb)
40977  {
40978 -       struct device_node * dn = (struct device_node *) phb->arch_data;
40979 +       struct device_node *dn = phb->dn;
40980         struct pci_dn *pdn;
40981  
40982         /* PHB nodes themselves must not match */
40983 --- a/arch/powerpc/kernel/ppc_ksyms.c
40984 +++ b/arch/powerpc/kernel/ppc_ksyms.c
40985 @@ -59,6 +59,7 @@
40986  extern int sys_sigreturn(struct pt_regs *regs);
40987  
40988  EXPORT_SYMBOL(clear_pages);
40989 +EXPORT_SYMBOL(copy_page);
40990  EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
40991  EXPORT_SYMBOL(DMA_MODE_READ);
40992  EXPORT_SYMBOL(DMA_MODE_WRITE);
40993 --- a/arch/powerpc/kernel/prom.c
40994 +++ b/arch/powerpc/kernel/prom.c
40995 @@ -583,6 +583,20 @@
40996                       ibm_pa_features, ARRAY_SIZE(ibm_pa_features));
40997  }
40998  
40999 +#ifdef CONFIG_PPC64
41000 +static void __init check_cpu_slb_size(unsigned long node)
41001 +{
41002 +       u32 *slb_size_ptr;
41003 +
41004 +       slb_size_ptr = of_get_flat_dt_prop(node, "ibm,slb-size", NULL);
41005 +       if (slb_size_ptr != NULL) {
41006 +               mmu_slb_size = *slb_size_ptr;
41007 +       }
41008 +}
41009 +#else
41010 +#define check_cpu_slb_size(node) do { } while(0)
41011 +#endif
41012 +
41013  static struct feature_property {
41014         const char *name;
41015         u32 min_value;
41016 @@ -600,6 +614,29 @@
41017  #endif /* CONFIG_PPC64 */
41018  };
41019  
41020 +#if defined(CONFIG_44x) && defined(CONFIG_PPC_FPU)
41021 +static inline void identical_pvr_fixup(unsigned long node)
41022 +{
41023 +       unsigned int pvr;
41024 +       char *model = of_get_flat_dt_prop(node, "model", NULL);
41025 +
41026 +       /*
41027 +        * Since 440GR(x)/440EP(x) processors have the same pvr,
41028 +        * we check the node path and set bit 28 in the cur_cpu_spec
41029 +        * pvr for EP(x) processor version. This bit is always 0 in
41030 +        * the "real" pvr. Then we call identify_cpu again with
41031 +        * the new logical pvr to enable FPU support.
41032 +        */
41033 +       if (model && strstr(model, "440EP")) {
41034 +               pvr = cur_cpu_spec->pvr_value | 0x8;
41035 +               identify_cpu(0, pvr);
41036 +               DBG("Using logical pvr %x for %s\n", pvr, model);
41037 +       }
41038 +}
41039 +#else
41040 +#define identical_pvr_fixup(node) do { } while(0)
41041 +#endif
41042 +
41043  static void __init check_cpu_feature_properties(unsigned long node)
41044  {
41045         unsigned long i;
41046 @@ -697,22 +734,13 @@
41047                 prop = of_get_flat_dt_prop(node, "cpu-version", NULL);
41048                 if (prop && (*prop & 0xff000000) == 0x0f000000)
41049                         identify_cpu(0, *prop);
41050 -#if defined(CONFIG_44x) && defined(CONFIG_PPC_FPU)
41051 -               /*
41052 -                * Since 440GR(x)/440EP(x) processors have the same pvr,
41053 -                * we check the node path and set bit 28 in the cur_cpu_spec
41054 -                * pvr for EP(x) processor version. This bit is always 0 in
41055 -                * the "real" pvr. Then we call identify_cpu again with
41056 -                * the new logical pvr to enable FPU support.
41057 -                */
41058 -               if (strstr(uname, "440EP")) {
41059 -                       identify_cpu(0, cur_cpu_spec->pvr_value | 0x8);
41060 -               }
41061 -#endif
41062 +
41063 +               identical_pvr_fixup(node);
41064         }
41065  
41066         check_cpu_feature_properties(node);
41067         check_cpu_pa_features(node);
41068 +       check_cpu_slb_size(node);
41069  
41070  #ifdef CONFIG_PPC_PSERIES
41071         if (nthreads > 1)
41072 --- a/arch/powerpc/kernel/prom_parse.c
41073 +++ b/arch/powerpc/kernel/prom_parse.c
41074 @@ -273,7 +273,7 @@
41075  #else
41076                         struct pci_controller *host;
41077                         host = pci_bus_to_host(pdev->bus);
41078 -                       ppnode = host ? host->arch_data : NULL;
41079 +                       ppnode = host ? host->dn : NULL;
41080  #endif
41081                         /* No node for host bridge ? give up */
41082                         if (ppnode == NULL)
41083 @@ -419,7 +419,7 @@
41084  
41085  static int of_translate_one(struct device_node *parent, struct of_bus *bus,
41086                             struct of_bus *pbus, u32 *addr,
41087 -                           int na, int ns, int pna)
41088 +                           int na, int ns, int pna, const char *rprop)
41089  {
41090         const u32 *ranges;
41091         unsigned int rlen;
41092 @@ -438,7 +438,7 @@
41093          * to translate addresses that aren't supposed to be translated in
41094          * the first place. --BenH.
41095          */
41096 -       ranges = of_get_property(parent, "ranges", &rlen);
41097 +       ranges = of_get_property(parent, rprop, &rlen);
41098         if (ranges == NULL || rlen == 0) {
41099                 offset = of_read_number(addr, na);
41100                 memset(addr, 0, pna * 4);
41101 @@ -481,7 +481,8 @@
41102   * that can be mapped to a cpu physical address). This is not really specified
41103   * that way, but this is traditionally the way IBM at least do things
41104   */
41105 -u64 of_translate_address(struct device_node *dev, const u32 *in_addr)
41106 +u64 __of_translate_address(struct device_node *dev, const u32 *in_addr,
41107 +                          const char *rprop)
41108  {
41109         struct device_node *parent = NULL;
41110         struct of_bus *bus, *pbus;
41111 @@ -540,7 +541,7 @@
41112                     pbus->name, pna, pns, parent->full_name);
41113  
41114                 /* Apply bus translation */
41115 -               if (of_translate_one(dev, bus, pbus, addr, na, ns, pna))
41116 +               if (of_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop))
41117                         break;
41118  
41119                 /* Complete the move up one level */
41120 @@ -556,8 +557,19 @@
41121  
41122         return result;
41123  }
41124 +
41125 +u64 of_translate_address(struct device_node *dev, const u32 *in_addr)
41126 +{
41127 +       return __of_translate_address(dev, in_addr, "ranges");
41128 +}
41129  EXPORT_SYMBOL(of_translate_address);
41130  
41131 +u64 of_translate_dma_address(struct device_node *dev, const u32 *in_addr)
41132 +{
41133 +       return __of_translate_address(dev, in_addr, "dma-ranges");
41134 +}
41135 +EXPORT_SYMBOL(of_translate_dma_address);
41136 +
41137  const u32 *of_get_address(struct device_node *dev, int index, u64 *size,
41138                     unsigned int *flags)
41139  {
41140 --- /dev/null
41141 +++ b/arch/powerpc/kernel/rio.c
41142 @@ -0,0 +1,52 @@
41143 +/*
41144 + * RapidIO PPC32 support
41145 + *
41146 + * Copyright 2005 MontaVista Software, Inc.
41147 + * Matt Porter <mporter@kernel.crashing.org>
41148 + *
41149 + * This program is free software; you can redistribute  it and/or modify it
41150 + * under  the terms of  the GNU General  Public License as published by the
41151 + * Free Software Foundation;  either version 2 of the  License, or (at your
41152 + * option) any later version.
41153 + */
41154 +
41155 +#include <linux/init.h>
41156 +#include <linux/kernel.h>
41157 +#include <linux/rio.h>
41158 +
41159 +#include <asm/rio.h>
41160 +
41161 +/**
41162 + * platform_rio_init - Do platform specific RIO init
41163 + *
41164 + * Any platform specific initialization of RapdIO
41165 + * hardware is done here as well as registration
41166 + * of any active master ports in the system.
41167 + */
41168 +void __attribute__ ((weak))
41169 +    platform_rio_init(void)
41170 +{
41171 +       printk(KERN_WARNING "RIO: No platform_rio_init() present\n");
41172 +}
41173 +
41174 +/**
41175 + * ppc_rio_init - Do PPC32 RIO init
41176 + *
41177 + * Calls platform-specific RIO init code and then calls
41178 + * rio_init_mports() to initialize any master ports that
41179 + * have been registered with the RIO subsystem.
41180 + */
41181 +static int __init ppc_rio_init(void)
41182 +{
41183 +       printk(KERN_INFO "RIO: RapidIO init\n");
41184 +
41185 +       /* Platform specific initialization */
41186 +       platform_rio_init();
41187 +
41188 +       /* Enumerate all registered ports */
41189 +       rio_init_mports();
41190 +
41191 +       return 0;
41192 +}
41193 +
41194 +subsys_initcall(ppc_rio_init);
41195 --- a/arch/powerpc/kernel/rtas_pci.c
41196 +++ b/arch/powerpc/kernel/rtas_pci.c
41197 @@ -260,7 +260,7 @@
41198  
41199  int __devinit rtas_setup_phb(struct pci_controller *phb)
41200  {
41201 -       struct device_node *dev = phb->arch_data;
41202 +       struct device_node *dev = phb->dn;
41203  
41204         if (is_python(dev))
41205                 python_countermeasures(dev);
41206 @@ -280,10 +280,7 @@
41207         struct pci_controller *phb;
41208         struct device_node *root = of_find_node_by_path("/");
41209  
41210 -       for (node = of_get_next_child(root, NULL);
41211 -            node != NULL;
41212 -            node = of_get_next_child(root, node)) {
41213 -
41214 +       for_each_child_of_node(root, node) {
41215                 if (node->type == NULL || (strcmp(node->type, "pci") != 0 &&
41216                                            strcmp(node->type, "pciex") != 0))
41217                         continue;
41218 @@ -311,10 +308,12 @@
41219                 if (prop)
41220                         pci_probe_only = *prop;
41221  
41222 +#ifdef CONFIG_PPC32 /* Will be made generic soon */
41223                 prop = of_get_property(of_chosen,
41224                                 "linux,pci-assign-all-buses", NULL);
41225 -               if (prop)
41226 -                       pci_assign_all_buses = *prop;
41227 +               if (prop && *prop)
41228 +                       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
41229 +#endif /* CONFIG_PPC32 */
41230         }
41231  }
41232  
41233 --- a/arch/powerpc/kernel/setup-common.c
41234 +++ b/arch/powerpc/kernel/setup-common.c
41235 @@ -33,6 +33,7 @@
41236  #include <linux/serial.h>
41237  #include <linux/serial_8250.h>
41238  #include <linux/debugfs.h>
41239 +#include <linux/percpu.h>
41240  #include <asm/io.h>
41241  #include <asm/prom.h>
41242  #include <asm/processor.h>
41243 @@ -57,6 +58,7 @@
41244  #include <asm/mmu.h>
41245  #include <asm/lmb.h>
41246  #include <asm/xmon.h>
41247 +#include <asm/cputhreads.h>
41248  
41249  #include "setup.h"
41250  
41251 @@ -327,6 +329,31 @@
41252  
41253  #ifdef CONFIG_SMP
41254  
41255 +int threads_per_core, threads_shift;
41256 +cpumask_t threads_core_mask;
41257 +
41258 +static void __init cpu_init_thread_core_maps(int tpc)
41259 +{
41260 +       int i;
41261 +
41262 +       threads_per_core = tpc;
41263 +       threads_core_mask = CPU_MASK_NONE;
41264 +
41265 +       /* This implementation only supports power of 2 number of threads
41266 +        * for simplicity and performance
41267 +        */
41268 +       threads_shift = ilog2(tpc);
41269 +       BUG_ON(tpc != (1 << threads_shift));
41270 +
41271 +       for (i = 0; i < tpc; i++)
41272 +               cpu_set(i, threads_core_mask);
41273 +
41274 +       printk(KERN_INFO "CPU maps initialized for %d thread%s per core\n",
41275 +              tpc, tpc > 1 ? "s" : "");
41276 +       printk(KERN_DEBUG " (thread shift is %d)\n", threads_shift);
41277 +}
41278 +
41279 +
41280  /**
41281   * setup_cpu_maps - initialize the following cpu maps:
41282   *                  cpu_possible_map
41283 @@ -350,22 +377,32 @@
41284  {
41285         struct device_node *dn = NULL;
41286         int cpu = 0;
41287 +       int nthreads = 1;
41288 +
41289 +       DBG("smp_setup_cpu_maps()\n");
41290  
41291         while ((dn = of_find_node_by_type(dn, "cpu")) && cpu < NR_CPUS) {
41292                 const int *intserv;
41293 -               int j, len = sizeof(u32), nthreads = 1;
41294 +               int j, len;
41295 +
41296 +               DBG("  * %s...\n", dn->full_name);
41297  
41298                 intserv = of_get_property(dn, "ibm,ppc-interrupt-server#s",
41299                                 &len);
41300 -               if (intserv)
41301 +               if (intserv) {
41302                         nthreads = len / sizeof(int);
41303 -               else {
41304 +                       DBG("    ibm,ppc-interrupt-server#s -> %d threads\n",
41305 +                           nthreads);
41306 +               } else {
41307 +                       DBG("    no ibm,ppc-interrupt-server#s -> 1 thread\n");
41308                         intserv = of_get_property(dn, "reg", NULL);
41309                         if (!intserv)
41310                                 intserv = &cpu; /* assume logical == phys */
41311                 }
41312  
41313                 for (j = 0; j < nthreads && cpu < NR_CPUS; j++) {
41314 +                       DBG("    thread %d -> cpu %d (hard id %d)\n",
41315 +                           j, cpu, intserv[j]);
41316                         cpu_set(cpu, cpu_present_map);
41317                         set_hard_smp_processor_id(cpu, intserv[j]);
41318                         cpu_set(cpu, cpu_possible_map);
41319 @@ -373,6 +410,12 @@
41320                 }
41321         }
41322  
41323 +       /* If no SMT supported, nthreads is forced to 1 */
41324 +       if (!cpu_has_feature(CPU_FTR_SMT)) {
41325 +               DBG("  SMT disabled ! nthreads forced to 1\n");
41326 +               nthreads = 1;
41327 +       }
41328 +
41329  #ifdef CONFIG_PPC64
41330         /*
41331          * On pSeries LPAR, we need to know how many cpus
41332 @@ -395,7 +438,7 @@
41333  
41334                 /* Double maxcpus for processors which have SMT capability */
41335                 if (cpu_has_feature(CPU_FTR_SMT))
41336 -                       maxcpus *= 2;
41337 +                       maxcpus *= nthreads;
41338  
41339                 if (maxcpus > NR_CPUS) {
41340                         printk(KERN_WARNING
41341 @@ -412,9 +455,16 @@
41342         out:
41343                 of_node_put(dn);
41344         }
41345 -
41346         vdso_data->processorCount = num_present_cpus();
41347  #endif /* CONFIG_PPC64 */
41348 +
41349 +        /* Initialize CPU <=> thread mapping/
41350 +        *
41351 +        * WARNING: We assume that the number of threads is the same for
41352 +        * every CPU in the system. If that is not the case, then some code
41353 +        * here will have to be reworked
41354 +        */
41355 +       cpu_init_thread_core_maps(nthreads);
41356  }
41357  
41358  /*
41359 @@ -424,17 +474,19 @@
41360   */
41361  void __init smp_setup_cpu_sibling_map(void)
41362  {
41363 -#if defined(CONFIG_PPC64)
41364 -       int cpu;
41365 +#ifdef CONFIG_PPC64
41366 +       int i, cpu, base;
41367  
41368 -       /*
41369 -        * Do the sibling map; assume only two threads per processor.
41370 -        */
41371         for_each_possible_cpu(cpu) {
41372 -               cpu_set(cpu, per_cpu(cpu_sibling_map, cpu));
41373 -               if (cpu_has_feature(CPU_FTR_SMT))
41374 -                       cpu_set(cpu ^ 0x1, per_cpu(cpu_sibling_map, cpu));
41375 +               DBG("Sibling map for CPU %d:", cpu);
41376 +               base = cpu_first_thread_in_core(cpu);
41377 +               for (i = 0; i < threads_per_core; i++) {
41378 +                       cpu_set(base + i, per_cpu(cpu_sibling_map, cpu));
41379 +                       DBG(" %d", base + i);
41380 +               }
41381 +               DBG("\n");
41382         }
41383 +
41384  #endif /* CONFIG_PPC64 */
41385  }
41386  #endif /* CONFIG_SMP */
41387 --- a/arch/powerpc/kernel/signal_32.c
41388 +++ b/arch/powerpc/kernel/signal_32.c
41389 @@ -24,13 +24,12 @@
41390  #include <linux/signal.h>
41391  #include <linux/errno.h>
41392  #include <linux/elf.h>
41393 +#include <linux/ptrace.h>
41394  #ifdef CONFIG_PPC64
41395  #include <linux/syscalls.h>
41396  #include <linux/compat.h>
41397 -#include <linux/ptrace.h>
41398  #else
41399  #include <linux/wait.h>
41400 -#include <linux/ptrace.h>
41401  #include <linux/unistd.h>
41402  #include <linux/stddef.h>
41403  #include <linux/tty.h>
41404 --- a/arch/powerpc/kernel/smp.c
41405 +++ b/arch/powerpc/kernel/smp.c
41406 @@ -76,6 +76,8 @@
41407  
41408  int smt_enabled_at_boot = 1;
41409  
41410 +static int ipi_fail_ok;
41411 +
41412  static void (*crash_ipi_function_ptr)(struct pt_regs *) = NULL;
41413  
41414  #ifdef CONFIG_PPC64
41415 @@ -181,12 +183,13 @@
41416   * <wait> If true, wait (atomically) until function has completed on other CPUs.
41417   * [RETURNS] 0 on success, else a negative status code. Does not return until
41418   * remote CPUs are nearly ready to execute <<func>> or are or have executed.
41419 + * <map> is a cpu map of the cpus to send IPI to.
41420   *
41421   * You must not call this function with disabled interrupts or from a
41422   * hardware interrupt handler or from a bottom half handler.
41423   */
41424 -int smp_call_function_map(void (*func) (void *info), void *info, int nonatomic,
41425 -                       int wait, cpumask_t map)
41426 +static int __smp_call_function_map(void (*func) (void *info), void *info,
41427 +                                  int nonatomic, int wait, cpumask_t map)
41428  {
41429         struct call_data_struct data;
41430         int ret = -1, num_cpus;
41431 @@ -203,8 +206,6 @@
41432         if (wait)
41433                 atomic_set(&data.finished, 0);
41434  
41435 -       spin_lock(&call_lock);
41436 -
41437         /* remove 'self' from the map */
41438         if (cpu_isset(smp_processor_id(), map))
41439                 cpu_clear(smp_processor_id(), map);
41440 @@ -231,7 +232,8 @@
41441                         printk("smp_call_function on cpu %d: other cpus not "
41442                                 "responding (%d)\n", smp_processor_id(),
41443                                 atomic_read(&data.started));
41444 -                       debugger(NULL);
41445 +                       if (!ipi_fail_ok)
41446 +                               debugger(NULL);
41447                         goto out;
41448                 }
41449         }
41450 @@ -258,14 +260,18 @@
41451   out:
41452         call_data = NULL;
41453         HMT_medium();
41454 -       spin_unlock(&call_lock);
41455         return ret;
41456  }
41457  
41458  static int __smp_call_function(void (*func)(void *info), void *info,
41459                                int nonatomic, int wait)
41460  {
41461 -       return smp_call_function_map(func,info,nonatomic,wait,cpu_online_map);
41462 +       int ret;
41463 +       spin_lock(&call_lock);
41464 +       ret =__smp_call_function_map(func, info, nonatomic, wait,
41465 +                                      cpu_online_map);
41466 +       spin_unlock(&call_lock);
41467 +       return ret;
41468  }
41469  
41470  int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
41471 @@ -278,8 +284,8 @@
41472  }
41473  EXPORT_SYMBOL(smp_call_function);
41474  
41475 -int smp_call_function_single(int cpu, void (*func) (void *info), void *info, int nonatomic,
41476 -                       int wait)
41477 +int smp_call_function_single(int cpu, void (*func) (void *info), void *info,
41478 +                            int nonatomic, int wait)
41479  {
41480         cpumask_t map = CPU_MASK_NONE;
41481         int ret = 0;
41482 @@ -291,9 +297,11 @@
41483                 return -EINVAL;
41484  
41485         cpu_set(cpu, map);
41486 -       if (cpu != get_cpu())
41487 -               ret = smp_call_function_map(func,info,nonatomic,wait,map);
41488 -       else {
41489 +       if (cpu != get_cpu()) {
41490 +               spin_lock(&call_lock);
41491 +               ret = __smp_call_function_map(func, info, nonatomic, wait, map);
41492 +               spin_unlock(&call_lock);
41493 +       } else {
41494                 local_irq_disable();
41495                 func(info);
41496                 local_irq_enable();
41497 @@ -305,7 +313,22 @@
41498  
41499  void smp_send_stop(void)
41500  {
41501 -       __smp_call_function(stop_this_cpu, NULL, 1, 0);
41502 +       int nolock;
41503 +
41504 +       /* It's OK to fail sending the IPI, since the alternative is to
41505 +        * be stuck forever waiting on the other CPU to take the interrupt.
41506 +        *
41507 +        * It's better to at least continue and go through reboot, since this
41508 +        * function is usually called at panic or reboot time in the first
41509 +        * place.
41510 +        */
41511 +       ipi_fail_ok = 1;
41512 +
41513 +       /* Don't deadlock in case we got called through panic */
41514 +       nolock = !spin_trylock(&call_lock);
41515 +       __smp_call_function_map(stop_this_cpu, NULL, 1, 0, cpu_online_map);
41516 +       if (!nolock)
41517 +               spin_unlock(&call_lock);
41518  }
41519  
41520  void smp_call_function_interrupt(void)
41521 --- /dev/null
41522 +++ b/arch/powerpc/kernel/systbl_chk.c
41523 @@ -0,0 +1,58 @@
41524 +/*
41525 + * This file, when run through CPP produces a list of syscall numbers
41526 + * in the order of systbl.h.  That way we can check for gaps and syscalls
41527 + * that are out of order.
41528 + *
41529 + * Unfortunately, we cannot check for the correct ordering of entries
41530 + * using SYSX().
41531 + *
41532 + * Copyright Â© IBM Corporation
41533 + *
41534 + * This program is free software; you can redistribute it and/or
41535 + * modify it under the terms of the GNU General Public License
41536 + * as published by the Free Software Foundation; either version
41537 + * 2 of the License, or (at your option) any later version.
41538 + */
41539 +#include <asm/unistd.h>
41540 +
41541 +#define SYSCALL(func)          __NR_##func
41542 +#define COMPAT_SYS(func)       __NR_##func
41543 +#define PPC_SYS(func)          __NR_##func
41544 +#ifdef CONFIG_PPC64
41545 +#define OLDSYS(func)           -1
41546 +#define SYS32ONLY(func)                -1
41547 +#else
41548 +#define OLDSYS(func)           __NR_old##func
41549 +#define SYS32ONLY(func)                __NR_##func
41550 +#endif
41551 +#define SYSX(f, f3264, f32)    -1
41552 +
41553 +#define SYSCALL_SPU(func)      SYSCALL(func)
41554 +#define COMPAT_SYS_SPU(func)   COMPAT_SYS(func)
41555 +#define PPC_SYS_SPU(func)      PPC_SYS(func)
41556 +#define SYSX_SPU(f, f3264, f32)        SYSX(f, f3264, f32)
41557 +
41558 +/* Just insert a marker for ni_syscalls */
41559 +#define        __NR_ni_syscall         -1
41560 +
41561 +/*
41562 + * These are the known exceptions.
41563 + * Hopefully, there will be no more.
41564 + */
41565 +#define        __NR_llseek             __NR__llseek
41566 +#undef __NR_umount
41567 +#define        __NR_umount             __NR_umount2
41568 +#define        __NR_old_getrlimit      __NR_getrlimit
41569 +#define        __NR_newstat            __NR_stat
41570 +#define        __NR_newlstat           __NR_lstat
41571 +#define        __NR_newfstat           __NR_fstat
41572 +#define        __NR_newuname           __NR_uname
41573 +#define        __NR_sysctl             __NR__sysctl
41574 +#define __NR_olddebug_setcontext       __NR_sys_debug_setcontext
41575 +
41576 +/* We call sys_ugetrlimit for syscall number __NR_getrlimit */
41577 +#define getrlimit              ugetrlimit
41578 +
41579 +START_TABLE
41580 +#include <asm/systbl.h>
41581 +END_TABLE __NR_syscalls
41582 --- /dev/null
41583 +++ b/arch/powerpc/kernel/systbl_chk.sh
41584 @@ -0,0 +1,33 @@
41585 +#!/bin/sh
41586 +#
41587 +# Just process the CPP output from systbl_chk.c and complain
41588 +# if anything is out of order.
41589 +#
41590 +# Copyright Â© 2008 IBM Corporation
41591 +#
41592 +# This program is free software; you can redistribute it and/or
41593 +# modify it under the terms of the GNU General Public License
41594 +# as published by the Free Software Foundation; either version
41595 +# 2 of the License, or (at your option) any later version.
41596 +
41597 +awk    'BEGIN { num = -1; }    # Ignore the beginning of the file
41598 +       /^#/ { next; }
41599 +       /^[ \t]*$/ { next; }
41600 +       /^START_TABLE/ { num = 0; next; }
41601 +       /^END_TABLE/ {
41602 +               if (num != $2) {
41603 +                       printf "__NR_syscalls (%s) is not one more than the last syscall (%s)\n",
41604 +                               $2, num - 1;
41605 +                       exit(1);
41606 +               }
41607 +               num = -1;       # Ignore the rest of the file
41608 +       }
41609 +       {
41610 +               if (num == -1) next;
41611 +               if (($1 != -1) && ($1 != num)) {
41612 +                       printf "Syscall %s out of order (expected %s)\n",
41613 +                               $1, num;
41614 +                       exit(1);
41615 +               };
41616 +               num++;
41617 +       }' "$1"
41618 --- a/arch/powerpc/kernel/time.c
41619 +++ b/arch/powerpc/kernel/time.c
41620 @@ -116,9 +116,12 @@
41621         .features       = CLOCK_EVT_FEAT_ONESHOT,
41622  };
41623  
41624 -static DEFINE_PER_CPU(struct clock_event_device, decrementers);
41625 -void init_decrementer_clockevent(void);
41626 -static DEFINE_PER_CPU(u64, decrementer_next_tb);
41627 +struct decrementer_clock {
41628 +       struct clock_event_device event;
41629 +       u64 next_tb;
41630 +};
41631 +
41632 +static DEFINE_PER_CPU(struct decrementer_clock, decrementers);
41633  
41634  #ifdef CONFIG_PPC_ISERIES
41635  static unsigned long __initdata iSeries_recal_titan;
41636 @@ -216,7 +219,11 @@
41637   */
41638  static u64 read_spurr(u64 purr)
41639  {
41640 -       if (cpu_has_feature(CPU_FTR_SPURR))
41641 +       /*
41642 +        * cpus without PURR won't have a SPURR
41643 +        * We already know the former when we use this, so tell gcc
41644 +        */
41645 +       if (cpu_has_feature(CPU_FTR_PURR) && cpu_has_feature(CPU_FTR_SPURR))
41646                 return mfspr(SPRN_SPURR);
41647         return purr;
41648  }
41649 @@ -227,29 +234,30 @@
41650   */
41651  void account_system_vtime(struct task_struct *tsk)
41652  {
41653 -       u64 now, nowscaled, delta, deltascaled;
41654 +       u64 now, nowscaled, delta, deltascaled, sys_time;
41655         unsigned long flags;
41656  
41657         local_irq_save(flags);
41658         now = read_purr();
41659 -       delta = now - get_paca()->startpurr;
41660 -       get_paca()->startpurr = now;
41661         nowscaled = read_spurr(now);
41662 +       delta = now - get_paca()->startpurr;
41663         deltascaled = nowscaled - get_paca()->startspurr;
41664 +       get_paca()->startpurr = now;
41665         get_paca()->startspurr = nowscaled;
41666         if (!in_interrupt()) {
41667                 /* deltascaled includes both user and system time.
41668                  * Hence scale it based on the purr ratio to estimate
41669                  * the system time */
41670 +               sys_time = get_paca()->system_time;
41671                 if (get_paca()->user_time)
41672 -                       deltascaled = deltascaled * get_paca()->system_time /
41673 -                            (get_paca()->system_time + get_paca()->user_time);
41674 -               delta += get_paca()->system_time;
41675 +                       deltascaled = deltascaled * sys_time /
41676 +                            (sys_time + get_paca()->user_time);
41677 +               delta += sys_time;
41678                 get_paca()->system_time = 0;
41679         }
41680         account_system_time(tsk, 0, delta);
41681 -       get_paca()->purrdelta = delta;
41682         account_system_time_scaled(tsk, deltascaled);
41683 +       get_paca()->purrdelta = delta;
41684         get_paca()->spurrdelta = deltascaled;
41685         local_irq_restore(flags);
41686  }
41687 @@ -326,11 +334,9 @@
41688         s64 stolen;
41689         struct cpu_purr_data *pme;
41690  
41691 -       if (!cpu_has_feature(CPU_FTR_PURR))
41692 -               return;
41693 -       pme = &per_cpu(cpu_purr_data, smp_processor_id());
41694 +       pme = &__get_cpu_var(cpu_purr_data);
41695         if (!pme->initialized)
41696 -               return;         /* this can happen in early boot */
41697 +               return;         /* !CPU_FTR_PURR or early in early boot */
41698         tb = mftb();
41699         purr = mfspr(SPRN_PURR);
41700         stolen = (tb - pme->tb) - (purr - pme->purr);
41701 @@ -353,7 +359,7 @@
41702         if (!cpu_has_feature(CPU_FTR_PURR))
41703                 return;
41704         local_irq_save(flags);
41705 -       pme = &per_cpu(cpu_purr_data, smp_processor_id());
41706 +       pme = &__get_cpu_var(cpu_purr_data);
41707         pme->tb = mftb();
41708         pme->purr = mfspr(SPRN_PURR);
41709         pme->initialized = 1;
41710 @@ -556,8 +562,8 @@
41711  void timer_interrupt(struct pt_regs * regs)
41712  {
41713         struct pt_regs *old_regs;
41714 -       int cpu = smp_processor_id();
41715 -       struct clock_event_device *evt = &per_cpu(decrementers, cpu);
41716 +       struct decrementer_clock *decrementer =  &__get_cpu_var(decrementers);
41717 +       struct clock_event_device *evt = &decrementer->event;
41718         u64 now;
41719  
41720         /* Ensure a positive value is written to the decrementer, or else
41721 @@ -570,9 +576,9 @@
41722  #endif
41723  
41724         now = get_tb_or_rtc();
41725 -       if (now < per_cpu(decrementer_next_tb, cpu)) {
41726 +       if (now < decrementer->next_tb) {
41727                 /* not time for this event yet */
41728 -               now = per_cpu(decrementer_next_tb, cpu) - now;
41729 +               now = decrementer->next_tb - now;
41730                 if (now <= DECREMENTER_MAX)
41731                         set_dec((int)now);
41732                 return;
41733 @@ -623,6 +629,45 @@
41734         set_dec(ticks);
41735  }
41736  
41737 +#ifdef CONFIG_SUSPEND
41738 +void generic_suspend_disable_irqs(void)
41739 +{
41740 +       preempt_disable();
41741 +
41742 +       /* Disable the decrementer, so that it doesn't interfere
41743 +        * with suspending.
41744 +        */
41745 +
41746 +       set_dec(0x7fffffff);
41747 +       local_irq_disable();
41748 +       set_dec(0x7fffffff);
41749 +}
41750 +
41751 +void generic_suspend_enable_irqs(void)
41752 +{
41753 +       wakeup_decrementer();
41754 +
41755 +       local_irq_enable();
41756 +       preempt_enable();
41757 +}
41758 +
41759 +/* Overrides the weak version in kernel/power/main.c */
41760 +void arch_suspend_disable_irqs(void)
41761 +{
41762 +       if (ppc_md.suspend_disable_irqs)
41763 +               ppc_md.suspend_disable_irqs();
41764 +       generic_suspend_disable_irqs();
41765 +}
41766 +
41767 +/* Overrides the weak version in kernel/power/main.c */
41768 +void arch_suspend_enable_irqs(void)
41769 +{
41770 +       generic_suspend_enable_irqs();
41771 +       if (ppc_md.suspend_enable_irqs)
41772 +               ppc_md.suspend_enable_irqs();
41773 +}
41774 +#endif
41775 +
41776  #ifdef CONFIG_SMP
41777  void __init smp_space_timers(unsigned int max_cpus)
41778  {
41779 @@ -811,7 +856,7 @@
41780  static int decrementer_set_next_event(unsigned long evt,
41781                                       struct clock_event_device *dev)
41782  {
41783 -       __get_cpu_var(decrementer_next_tb) = get_tb_or_rtc() + evt;
41784 +       __get_cpu_var(decrementers).next_tb = get_tb_or_rtc() + evt;
41785         set_dec(evt);
41786         return 0;
41787  }
41788 @@ -825,7 +870,7 @@
41789  
41790  static void register_decrementer_clockevent(int cpu)
41791  {
41792 -       struct clock_event_device *dec = &per_cpu(decrementers, cpu);
41793 +       struct clock_event_device *dec = &per_cpu(decrementers, cpu).event;
41794  
41795         *dec = decrementer_clockevent;
41796         dec->cpumask = cpumask_of_cpu(cpu);
41797 @@ -836,7 +881,7 @@
41798         clockevents_register_device(dec);
41799  }
41800  
41801 -void init_decrementer_clockevent(void)
41802 +static void __init init_decrementer_clockevent(void)
41803  {
41804         int cpu = smp_processor_id();
41805  
41806 --- a/arch/powerpc/kernel/traps.c
41807 +++ b/arch/powerpc/kernel/traps.c
41808 @@ -334,18 +334,25 @@
41809  #define clear_single_step(regs)        ((regs)->msr &= ~MSR_SE)
41810  #endif
41811  
41812 -static int generic_machine_check_exception(struct pt_regs *regs)
41813 +#if defined(CONFIG_4xx)
41814 +int machine_check_4xx(struct pt_regs *regs)
41815  {
41816         unsigned long reason = get_mc_reason(regs);
41817  
41818 -#if defined(CONFIG_4xx) && !defined(CONFIG_440A)
41819         if (reason & ESR_IMCP) {
41820                 printk("Instruction");
41821                 mtspr(SPRN_ESR, reason & ~ESR_IMCP);
41822         } else
41823                 printk("Data");
41824         printk(" machine check in kernel mode.\n");
41825 -#elif defined(CONFIG_440A)
41826 +
41827 +       return 0;
41828 +}
41829 +
41830 +int machine_check_440A(struct pt_regs *regs)
41831 +{
41832 +       unsigned long reason = get_mc_reason(regs);
41833 +
41834         printk("Machine check in kernel mode.\n");
41835         if (reason & ESR_IMCP){
41836                 printk("Instruction Synchronous Machine Check exception\n");
41837 @@ -375,7 +382,13 @@
41838                 /* Clear MCSR */
41839                 mtspr(SPRN_MCSR, mcsr);
41840         }
41841 -#elif defined (CONFIG_E500)
41842 +       return 0;
41843 +}
41844 +#elif defined(CONFIG_E500)
41845 +int machine_check_e500(struct pt_regs *regs)
41846 +{
41847 +       unsigned long reason = get_mc_reason(regs);
41848 +
41849         printk("Machine check in kernel mode.\n");
41850         printk("Caused by (from MCSR=%lx): ", reason);
41851  
41852 @@ -403,7 +416,14 @@
41853                 printk("Bus - Instruction Parity Error\n");
41854         if (reason & MCSR_BUS_RPERR)
41855                 printk("Bus - Read Parity Error\n");
41856 -#elif defined (CONFIG_E200)
41857 +
41858 +       return 0;
41859 +}
41860 +#elif defined(CONFIG_E200)
41861 +int machine_check_e200(struct pt_regs *regs)
41862 +{
41863 +       unsigned long reason = get_mc_reason(regs);
41864 +
41865         printk("Machine check in kernel mode.\n");
41866         printk("Caused by (from MCSR=%lx): ", reason);
41867  
41868 @@ -421,7 +441,14 @@
41869                 printk("Bus - Read Bus Error on data load\n");
41870         if (reason & MCSR_BUS_WRERR)
41871                 printk("Bus - Write Bus Error on buffered store or cache line push\n");
41872 -#else /* !CONFIG_4xx && !CONFIG_E500 && !CONFIG_E200 */
41873 +
41874 +       return 0;
41875 +}
41876 +#else
41877 +int machine_check_generic(struct pt_regs *regs)
41878 +{
41879 +       unsigned long reason = get_mc_reason(regs);
41880 +
41881         printk("Machine check in kernel mode.\n");
41882         printk("Caused by (from SRR1=%lx): ", reason);
41883         switch (reason & 0x601F0000) {
41884 @@ -451,22 +478,26 @@
41885         default:
41886                 printk("Unknown values in msr\n");
41887         }
41888 -#endif /* CONFIG_4xx */
41889 -
41890         return 0;
41891  }
41892 +#endif /* everything else */
41893  
41894  void machine_check_exception(struct pt_regs *regs)
41895  {
41896         int recover = 0;
41897  
41898 -       /* See if any machine dependent calls */
41899 +       /* See if any machine dependent calls. In theory, we would want
41900 +        * to call the CPU first, and call the ppc_md. one if the CPU
41901 +        * one returns a positive number. However there is existing code
41902 +        * that assumes the board gets a first chance, so let's keep it
41903 +        * that way for now and fix things later. --BenH.
41904 +        */
41905         if (ppc_md.machine_check_exception)
41906                 recover = ppc_md.machine_check_exception(regs);
41907 -       else
41908 -               recover = generic_machine_check_exception(regs);
41909 +       else if (cur_cpu_spec->machine_check)
41910 +               recover = cur_cpu_spec->machine_check(regs);
41911  
41912 -       if (recover)
41913 +       if (recover > 0)
41914                 return;
41915  
41916         if (user_mode(regs)) {
41917 @@ -476,7 +507,12 @@
41918         }
41919  
41920  #if defined(CONFIG_8xx) && defined(CONFIG_PCI)
41921 -       /* the qspan pci read routines can cause machine checks -- Cort */
41922 +       /* the qspan pci read routines can cause machine checks -- Cort
41923 +        *
41924 +        * yuck !!! that totally needs to go away ! There are better ways
41925 +        * to deal with that than having a wart in the mcheck handler.
41926 +        * -- BenH
41927 +        */
41928         bad_page_fault(regs, regs->dar, SIGBUS);
41929         return;
41930  #endif
41931 @@ -622,6 +658,9 @@
41932  #define INST_POPCNTB           0x7c0000f4
41933  #define INST_POPCNTB_MASK      0xfc0007fe
41934  
41935 +#define INST_ISEL              0x7c00001e
41936 +#define INST_ISEL_MASK         0xfc00003e
41937 +
41938  static int emulate_string_inst(struct pt_regs *regs, u32 instword)
41939  {
41940         u8 rT = (instword >> 21) & 0x1f;
41941 @@ -707,6 +746,23 @@
41942         return 0;
41943  }
41944  
41945 +static int emulate_isel(struct pt_regs *regs, u32 instword)
41946 +{
41947 +       u8 rT = (instword >> 21) & 0x1f;
41948 +       u8 rA = (instword >> 16) & 0x1f;
41949 +       u8 rB = (instword >> 11) & 0x1f;
41950 +       u8 BC = (instword >> 6) & 0x1f;
41951 +       u8 bit;
41952 +       unsigned long tmp;
41953 +
41954 +       tmp = (rA == 0) ? 0 : regs->gpr[rA];
41955 +       bit = (regs->ccr >> (31 - BC)) & 0x1;
41956 +
41957 +       regs->gpr[rT] = bit ? tmp : regs->gpr[rB];
41958 +
41959 +       return 0;
41960 +}
41961 +
41962  static int emulate_instruction(struct pt_regs *regs)
41963  {
41964         u32 instword;
41965 @@ -749,6 +805,11 @@
41966                 return emulate_popcntb_inst(regs, instword);
41967         }
41968  
41969 +       /* Emulate isel (Integer Select) instruction */
41970 +       if ((instword & INST_ISEL_MASK) == INST_ISEL) {
41971 +               return emulate_isel(regs, instword);
41972 +       }
41973 +
41974         return -EINVAL;
41975  }
41976  
41977 --- a/arch/powerpc/kernel/udbg.c
41978 +++ b/arch/powerpc/kernel/udbg.c
41979 @@ -54,9 +54,16 @@
41980  #elif defined(CONFIG_PPC_EARLY_DEBUG_44x)
41981         /* PPC44x debug */
41982         udbg_init_44x_as1();
41983 +#elif defined(CONFIG_PPC_EARLY_DEBUG_40x)
41984 +       /* PPC40x debug */
41985 +       udbg_init_40x_realmode();
41986  #elif defined(CONFIG_PPC_EARLY_DEBUG_CPM)
41987         udbg_init_cpm();
41988  #endif
41989 +
41990 +#ifdef CONFIG_PPC_EARLY_DEBUG
41991 +       console_loglevel = 10;
41992 +#endif
41993  }
41994  
41995  /* udbg library, used by xmon et al */
41996 --- a/arch/powerpc/kernel/udbg_16550.c
41997 +++ b/arch/powerpc/kernel/udbg_16550.c
41998 @@ -46,7 +46,7 @@
41999  
42000  #define LCR_DLAB 0x80
42001  
42002 -static volatile struct NS16550 __iomem *udbg_comport;
42003 +static struct NS16550 __iomem *udbg_comport;
42004  
42005  static void udbg_550_putc(char c)
42006  {
42007 @@ -117,7 +117,7 @@
42008  {
42009         unsigned int dll, dlm, divisor, prescaler, speed;
42010         u8 old_lcr;
42011 -       volatile struct NS16550 __iomem *port = comport;
42012 +       struct NS16550 __iomem *port = comport;
42013  
42014         old_lcr = in_8(&port->lcr);
42015  
42016 @@ -162,7 +162,7 @@
42017  
42018  void __init udbg_init_maple_realmode(void)
42019  {
42020 -       udbg_comport = (volatile struct NS16550 __iomem *)0xf40003f8;
42021 +       udbg_comport = (struct NS16550 __iomem *)0xf40003f8;
42022  
42023         udbg_putc = udbg_maple_real_putc;
42024         udbg_getc = NULL;
42025 @@ -184,7 +184,7 @@
42026  
42027  void udbg_init_pas_realmode(void)
42028  {
42029 -       udbg_comport = (volatile struct NS16550 __iomem *)0xfcff03f8UL;
42030 +       udbg_comport = (struct NS16550 __iomem *)0xfcff03f8UL;
42031  
42032         udbg_putc = udbg_pas_real_putc;
42033         udbg_getc = NULL;
42034 @@ -219,9 +219,42 @@
42035  void __init udbg_init_44x_as1(void)
42036  {
42037         udbg_comport =
42038 -               (volatile struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR;
42039 +               (struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR;
42040  
42041         udbg_putc = udbg_44x_as1_putc;
42042         udbg_getc = udbg_44x_as1_getc;
42043  }
42044  #endif /* CONFIG_PPC_EARLY_DEBUG_44x */
42045 +
42046 +#ifdef CONFIG_PPC_EARLY_DEBUG_40x
42047 +static void udbg_40x_real_putc(char c)
42048 +{
42049 +       if (udbg_comport) {
42050 +               while ((real_readb(&udbg_comport->lsr) & LSR_THRE) == 0)
42051 +                       /* wait for idle */;
42052 +               real_writeb(c, &udbg_comport->thr); eieio();
42053 +               if (c == '\n')
42054 +                       udbg_40x_real_putc('\r');
42055 +       }
42056 +}
42057 +
42058 +static int udbg_40x_real_getc(void)
42059 +{
42060 +       if (udbg_comport) {
42061 +               while ((real_readb(&udbg_comport->lsr) & LSR_DR) == 0)
42062 +                       ; /* wait for char */
42063 +               return real_readb(&udbg_comport->rbr);
42064 +       }
42065 +       return -1;
42066 +}
42067 +
42068 +void __init udbg_init_40x_realmode(void)
42069 +{
42070 +       udbg_comport = (struct NS16550 __iomem *)
42071 +               CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR;
42072 +
42073 +       udbg_putc = udbg_40x_real_putc;
42074 +       udbg_getc = udbg_40x_real_getc;
42075 +       udbg_getc_poll = NULL;
42076 +}
42077 +#endif /* CONFIG_PPC_EARLY_DEBUG_40x */
42078 --- a/arch/powerpc/math-emu/op-4.h
42079 +++ b/arch/powerpc/math-emu/op-4.h
42080 @@ -194,19 +194,39 @@
42081    (X##_f[3] = I3, X##_f[2] = I2, X##_f[1] = I1, X##_f[0] = I0)
42082  
42083  #ifndef __FP_FRAC_ADD_4
42084 -#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)           \
42085 -  (r0 = x0 + y0,                                                       \
42086 -   r1 = x1 + y1 + (r0 < x0),                                           \
42087 -   r2 = x2 + y2 + (r1 < x1),                                           \
42088 -   r3 = x3 + y3 + (r2 < x2))
42089 +#define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)   \
42090 +  do {                                                         \
42091 +    int _c1, _c2, _c3;                                         \
42092 +    r0 = x0 + y0;                                              \
42093 +    _c1 = r0 < x0;                                             \
42094 +    r1 = x1 + y1;                                              \
42095 +    _c2 = r1 < x1;                                             \
42096 +    r1 += _c1;                                                 \
42097 +    _c2 |= r1 < _c1;                                           \
42098 +    r2 = x2 + y2;                                              \
42099 +    _c3 = r2 < x2;                                             \
42100 +    r2 += _c2;                                                 \
42101 +    _c3 |= r2 < _c2;                                           \
42102 +    r3 = x3 + y3 + _c3;                                                \
42103 +  } while (0)
42104  #endif
42105  
42106  #ifndef __FP_FRAC_SUB_4
42107 -#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)           \
42108 -  (r0 = x0 - y0,                                                        \
42109 -   r1 = x1 - y1 - (r0 > x0),                                            \
42110 -   r2 = x2 - y2 - (r1 > x1),                                            \
42111 -   r3 = x3 - y3 - (r2 > x2))
42112 +#define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0)   \
42113 +  do {                                                         \
42114 +    int _c1, _c2, _c3;                                         \
42115 +    r0 = x0 - y0;                                              \
42116 +    _c1 = r0 > x0;                                             \
42117 +    r1 = x1 - y1;                                              \
42118 +    _c2 = r1 > x1;                                             \
42119 +    r1 -= _c1;                                                 \
42120 +    _c2 |= r1 > _c1;                                           \
42121 +    r2 = x2 - y2;                                              \
42122 +    _c3 = r2 > x2;                                             \
42123 +    r2 -= _c2;                                                 \
42124 +    _c3 |= r2 > _c2;                                           \
42125 +    r3 = x3 - y3 - _c3;                                                \
42126 +  } while (0)
42127  #endif
42128  
42129  #ifndef __FP_FRAC_ADDI_4
42130 --- a/arch/powerpc/mm/fault.c
42131 +++ b/arch/powerpc/mm/fault.c
42132 @@ -167,10 +167,8 @@
42133         if (notify_page_fault(regs))
42134                 return 0;
42135  
42136 -       if (trap == 0x300) {
42137 -               if (debugger_fault_handler(regs))
42138 -                       return 0;
42139 -       }
42140 +       if (unlikely(debugger_fault_handler(regs)))
42141 +               return 0;
42142  
42143         /* On a kernel SLB miss we can only check for a valid exception entry */
42144         if (!user_mode(regs) && (address >= TASK_SIZE))
42145 @@ -189,7 +187,7 @@
42146                         return SIGSEGV;
42147                 /* in_atomic() in user mode is really bad,
42148                    as is current->mm == NULL. */
42149 -               printk(KERN_EMERG "Page fault in user mode with"
42150 +               printk(KERN_EMERG "Page fault in user mode with "
42151                        "in_atomic() = %d mm = %p\n", in_atomic(), mm);
42152                 printk(KERN_EMERG "NIP = %lx  MSR = %lx\n",
42153                        regs->nip, regs->msr);
42154 --- a/arch/powerpc/mm/fsl_booke_mmu.c
42155 +++ b/arch/powerpc/mm/fsl_booke_mmu.c
42156 @@ -165,15 +165,15 @@
42157  void __init cam_mapin_ram(unsigned long cam0, unsigned long cam1,
42158                 unsigned long cam2)
42159  {
42160 -       settlbcam(0, KERNELBASE, PPC_MEMSTART, cam0, _PAGE_KERNEL, 0);
42161 +       settlbcam(0, PAGE_OFFSET, PPC_MEMSTART, cam0, _PAGE_KERNEL, 0);
42162         tlbcam_index++;
42163         if (cam1) {
42164                 tlbcam_index++;
42165 -               settlbcam(1, KERNELBASE+cam0, PPC_MEMSTART+cam0, cam1, _PAGE_KERNEL, 0);
42166 +               settlbcam(1, PAGE_OFFSET+cam0, PPC_MEMSTART+cam0, cam1, _PAGE_KERNEL, 0);
42167         }
42168         if (cam2) {
42169                 tlbcam_index++;
42170 -               settlbcam(2, KERNELBASE+cam0+cam1, PPC_MEMSTART+cam0+cam1, cam2, _PAGE_KERNEL, 0);
42171 +               settlbcam(2, PAGE_OFFSET+cam0+cam1, PPC_MEMSTART+cam0+cam1, cam2, _PAGE_KERNEL, 0);
42172         }
42173  }
42174  
42175 --- a/arch/powerpc/mm/hash_utils_64.c
42176 +++ b/arch/powerpc/mm/hash_utils_64.c
42177 @@ -96,6 +96,7 @@
42178  int mmu_io_psize = MMU_PAGE_4K;
42179  int mmu_kernel_ssize = MMU_SEGSIZE_256M;
42180  int mmu_highuser_ssize = MMU_SEGSIZE_256M;
42181 +u16 mmu_slb_size = 64;
42182  #ifdef CONFIG_HUGETLB_PAGE
42183  int mmu_huge_psize = MMU_PAGE_16M;
42184  unsigned int HPAGE_SHIFT;
42185 @@ -368,18 +369,11 @@
42186          * on what is available
42187          */
42188         if (mmu_psize_defs[MMU_PAGE_16M].shift)
42189 -               mmu_huge_psize = MMU_PAGE_16M;
42190 +               set_huge_psize(MMU_PAGE_16M);
42191         /* With 4k/4level pagetables, we can't (for now) cope with a
42192          * huge page size < PMD_SIZE */
42193         else if (mmu_psize_defs[MMU_PAGE_1M].shift)
42194 -               mmu_huge_psize = MMU_PAGE_1M;
42195 -
42196 -       /* Calculate HPAGE_SHIFT and sanity check it */
42197 -       if (mmu_psize_defs[mmu_huge_psize].shift > MIN_HUGEPTE_SHIFT &&
42198 -           mmu_psize_defs[mmu_huge_psize].shift < SID_SHIFT)
42199 -               HPAGE_SHIFT = mmu_psize_defs[mmu_huge_psize].shift;
42200 -       else
42201 -               HPAGE_SHIFT = 0; /* No huge pages dude ! */
42202 +               set_huge_psize(MMU_PAGE_1M);
42203  #endif /* CONFIG_HUGETLB_PAGE */
42204  }
42205  
42206 --- a/arch/powerpc/mm/hugetlbpage.c
42207 +++ b/arch/powerpc/mm/hugetlbpage.c
42208 @@ -24,18 +24,17 @@
42209  #include <asm/cputable.h>
42210  #include <asm/spu.h>
42211  
42212 +#define HPAGE_SHIFT_64K        16
42213 +#define HPAGE_SHIFT_16M        24
42214 +
42215  #define NUM_LOW_AREAS  (0x100000000UL >> SID_SHIFT)
42216  #define NUM_HIGH_AREAS (PGTABLE_RANGE >> HTLB_AREA_SHIFT)
42217  
42218 -#ifdef CONFIG_PPC_64K_PAGES
42219 -#define HUGEPTE_INDEX_SIZE     (PMD_SHIFT-HPAGE_SHIFT)
42220 -#else
42221 -#define HUGEPTE_INDEX_SIZE     (PUD_SHIFT-HPAGE_SHIFT)
42222 -#endif
42223 -#define PTRS_PER_HUGEPTE       (1 << HUGEPTE_INDEX_SIZE)
42224 -#define HUGEPTE_TABLE_SIZE     (sizeof(pte_t) << HUGEPTE_INDEX_SIZE)
42225 +unsigned int hugepte_shift;
42226 +#define PTRS_PER_HUGEPTE       (1 << hugepte_shift)
42227 +#define HUGEPTE_TABLE_SIZE     (sizeof(pte_t) << hugepte_shift)
42228  
42229 -#define HUGEPD_SHIFT           (HPAGE_SHIFT + HUGEPTE_INDEX_SIZE)
42230 +#define HUGEPD_SHIFT           (HPAGE_SHIFT + hugepte_shift)
42231  #define HUGEPD_SIZE            (1UL << HUGEPD_SHIFT)
42232  #define HUGEPD_MASK            (~(HUGEPD_SIZE-1))
42233  
42234 @@ -82,11 +81,35 @@
42235         return 0;
42236  }
42237  
42238 +/* Base page size affects how we walk hugetlb page tables */
42239 +#ifdef CONFIG_PPC_64K_PAGES
42240 +#define hpmd_offset(pud, addr)         pmd_offset(pud, addr)
42241 +#define hpmd_alloc(mm, pud, addr)      pmd_alloc(mm, pud, addr)
42242 +#else
42243 +static inline
42244 +pmd_t *hpmd_offset(pud_t *pud, unsigned long addr)
42245 +{
42246 +       if (HPAGE_SHIFT == HPAGE_SHIFT_64K)
42247 +               return pmd_offset(pud, addr);
42248 +       else
42249 +               return (pmd_t *) pud;
42250 +}
42251 +static inline
42252 +pmd_t *hpmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long addr)
42253 +{
42254 +       if (HPAGE_SHIFT == HPAGE_SHIFT_64K)
42255 +               return pmd_alloc(mm, pud, addr);
42256 +       else
42257 +               return (pmd_t *) pud;
42258 +}
42259 +#endif
42260 +
42261  /* Modelled after find_linux_pte() */
42262  pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
42263  {
42264         pgd_t *pg;
42265         pud_t *pu;
42266 +       pmd_t *pm;
42267  
42268         BUG_ON(get_slice_psize(mm, addr) != mmu_huge_psize);
42269  
42270 @@ -96,14 +119,9 @@
42271         if (!pgd_none(*pg)) {
42272                 pu = pud_offset(pg, addr);
42273                 if (!pud_none(*pu)) {
42274 -#ifdef CONFIG_PPC_64K_PAGES
42275 -                       pmd_t *pm;
42276 -                       pm = pmd_offset(pu, addr);
42277 +                       pm = hpmd_offset(pu, addr);
42278                         if (!pmd_none(*pm))
42279                                 return hugepte_offset((hugepd_t *)pm, addr);
42280 -#else
42281 -                       return hugepte_offset((hugepd_t *)pu, addr);
42282 -#endif
42283                 }
42284         }
42285  
42286 @@ -114,6 +132,7 @@
42287  {
42288         pgd_t *pg;
42289         pud_t *pu;
42290 +       pmd_t *pm;
42291         hugepd_t *hpdp = NULL;
42292  
42293         BUG_ON(get_slice_psize(mm, addr) != mmu_huge_psize);
42294 @@ -124,14 +143,9 @@
42295         pu = pud_alloc(mm, pg, addr);
42296  
42297         if (pu) {
42298 -#ifdef CONFIG_PPC_64K_PAGES
42299 -               pmd_t *pm;
42300 -               pm = pmd_alloc(mm, pu, addr);
42301 +               pm = hpmd_alloc(mm, pu, addr);
42302                 if (pm)
42303                         hpdp = (hugepd_t *)pm;
42304 -#else
42305 -               hpdp = (hugepd_t *)pu;
42306 -#endif
42307         }
42308  
42309         if (! hpdp)
42310 @@ -158,7 +172,6 @@
42311                                                  PGF_CACHENUM_MASK));
42312  }
42313  
42314 -#ifdef CONFIG_PPC_64K_PAGES
42315  static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
42316                                    unsigned long addr, unsigned long end,
42317                                    unsigned long floor, unsigned long ceiling)
42318 @@ -191,7 +204,6 @@
42319         pud_clear(pud);
42320         pmd_free_tlb(tlb, pmd);
42321  }
42322 -#endif
42323  
42324  static void hugetlb_free_pud_range(struct mmu_gather *tlb, pgd_t *pgd,
42325                                    unsigned long addr, unsigned long end,
42326 @@ -210,9 +222,15 @@
42327                         continue;
42328                 hugetlb_free_pmd_range(tlb, pud, addr, next, floor, ceiling);
42329  #else
42330 -               if (pud_none(*pud))
42331 -                       continue;
42332 -               free_hugepte_range(tlb, (hugepd_t *)pud);
42333 +               if (HPAGE_SHIFT == HPAGE_SHIFT_64K) {
42334 +                       if (pud_none_or_clear_bad(pud))
42335 +                               continue;
42336 +                       hugetlb_free_pmd_range(tlb, pud, addr, next, floor, ceiling);
42337 +               } else {
42338 +                       if (pud_none(*pud))
42339 +                               continue;
42340 +                       free_hugepte_range(tlb, (hugepd_t *)pud);
42341 +               }
42342  #endif
42343         } while (pud++, addr = next, addr != end);
42344  
42345 @@ -526,6 +544,57 @@
42346         return err;
42347  }
42348  
42349 +void set_huge_psize(int psize)
42350 +{
42351 +       /* Check that it is a page size supported by the hardware and
42352 +        * that it fits within pagetable limits. */
42353 +       if (mmu_psize_defs[psize].shift && mmu_psize_defs[psize].shift < SID_SHIFT &&
42354 +               (mmu_psize_defs[psize].shift > MIN_HUGEPTE_SHIFT ||
42355 +                       mmu_psize_defs[psize].shift == HPAGE_SHIFT_64K)) {
42356 +               HPAGE_SHIFT = mmu_psize_defs[psize].shift;
42357 +               mmu_huge_psize = psize;
42358 +#ifdef CONFIG_PPC_64K_PAGES
42359 +               hugepte_shift = (PMD_SHIFT-HPAGE_SHIFT);
42360 +#else
42361 +               if (HPAGE_SHIFT == HPAGE_SHIFT_64K)
42362 +                       hugepte_shift = (PMD_SHIFT-HPAGE_SHIFT);
42363 +               else
42364 +                       hugepte_shift = (PUD_SHIFT-HPAGE_SHIFT);
42365 +#endif
42366 +
42367 +       } else
42368 +               HPAGE_SHIFT = 0;
42369 +}
42370 +
42371 +static int __init hugepage_setup_sz(char *str)
42372 +{
42373 +       unsigned long long size;
42374 +       int mmu_psize = -1;
42375 +       int shift;
42376 +
42377 +       size = memparse(str, &str);
42378 +
42379 +       shift = __ffs(size);
42380 +       switch (shift) {
42381 +#ifndef CONFIG_PPC_64K_PAGES
42382 +       case HPAGE_SHIFT_64K:
42383 +               mmu_psize = MMU_PAGE_64K;
42384 +               break;
42385 +#endif
42386 +       case HPAGE_SHIFT_16M:
42387 +               mmu_psize = MMU_PAGE_16M;
42388 +               break;
42389 +       }
42390 +
42391 +       if (mmu_psize >=0 && mmu_psize_defs[mmu_psize].shift)
42392 +               set_huge_psize(mmu_psize);
42393 +       else
42394 +               printk(KERN_WARNING "Invalid huge page size specified(%llu)\n", size);
42395 +
42396 +       return 1;
42397 +}
42398 +__setup("hugepagesz=", hugepage_setup_sz);
42399 +
42400  static void zero_ctor(struct kmem_cache *cache, void *addr)
42401  {
42402         memset(addr, 0, kmem_cache_size(cache));
42403 --- a/arch/powerpc/mm/lmb.c
42404 +++ b/arch/powerpc/mm/lmb.c
42405 @@ -342,3 +342,16 @@
42406                 }
42407         }
42408  }
42409 +
42410 +int __init lmb_is_reserved(unsigned long addr)
42411 +{
42412 +       int i;
42413 +
42414 +       for (i = 0; i < lmb.reserved.cnt; i++) {
42415 +               unsigned long upper = lmb.reserved.region[i].base +
42416 +                                     lmb.reserved.region[i].size - 1;
42417 +               if ((addr >= lmb.reserved.region[i].base) && (addr <= upper))
42418 +                       return 1;
42419 +       }
42420 +       return 0;
42421 +}
42422 --- a/arch/powerpc/mm/mem.c
42423 +++ b/arch/powerpc/mm/mem.c
42424 @@ -213,15 +213,30 @@
42425          */
42426  #ifdef CONFIG_HIGHMEM
42427         free_bootmem_with_active_regions(0, total_lowmem >> PAGE_SHIFT);
42428 +
42429 +       /* reserve the sections we're already using */
42430 +       for (i = 0; i < lmb.reserved.cnt; i++) {
42431 +               unsigned long addr = lmb.reserved.region[i].base +
42432 +                                    lmb_size_bytes(&lmb.reserved, i) - 1;
42433 +               if (addr < total_lowmem)
42434 +                       reserve_bootmem(lmb.reserved.region[i].base,
42435 +                                       lmb_size_bytes(&lmb.reserved, i));
42436 +               else if (lmb.reserved.region[i].base < total_lowmem) {
42437 +                       unsigned long adjusted_size = total_lowmem -
42438 +                                     lmb.reserved.region[i].base;
42439 +                       reserve_bootmem(lmb.reserved.region[i].base,
42440 +                                       adjusted_size);
42441 +               }
42442 +       }
42443  #else
42444         free_bootmem_with_active_regions(0, max_pfn);
42445 -#endif
42446  
42447         /* reserve the sections we're already using */
42448         for (i = 0; i < lmb.reserved.cnt; i++)
42449                 reserve_bootmem(lmb.reserved.region[i].base,
42450                                 lmb_size_bytes(&lmb.reserved, i));
42451  
42452 +#endif
42453         /* XXX need to clip this if using highmem? */
42454         sparse_memory_present_with_active_regions(0);
42455  
42456 @@ -334,11 +349,13 @@
42457                 highmem_mapnr = total_lowmem >> PAGE_SHIFT;
42458                 for (pfn = highmem_mapnr; pfn < max_mapnr; ++pfn) {
42459                         struct page *page = pfn_to_page(pfn);
42460 -
42461 +                       if (lmb_is_reserved(pfn << PAGE_SHIFT))
42462 +                               continue;
42463                         ClearPageReserved(page);
42464                         init_page_count(page);
42465                         __free_page(page);
42466                         totalhigh_pages++;
42467 +                       reservedpages--;
42468                 }
42469                 totalram_pages += totalhigh_pages;
42470                 printk(KERN_DEBUG "High memory: %luk\n",
42471 --- a/arch/powerpc/mm/slb.c
42472 +++ b/arch/powerpc/mm/slb.c
42473 @@ -256,6 +256,7 @@
42474         static int slb_encoding_inited;
42475         extern unsigned int *slb_miss_kernel_load_linear;
42476         extern unsigned int *slb_miss_kernel_load_io;
42477 +       extern unsigned int *slb_compare_rr_to_size;
42478  
42479         /* Prepare our SLB miss handler based on our page size */
42480         linear_llp = mmu_psize_defs[mmu_linear_psize].sllp;
42481 @@ -269,6 +270,8 @@
42482                                    SLB_VSID_KERNEL | linear_llp);
42483                 patch_slb_encoding(slb_miss_kernel_load_io,
42484                                    SLB_VSID_KERNEL | io_llp);
42485 +               patch_slb_encoding(slb_compare_rr_to_size,
42486 +                                  mmu_slb_size);
42487  
42488                 DBG("SLB: linear  LLP = %04x\n", linear_llp);
42489                 DBG("SLB: io      LLP = %04x\n", io_llp);
42490 --- a/arch/powerpc/mm/slb_low.S
42491 +++ b/arch/powerpc/mm/slb_low.S
42492 @@ -227,8 +227,9 @@
42493  
42494  7:     ld      r10,PACASTABRR(r13)
42495         addi    r10,r10,1
42496 -       /* use a cpu feature mask if we ever change our slb size */
42497 -       cmpldi  r10,SLB_NUM_ENTRIES
42498 +       /* This gets soft patched on boot. */
42499 +_GLOBAL(slb_compare_rr_to_size)
42500 +       cmpldi  r10,0
42501  
42502         blt+    4f
42503         li      r10,SLB_NUM_BOLTED
42504 --- a/arch/powerpc/oprofile/op_model_cell.c
42505 +++ b/arch/powerpc/oprofile/op_model_cell.c
42506 @@ -61,7 +61,7 @@
42507  #define NUM_THREADS 2         /* number of physical threads in
42508                                * physical processor
42509                                */
42510 -#define NUM_TRACE_BUS_WORDS 4
42511 +#define NUM_DEBUG_BUS_WORDS 4
42512  #define NUM_INPUT_BUS_WORDS 2
42513  
42514  #define MAX_SPU_COUNT 0xFFFFFF /* maximum 24 bit LFSR value */
42515 @@ -169,7 +169,6 @@
42516  
42517  static u32 ctr_enabled;
42518  
42519 -static unsigned char trace_bus[NUM_TRACE_BUS_WORDS];
42520  static unsigned char input_bus[NUM_INPUT_BUS_WORDS];
42521  
42522  /*
42523 @@ -298,7 +297,7 @@
42524  
42525         p->signal_group = event / 100;
42526         p->bus_word = bus_word;
42527 -       p->sub_unit = (unit_mask & 0x0000f000) >> 12;
42528 +       p->sub_unit = GET_SUB_UNIT(unit_mask);
42529  
42530         pm_regs.pm07_cntrl[ctr] = 0;
42531         pm_regs.pm07_cntrl[ctr] |= PM07_CTR_COUNT_CYCLES(count_cycles);
42532 @@ -334,16 +333,16 @@
42533                 p->bit = signal_bit;
42534         }
42535  
42536 -       for (i = 0; i < NUM_TRACE_BUS_WORDS; i++) {
42537 +       for (i = 0; i < NUM_DEBUG_BUS_WORDS; i++) {
42538                 if (bus_word & (1 << i)) {
42539                         pm_regs.debug_bus_control |=
42540 -                           (bus_type << (31 - (2 * i) + 1));
42541 +                           (bus_type << (30 - (2 * i)));
42542  
42543                         for (j = 0; j < NUM_INPUT_BUS_WORDS; j++) {
42544                                 if (input_bus[j] == 0xff) {
42545                                         input_bus[j] = i;
42546                                         pm_regs.group_control |=
42547 -                                           (i << (31 - i));
42548 +                                           (i << (30 - (2 * j)));
42549  
42550                                         break;
42551                                 }
42552 @@ -450,6 +449,12 @@
42553         hdw_thread = 1 ^ hdw_thread;
42554         next_hdw_thread = hdw_thread;
42555  
42556 +       pm_regs.group_control = 0;
42557 +       pm_regs.debug_bus_control = 0;
42558 +
42559 +       for (i = 0; i < NUM_INPUT_BUS_WORDS; i++)
42560 +               input_bus[i] = 0xff;
42561 +
42562         /*
42563          * There are some per thread events.  Must do the
42564          * set event, for the thread that is being started
42565 @@ -619,9 +624,6 @@
42566                 pmc_cntrl[1][i].vcntr = i;
42567         }
42568  
42569 -       for (i = 0; i < NUM_TRACE_BUS_WORDS; i++)
42570 -               trace_bus[i] = 0xff;
42571 -
42572         for (i = 0; i < NUM_INPUT_BUS_WORDS; i++)
42573                 input_bus[i] = 0xff;
42574  
42575 --- a/arch/powerpc/platforms/40x/Kconfig
42576 +++ b/arch/powerpc/platforms/40x/Kconfig
42577 @@ -14,28 +14,34 @@
42578  #      help
42579  #        This option enables support for the CPCI405 board.
42580  
42581 -#config EP405
42582 -#      bool "EP405/EP405PC"
42583 -#      depends on 40x
42584 -#      default n
42585 -#      select 405GP
42586 -#      help
42587 -#        This option enables support for the EP405/EP405PC boards.
42588 -
42589 -#config EP405PC
42590 -#      bool "EP405PC Support"
42591 -#      depends on EP405
42592 -#      default y
42593 -#      help
42594 -#        This option enables support for the extra features of the EP405PC board.
42595 +config EP405
42596 +       bool "EP405/EP405PC"
42597 +       depends on 40x
42598 +       default n
42599 +       select 405GP
42600 +       select PCI
42601 +       help
42602 +         This option enables support for the EP405/EP405PC boards.
42603  
42604  config KILAUEA
42605         bool "Kilauea"
42606         depends on 40x
42607         default n
42608 +       select 405EX
42609 +       select PPC4xx_PCI_EXPRESS
42610         help
42611           This option enables support for the AMCC PPC405EX evaluation board.
42612  
42613 +config MAKALU
42614 +       bool "Makalu"
42615 +       depends on 40x
42616 +       default n
42617 +       select 405EX
42618 +       select PCI
42619 +       select PPC4xx_PCI_EXPRESS
42620 +       help
42621 +         This option enables support for the AMCC PPC405EX board.
42622 +
42623  #config REDWOOD_5
42624  #      bool "Redwood-5"
42625  #      depends on 40x
42626 @@ -65,6 +71,7 @@
42627         depends on 40x
42628         default y
42629         select 405GP
42630 +       select PCI
42631         help
42632           This option enables support for the IBM PPC405GP evaluation board.
42633  
42634 @@ -105,6 +112,11 @@
42635  config 405EP
42636         bool
42637  
42638 +config 405EX
42639 +       bool
42640 +       select IBM_NEW_EMAC_EMAC4
42641 +       select IBM_NEW_EMAC_RGMII
42642 +
42643  config 405GPR
42644         bool
42645  
42646 --- a/arch/powerpc/platforms/40x/Makefile
42647 +++ b/arch/powerpc/platforms/40x/Makefile
42648 @@ -1,3 +1,5 @@
42649  obj-$(CONFIG_KILAUEA)                          += kilauea.o
42650 +obj-$(CONFIG_MAKALU)                           += makalu.o
42651  obj-$(CONFIG_WALNUT)                           += walnut.o
42652  obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD)      += virtex.o
42653 +obj-$(CONFIG_EP405)                            += ep405.o
42654 --- /dev/null
42655 +++ b/arch/powerpc/platforms/40x/ep405.c
42656 @@ -0,0 +1,123 @@
42657 +/*
42658 + * Architecture- / platform-specific boot-time initialization code for
42659 + * IBM PowerPC 4xx based boards. Adapted from original
42660 + * code by Gary Thomas, Cort Dougan <cort@fsmlabs.com>, and Dan Malek
42661 + * <dan@net4x.com>.
42662 + *
42663 + * Copyright(c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
42664 + *
42665 + * Rewritten and ported to the merged powerpc tree:
42666 + * Copyright 2007 IBM Corporation
42667 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
42668 + *
42669 + * Adapted to EP405 by Ben. Herrenschmidt <benh@kernel.crashing.org>
42670 + *
42671 + * TODO: Wire up the PCI IRQ mux and the southbridge interrupts
42672 + *
42673 + * 2002 (c) MontaVista, Software, Inc.  This file is licensed under
42674 + * the terms of the GNU General Public License version 2.  This program
42675 + * is licensed "as is" without any warranty of any kind, whether express
42676 + * or implied.
42677 + */
42678 +
42679 +#include <linux/init.h>
42680 +#include <linux/of_platform.h>
42681 +
42682 +#include <asm/machdep.h>
42683 +#include <asm/prom.h>
42684 +#include <asm/udbg.h>
42685 +#include <asm/time.h>
42686 +#include <asm/uic.h>
42687 +#include <asm/pci-bridge.h>
42688 +
42689 +static struct device_node *bcsr_node;
42690 +static void __iomem *bcsr_regs;
42691 +
42692 +/* BCSR registers  */
42693 +#define BCSR_ID                        0
42694 +#define BCSR_PCI_CTRL          1
42695 +#define BCSR_FLASH_NV_POR_CTRL 2
42696 +#define BCSR_FENET_UART_CTRL   3
42697 +#define BCSR_PCI_IRQ           4
42698 +#define BCSR_XIRQ_SELECT       5
42699 +#define BCSR_XIRQ_ROUTING      6
42700 +#define BCSR_XIRQ_STATUS       7
42701 +#define BCSR_XIRQ_STATUS2      8
42702 +#define BCSR_SW_STAT_LED_CTRL  9
42703 +#define BCSR_GPIO_IRQ_PAR_CTRL 10
42704 +/* there's more, can't be bothered typing them tho */
42705 +
42706 +
42707 +static __initdata struct of_device_id ep405_of_bus[] = {
42708 +       { .compatible = "ibm,plb3", },
42709 +       { .compatible = "ibm,opb", },
42710 +       { .compatible = "ibm,ebc", },
42711 +       {},
42712 +};
42713 +
42714 +static int __init ep405_device_probe(void)
42715 +{
42716 +       of_platform_bus_probe(NULL, ep405_of_bus, NULL);
42717 +
42718 +       return 0;
42719 +}
42720 +machine_device_initcall(ep405, ep405_device_probe);
42721 +
42722 +static void __init ep405_init_bcsr(void)
42723 +{
42724 +       const u8 *irq_routing;
42725 +       int i;
42726 +
42727 +       /* Find the bloody thing & map it */
42728 +       bcsr_node = of_find_compatible_node(NULL, NULL, "ep405-bcsr");
42729 +       if (bcsr_node == NULL) {
42730 +               printk(KERN_ERR "EP405 BCSR not found !\n");
42731 +               return;
42732 +       }
42733 +       bcsr_regs = of_iomap(bcsr_node, 0);
42734 +       if (bcsr_regs == NULL) {
42735 +               printk(KERN_ERR "EP405 BCSR failed to map !\n");
42736 +               return;
42737 +       }
42738 +
42739 +       /* Get the irq-routing property and apply the routing to the CPLD */
42740 +       irq_routing = of_get_property(bcsr_node, "irq-routing", NULL);
42741 +       if (irq_routing == NULL)
42742 +               return;
42743 +       for (i = 0; i < 16; i++) {
42744 +               u8 irq = irq_routing[i];
42745 +               out_8(bcsr_regs + BCSR_XIRQ_SELECT, i);
42746 +               out_8(bcsr_regs + BCSR_XIRQ_ROUTING, irq);
42747 +       }
42748 +       in_8(bcsr_regs + BCSR_XIRQ_SELECT);
42749 +       mb();
42750 +       out_8(bcsr_regs + BCSR_GPIO_IRQ_PAR_CTRL, 0xfe);
42751 +}
42752 +
42753 +static void __init ep405_setup_arch(void)
42754 +{
42755 +       /* Find & init the BCSR CPLD */
42756 +       ep405_init_bcsr();
42757 +
42758 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
42759 +}
42760 +
42761 +static int __init ep405_probe(void)
42762 +{
42763 +       unsigned long root = of_get_flat_dt_root();
42764 +
42765 +       if (!of_flat_dt_is_compatible(root, "ep405"))
42766 +               return 0;
42767 +
42768 +       return 1;
42769 +}
42770 +
42771 +define_machine(ep405) {
42772 +       .name                   = "EP405",
42773 +       .probe                  = ep405_probe,
42774 +       .setup_arch             = ep405_setup_arch,
42775 +       .progress               = udbg_progress,
42776 +       .init_IRQ               = uic_init_tree,
42777 +       .get_irq                = uic_get_irq,
42778 +       .calibrate_decr         = generic_calibrate_decr,
42779 +};
42780 --- a/arch/powerpc/platforms/40x/kilauea.c
42781 +++ b/arch/powerpc/platforms/40x/kilauea.c
42782 @@ -19,8 +19,9 @@
42783  #include <asm/udbg.h>
42784  #include <asm/time.h>
42785  #include <asm/uic.h>
42786 +#include <asm/pci-bridge.h>
42787  
42788 -static struct of_device_id kilauea_of_bus[] = {
42789 +static __initdata struct of_device_id kilauea_of_bus[] = {
42790         { .compatible = "ibm,plb4", },
42791         { .compatible = "ibm,opb", },
42792         { .compatible = "ibm,ebc", },
42793 @@ -29,14 +30,11 @@
42794  
42795  static int __init kilauea_device_probe(void)
42796  {
42797 -       if (!machine_is(kilauea))
42798 -               return 0;
42799 -
42800         of_platform_bus_probe(NULL, kilauea_of_bus, NULL);
42801  
42802         return 0;
42803  }
42804 -device_initcall(kilauea_device_probe);
42805 +machine_device_initcall(kilauea, kilauea_device_probe);
42806  
42807  static int __init kilauea_probe(void)
42808  {
42809 @@ -45,6 +43,8 @@
42810         if (!of_flat_dt_is_compatible(root, "amcc,kilauea"))
42811                 return 0;
42812  
42813 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
42814 +
42815         return 1;
42816  }
42817  
42818 --- /dev/null
42819 +++ b/arch/powerpc/platforms/40x/makalu.c
42820 @@ -0,0 +1,58 @@
42821 +/*
42822 + * Makalu board specific routines
42823 + *
42824 + * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
42825 + *
42826 + * Based on the Walnut code by
42827 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
42828 + * Copyright 2007 IBM Corporation
42829 + *
42830 + * This program is free software; you can redistribute  it and/or modify it
42831 + * under  the terms of  the GNU General  Public License as published by the
42832 + * Free Software Foundation;  either version 2 of the  License, or (at your
42833 + * option) any later version.
42834 + */
42835 +#include <linux/init.h>
42836 +#include <linux/of_platform.h>
42837 +#include <asm/machdep.h>
42838 +#include <asm/prom.h>
42839 +#include <asm/udbg.h>
42840 +#include <asm/time.h>
42841 +#include <asm/uic.h>
42842 +#include <asm/pci-bridge.h>
42843 +
42844 +static __initdata struct of_device_id makalu_of_bus[] = {
42845 +       { .compatible = "ibm,plb4", },
42846 +       { .compatible = "ibm,opb", },
42847 +       { .compatible = "ibm,ebc", },
42848 +       {},
42849 +};
42850 +
42851 +static int __init makalu_device_probe(void)
42852 +{
42853 +       of_platform_bus_probe(NULL, makalu_of_bus, NULL);
42854 +
42855 +       return 0;
42856 +}
42857 +machine_device_initcall(makalu, makalu_device_probe);
42858 +
42859 +static int __init makalu_probe(void)
42860 +{
42861 +       unsigned long root = of_get_flat_dt_root();
42862 +
42863 +       if (!of_flat_dt_is_compatible(root, "amcc,makalu"))
42864 +               return 0;
42865 +
42866 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
42867 +
42868 +       return 1;
42869 +}
42870 +
42871 +define_machine(makalu) {
42872 +       .name                           = "Makalu",
42873 +       .probe                          = makalu_probe,
42874 +       .progress                       = udbg_progress,
42875 +       .init_IRQ                       = uic_init_tree,
42876 +       .get_irq                        = uic_get_irq,
42877 +       .calibrate_decr                 = generic_calibrate_decr,
42878 +};
42879 --- a/arch/powerpc/platforms/40x/virtex.c
42880 +++ b/arch/powerpc/platforms/40x/virtex.c
42881 @@ -15,16 +15,23 @@
42882  #include <asm/time.h>
42883  #include <asm/xilinx_intc.h>
42884  
42885 +static struct of_device_id xilinx_of_bus_ids[] __initdata = {
42886 +       { .compatible = "xlnx,plb-v46-1.00.a", },
42887 +       { .compatible = "xlnx,plb-v34-1.01.a", },
42888 +       { .compatible = "xlnx,plb-v34-1.02.a", },
42889 +       { .compatible = "xlnx,opb-v20-1.10.c", },
42890 +       { .compatible = "xlnx,dcr-v29-1.00.a", },
42891 +       { .compatible = "xlnx,compound", },
42892 +       {}
42893 +};
42894 +
42895  static int __init virtex_device_probe(void)
42896  {
42897 -       if (!machine_is(virtex))
42898 -               return 0;
42899 -
42900 -       of_platform_bus_probe(NULL, NULL, NULL);
42901 +       of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL);
42902  
42903         return 0;
42904  }
42905 -device_initcall(virtex_device_probe);
42906 +machine_device_initcall(virtex, virtex_device_probe);
42907  
42908  static int __init virtex_probe(void)
42909  {
42910 --- a/arch/powerpc/platforms/40x/walnut.c
42911 +++ b/arch/powerpc/platforms/40x/walnut.c
42912 @@ -24,8 +24,9 @@
42913  #include <asm/udbg.h>
42914  #include <asm/time.h>
42915  #include <asm/uic.h>
42916 +#include <asm/pci-bridge.h>
42917  
42918 -static struct of_device_id walnut_of_bus[] = {
42919 +static __initdata struct of_device_id walnut_of_bus[] = {
42920         { .compatible = "ibm,plb3", },
42921         { .compatible = "ibm,opb", },
42922         { .compatible = "ibm,ebc", },
42923 @@ -34,15 +35,12 @@
42924  
42925  static int __init walnut_device_probe(void)
42926  {
42927 -       if (!machine_is(walnut))
42928 -               return 0;
42929 -
42930 -       /* FIXME: do bus probe here */
42931         of_platform_bus_probe(NULL, walnut_of_bus, NULL);
42932 +       of_instantiate_rtc();
42933  
42934         return 0;
42935  }
42936 -device_initcall(walnut_device_probe);
42937 +machine_device_initcall(walnut, walnut_device_probe);
42938  
42939  static int __init walnut_probe(void)
42940  {
42941 @@ -51,6 +49,8 @@
42942         if (!of_flat_dt_is_compatible(root, "ibm,walnut"))
42943                 return 0;
42944  
42945 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
42946 +
42947         return 1;
42948  }
42949  
42950 --- a/arch/powerpc/platforms/44x/Kconfig
42951 +++ b/arch/powerpc/platforms/44x/Kconfig
42952 @@ -3,6 +3,7 @@
42953         depends on 44x
42954         default n
42955         select 440EP
42956 +       select PCI
42957         help
42958           This option enables support for the IBM PPC440EP evaluation board.
42959  
42960 @@ -11,6 +12,8 @@
42961         depends on 44x
42962         default y
42963         select 440GP
42964 +       select PCI
42965 +       select OF_RTC
42966         help
42967           This option enables support for the IBM PPC440GP evaluation board.
42968  
42969 @@ -22,6 +25,48 @@
42970         help
42971           This option enables support for the AMCC PPC440EPX evaluation board.
42972  
42973 +config TAISHAN
42974 +       bool "Taishan"
42975 +       depends on 44x
42976 +       default n
42977 +       select 440GX
42978 +       select PCI
42979 +       help
42980 +         This option enables support for the AMCC PPC440GX "Taishan"
42981 +         evaluation board.
42982 +
42983 +config KATMAI
42984 +       bool "Katmai"
42985 +       depends on 44x
42986 +       default n
42987 +       select 440SPe
42988 +       select PCI
42989 +       select PPC4xx_PCI_EXPRESS
42990 +       help
42991 +         This option enables support for the AMCC PPC440SPe evaluation board.
42992 +
42993 +config RAINIER
42994 +       bool "Rainier"
42995 +       depends on 44x
42996 +       default n
42997 +       select 440GRX
42998 +       select PCI
42999 +       help
43000 +         This option enables support for the AMCC PPC440GRX evaluation board.
43001 +
43002 +config WARP
43003 +       bool "PIKA Warp"
43004 +       depends on 44x
43005 +       default n
43006 +       select 440EP
43007 +       help
43008 +         This option enables support for the PIKA Warp(tm) Appliance. The Warp
43009 +          is a small computer replacement with up to 9 ports of FXO/FXS plus VOIP
43010 +         stations and trunks.
43011 +
43012 +         See http://www.pikatechnologies.com/ and follow the "PIKA for Computer
43013 +         Telephony Developers" link for more information.
43014 +
43015  #config LUAN
43016  #      bool "Luan"
43017  #      depends on 44x
43018 @@ -44,6 +89,7 @@
43019         select PPC_FPU
43020         select IBM440EP_ERR42
43021         select IBM_NEW_EMAC_ZMII
43022 +       select USB_ARCH_HAS_OHCI
43023  
43024  config 440EPX
43025         bool
43026 @@ -52,20 +98,29 @@
43027         select IBM_NEW_EMAC_RGMII
43028         select IBM_NEW_EMAC_ZMII
43029  
43030 +config 440GRX
43031 +       bool
43032 +       select IBM_NEW_EMAC_EMAC4
43033 +       select IBM_NEW_EMAC_RGMII
43034 +       select IBM_NEW_EMAC_ZMII
43035 +
43036  config 440GP
43037         bool
43038         select IBM_NEW_EMAC_ZMII
43039  
43040  config 440GX
43041         bool
43042 +        select IBM_NEW_EMAC_EMAC4
43043 +       select IBM_NEW_EMAC_RGMII
43044 +        select IBM_NEW_EMAC_ZMII #test only
43045 +        select IBM_NEW_EMAC_TAH  #test only
43046  
43047  config 440SP
43048         bool
43049  
43050 -config 440A
43051 +config 440SPe
43052 +        select IBM_NEW_EMAC_EMAC4
43053         bool
43054 -       depends on 440GX || 440EPX
43055 -       default y
43056  
43057  # 44x errata/workaround config symbols, selected by the CPU models above
43058  config IBM440EP_ERR42
43059 --- a/arch/powerpc/platforms/44x/Makefile
43060 +++ b/arch/powerpc/platforms/44x/Makefile
43061 @@ -1,4 +1,9 @@
43062  obj-$(CONFIG_44x)      := misc_44x.o
43063  obj-$(CONFIG_EBONY)    += ebony.o
43064 -obj-$(CONFIG_BAMBOO) += bamboo.o
43065 +obj-$(CONFIG_TAISHAN)  += taishan.o
43066 +obj-$(CONFIG_BAMBOO)   += bamboo.o
43067  obj-$(CONFIG_SEQUOIA)  += sequoia.o
43068 +obj-$(CONFIG_KATMAI)   += katmai.o
43069 +obj-$(CONFIG_RAINIER)  += rainier.o
43070 +obj-$(CONFIG_WARP)     += warp.o
43071 +obj-$(CONFIG_WARP)     += warp-nand.o
43072 --- a/arch/powerpc/platforms/44x/bamboo.c
43073 +++ b/arch/powerpc/platforms/44x/bamboo.c
43074 @@ -21,9 +21,11 @@
43075  #include <asm/udbg.h>
43076  #include <asm/time.h>
43077  #include <asm/uic.h>
43078 +#include <asm/pci-bridge.h>
43079 +
43080  #include "44x.h"
43081  
43082 -static struct of_device_id bamboo_of_bus[] = {
43083 +static __initdata struct of_device_id bamboo_of_bus[] = {
43084         { .compatible = "ibm,plb4", },
43085         { .compatible = "ibm,opb", },
43086         { .compatible = "ibm,ebc", },
43087 @@ -32,14 +34,11 @@
43088  
43089  static int __init bamboo_device_probe(void)
43090  {
43091 -       if (!machine_is(bamboo))
43092 -               return 0;
43093 -
43094         of_platform_bus_probe(NULL, bamboo_of_bus, NULL);
43095  
43096         return 0;
43097  }
43098 -device_initcall(bamboo_device_probe);
43099 +machine_device_initcall(bamboo, bamboo_device_probe);
43100  
43101  static int __init bamboo_probe(void)
43102  {
43103 @@ -48,6 +47,8 @@
43104         if (!of_flat_dt_is_compatible(root, "amcc,bamboo"))
43105                 return 0;
43106  
43107 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43108 +
43109         return 1;
43110  }
43111  
43112 --- a/arch/powerpc/platforms/44x/ebony.c
43113 +++ b/arch/powerpc/platforms/44x/ebony.c
43114 @@ -18,16 +18,18 @@
43115  
43116  #include <linux/init.h>
43117  #include <linux/of_platform.h>
43118 +#include <linux/rtc.h>
43119  
43120  #include <asm/machdep.h>
43121  #include <asm/prom.h>
43122  #include <asm/udbg.h>
43123  #include <asm/time.h>
43124  #include <asm/uic.h>
43125 +#include <asm/pci-bridge.h>
43126  
43127  #include "44x.h"
43128  
43129 -static struct of_device_id ebony_of_bus[] = {
43130 +static __initdata struct of_device_id ebony_of_bus[] = {
43131         { .compatible = "ibm,plb4", },
43132         { .compatible = "ibm,opb", },
43133         { .compatible = "ibm,ebc", },
43134 @@ -36,14 +38,12 @@
43135  
43136  static int __init ebony_device_probe(void)
43137  {
43138 -       if (!machine_is(ebony))
43139 -               return 0;
43140 -
43141         of_platform_bus_probe(NULL, ebony_of_bus, NULL);
43142 +       of_instantiate_rtc();
43143  
43144         return 0;
43145  }
43146 -device_initcall(ebony_device_probe);
43147 +machine_device_initcall(ebony, ebony_device_probe);
43148  
43149  /*
43150   * Called very early, MMU is off, device-tree isn't unflattened
43151 @@ -55,6 +55,8 @@
43152         if (!of_flat_dt_is_compatible(root, "ibm,ebony"))
43153                 return 0;
43154  
43155 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43156 +
43157         return 1;
43158  }
43159  
43160 --- /dev/null
43161 +++ b/arch/powerpc/platforms/44x/katmai.c
43162 @@ -0,0 +1,63 @@
43163 +/*
43164 + * Katmai board specific routines
43165 + *
43166 + * Benjamin Herrenschmidt <benh@kernel.crashing.org>
43167 + * Copyright 2007 IBM Corp.
43168 + *
43169 + * Based on the Bamboo code by
43170 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
43171 + * Copyright 2007 IBM Corporation
43172 + *
43173 + * This program is free software; you can redistribute  it and/or modify it
43174 + * under  the terms of  the GNU General  Public License as published by the
43175 + * Free Software Foundation;  either version 2 of the  License, or (at your
43176 + * option) any later version.
43177 + */
43178 +#include <linux/init.h>
43179 +#include <linux/of_platform.h>
43180 +
43181 +#include <asm/machdep.h>
43182 +#include <asm/prom.h>
43183 +#include <asm/udbg.h>
43184 +#include <asm/time.h>
43185 +#include <asm/uic.h>
43186 +#include <asm/pci-bridge.h>
43187 +
43188 +#include "44x.h"
43189 +
43190 +static __initdata struct of_device_id katmai_of_bus[] = {
43191 +       { .compatible = "ibm,plb4", },
43192 +       { .compatible = "ibm,opb", },
43193 +       { .compatible = "ibm,ebc", },
43194 +       {},
43195 +};
43196 +
43197 +static int __init katmai_device_probe(void)
43198 +{
43199 +       of_platform_bus_probe(NULL, katmai_of_bus, NULL);
43200 +
43201 +       return 0;
43202 +}
43203 +machine_device_initcall(katmai, katmai_device_probe);
43204 +
43205 +static int __init katmai_probe(void)
43206 +{
43207 +       unsigned long root = of_get_flat_dt_root();
43208 +
43209 +       if (!of_flat_dt_is_compatible(root, "amcc,katmai"))
43210 +               return 0;
43211 +
43212 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43213 +
43214 +       return 1;
43215 +}
43216 +
43217 +define_machine(katmai) {
43218 +       .name                           = "Katmai",
43219 +       .probe                          = katmai_probe,
43220 +       .progress                       = udbg_progress,
43221 +       .init_IRQ                       = uic_init_tree,
43222 +       .get_irq                        = uic_get_irq,
43223 +       .restart                        = ppc44x_reset_system,
43224 +       .calibrate_decr                 = generic_calibrate_decr,
43225 +};
43226 --- /dev/null
43227 +++ b/arch/powerpc/platforms/44x/rainier.c
43228 @@ -0,0 +1,62 @@
43229 +/*
43230 + * Rainier board specific routines
43231 + *
43232 + * Valentine Barshak <vbarshak@ru.mvista.com>
43233 + * Copyright 2007 MontaVista Software Inc.
43234 + *
43235 + * Based on the Bamboo code by
43236 + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
43237 + * Copyright 2007 IBM Corporation
43238 + *
43239 + * This program is free software; you can redistribute  it and/or modify it
43240 + * under  the terms of  the GNU General  Public License as published by the
43241 + * Free Software Foundation;  either version 2 of the  License, or (at your
43242 + * option) any later version.
43243 + */
43244 +#include <linux/init.h>
43245 +#include <linux/of_platform.h>
43246 +
43247 +#include <asm/machdep.h>
43248 +#include <asm/prom.h>
43249 +#include <asm/udbg.h>
43250 +#include <asm/time.h>
43251 +#include <asm/uic.h>
43252 +#include <asm/pci-bridge.h>
43253 +#include "44x.h"
43254 +
43255 +static __initdata struct of_device_id rainier_of_bus[] = {
43256 +       { .compatible = "ibm,plb4", },
43257 +       { .compatible = "ibm,opb", },
43258 +       { .compatible = "ibm,ebc", },
43259 +       {},
43260 +};
43261 +
43262 +static int __init rainier_device_probe(void)
43263 +{
43264 +       of_platform_bus_probe(NULL, rainier_of_bus, NULL);
43265 +
43266 +       return 0;
43267 +}
43268 +machine_device_initcall(rainier, rainier_device_probe);
43269 +
43270 +static int __init rainier_probe(void)
43271 +{
43272 +       unsigned long root = of_get_flat_dt_root();
43273 +
43274 +       if (!of_flat_dt_is_compatible(root, "amcc,rainier"))
43275 +               return 0;
43276 +
43277 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43278 +
43279 +       return 1;
43280 +}
43281 +
43282 +define_machine(rainier) {
43283 +       .name                           = "Rainier",
43284 +       .probe                          = rainier_probe,
43285 +       .progress                       = udbg_progress,
43286 +       .init_IRQ                       = uic_init_tree,
43287 +       .get_irq                        = uic_get_irq,
43288 +       .restart                        = ppc44x_reset_system,
43289 +       .calibrate_decr                 = generic_calibrate_decr,
43290 +};
43291 --- a/arch/powerpc/platforms/44x/sequoia.c
43292 +++ b/arch/powerpc/platforms/44x/sequoia.c
43293 @@ -21,9 +21,11 @@
43294  #include <asm/udbg.h>
43295  #include <asm/time.h>
43296  #include <asm/uic.h>
43297 +#include <asm/pci-bridge.h>
43298 +
43299  #include "44x.h"
43300  
43301 -static struct of_device_id sequoia_of_bus[] = {
43302 +static __initdata struct of_device_id sequoia_of_bus[] = {
43303         { .compatible = "ibm,plb4", },
43304         { .compatible = "ibm,opb", },
43305         { .compatible = "ibm,ebc", },
43306 @@ -32,14 +34,11 @@
43307  
43308  static int __init sequoia_device_probe(void)
43309  {
43310 -       if (!machine_is(sequoia))
43311 -               return 0;
43312 -
43313         of_platform_bus_probe(NULL, sequoia_of_bus, NULL);
43314  
43315         return 0;
43316  }
43317 -device_initcall(sequoia_device_probe);
43318 +machine_device_initcall(sequoia, sequoia_device_probe);
43319  
43320  static int __init sequoia_probe(void)
43321  {
43322 @@ -48,6 +47,8 @@
43323         if (!of_flat_dt_is_compatible(root, "amcc,sequoia"))
43324                 return 0;
43325  
43326 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43327 +
43328         return 1;
43329  }
43330  
43331 --- /dev/null
43332 +++ b/arch/powerpc/platforms/44x/taishan.c
43333 @@ -0,0 +1,73 @@
43334 +/*
43335 + * Taishan board specific routines based off ebony.c code
43336 + * original copyrights below
43337 + *
43338 + * Matt Porter <mporter@kernel.crashing.org>
43339 + * Copyright 2002-2005 MontaVista Software Inc.
43340 + *
43341 + * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
43342 + * Copyright (c) 2003-2005 Zultys Technologies
43343 + *
43344 + * Rewritten and ported to the merged powerpc tree:
43345 + * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
43346 + *
43347 + * Modified from ebony.c for taishan:
43348 + * Copyright 2007 Hugh Blemings <hugh@au.ibm.com>, IBM Corporation.
43349 + *
43350 + * This program is free software; you can redistribute  it and/or modify it
43351 + * under  the terms of  the GNU General  Public License as published by the
43352 + * Free Software Foundation;  either version 2 of the  License, or (at your
43353 + * option) any later version.
43354 + */
43355 +
43356 +#include <linux/init.h>
43357 +#include <linux/of_platform.h>
43358 +
43359 +#include <asm/machdep.h>
43360 +#include <asm/prom.h>
43361 +#include <asm/udbg.h>
43362 +#include <asm/time.h>
43363 +#include <asm/uic.h>
43364 +#include <asm/pci-bridge.h>
43365 +
43366 +#include "44x.h"
43367 +
43368 +static __initdata struct of_device_id taishan_of_bus[] = {
43369 +       { .compatible = "ibm,plb4", },
43370 +       { .compatible = "ibm,opb", },
43371 +       { .compatible = "ibm,ebc", },
43372 +       {},
43373 +};
43374 +
43375 +static int __init taishan_device_probe(void)
43376 +{
43377 +       of_platform_bus_probe(NULL, taishan_of_bus, NULL);
43378 +
43379 +       return 0;
43380 +}
43381 +machine_device_initcall(taishan, taishan_device_probe);
43382 +
43383 +/*
43384 + * Called very early, MMU is off, device-tree isn't unflattened
43385 + */
43386 +static int __init taishan_probe(void)
43387 +{
43388 +       unsigned long root = of_get_flat_dt_root();
43389 +
43390 +       if (!of_flat_dt_is_compatible(root, "amcc,taishan"))
43391 +               return 0;
43392 +
43393 +       ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
43394 +
43395 +       return 1;
43396 +}
43397 +
43398 +define_machine(taishan) {
43399 +       .name                   = "Taishan",
43400 +       .probe                  = taishan_probe,
43401 +       .progress               = udbg_progress,
43402 +       .init_IRQ               = uic_init_tree,
43403 +       .get_irq                = uic_get_irq,
43404 +       .restart                = ppc44x_reset_system,
43405 +       .calibrate_decr         = generic_calibrate_decr,
43406 +};
43407 --- /dev/null
43408 +++ b/arch/powerpc/platforms/44x/warp-nand.c
43409 @@ -0,0 +1,105 @@
43410 +/*
43411 + * PIKA Warp(tm) NAND flash specific routines
43412 + *
43413 + * Copyright (c) 2008 PIKA Technologies
43414 + *   Sean MacLennan <smaclennan@pikatech.com>
43415 + */
43416 +
43417 +#include <linux/platform_device.h>
43418 +#include <linux/mtd/mtd.h>
43419 +#include <linux/mtd/map.h>
43420 +#include <linux/mtd/partitions.h>
43421 +#include <linux/mtd/nand.h>
43422 +#include <linux/mtd/ndfc.h>
43423 +
43424 +#ifdef CONFIG_MTD_NAND_NDFC
43425 +
43426 +#define CS_NAND_0      1       /* use chip select 1 for NAND device 0 */
43427 +
43428 +#define WARP_NAND_FLASH_REG_ADDR       0xD0000000UL
43429 +#define WARP_NAND_FLASH_REG_SIZE       0x2000
43430 +
43431 +static struct resource warp_ndfc = {
43432 +       .start = WARP_NAND_FLASH_REG_ADDR,
43433 +       .end   = WARP_NAND_FLASH_REG_ADDR + WARP_NAND_FLASH_REG_SIZE,
43434 +       .flags = IORESOURCE_MEM,
43435 +};
43436 +
43437 +static struct mtd_partition nand_parts[] = {
43438 +       {
43439 +               .name   = "kernel",
43440 +               .offset = 0,
43441 +               .size   = 0x0200000
43442 +       },
43443 +       {
43444 +               .name   = "root",
43445 +               .offset = 0x0200000,
43446 +               .size   = 0x3400000
43447 +       },
43448 +       {
43449 +               .name   = "user",
43450 +               .offset = 0x3600000,
43451 +               .size   = 0x0A00000
43452 +       },
43453 +};
43454 +
43455 +struct ndfc_controller_settings warp_ndfc_settings = {
43456 +       .ccr_settings = (NDFC_CCR_BS(CS_NAND_0) | NDFC_CCR_ARAC1),
43457 +       .ndfc_erpn = 0,
43458 +};
43459 +
43460 +static struct ndfc_chip_settings warp_chip0_settings = {
43461 +       .bank_settings = 0x80002222,
43462 +};
43463 +
43464 +struct platform_nand_ctrl warp_nand_ctrl = {
43465 +       .priv = &warp_ndfc_settings,
43466 +};
43467 +
43468 +static struct platform_device warp_ndfc_device = {
43469 +       .name = "ndfc-nand",
43470 +       .id = 0,
43471 +       .dev = {
43472 +               .platform_data = &warp_nand_ctrl,
43473 +       },
43474 +       .num_resources = 1,
43475 +       .resource = &warp_ndfc,
43476 +};
43477 +
43478 +static struct nand_ecclayout nand_oob_16 = {
43479 +       .eccbytes = 3,
43480 +       .eccpos = { 0, 1, 2, 3, 6, 7 },
43481 +       .oobfree = { {.offset = 8, .length = 16} }
43482 +};
43483 +
43484 +static struct platform_nand_chip warp_nand_chip0 = {
43485 +       .nr_chips = 1,
43486 +       .chip_offset = CS_NAND_0,
43487 +       .nr_partitions = ARRAY_SIZE(nand_parts),
43488 +       .partitions = nand_parts,
43489 +       .chip_delay = 50,
43490 +       .ecclayout = &nand_oob_16,
43491 +       .priv = &warp_chip0_settings,
43492 +};
43493 +
43494 +static struct platform_device warp_nand_device = {
43495 +       .name = "ndfc-chip",
43496 +       .id = 0,
43497 +       .num_resources = 1,
43498 +       .resource = &warp_ndfc,
43499 +       .dev = {
43500 +               .platform_data = &warp_nand_chip0,
43501 +               .parent = &warp_ndfc_device.dev,
43502 +       }
43503 +};
43504 +
43505 +static int warp_setup_nand_flash(void)
43506 +{
43507 +       platform_device_register(&warp_ndfc_device);
43508 +       platform_device_register(&warp_nand_device);
43509 +
43510 +       return 0;
43511 +}
43512 +device_initcall(warp_setup_nand_flash);
43513 +
43514 +#endif
43515 --- /dev/null
43516 +++ b/arch/powerpc/platforms/44x/warp.c
43517 @@ -0,0 +1,153 @@
43518 +/*
43519 + * PIKA Warp(tm) board specific routines
43520 + *
43521 + * Copyright (c) 2008 PIKA Technologies
43522 + *   Sean MacLennan <smaclennan@pikatech.com>
43523 + *
43524 + * This program is free software; you can redistribute  it and/or modify it
43525 + * under  the terms of  the GNU General  Public License as published by the
43526 + * Free Software Foundation;  either version 2 of the  License, or (at your
43527 + * option) any later version.
43528 + */
43529 +#include <linux/init.h>
43530 +#include <linux/of_platform.h>
43531 +#include <linux/kthread.h>
43532 +
43533 +#include <asm/machdep.h>
43534 +#include <asm/prom.h>
43535 +#include <asm/udbg.h>
43536 +#include <asm/time.h>
43537 +#include <asm/uic.h>
43538 +
43539 +#include "44x.h"
43540 +
43541 +
43542 +static __initdata struct of_device_id warp_of_bus[] = {
43543 +       { .compatible = "ibm,plb4", },
43544 +       { .compatible = "ibm,opb", },
43545 +       { .compatible = "ibm,ebc", },
43546 +       {},
43547 +};
43548 +
43549 +static int __init warp_device_probe(void)
43550 +{
43551 +       of_platform_bus_probe(NULL, warp_of_bus, NULL);
43552 +       return 0;
43553 +}
43554 +machine_device_initcall(warp, warp_device_probe);
43555 +
43556 +static int __init warp_probe(void)
43557 +{
43558 +       unsigned long root = of_get_flat_dt_root();
43559 +
43560 +       return of_flat_dt_is_compatible(root, "pika,warp");
43561 +}
43562 +
43563 +define_machine(warp) {
43564 +       .name           = "Warp",
43565 +       .probe          = warp_probe,
43566 +       .progress       = udbg_progress,
43567 +       .init_IRQ       = uic_init_tree,
43568 +       .get_irq        = uic_get_irq,
43569 +       .restart        = ppc44x_reset_system,
43570 +       .calibrate_decr = generic_calibrate_decr,
43571 +};
43572 +
43573 +
43574 +#define LED_GREEN (0x80000000 >> 0)
43575 +#define LED_RED   (0x80000000 >> 1)
43576 +
43577 +
43578 +/* This is for the power LEDs 1 = on, 0 = off, -1 = leave alone */
43579 +void warp_set_power_leds(int green, int red)
43580 +{
43581 +       static void __iomem *gpio_base = NULL;
43582 +       unsigned leds;
43583 +
43584 +       if (gpio_base == NULL) {
43585 +               struct device_node *np;
43586 +
43587 +               /* Power LEDS are on the second GPIO controller */
43588 +               np = of_find_compatible_node(NULL, NULL, "ibm,gpio-440EP");
43589 +               if (np)
43590 +                       np = of_find_compatible_node(np, NULL, "ibm,gpio-440EP");
43591 +               if (np == NULL) {
43592 +                       printk(KERN_ERR __FILE__ ": Unable to find gpio\n");
43593 +                       return;
43594 +               }
43595 +
43596 +               gpio_base = of_iomap(np, 0);
43597 +               of_node_put(np);
43598 +               if (gpio_base == NULL) {
43599 +                       printk(KERN_ERR __FILE__ ": Unable to map gpio");
43600 +                       return;
43601 +               }
43602 +       }
43603 +
43604 +       leds = in_be32(gpio_base);
43605 +
43606 +       switch (green) {
43607 +       case 0: leds &= ~LED_GREEN; break;
43608 +       case 1: leds |=  LED_GREEN; break;
43609 +       }
43610 +       switch (red) {
43611 +       case 0: leds &= ~LED_RED; break;
43612 +       case 1: leds |=  LED_RED; break;
43613 +       }
43614 +
43615 +       out_be32(gpio_base, leds);
43616 +}
43617 +EXPORT_SYMBOL(warp_set_power_leds);
43618 +
43619 +
43620 +#ifdef CONFIG_SENSORS_AD7414
43621 +static int pika_dtm_thread(void __iomem *fpga)
43622 +{
43623 +       extern int ad7414_get_temp(int index);
43624 +
43625 +       while (!kthread_should_stop()) {
43626 +               int temp = ad7414_get_temp(0);
43627 +
43628 +               out_be32(fpga, temp);
43629 +
43630 +               set_current_state(TASK_INTERRUPTIBLE);
43631 +               schedule_timeout(HZ);
43632 +       }
43633 +
43634 +       return 0;
43635 +}
43636 +
43637 +static int __init pika_dtm_start(void)
43638 +{
43639 +       struct task_struct *dtm_thread;
43640 +       struct device_node *np;
43641 +       struct resource res;
43642 +       void __iomem *fpga;
43643 +
43644 +       np = of_find_compatible_node(NULL, NULL, "pika,fpga");
43645 +       if (np == NULL)
43646 +               return -ENOENT;
43647 +
43648 +       /* We do not call of_iomap here since it would map in the entire
43649 +        * fpga space, which is over 8k.
43650 +        */
43651 +       if (of_address_to_resource(np, 0, &res)) {
43652 +               of_node_put(np);
43653 +               return -ENOENT;
43654 +       }
43655 +       of_node_put(np);
43656 +
43657 +       fpga = ioremap(res.start + 0x20, 4);
43658 +       if (fpga == NULL)
43659 +               return -ENOENT;
43660 +
43661 +       dtm_thread = kthread_run(pika_dtm_thread, fpga + 0x20, "pika-dtm");
43662 +       if (IS_ERR(dtm_thread)) {
43663 +               iounmap(fpga);
43664 +               return PTR_ERR(dtm_thread);
43665 +       }
43666 +
43667 +       return 0;
43668 +}
43669 +device_initcall(pika_dtm_start);
43670 +#endif
43671 --- a/arch/powerpc/platforms/52xx/Kconfig
43672 +++ b/arch/powerpc/platforms/52xx/Kconfig
43673 @@ -19,6 +19,28 @@
43674  
43675           It is safe to say 'Y' here
43676  
43677 +config PPC_MPC5200_SIMPLE
43678 +       bool "Generic support for simple MPC5200 based boards"
43679 +       depends on PPC_MULTIPLATFORM && PPC32
43680 +       select PPC_MPC5200
43681 +       select DEFAULT_UIMAGE
43682 +       select WANT_DEVICE_TREE
43683 +       default n
43684 +       help
43685 +         This option enables support for a simple MPC52xx based boards which
43686 +         do not need a custom platform specific setup. Such boards are
43687 +         supported assuming the following:
43688 +
43689 +         - GPIO pins are configured by the firmware,
43690 +         - CDM configuration (clocking) is setup correctly by firmware,
43691 +         - if the 'fsl,has-wdt' property is present in one of the
43692 +           gpt nodes, then it is safe to use such gpt to reset the board,
43693 +         - PCI is supported if enabled in the kernel configuration
43694 +           and if there is a PCI bus node defined in the device tree.
43695 +
43696 +         Boards that are compatible with this generic platform support
43697 +         are: 'tqc,tqm5200', 'promess,motionpro', 'schindler,cm5200'.
43698 +
43699  config PPC_EFIKA
43700         bool "bPlan Efika 5k2. MPC5200B based computer"
43701         depends on PPC_MULTIPLATFORM && PPC32
43702 @@ -31,8 +53,7 @@
43703  config PPC_LITE5200
43704         bool "Freescale Lite5200 Eval Board"
43705         depends on PPC_MULTIPLATFORM && PPC32
43706 -       select WANT_DEVICE_TREE
43707         select PPC_MPC5200
43708 +       select DEFAULT_UIMAGE
43709 +       select WANT_DEVICE_TREE
43710         default n
43711 -
43712 -
43713 --- a/arch/powerpc/platforms/52xx/Makefile
43714 +++ b/arch/powerpc/platforms/52xx/Makefile
43715 @@ -6,6 +6,7 @@
43716  obj-$(CONFIG_PCI)              += mpc52xx_pci.o
43717  endif
43718  
43719 +obj-$(CONFIG_PPC_MPC5200_SIMPLE) += mpc5200_simple.o
43720  obj-$(CONFIG_PPC_EFIKA)                += efika.o
43721  obj-$(CONFIG_PPC_LITE5200)     += lite5200.o
43722  
43723 --- a/arch/powerpc/platforms/52xx/lite5200.c
43724 +++ b/arch/powerpc/platforms/52xx/lite5200.c
43725 @@ -42,10 +42,13 @@
43726  static void __init
43727  lite5200_fix_clock_config(void)
43728  {
43729 +       struct device_node *np;
43730         struct mpc52xx_cdm  __iomem *cdm;
43731  
43732         /* Map zones */
43733 -       cdm = mpc52xx_find_and_map("mpc5200-cdm");
43734 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-cdm");
43735 +       cdm = of_iomap(np, 0);
43736 +       of_node_put(np);
43737         if (!cdm) {
43738                 printk(KERN_ERR "%s() failed; expect abnormal behaviour\n",
43739                        __FUNCTION__);
43740 @@ -74,10 +77,13 @@
43741  static void __init
43742  lite5200_fix_port_config(void)
43743  {
43744 +       struct device_node *np;
43745         struct mpc52xx_gpio __iomem *gpio;
43746         u32 port_config;
43747  
43748 -       gpio = mpc52xx_find_and_map("mpc5200-gpio");
43749 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-gpio");
43750 +       gpio = of_iomap(np, 0);
43751 +       of_node_put(np);
43752         if (!gpio) {
43753                 printk(KERN_ERR "%s() failed. expect abnormal behavior\n",
43754                        __FUNCTION__);
43755 @@ -131,10 +137,6 @@
43756  
43757  static void __init lite5200_setup_arch(void)
43758  {
43759 -#ifdef CONFIG_PCI
43760 -       struct device_node *np;
43761 -#endif
43762 -
43763         if (ppc_md.progress)
43764                 ppc_md.progress("lite5200_setup_arch()", 0);
43765  
43766 @@ -154,13 +156,7 @@
43767         lite5200_pm_init();
43768  #endif
43769  
43770 -#ifdef CONFIG_PCI
43771 -       np = of_find_node_by_type(NULL, "pci");
43772 -       if (np) {
43773 -               mpc52xx_add_bridge(np);
43774 -               of_node_put(np);
43775 -       }
43776 -#endif
43777 +       mpc52xx_setup_pci();
43778  }
43779  
43780  /*
43781 --- a/arch/powerpc/platforms/52xx/lite5200_pm.c
43782 +++ b/arch/powerpc/platforms/52xx/lite5200_pm.c
43783 @@ -42,6 +42,8 @@
43784  
43785  static int lite5200_pm_prepare(void)
43786  {
43787 +       struct device_node *np;
43788 +
43789         /* deep sleep? let mpc52xx code handle that */
43790         if (lite5200_pm_target_state == PM_SUSPEND_STANDBY)
43791                 return mpc52xx_pm_prepare();
43792 @@ -50,7 +52,9 @@
43793                 return -EINVAL;
43794  
43795         /* map registers */
43796 -       mbar = mpc52xx_find_and_map("mpc5200");
43797 +       np = of_find_compatible_node(NULL, NULL, "mpc5200");
43798 +       mbar = of_iomap(np, 0);
43799 +       of_node_put(np);
43800         if (!mbar) {
43801                 printk(KERN_ERR "%s:%i Error mapping registers\n", __func__, __LINE__);
43802                 return -ENOSYS;
43803 --- /dev/null
43804 +++ b/arch/powerpc/platforms/52xx/mpc5200_simple.c
43805 @@ -0,0 +1,85 @@
43806 +/*
43807 + * Support for 'mpc5200-simple-platform' compatible boards.
43808 + *
43809 + * Written by Marian Balakowicz <m8@semihalf.com>
43810 + * Copyright (C) 2007 Semihalf
43811 + *
43812 + * This program is free software; you can redistribute  it and/or modify it
43813 + * under  the terms of  the GNU General  Public License as published by the
43814 + * Free Software Foundation;  either version 2 of the  License, or (at your
43815 + * option) any later version.
43816 + *
43817 + * Description:
43818 + * This code implements support for a simple MPC52xx based boards which
43819 + * do not need a custom platform specific setup. Such boards are
43820 + * supported assuming the following:
43821 + *
43822 + * - GPIO pins are configured by the firmware,
43823 + * - CDM configuration (clocking) is setup correctly by firmware,
43824 + * - if the 'fsl,has-wdt' property is present in one of the
43825 + *   gpt nodes, then it is safe to use such gpt to reset the board,
43826 + * - PCI is supported if enabled in the kernel configuration
43827 + *   and if there is a PCI bus node defined in the device tree.
43828 + *
43829 + * Boards that are compatible with this generic platform support
43830 + * are listed in a 'board' table.
43831 + */
43832 +
43833 +#undef DEBUG
43834 +#include <asm/time.h>
43835 +#include <asm/prom.h>
43836 +#include <asm/machdep.h>
43837 +#include <asm/mpc52xx.h>
43838 +
43839 +/*
43840 + * Setup the architecture
43841 + */
43842 +static void __init mpc5200_simple_setup_arch(void)
43843 +{
43844 +       if (ppc_md.progress)
43845 +               ppc_md.progress("mpc5200_simple_setup_arch()", 0);
43846 +
43847 +       /* Some mpc5200 & mpc5200b related configuration */
43848 +       mpc5200_setup_xlb_arbiter();
43849 +
43850 +       /* Map wdt for mpc52xx_restart() */
43851 +       mpc52xx_map_wdt();
43852 +
43853 +       mpc52xx_setup_pci();
43854 +}
43855 +
43856 +/* list of the supported boards */
43857 +static char *board[] __initdata = {
43858 +       "promess,motionpro",
43859 +       "schindler,cm5200",
43860 +       "tqc,tqm5200",
43861 +       NULL
43862 +};
43863 +
43864 +/*
43865 + * Called very early, MMU is off, device-tree isn't unflattened
43866 + */
43867 +static int __init mpc5200_simple_probe(void)
43868 +{
43869 +       unsigned long node = of_get_flat_dt_root();
43870 +       int i = 0;
43871 +
43872 +       while (board[i]) {
43873 +               if (of_flat_dt_is_compatible(node, board[i]))
43874 +                       break;
43875 +               i++;
43876 +       }
43877 +       
43878 +       return (board[i] != NULL);
43879 +}
43880 +
43881 +define_machine(mpc5200_simple_platform) {
43882 +       .name           = "mpc5200-simple-platform",
43883 +       .probe          = mpc5200_simple_probe,
43884 +       .setup_arch     = mpc5200_simple_setup_arch,
43885 +       .init           = mpc52xx_declare_of_platform_devices,
43886 +       .init_IRQ       = mpc52xx_init_irq,
43887 +       .get_irq        = mpc52xx_get_irq,
43888 +       .restart        = mpc52xx_restart,
43889 +       .calibrate_decr = generic_calibrate_decr,
43890 +};
43891 --- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
43892 +++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
43893 @@ -26,45 +26,6 @@
43894   */
43895  static volatile struct mpc52xx_gpt *mpc52xx_wdt = NULL;
43896  
43897 -static void __iomem *
43898 -mpc52xx_map_node(struct device_node *ofn)
43899 -{
43900 -       const u32 *regaddr_p;
43901 -       u64 regaddr64, size64;
43902 -
43903 -       if (!ofn)
43904 -               return NULL;
43905 -
43906 -       regaddr_p = of_get_address(ofn, 0, &size64, NULL);
43907 -       if (!regaddr_p) {
43908 -               of_node_put(ofn);
43909 -               return NULL;
43910 -       }
43911 -
43912 -       regaddr64 = of_translate_address(ofn, regaddr_p);
43913 -
43914 -       of_node_put(ofn);
43915 -
43916 -       return ioremap((u32)regaddr64, (u32)size64);
43917 -}
43918 -
43919 -void __iomem *
43920 -mpc52xx_find_and_map(const char *compatible)
43921 -{
43922 -       return mpc52xx_map_node(
43923 -               of_find_compatible_node(NULL, NULL, compatible));
43924 -}
43925 -
43926 -EXPORT_SYMBOL(mpc52xx_find_and_map);
43927 -
43928 -void __iomem *
43929 -mpc52xx_find_and_map_path(const char *path)
43930 -{
43931 -       return mpc52xx_map_node(of_find_node_by_path(path));
43932 -}
43933 -
43934 -EXPORT_SYMBOL(mpc52xx_find_and_map_path);
43935 -
43936  /**
43937   *     mpc52xx_find_ipb_freq - Find the IPB bus frequency for a device
43938   *     @node:  device node
43939 @@ -101,9 +62,12 @@
43940  void __init
43941  mpc5200_setup_xlb_arbiter(void)
43942  {
43943 +       struct device_node *np;
43944         struct mpc52xx_xlb  __iomem *xlb;
43945  
43946 -       xlb = mpc52xx_find_and_map("mpc5200-xlb");
43947 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-xlb");
43948 +       xlb = of_iomap(np, 0);
43949 +       of_node_put(np);
43950         if (!xlb) {
43951                 printk(KERN_ERR __FILE__ ": "
43952                         "Error mapping XLB in mpc52xx_setup_cpu().  "
43953 @@ -124,11 +88,21 @@
43954         iounmap(xlb);
43955  }
43956  
43957 +static struct of_device_id mpc52xx_bus_ids[] __initdata= {
43958 +       { .compatible = "fsl,mpc5200-immr", },
43959 +       { .compatible = "fsl,lpb", },
43960 +
43961 +       /* depreciated matches; shouldn't be used in new device trees */
43962 +       { .type = "builtin", .compatible = "mpc5200", }, /* efika */
43963 +       { .type = "soc", .compatible = "mpc5200", }, /* lite5200 */
43964 +       {},
43965 +};
43966 +
43967  void __init
43968  mpc52xx_declare_of_platform_devices(void)
43969  {
43970         /* Find every child of the SOC node and add it to of_platform */
43971 -       if (of_platform_bus_probe(NULL, NULL, NULL))
43972 +       if (of_platform_bus_probe(NULL, mpc52xx_bus_ids, NULL))
43973                 printk(KERN_ERR __FILE__ ": "
43974                         "Error while probing of_platform bus\n");
43975  }
43976 @@ -146,16 +120,19 @@
43977         for_each_compatible_node(np, NULL, "fsl,mpc5200-gpt") {
43978                 has_wdt = of_get_property(np, "fsl,has-wdt", NULL);
43979                 if (has_wdt) {
43980 -                       mpc52xx_wdt = mpc52xx_map_node(np);
43981 +                       mpc52xx_wdt = of_iomap(np, 0);
43982 +                       of_node_put(np);
43983                         return;
43984                 }
43985         }
43986         for_each_compatible_node(np, NULL, "mpc5200-gpt") {
43987                 has_wdt = of_get_property(np, "has-wdt", NULL);
43988                 if (has_wdt) {
43989 -                       mpc52xx_wdt = mpc52xx_map_node(np);
43990 +                       mpc52xx_wdt = of_iomap(np, 0);
43991 +                       of_node_put(np);
43992                         return;
43993                 }
43994 +
43995         }
43996  }
43997  
43998 --- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c
43999 +++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
44000 @@ -363,7 +363,7 @@
44001  
44002         pr_debug("Adding MPC52xx PCI host bridge %s\n", node->full_name);
44003  
44004 -       pci_assign_all_buses = 1;
44005 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
44006  
44007         if (of_address_to_resource(node, 0, &rsrc) != 0) {
44008                 printk(KERN_ERR "Can't get %s resources\n", node->full_name);
44009 @@ -406,3 +406,17 @@
44010  
44011         return 0;
44012  }
44013 +
44014 +void __init mpc52xx_setup_pci(void)
44015 +{
44016 +       struct device_node *pci;
44017 +
44018 +       pci = of_find_compatible_node(NULL, NULL, "fsl,mpc5200-pci");
44019 +       if (!pci)
44020 +               pci = of_find_compatible_node(NULL, NULL, "mpc5200-pci");
44021 +       if (!pci)
44022 +               return;
44023 +
44024 +       mpc52xx_add_bridge(pci);
44025 +       of_node_put(pci);
44026 +}
44027 --- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c
44028 +++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c
44029 @@ -364,16 +364,18 @@
44030  {
44031         u32 intr_ctrl;
44032         struct device_node *picnode;
44033 +       struct device_node *np;
44034  
44035         /* Remap the necessary zones */
44036         picnode = of_find_compatible_node(NULL, NULL, "mpc5200-pic");
44037 -
44038 -       intr = mpc52xx_find_and_map("mpc5200-pic");
44039 +       intr = of_iomap(picnode, 0);
44040         if (!intr)
44041                 panic(__FILE__  ": find_and_map failed on 'mpc5200-pic'. "
44042                                 "Check node !");
44043  
44044 -       sdma = mpc52xx_find_and_map("mpc5200-bestcomm");
44045 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-bestcomm");
44046 +       sdma = of_iomap(np, 0);
44047 +       of_node_put(np);
44048         if (!sdma)
44049                 panic(__FILE__  ": find_and_map failed on 'mpc5200-bestcomm'. "
44050                                 "Check node !");
44051 --- a/arch/powerpc/platforms/52xx/mpc52xx_pm.c
44052 +++ b/arch/powerpc/platforms/52xx/mpc52xx_pm.c
44053 @@ -59,10 +59,14 @@
44054  
44055  int mpc52xx_pm_prepare(void)
44056  {
44057 +       struct device_node *np;
44058 +
44059         /* map the whole register space */
44060 -       mbar = mpc52xx_find_and_map("mpc5200");
44061 +       np = of_find_compatible_node(NULL, NULL, "mpc5200");
44062 +       mbar = of_iomap(np, 0);
44063 +       of_node_put(np);
44064         if (!mbar) {
44065 -               printk(KERN_ERR "%s:%i Error mapping registers\n", __func__, __LINE__);
44066 +               pr_err("mpc52xx_pm_prepare(): could not map registers\n");
44067                 return -ENOSYS;
44068         }
44069         /* these offsets are from mpc5200 users manual */
44070 --- a/arch/powerpc/platforms/82xx/Kconfig
44071 +++ b/arch/powerpc/platforms/82xx/Kconfig
44072 @@ -26,6 +26,19 @@
44073         help
44074           This option enables support for the PQ2FADS board
44075  
44076 +config EP8248E
44077 +       bool "Embedded Planet EP8248E (a.k.a. CWH-PPC-8248N-VE)"
44078 +       select 8272
44079 +       select 8260
44080 +       select FSL_SOC
44081 +       select PPC_CPM_NEW_BINDING
44082 +       select MDIO_BITBANG
44083 +       help
44084 +         This enables support for the Embedded Planet EP8248E board.
44085 +
44086 +         This board is also resold by Freescale as the QUICCStart
44087 +         MPC8248 Evaluation System and/or the CWH-PPC-8248N-VE.
44088 +
44089  endchoice
44090  
44091  config PQ2ADS
44092 --- a/arch/powerpc/platforms/82xx/Makefile
44093 +++ b/arch/powerpc/platforms/82xx/Makefile
44094 @@ -5,3 +5,4 @@
44095  obj-$(CONFIG_CPM2) += pq2.o
44096  obj-$(CONFIG_PQ2_ADS_PCI_PIC) += pq2ads-pci-pic.o
44097  obj-$(CONFIG_PQ2FADS) += pq2fads.o
44098 +obj-$(CONFIG_EP8248E) += ep8248e.o
44099 --- /dev/null
44100 +++ b/arch/powerpc/platforms/82xx/ep8248e.c
44101 @@ -0,0 +1,324 @@
44102 +/*
44103 + * Embedded Planet EP8248E support
44104 + *
44105 + * Copyright 2007 Freescale Semiconductor, Inc.
44106 + * Author: Scott Wood <scottwood@freescale.com>
44107 + *
44108 + * This program is free software; you can redistribute  it and/or modify it
44109 + * under  the terms of  the GNU General  Public License as published by the
44110 + * Free Software Foundation;  either version 2 of the  License, or (at your
44111 + * option) any later version.
44112 + */
44113 +
44114 +#include <linux/init.h>
44115 +#include <linux/interrupt.h>
44116 +#include <linux/fsl_devices.h>
44117 +#include <linux/mdio-bitbang.h>
44118 +#include <linux/of_platform.h>
44119 +
44120 +#include <asm/io.h>
44121 +#include <asm/cpm2.h>
44122 +#include <asm/udbg.h>
44123 +#include <asm/machdep.h>
44124 +#include <asm/time.h>
44125 +#include <asm/mpc8260.h>
44126 +#include <asm/prom.h>
44127 +
44128 +#include <sysdev/fsl_soc.h>
44129 +#include <sysdev/cpm2_pic.h>
44130 +
44131 +#include "pq2.h"
44132 +
44133 +static u8 __iomem *ep8248e_bcsr;
44134 +static struct device_node *ep8248e_bcsr_node;
44135 +
44136 +#define BCSR7_SCC2_ENABLE 0x10
44137 +
44138 +#define BCSR8_PHY1_ENABLE 0x80
44139 +#define BCSR8_PHY1_POWER  0x40
44140 +#define BCSR8_PHY2_ENABLE 0x20
44141 +#define BCSR8_PHY2_POWER  0x10
44142 +#define BCSR8_MDIO_READ   0x04
44143 +#define BCSR8_MDIO_CLOCK  0x02
44144 +#define BCSR8_MDIO_DATA   0x01
44145 +
44146 +#define BCSR9_USB_ENABLE  0x80
44147 +#define BCSR9_USB_POWER   0x40
44148 +#define BCSR9_USB_HOST    0x20
44149 +#define BCSR9_USB_FULL_SPEED_TARGET 0x10
44150 +
44151 +static void __init ep8248e_pic_init(void)
44152 +{
44153 +       struct device_node *np = of_find_compatible_node(NULL, NULL, "fsl,pq2-pic");
44154 +       if (!np) {
44155 +               printk(KERN_ERR "PIC init: can not find cpm-pic node\n");
44156 +               return;
44157 +       }
44158 +
44159 +       cpm2_pic_init(np);
44160 +       of_node_put(np);
44161 +}
44162 +
44163 +static void ep8248e_set_mdc(struct mdiobb_ctrl *ctrl, int level)
44164 +{
44165 +       if (level)
44166 +               setbits8(&ep8248e_bcsr[8], BCSR8_MDIO_CLOCK);
44167 +       else
44168 +               clrbits8(&ep8248e_bcsr[8], BCSR8_MDIO_CLOCK);
44169 +
44170 +       /* Read back to flush the write. */
44171 +       in_8(&ep8248e_bcsr[8]);
44172 +}
44173 +
44174 +static void ep8248e_set_mdio_dir(struct mdiobb_ctrl *ctrl, int output)
44175 +{
44176 +       if (output)
44177 +               clrbits8(&ep8248e_bcsr[8], BCSR8_MDIO_READ);
44178 +       else
44179 +               setbits8(&ep8248e_bcsr[8], BCSR8_MDIO_READ);
44180 +
44181 +       /* Read back to flush the write. */
44182 +       in_8(&ep8248e_bcsr[8]);
44183 +}
44184 +
44185 +static void ep8248e_set_mdio_data(struct mdiobb_ctrl *ctrl, int data)
44186 +{
44187 +       if (data)
44188 +               setbits8(&ep8248e_bcsr[8], BCSR8_MDIO_DATA);
44189 +       else
44190 +               clrbits8(&ep8248e_bcsr[8], BCSR8_MDIO_DATA);
44191 +
44192 +       /* Read back to flush the write. */
44193 +       in_8(&ep8248e_bcsr[8]);
44194 +}
44195 +
44196 +static int ep8248e_get_mdio_data(struct mdiobb_ctrl *ctrl)
44197 +{
44198 +       return in_8(&ep8248e_bcsr[8]) & BCSR8_MDIO_DATA;
44199 +}
44200 +
44201 +static const struct mdiobb_ops ep8248e_mdio_ops = {
44202 +       .set_mdc = ep8248e_set_mdc,
44203 +       .set_mdio_dir = ep8248e_set_mdio_dir,
44204 +       .set_mdio_data = ep8248e_set_mdio_data,
44205 +       .get_mdio_data = ep8248e_get_mdio_data,
44206 +       .owner = THIS_MODULE,
44207 +};
44208 +
44209 +static struct mdiobb_ctrl ep8248e_mdio_ctrl = {
44210 +       .ops = &ep8248e_mdio_ops,
44211 +};
44212 +
44213 +static int __devinit ep8248e_mdio_probe(struct of_device *ofdev,
44214 +                                        const struct of_device_id *match)
44215 +{
44216 +       struct mii_bus *bus;
44217 +       struct resource res;
44218 +       struct device_node *node;
44219 +       int ret, i;
44220 +
44221 +       node = of_get_parent(ofdev->node);
44222 +       of_node_put(node);
44223 +       if (node != ep8248e_bcsr_node)
44224 +               return -ENODEV;
44225 +
44226 +       ret = of_address_to_resource(ofdev->node, 0, &res);
44227 +       if (ret)
44228 +               return ret;
44229 +
44230 +       bus = alloc_mdio_bitbang(&ep8248e_mdio_ctrl);
44231 +       if (!bus)
44232 +               return -ENOMEM;
44233 +
44234 +       bus->phy_mask = 0;
44235 +       bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
44236 +
44237 +       for (i = 0; i < PHY_MAX_ADDR; i++)
44238 +               bus->irq[i] = -1;
44239 +
44240 +       bus->name = "ep8248e-mdio-bitbang";
44241 +       bus->dev = &ofdev->dev;
44242 +       bus->id = res.start;
44243 +
44244 +       return mdiobus_register(bus);
44245 +}
44246 +
44247 +static int ep8248e_mdio_remove(struct of_device *ofdev)
44248 +{
44249 +       BUG();
44250 +       return 0;
44251 +}
44252 +
44253 +static const struct of_device_id ep8248e_mdio_match[] = {
44254 +       {
44255 +               .compatible = "fsl,ep8248e-mdio-bitbang",
44256 +       },
44257 +       {},
44258 +};
44259 +
44260 +static struct of_platform_driver ep8248e_mdio_driver = {
44261 +       .driver = {
44262 +               .name = "ep8248e-mdio-bitbang",
44263 +       },
44264 +       .match_table = ep8248e_mdio_match,
44265 +       .probe = ep8248e_mdio_probe,
44266 +       .remove = ep8248e_mdio_remove,
44267 +};
44268 +
44269 +struct cpm_pin {
44270 +       int port, pin, flags;
44271 +};
44272 +
44273 +static __initdata struct cpm_pin ep8248e_pins[] = {
44274 +       /* SMC1 */
44275 +       {2, 4, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44276 +       {2, 5, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44277 +
44278 +       /* SCC1 */
44279 +       {2, 14, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44280 +       {2, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44281 +       {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44282 +       {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
44283 +       {3, 31, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44284 +
44285 +       /* FCC1 */
44286 +       {0, 14, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44287 +       {0, 15, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44288 +       {0, 16, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44289 +       {0, 17, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44290 +       {0, 18, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44291 +       {0, 19, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44292 +       {0, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44293 +       {0, 21, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44294 +       {0, 26, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44295 +       {0, 27, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44296 +       {0, 28, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
44297 +       {0, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
44298 +       {0, 30, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44299 +       {0, 31, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44300 +       {2, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44301 +       {2, 22, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44302 +
44303 +       /* FCC2 */
44304 +       {1, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44305 +       {1, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44306 +       {1, 20, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44307 +       {1, 21, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44308 +       {1, 22, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44309 +       {1, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44310 +       {1, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44311 +       {1, 25, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44312 +       {1, 26, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44313 +       {1, 27, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44314 +       {1, 28, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44315 +       {1, 29, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
44316 +       {1, 30, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44317 +       {1, 31, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44318 +       {2, 18, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44319 +       {2, 19, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44320 +
44321 +       /* I2C */
44322 +       {4, 14, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44323 +       {4, 15, CPM_PIN_INPUT | CPM_PIN_SECONDARY},
44324 +
44325 +       /* USB */
44326 +       {2, 10, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44327 +       {2, 11, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44328 +       {2, 20, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44329 +       {2, 24, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44330 +       {3, 23, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44331 +       {3, 24, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
44332 +       {3, 25, CPM_PIN_INPUT | CPM_PIN_PRIMARY},
44333 +};
44334 +
44335 +static void __init init_ioports(void)
44336 +{
44337 +       int i;
44338 +
44339 +       for (i = 0; i < ARRAY_SIZE(ep8248e_pins); i++) {
44340 +               const struct cpm_pin *pin = &ep8248e_pins[i];
44341 +               cpm2_set_pin(pin->port, pin->pin, pin->flags);
44342 +       }
44343 +
44344 +       cpm2_smc_clk_setup(CPM_CLK_SMC1, CPM_BRG7);
44345 +       cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_RX);
44346 +       cpm2_clk_setup(CPM_CLK_SCC1, CPM_BRG1, CPM_CLK_TX);
44347 +       cpm2_clk_setup(CPM_CLK_SCC3, CPM_CLK8, CPM_CLK_TX); /* USB */
44348 +       cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK11, CPM_CLK_RX);
44349 +       cpm2_clk_setup(CPM_CLK_FCC1, CPM_CLK10, CPM_CLK_TX);
44350 +       cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK13, CPM_CLK_RX);
44351 +       cpm2_clk_setup(CPM_CLK_FCC2, CPM_CLK14, CPM_CLK_TX);
44352 +}
44353 +
44354 +static void __init ep8248e_setup_arch(void)
44355 +{
44356 +       if (ppc_md.progress)
44357 +               ppc_md.progress("ep8248e_setup_arch()", 0);
44358 +
44359 +       cpm2_reset();
44360 +
44361 +       /* When this is set, snooping CPM DMA from RAM causes
44362 +        * machine checks.  See erratum SIU18.
44363 +        */
44364 +       clrbits32(&cpm2_immr->im_siu_conf.siu_82xx.sc_bcr, MPC82XX_BCR_PLDP);
44365 +
44366 +       ep8248e_bcsr_node =
44367 +               of_find_compatible_node(NULL, NULL, "fsl,ep8248e-bcsr");
44368 +       if (!ep8248e_bcsr_node) {
44369 +               printk(KERN_ERR "No bcsr in device tree\n");
44370 +               return;
44371 +       }
44372 +
44373 +       ep8248e_bcsr = of_iomap(ep8248e_bcsr_node, 0);
44374 +       if (!ep8248e_bcsr) {
44375 +               printk(KERN_ERR "Cannot map BCSR registers\n");
44376 +               of_node_put(ep8248e_bcsr_node);
44377 +               ep8248e_bcsr_node = NULL;
44378 +               return;
44379 +       }
44380 +
44381 +       setbits8(&ep8248e_bcsr[7], BCSR7_SCC2_ENABLE);
44382 +       setbits8(&ep8248e_bcsr[8], BCSR8_PHY1_ENABLE | BCSR8_PHY1_POWER |
44383 +                                  BCSR8_PHY2_ENABLE | BCSR8_PHY2_POWER);
44384 +
44385 +       init_ioports();
44386 +
44387 +       if (ppc_md.progress)
44388 +               ppc_md.progress("ep8248e_setup_arch(), finish", 0);
44389 +}
44390 +
44391 +static  __initdata struct of_device_id of_bus_ids[] = {
44392 +       { .compatible = "simple-bus", },
44393 +       { .compatible = "fsl,ep8248e-bcsr", },
44394 +       {},
44395 +};
44396 +
44397 +static int __init declare_of_platform_devices(void)
44398 +{
44399 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
44400 +       of_register_platform_driver(&ep8248e_mdio_driver);
44401 +
44402 +       return 0;
44403 +}
44404 +machine_device_initcall(ep8248e, declare_of_platform_devices);
44405 +
44406 +/*
44407 + * Called very early, device-tree isn't unflattened
44408 + */
44409 +static int __init ep8248e_probe(void)
44410 +{
44411 +       unsigned long root = of_get_flat_dt_root();
44412 +       return of_flat_dt_is_compatible(root, "fsl,ep8248e");
44413 +}
44414 +
44415 +define_machine(ep8248e)
44416 +{
44417 +       .name = "Embedded Planet EP8248E",
44418 +       .probe = ep8248e_probe,
44419 +       .setup_arch = ep8248e_setup_arch,
44420 +       .init_IRQ = ep8248e_pic_init,
44421 +       .get_irq = cpm2_get_irq,
44422 +       .calibrate_decr = generic_calibrate_decr,
44423 +       .restart = pq2_restart,
44424 +       .progress = udbg_progress,
44425 +};
44426 --- a/arch/powerpc/platforms/82xx/pq2.c
44427 +++ b/arch/powerpc/platforms/82xx/pq2.c
44428 @@ -53,13 +53,13 @@
44429         if (of_address_to_resource(np, 0, &r) || r.end - r.start < 0x10b)
44430                 goto err;
44431  
44432 -       pci_assign_all_buses = 1;
44433 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
44434  
44435         hose = pcibios_alloc_controller(np);
44436         if (!hose)
44437                 return;
44438  
44439 -       hose->arch_data = np;
44440 +       hose->dn = np;
44441  
44442         setup_indirect_pci(hose, r.start + 0x100, r.start + 0x104, 0);
44443         pci_process_bridge_OF_ranges(hose, np, 1);
44444 --- a/arch/powerpc/platforms/82xx/pq2fads.c
44445 +++ b/arch/powerpc/platforms/82xx/pq2fads.c
44446 @@ -15,12 +15,12 @@
44447  #include <linux/init.h>
44448  #include <linux/interrupt.h>
44449  #include <linux/fsl_devices.h>
44450 +#include <linux/of_platform.h>
44451  
44452  #include <asm/io.h>
44453  #include <asm/cpm2.h>
44454  #include <asm/udbg.h>
44455  #include <asm/machdep.h>
44456 -#include <asm/of_platform.h>
44457  #include <asm/time.h>
44458  
44459  #include <sysdev/fsl_soc.h>
44460 --- a/arch/powerpc/platforms/83xx/Kconfig
44461 +++ b/arch/powerpc/platforms/83xx/Kconfig
44462 @@ -50,6 +50,11 @@
44463         help
44464           This option enables support for the MPC836x MDS Processor Board.
44465  
44466 +config MPC837x_MDS
44467 +       bool "Freescale MPC837x MDS"
44468 +       select DEFAULT_UIMAGE
44469 +       help
44470 +         This option enables support for the MPC837x MDS Processor Board.
44471  endchoice
44472  
44473  config PPC_MPC831x
44474 @@ -75,3 +80,9 @@
44475         select PPC_UDBG_16550
44476         select PPC_INDIRECT_PCI
44477         default y if MPC836x_MDS
44478 +
44479 +config PPC_MPC837x
44480 +       bool
44481 +       select PPC_UDBG_16550
44482 +       select PPC_INDIRECT_PCI
44483 +       default y if MPC837x_MDS
44484 --- a/arch/powerpc/platforms/83xx/Makefile
44485 +++ b/arch/powerpc/platforms/83xx/Makefile
44486 @@ -9,3 +9,4 @@
44487  obj-$(CONFIG_MPC834x_ITX)      += mpc834x_itx.o
44488  obj-$(CONFIG_MPC836x_MDS)      += mpc836x_mds.o
44489  obj-$(CONFIG_MPC832x_MDS)      += mpc832x_mds.o
44490 +obj-$(CONFIG_MPC837x_MDS)      += mpc837x_mds.o
44491 --- a/arch/powerpc/platforms/83xx/mpc8313_rdb.c
44492 +++ b/arch/powerpc/platforms/83xx/mpc8313_rdb.c
44493 @@ -14,6 +14,7 @@
44494   */
44495  
44496  #include <linux/pci.h>
44497 +#include <linux/of_platform.h>
44498  
44499  #include <asm/time.h>
44500  #include <asm/ipic.h>
44501 @@ -70,11 +71,23 @@
44502   */
44503  static int __init mpc8313_rdb_probe(void)
44504  {
44505 -        unsigned long root = of_get_flat_dt_root();
44506 +       unsigned long root = of_get_flat_dt_root();
44507  
44508 -        return of_flat_dt_is_compatible(root, "MPC8313ERDB");
44509 +       return of_flat_dt_is_compatible(root, "MPC8313ERDB");
44510  }
44511  
44512 +static struct of_device_id __initdata of_bus_ids[] = {
44513 +       { .compatible = "simple-bus" },
44514 +       {},
44515 +};
44516 +
44517 +static int __init declare_of_platform_devices(void)
44518 +{
44519 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
44520 +       return 0;
44521 +}
44522 +machine_device_initcall(mpc8313_rdb, declare_of_platform_devices);
44523 +
44524  define_machine(mpc8313_rdb) {
44525         .name                   = "MPC8313 RDB",
44526         .probe                  = mpc8313_rdb_probe,
44527 --- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
44528 +++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
44529 @@ -23,9 +23,9 @@
44530  #include <linux/seq_file.h>
44531  #include <linux/root_dev.h>
44532  #include <linux/initrd.h>
44533 +#include <linux/of_platform.h>
44534 +#include <linux/of_device.h>
44535  
44536 -#include <asm/of_device.h>
44537 -#include <asm/of_platform.h>
44538  #include <asm/system.h>
44539  #include <asm/atomic.h>
44540  #include <asm/time.h>
44541 @@ -110,15 +110,12 @@
44542  
44543  static int __init mpc832x_declare_of_platform_devices(void)
44544  {
44545 -       if (!machine_is(mpc832x_mds))
44546 -               return 0;
44547 -
44548         /* Publish the QE devices */
44549         of_platform_bus_probe(NULL, mpc832x_ids, NULL);
44550  
44551         return 0;
44552  }
44553 -device_initcall(mpc832x_declare_of_platform_devices);
44554 +machine_device_initcall(mpc832x_mds, mpc832x_declare_of_platform_devices);
44555  
44556  static void __init mpc832x_sys_init_IRQ(void)
44557  {
44558 --- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
44559 +++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
44560 @@ -19,8 +19,8 @@
44561  #include <linux/spi/spi.h>
44562  #include <linux/spi/mmc_spi.h>
44563  #include <linux/mmc/host.h>
44564 +#include <linux/of_platform.h>
44565  
44566 -#include <asm/of_platform.h>
44567  #include <asm/time.h>
44568  #include <asm/ipic.h>
44569  #include <asm/udbg.h>
44570 @@ -63,9 +63,6 @@
44571  
44572  static int __init mpc832x_spi_init(void)
44573  {
44574 -       if (!machine_is(mpc832x_rdb))
44575 -               return 0;
44576 -
44577         par_io_config_pin(3,  0, 3, 0, 1, 0); /* SPI1 MOSI, I/O */
44578         par_io_config_pin(3,  1, 3, 0, 1, 0); /* SPI1 MISO, I/O */
44579         par_io_config_pin(3,  2, 3, 0, 1, 0); /* SPI1 CLK,  I/O */
44580 @@ -80,7 +77,7 @@
44581                             mpc83xx_spi_deactivate_cs);
44582  }
44583  
44584 -device_initcall(mpc832x_spi_init);
44585 +machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
44586  
44587  /* ************************************************************************
44588   *
44589 @@ -123,15 +120,12 @@
44590  
44591  static int __init mpc832x_declare_of_platform_devices(void)
44592  {
44593 -       if (!machine_is(mpc832x_rdb))
44594 -               return 0;
44595 -
44596         /* Publish the QE devices */
44597         of_platform_bus_probe(NULL, mpc832x_ids, NULL);
44598  
44599         return 0;
44600  }
44601 -device_initcall(mpc832x_declare_of_platform_devices);
44602 +machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
44603  
44604  void __init mpc832x_rdb_init_IRQ(void)
44605  {
44606 --- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
44607 +++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
44608 @@ -23,6 +23,7 @@
44609  #include <linux/delay.h>
44610  #include <linux/seq_file.h>
44611  #include <linux/root_dev.h>
44612 +#include <linux/of_platform.h>
44613  
44614  #include <asm/system.h>
44615  #include <asm/atomic.h>
44616 @@ -37,6 +38,17 @@
44617  
44618  #include "mpc83xx.h"
44619  
44620 +static struct of_device_id __initdata mpc834x_itx_ids[] = {
44621 +       { .compatible = "fsl,pq2pro-localbus", },
44622 +       {},
44623 +};
44624 +
44625 +static int __init mpc834x_itx_declare_of_platform_devices(void)
44626 +{
44627 +       return of_platform_bus_probe(NULL, mpc834x_itx_ids, NULL);
44628 +}
44629 +machine_device_initcall(mpc834x_itx, mpc834x_itx_declare_of_platform_devices);
44630 +
44631  /* ************************************************************************
44632   *
44633   * Setup the architecture
44634 --- a/arch/powerpc/platforms/83xx/mpc834x_mds.c
44635 +++ b/arch/powerpc/platforms/83xx/mpc834x_mds.c
44636 @@ -23,6 +23,7 @@
44637  #include <linux/delay.h>
44638  #include <linux/seq_file.h>
44639  #include <linux/root_dev.h>
44640 +#include <linux/of_platform.h>
44641  
44642  #include <asm/system.h>
44643  #include <asm/atomic.h>
44644 @@ -106,14 +107,27 @@
44645         ipic_set_default_priority();
44646  }
44647  
44648 +static struct of_device_id mpc834x_ids[] = {
44649 +       { .type = "soc", },
44650 +       { .compatible = "soc", },
44651 +       {},
44652 +};
44653 +
44654 +static int __init mpc834x_declare_of_platform_devices(void)
44655 +{
44656 +       of_platform_bus_probe(NULL, mpc834x_ids, NULL);
44657 +       return 0;
44658 +}
44659 +machine_device_initcall(mpc834x_mds, mpc834x_declare_of_platform_devices);
44660 +
44661  /*
44662   * Called very early, MMU is off, device-tree isn't unflattened
44663   */
44664  static int __init mpc834x_mds_probe(void)
44665  {
44666 -        unsigned long root = of_get_flat_dt_root();
44667 +       unsigned long root = of_get_flat_dt_root();
44668  
44669 -        return of_flat_dt_is_compatible(root, "MPC834xMDS");
44670 +       return of_flat_dt_is_compatible(root, "MPC834xMDS");
44671  }
44672  
44673  define_machine(mpc834x_mds) {
44674 --- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
44675 +++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
44676 @@ -29,9 +29,9 @@
44677  #include <linux/seq_file.h>
44678  #include <linux/root_dev.h>
44679  #include <linux/initrd.h>
44680 +#include <linux/of_platform.h>
44681 +#include <linux/of_device.h>
44682  
44683 -#include <asm/of_device.h>
44684 -#include <asm/of_platform.h>
44685  #include <asm/system.h>
44686  #include <asm/atomic.h>
44687  #include <asm/time.h>
44688 @@ -141,15 +141,12 @@
44689  
44690  static int __init mpc836x_declare_of_platform_devices(void)
44691  {
44692 -       if (!machine_is(mpc836x_mds))
44693 -               return 0;
44694 -
44695         /* Publish the QE devices */
44696         of_platform_bus_probe(NULL, mpc836x_ids, NULL);
44697  
44698         return 0;
44699  }
44700 -device_initcall(mpc836x_declare_of_platform_devices);
44701 +machine_device_initcall(mpc836x_mds, mpc836x_declare_of_platform_devices);
44702  
44703  static void __init mpc836x_mds_init_IRQ(void)
44704  {
44705 --- /dev/null
44706 +++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
44707 @@ -0,0 +1,147 @@
44708 +/*
44709 + * arch/powerpc/platforms/83xx/mpc837x_mds.c
44710 + *
44711 + * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved.
44712 + *
44713 + * MPC837x MDS board specific routines
44714 + *
44715 + * This program is free software; you can redistribute it and/or modify it
44716 + * under the terms of the GNU General Public License as published by the
44717 + * Free Software Foundation;  either version 2 of the License, or (at your
44718 + * option) any later version.
44719 + */
44720 +
44721 +#include <linux/pci.h>
44722 +#include <linux/of.h>
44723 +#include <linux/of_platform.h>
44724 +
44725 +#include <asm/time.h>
44726 +#include <asm/ipic.h>
44727 +#include <asm/udbg.h>
44728 +#include <asm/prom.h>
44729 +
44730 +#include "mpc83xx.h"
44731 +
44732 +#define BCSR12_USB_SER_MASK    0x8a
44733 +#define BCSR12_USB_SER_PIN     0x80
44734 +#define BCSR12_USB_SER_DEVICE  0x02
44735 +extern int mpc837x_usb_cfg(void);
44736 +
44737 +static int mpc837xmds_usb_cfg(void)
44738 +{
44739 +       struct device_node *np;
44740 +       const void *phy_type, *mode;
44741 +       void __iomem *bcsr_regs = NULL;
44742 +       u8 bcsr12;
44743 +       int ret;
44744 +
44745 +       ret = mpc837x_usb_cfg();
44746 +       if (ret)
44747 +               return ret;
44748 +       /* Map BCSR area */
44749 +       np = of_find_node_by_name(NULL, "bcsr");
44750 +       if (np) {
44751 +               struct resource res;
44752 +
44753 +               of_address_to_resource(np, 0, &res);
44754 +               bcsr_regs = ioremap(res.start, res.end - res.start + 1);
44755 +               of_node_put(np);
44756 +       }
44757 +       if (!bcsr_regs)
44758 +               return -1;
44759 +
44760 +       np = of_find_node_by_name(NULL, "usb");
44761 +       if (!np)
44762 +               return -ENODEV;
44763 +       phy_type = of_get_property(np, "phy_type", NULL);
44764 +       if (phy_type && !strcmp(phy_type, "ulpi")) {
44765 +               clrbits8(bcsr_regs + 12, BCSR12_USB_SER_PIN);
44766 +       } else if (phy_type && !strcmp(phy_type, "serial")) {
44767 +               mode = of_get_property(np, "dr_mode", NULL);
44768 +               bcsr12 = in_8(bcsr_regs + 12) & ~BCSR12_USB_SER_MASK;
44769 +               bcsr12 |= BCSR12_USB_SER_PIN;
44770 +               if (mode && !strcmp(mode, "peripheral"))
44771 +                       bcsr12 |= BCSR12_USB_SER_DEVICE;
44772 +               out_8(bcsr_regs + 12, bcsr12);
44773 +       } else {
44774 +               printk(KERN_ERR "USB DR: unsupported PHY\n");
44775 +       }
44776 +
44777 +       of_node_put(np);
44778 +       iounmap(bcsr_regs);
44779 +       return 0;
44780 +}
44781 +
44782 +/* ************************************************************************
44783 + *
44784 + * Setup the architecture
44785 + *
44786 + */
44787 +static void __init mpc837x_mds_setup_arch(void)
44788 +{
44789 +#ifdef CONFIG_PCI
44790 +       struct device_node *np;
44791 +#endif
44792 +
44793 +       if (ppc_md.progress)
44794 +               ppc_md.progress("mpc837x_mds_setup_arch()", 0);
44795 +
44796 +#ifdef CONFIG_PCI
44797 +       for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
44798 +               mpc83xx_add_bridge(np);
44799 +#endif
44800 +       mpc837xmds_usb_cfg();
44801 +}
44802 +
44803 +static struct of_device_id mpc837x_ids[] = {
44804 +       { .type = "soc", },
44805 +       { .compatible = "soc", },
44806 +       {},
44807 +};
44808 +
44809 +static int __init mpc837x_declare_of_platform_devices(void)
44810 +{
44811 +       /* Publish of_device */
44812 +       of_platform_bus_probe(NULL, mpc837x_ids, NULL);
44813 +
44814 +       return 0;
44815 +}
44816 +machine_device_initcall(mpc837x_mds, mpc837x_declare_of_platform_devices);
44817 +
44818 +static void __init mpc837x_mds_init_IRQ(void)
44819 +{
44820 +       struct device_node *np;
44821 +
44822 +       np = of_find_compatible_node(NULL, NULL, "fsl,ipic");
44823 +       if (!np)
44824 +               return;
44825 +
44826 +       ipic_init(np, 0);
44827 +
44828 +       /* Initialize the default interrupt mapping priorities,
44829 +        * in case the boot rom changed something on us.
44830 +        */
44831 +       ipic_set_default_priority();
44832 +}
44833 +
44834 +/*
44835 + * Called very early, MMU is off, device-tree isn't unflattened
44836 + */
44837 +static int __init mpc837x_mds_probe(void)
44838 +{
44839 +        unsigned long root = of_get_flat_dt_root();
44840 +
44841 +        return of_flat_dt_is_compatible(root, "fsl,mpc837xmds");
44842 +}
44843 +
44844 +define_machine(mpc837x_mds) {
44845 +       .name                   = "MPC837x MDS",
44846 +       .probe                  = mpc837x_mds_probe,
44847 +       .setup_arch             = mpc837x_mds_setup_arch,
44848 +       .init_IRQ               = mpc837x_mds_init_IRQ,
44849 +       .get_irq                = ipic_get_irq,
44850 +       .restart                = mpc83xx_restart,
44851 +       .time_init              = mpc83xx_time_init,
44852 +       .calibrate_decr         = generic_calibrate_decr,
44853 +       .progress               = udbg_progress,
44854 +};
44855 --- a/arch/powerpc/platforms/83xx/mpc83xx.h
44856 +++ b/arch/powerpc/platforms/83xx/mpc83xx.h
44857 @@ -14,6 +14,7 @@
44858  #define MPC83XX_SCCR_USB_DRCM_11   0x00300000
44859  #define MPC83XX_SCCR_USB_DRCM_01   0x00100000
44860  #define MPC83XX_SCCR_USB_DRCM_10   0x00200000
44861 +#define MPC837X_SCCR_USB_DRCM_11   0x00c00000
44862  
44863  /* system i/o configuration register low */
44864  #define MPC83XX_SICRL_OFFS         0x114
44865 @@ -22,6 +23,8 @@
44866  #define MPC834X_SICRL_USB1         0x20000000
44867  #define MPC831X_SICRL_USB_MASK     0x00000c00
44868  #define MPC831X_SICRL_USB_ULPI     0x00000800
44869 +#define MPC837X_SICRL_USB_MASK     0xf0000000
44870 +#define MPC837X_SICRL_USB_ULPI     0x50000000
44871  
44872  /* system i/o configuration register high */
44873  #define MPC83XX_SICRH_OFFS         0x118
44874 --- a/arch/powerpc/platforms/83xx/pci.c
44875 +++ b/arch/powerpc/platforms/83xx/pci.c
44876 @@ -54,7 +54,7 @@
44877                        " bus 0\n", dev->full_name);
44878         }
44879  
44880 -       pci_assign_all_buses = 1;
44881 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
44882         hose = pcibios_alloc_controller(dev);
44883         if (!hose)
44884                 return -ENOMEM;
44885 --- a/arch/powerpc/platforms/83xx/usb.c
44886 +++ b/arch/powerpc/platforms/83xx/usb.c
44887 @@ -41,7 +41,7 @@
44888         sicrl = in_be32(immap + MPC83XX_SICRL_OFFS) & ~MPC834X_SICRL_USB_MASK;
44889         sicrh = in_be32(immap + MPC83XX_SICRH_OFFS) & ~MPC834X_SICRH_USB_UTMI;
44890  
44891 -       np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr");
44892 +       np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
44893         if (np) {
44894                 sccr |= MPC83XX_SCCR_USB_DRCM_11;  /* 1:3 */
44895  
44896 @@ -67,7 +67,7 @@
44897                 port0_is_dr = 1;
44898                 of_node_put(np);
44899         }
44900 -       np = of_find_compatible_node(NULL, "usb", "fsl-usb2-mph");
44901 +       np = of_find_compatible_node(NULL, NULL, "fsl-usb2-mph");
44902         if (np) {
44903                 sccr |= MPC83XX_SCCR_USB_MPHCM_11; /* 1:3 */
44904  
44905 @@ -111,7 +111,7 @@
44906         const void *dr_mode;
44907  #endif
44908  
44909 -       np = of_find_compatible_node(NULL, "usb", "fsl-usb2-dr");
44910 +       np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
44911         if (!np)
44912                 return -ENODEV;
44913         prop = of_get_property(np, "phy_type", NULL);
44914 @@ -179,3 +179,43 @@
44915         return ret;
44916  }
44917  #endif /* CONFIG_PPC_MPC831x */
44918 +
44919 +#ifdef CONFIG_PPC_MPC837x
44920 +int mpc837x_usb_cfg(void)
44921 +{
44922 +       void __iomem *immap;
44923 +       struct device_node *np = NULL;
44924 +       const void *prop;
44925 +       int ret = 0;
44926 +
44927 +       np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
44928 +       if (!np)
44929 +               return -ENODEV;
44930 +       prop = of_get_property(np, "phy_type", NULL);
44931 +
44932 +       if (!prop || (strcmp(prop, "ulpi") && strcmp(prop, "serial"))) {
44933 +               printk(KERN_WARNING "837x USB PHY type not supported\n");
44934 +               of_node_put(np);
44935 +               return -EINVAL;
44936 +       }
44937 +
44938 +       /* Map IMMR space for pin and clock settings */
44939 +       immap = ioremap(get_immrbase(), 0x1000);
44940 +       if (!immap) {
44941 +               of_node_put(np);
44942 +               return -ENOMEM;
44943 +       }
44944 +
44945 +       /* Configure clock */
44946 +       clrsetbits_be32(immap + MPC83XX_SCCR_OFFS, MPC837X_SCCR_USB_DRCM_11,
44947 +                       MPC837X_SCCR_USB_DRCM_11);
44948 +
44949 +       /* Configure pin mux for ULPI/serial */
44950 +       clrsetbits_be32(immap + MPC83XX_SICRL_OFFS, MPC837X_SICRL_USB_MASK,
44951 +                       MPC837X_SICRL_USB_ULPI);
44952 +
44953 +       iounmap(immap);
44954 +       of_node_put(np);
44955 +       return ret;
44956 +}
44957 +#endif /* CONFIG_PPC_MPC837x */
44958 --- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
44959 +++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
44960 @@ -52,9 +52,9 @@
44961  {
44962         int cascade_irq;
44963  
44964 -       while ((cascade_irq = cpm2_get_irq()) >= 0) {
44965 +       while ((cascade_irq = cpm2_get_irq()) >= 0)
44966                 generic_handle_irq(cascade_irq);
44967 -       }
44968 +
44969         desc->chip->eoi(irq);
44970  }
44971  
44972 @@ -70,13 +70,12 @@
44973  #endif
44974  
44975         np = of_find_node_by_type(np, "open-pic");
44976 -
44977 -       if (np == NULL) {
44978 +       if (!np) {
44979                 printk(KERN_ERR "Could not find open-pic node\n");
44980                 return;
44981         }
44982  
44983 -       if(of_address_to_resource(np, 0, &r)) {
44984 +       if (of_address_to_resource(np, 0, &r)) {
44985                 printk(KERN_ERR "Could not map mpic register space\n");
44986                 of_node_put(np);
44987                 return;
44988 @@ -100,6 +99,7 @@
44989         irq = irq_of_parse_and_map(np, 0);
44990  
44991         cpm2_pic_init(np);
44992 +       of_node_put(np);
44993         set_irq_chained_handler(irq, cpm2_cascade);
44994  #endif
44995  }
44996 @@ -112,7 +112,7 @@
44997         int port, pin, flags;
44998  };
44999  
45000 -static struct cpm_pin mpc8560_ads_pins[] = {
45001 +static const struct cpm_pin mpc8560_ads_pins[] = {
45002         /* SCC1 */
45003         {3, 29, CPM_PIN_OUTPUT | CPM_PIN_PRIMARY},
45004         {3, 30, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45005 @@ -233,13 +233,11 @@
45006  
45007  static int __init declare_of_platform_devices(void)
45008  {
45009 -       if (!machine_is(mpc85xx_ads))
45010 -               return 0;
45011 -
45012         of_platform_bus_probe(NULL, of_bus_ids, NULL);
45013 +
45014         return 0;
45015  }
45016 -device_initcall(declare_of_platform_devices);
45017 +machine_device_initcall(mpc85xx_ads, declare_of_platform_devices);
45018  
45019  /*
45020   * Called very early, device-tree isn't unflattened
45021 --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c
45022 +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
45023 @@ -222,9 +222,6 @@
45024         struct device_node *cascade_node = NULL;
45025         int cascade_irq;
45026  
45027 -       if (!machine_is(mpc85xx_cds))
45028 -               return 0;
45029 -
45030         /* Initialize the i8259 controller */
45031         for_each_node_by_type(np, "interrupt-controller")
45032                 if (of_device_is_compatible(np, "chrp,iic")) {
45033 @@ -262,8 +259,7 @@
45034  
45035         return 0;
45036  }
45037 -
45038 -device_initcall(mpc85xx_cds_8259_attach);
45039 +machine_device_initcall(mpc85xx_cds, mpc85xx_cds_8259_attach);
45040  
45041  #endif /* CONFIG_PPC_I8259 */
45042  
45043 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
45044 +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
45045 @@ -123,7 +123,7 @@
45046         struct device_node* node;
45047         struct resource rsrc;
45048  
45049 -       node = (struct device_node *)hose->arch_data;
45050 +       node = hose->dn;
45051         of_address_to_resource(node, 0, &rsrc);
45052  
45053         if ((rsrc.start & 0xfffff) == primary_phb_addr) {
45054 --- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
45055 +++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
45056 @@ -30,9 +30,9 @@
45057  #include <linux/initrd.h>
45058  #include <linux/module.h>
45059  #include <linux/fsl_devices.h>
45060 +#include <linux/of_platform.h>
45061 +#include <linux/of_device.h>
45062  
45063 -#include <asm/of_device.h>
45064 -#include <asm/of_platform.h>
45065  #include <asm/system.h>
45066  #include <asm/atomic.h>
45067  #include <asm/time.h>
45068 @@ -144,15 +144,12 @@
45069  
45070  static int __init mpc85xx_publish_devices(void)
45071  {
45072 -       if (!machine_is(mpc85xx_mds))
45073 -               return 0;
45074 -
45075         /* Publish the QE devices */
45076 -       of_platform_bus_probe(NULL,mpc85xx_ids,NULL);
45077 +       of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
45078  
45079         return 0;
45080  }
45081 -device_initcall(mpc85xx_publish_devices);
45082 +machine_device_initcall(mpc85xx_mds, mpc85xx_publish_devices);
45083  
45084  static void __init mpc85xx_mds_pic_init(void)
45085  {
45086 --- a/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
45087 +++ b/arch/powerpc/platforms/86xx/mpc8610_hpcd.c
45088 @@ -34,9 +34,24 @@
45089  
45090  #include <asm/mpic.h>
45091  
45092 +#include <linux/of_platform.h>
45093  #include <sysdev/fsl_pci.h>
45094  #include <sysdev/fsl_soc.h>
45095  
45096 +static struct of_device_id __initdata mpc8610_ids[] = {
45097 +       { .compatible = "fsl,mpc8610-immr", },
45098 +       {}
45099 +};
45100 +
45101 +static int __init mpc8610_declare_of_platform_devices(void)
45102 +{
45103 +       /* Without this call, the SSI device driver won't get probed. */
45104 +       of_platform_bus_probe(NULL, mpc8610_ids, NULL);
45105 +
45106 +       return 0;
45107 +}
45108 +machine_device_initcall(mpc86xx_hpcd, mpc8610_declare_of_platform_devices);
45109 +
45110  void __init
45111  mpc86xx_hpcd_init_irq(void)
45112  {
45113 @@ -124,7 +139,7 @@
45114  static void __devinit final_uli5288(struct pci_dev *dev)
45115  {
45116         struct pci_controller *hose = pci_bus_to_host(dev->bus);
45117 -       struct device_node *hosenode = hose ? hose->arch_data : NULL;
45118 +       struct device_node *hosenode = hose ? hose->dn : NULL;
45119         struct of_irq oirq;
45120         int virq, pin = 2;
45121         u32 laddr[3];
45122 --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
45123 +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
45124 @@ -18,6 +18,7 @@
45125  #include <linux/kdev_t.h>
45126  #include <linux/delay.h>
45127  #include <linux/seq_file.h>
45128 +#include <linux/of_platform.h>
45129  
45130  #include <asm/system.h>
45131  #include <asm/time.h>
45132 @@ -116,7 +117,7 @@
45133         struct device_node* node;       
45134         struct resource rsrc;
45135  
45136 -       node = (struct device_node *)hose->arch_data;
45137 +       node = hose->dn;
45138         of_address_to_resource(node, 0, &rsrc);
45139  
45140         if ((rsrc.start & 0xfffff) == 0x8000) {
45141 @@ -212,6 +213,19 @@
45142         return 0;
45143  }
45144  
45145 +static __initdata struct of_device_id of_bus_ids[] = {
45146 +       { .compatible = "simple-bus", },
45147 +       {},
45148 +};
45149 +
45150 +static int __init declare_of_platform_devices(void)
45151 +{
45152 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
45153 +
45154 +       return 0;
45155 +}
45156 +machine_device_initcall(mpc86xx_hpcn, declare_of_platform_devices);
45157 +
45158  define_machine(mpc86xx_hpcn) {
45159         .name                   = "MPC86xx HPCN",
45160         .probe                  = mpc86xx_hpcn_probe,
45161 --- a/arch/powerpc/platforms/8xx/Kconfig
45162 +++ b/arch/powerpc/platforms/8xx/Kconfig
45163 @@ -18,6 +18,7 @@
45164  config MPC86XADS
45165         bool "MPC86XADS"
45166         select CPM1
45167 +       select PPC_CPM_NEW_BINDING
45168         help
45169           MPC86x Application Development System by Freescale Semiconductor.
45170           The MPC86xADS is meant to serve as a platform for s/w and h/w
45171 @@ -43,6 +44,15 @@
45172           This board is also resold by Freescale as the QUICCStart
45173           MPC885 Evaluation System and/or the CWH-PPC-885XN-VE.
45174  
45175 +config PPC_ADDER875
45176 +       bool "Analogue & Micro Adder 875"
45177 +       select CPM1
45178 +       select PPC_CPM_NEW_BINDING
45179 +       select REDBOOT
45180 +       help
45181 +         This enables support for the Analogue & Micro Adder 875
45182 +         board.
45183 +
45184  endchoice
45185  
45186  menu "Freescale Ethernet driver platform-specific options"
45187 --- a/arch/powerpc/platforms/8xx/Makefile
45188 +++ b/arch/powerpc/platforms/8xx/Makefile
45189 @@ -5,3 +5,4 @@
45190  obj-$(CONFIG_MPC885ADS)   += mpc885ads_setup.o
45191  obj-$(CONFIG_MPC86XADS)   += mpc86xads_setup.o
45192  obj-$(CONFIG_PPC_EP88XC)  += ep88xc.o
45193 +obj-$(CONFIG_PPC_ADDER875) += adder875.o
45194 --- /dev/null
45195 +++ b/arch/powerpc/platforms/8xx/adder875.c
45196 @@ -0,0 +1,118 @@
45197 +/* Analogue & Micro Adder MPC875 board support
45198 + *
45199 + * Author: Scott Wood <scottwood@freescale.com>
45200 + *
45201 + * Copyright (c) 2007 Freescale Semiconductor, Inc.
45202 + *
45203 + * This program is free software; you can redistribute  it and/or modify
45204 + * it under the terms of the GNU General Public License, version 2, as
45205 + * published by the Free Software Foundation.
45206 + */
45207 +
45208 +#include <linux/init.h>
45209 +#include <linux/fs_enet_pd.h>
45210 +#include <linux/of_platform.h>
45211 +
45212 +#include <asm/time.h>
45213 +#include <asm/machdep.h>
45214 +#include <asm/commproc.h>
45215 +#include <asm/fs_pd.h>
45216 +#include <asm/udbg.h>
45217 +#include <asm/prom.h>
45218 +
45219 +#include <sysdev/commproc.h>
45220 +
45221 +struct cpm_pin {
45222 +       int port, pin, flags;
45223 +};
45224 +
45225 +static __initdata struct cpm_pin adder875_pins[] = {
45226 +       /* SMC1 */
45227 +       {CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */
45228 +       {CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
45229 +
45230 +       /* MII1 */
45231 +       {CPM_PORTA, 0, CPM_PIN_INPUT},
45232 +       {CPM_PORTA, 1, CPM_PIN_INPUT},
45233 +       {CPM_PORTA, 2, CPM_PIN_INPUT},
45234 +       {CPM_PORTA, 3, CPM_PIN_INPUT},
45235 +       {CPM_PORTA, 4, CPM_PIN_OUTPUT},
45236 +       {CPM_PORTA, 10, CPM_PIN_OUTPUT},
45237 +       {CPM_PORTA, 11, CPM_PIN_OUTPUT},
45238 +       {CPM_PORTB, 19, CPM_PIN_INPUT},
45239 +       {CPM_PORTB, 31, CPM_PIN_INPUT},
45240 +       {CPM_PORTC, 12, CPM_PIN_INPUT},
45241 +       {CPM_PORTC, 13, CPM_PIN_INPUT},
45242 +       {CPM_PORTE, 30, CPM_PIN_OUTPUT},
45243 +       {CPM_PORTE, 31, CPM_PIN_OUTPUT},
45244 +
45245 +       /* MII2 */
45246 +       {CPM_PORTE, 14, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45247 +       {CPM_PORTE, 15, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45248 +       {CPM_PORTE, 16, CPM_PIN_OUTPUT},
45249 +       {CPM_PORTE, 17, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45250 +       {CPM_PORTE, 18, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45251 +       {CPM_PORTE, 19, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45252 +       {CPM_PORTE, 20, CPM_PIN_OUTPUT | CPM_PIN_SECONDARY},
45253 +       {CPM_PORTE, 21, CPM_PIN_OUTPUT},
45254 +       {CPM_PORTE, 22, CPM_PIN_OUTPUT},
45255 +       {CPM_PORTE, 23, CPM_PIN_OUTPUT},
45256 +       {CPM_PORTE, 24, CPM_PIN_OUTPUT},
45257 +       {CPM_PORTE, 25, CPM_PIN_OUTPUT},
45258 +       {CPM_PORTE, 26, CPM_PIN_OUTPUT},
45259 +       {CPM_PORTE, 27, CPM_PIN_OUTPUT},
45260 +       {CPM_PORTE, 28, CPM_PIN_OUTPUT},
45261 +       {CPM_PORTE, 29, CPM_PIN_OUTPUT},
45262 +};
45263 +
45264 +static void __init init_ioports(void)
45265 +{
45266 +       int i;
45267 +
45268 +       for (i = 0; i < ARRAY_SIZE(adder875_pins); i++) {
45269 +               const struct cpm_pin *pin = &adder875_pins[i];
45270 +               cpm1_set_pin(pin->port, pin->pin, pin->flags);
45271 +       }
45272 +
45273 +       cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX);
45274 +
45275 +       /* Set FEC1 and FEC2 to MII mode */
45276 +       clrbits32(&mpc8xx_immr->im_cpm.cp_cptr, 0x00000180);
45277 +}
45278 +
45279 +static void __init adder875_setup(void)
45280 +{
45281 +       cpm_reset();
45282 +       init_ioports();
45283 +}
45284 +
45285 +static int __init adder875_probe(void)
45286 +{
45287 +       unsigned long root = of_get_flat_dt_root();
45288 +       return of_flat_dt_is_compatible(root, "analogue-and-micro,adder875");
45289 +}
45290 +
45291 +static __initdata struct of_device_id of_bus_ids[] = {
45292 +       { .compatible = "simple-bus", },
45293 +       {},
45294 +};
45295 +
45296 +static int __init declare_of_platform_devices(void)
45297 +{
45298 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
45299 +       return 0;
45300 +}
45301 +machine_device_initcall(adder875, declare_of_platform_devices);
45302 +
45303 +define_machine(adder875) {
45304 +       .name = "Adder MPC875",
45305 +       .probe = adder875_probe,
45306 +       .setup_arch = adder875_setup,
45307 +       .init_IRQ = m8xx_pic_init,
45308 +       .get_irq = mpc8xx_get_irq,
45309 +       .restart = mpc8xx_restart,
45310 +       .calibrate_decr = generic_calibrate_decr,
45311 +       .set_rtc_time = mpc8xx_set_rtc_time,
45312 +       .get_rtc_time = mpc8xx_get_rtc_time,
45313 +       .progress = udbg_progress,
45314 +};
45315 --- a/arch/powerpc/platforms/8xx/ep88xc.c
45316 +++ b/arch/powerpc/platforms/8xx/ep88xc.c
45317 @@ -155,12 +155,11 @@
45318  static int __init declare_of_platform_devices(void)
45319  {
45320         /* Publish the QE devices */
45321 -       if (machine_is(ep88xc))
45322 -               of_platform_bus_probe(NULL, of_bus_ids, NULL);
45323 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
45324  
45325         return 0;
45326  }
45327 -device_initcall(declare_of_platform_devices);
45328 +machine_device_initcall(ep88xc, declare_of_platform_devices);
45329  
45330  define_machine(ep88xc) {
45331         .name = "Embedded Planet EP88xC",
45332 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c
45333 +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
45334 @@ -120,7 +120,7 @@
45335         ppc_tb_freq /= 16;
45336         ppc_proc_freq = 50000000;
45337         if (!get_freq("clock-frequency", &ppc_proc_freq))
45338 -               printk(KERN_ERR "WARNING: Estimating processor frequency"
45339 +               printk(KERN_ERR "WARNING: Estimating processor frequency "
45340                                 "(not found)\n");
45341  
45342         printk("Decrementer Frequency = 0x%lx\n", ppc_tb_freq);
45343 --- a/arch/powerpc/platforms/8xx/mpc86xads.h
45344 +++ b/arch/powerpc/platforms/8xx/mpc86xads.h
45345 @@ -15,27 +15,6 @@
45346  #ifndef __ASM_MPC86XADS_H__
45347  #define __ASM_MPC86XADS_H__
45348  
45349 -#include <sysdev/fsl_soc.h>
45350 -
45351 -/* U-Boot maps BCSR to 0xff080000 */
45352 -#define BCSR_ADDR              ((uint)0xff080000)
45353 -#define BCSR_SIZE              ((uint)32)
45354 -#define BCSR0                  ((uint)(BCSR_ADDR + 0x00))
45355 -#define BCSR1                  ((uint)(BCSR_ADDR + 0x04))
45356 -#define BCSR2                  ((uint)(BCSR_ADDR + 0x08))
45357 -#define BCSR3                  ((uint)(BCSR_ADDR + 0x0c))
45358 -#define BCSR4                  ((uint)(BCSR_ADDR + 0x10))
45359 -
45360 -#define CFG_PHYDEV_ADDR                ((uint)0xff0a0000)
45361 -#define BCSR5                  ((uint)(CFG_PHYDEV_ADDR + 0x300))
45362 -
45363 -#define MPC8xx_CPM_OFFSET      (0x9c0)
45364 -#define CPM_MAP_ADDR           (get_immrbase() + MPC8xx_CPM_OFFSET)
45365 -#define CPM_IRQ_OFFSET         16     // for compability with cpm_uart driver
45366 -
45367 -#define PCMCIA_MEM_ADDR                ((uint)0xff020000)
45368 -#define PCMCIA_MEM_SIZE                ((uint)(64 * 1024))
45369 -
45370  /* Bits of interest in the BCSRs.
45371   */
45372  #define BCSR1_ETHEN            ((uint)0x20000000)
45373 @@ -64,28 +43,5 @@
45374  #define BCSR5_MII1_EN          0x02
45375  #define BCSR5_MII1_RST         0x01
45376  
45377 -/* Interrupt level assignments */
45378 -#define PHY_INTERRUPT  SIU_IRQ7        /* PHY link change interrupt */
45379 -#define SIU_INT_FEC1   SIU_LEVEL1      /* FEC1 interrupt */
45380 -#define FEC_INTERRUPT  SIU_INT_FEC1    /* FEC interrupt */
45381 -
45382 -/* We don't use the 8259 */
45383 -#define NR_8259_INTS   0
45384 -
45385 -/* CPM Ethernet through SCC1 */
45386 -#define PA_ENET_RXD     ((ushort)0x0001)
45387 -#define PA_ENET_TXD     ((ushort)0x0002)
45388 -#define PA_ENET_TCLK    ((ushort)0x0100)
45389 -#define PA_ENET_RCLK    ((ushort)0x0200)
45390 -#define PB_ENET_TENA    ((uint)0x00001000)
45391 -#define PC_ENET_CLSN    ((ushort)0x0010)
45392 -#define PC_ENET_RENA    ((ushort)0x0020)
45393 -
45394 -/* Control bits in the SICR to route TCLK (CLK1) and RCLK (CLK2) to
45395 - * SCC1.  Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero.
45396 - */
45397 -#define SICR_ENET_MASK  ((uint)0x000000ff)
45398 -#define SICR_ENET_CLKRT ((uint)0x0000002c)
45399 -
45400  #endif /* __ASM_MPC86XADS_H__ */
45401  #endif /* __KERNEL__ */
45402 --- a/arch/powerpc/platforms/8xx/mpc86xads_setup.c
45403 +++ b/arch/powerpc/platforms/8xx/mpc86xads_setup.c
45404 @@ -6,264 +6,133 @@
45405   *
45406   * Copyright 2005 MontaVista Software Inc.
45407   *
45408 + * Heavily modified by Scott Wood <scottwood@freescale.com>
45409 + * Copyright 2007 Freescale Semiconductor, Inc.
45410 + *
45411   * This file is licensed under the terms of the GNU General Public License
45412   * version 2. This program is licensed "as is" without any warranty of any
45413   * kind, whether express or implied.
45414   */
45415  
45416  #include <linux/init.h>
45417 -#include <linux/module.h>
45418 -#include <linux/param.h>
45419 -#include <linux/string.h>
45420 -#include <linux/ioport.h>
45421 -#include <linux/device.h>
45422 -#include <linux/delay.h>
45423 -#include <linux/root_dev.h>
45424 -
45425 -#include <linux/fs_enet_pd.h>
45426 -#include <linux/fs_uart_pd.h>
45427 -#include <linux/mii.h>
45428 +#include <linux/of_platform.h>
45429  
45430 -#include <asm/delay.h>
45431  #include <asm/io.h>
45432  #include <asm/machdep.h>
45433 -#include <asm/page.h>
45434 -#include <asm/processor.h>
45435  #include <asm/system.h>
45436  #include <asm/time.h>
45437  #include <asm/mpc8xx.h>
45438  #include <asm/8xx_immap.h>
45439  #include <asm/commproc.h>
45440  #include <asm/fs_pd.h>
45441 -#include <asm/prom.h>
45442 +#include <asm/udbg.h>
45443  
45444  #include <sysdev/commproc.h>
45445  
45446 -static void init_smc1_uart_ioports(struct fs_uart_platform_info* fpi);
45447 -static void init_smc2_uart_ioports(struct fs_uart_platform_info* fpi);
45448 -static void init_scc1_ioports(struct fs_platform_info* ptr);
45449 -
45450 -void __init mpc86xads_board_setup(void)
45451 -{
45452 -       cpm8xx_t *cp;
45453 -       unsigned int *bcsr_io;
45454 -       u8 tmpval8;
45455 -
45456 -       bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
45457 -       cp = (cpm8xx_t *)immr_map(im_cpm);
45458 +#include "mpc86xads.h"
45459  
45460 -       if (bcsr_io == NULL) {
45461 -               printk(KERN_CRIT "Could not remap BCSR\n");
45462 -               return;
45463 -       }
45464 -#ifdef CONFIG_SERIAL_CPM_SMC1
45465 -       clrbits32(bcsr_io, BCSR1_RS232EN_1);
45466 -       clrbits32(&cp->cp_simode, 0xe0000000 >> 17);    /* brg1 */
45467 -       tmpval8 = in_8(&(cp->cp_smc[0].smc_smcm)) | (SMCM_RX | SMCM_TX);
45468 -       out_8(&(cp->cp_smc[0].smc_smcm), tmpval8);
45469 -       clrbits16(&cp->cp_smc[0].smc_smcmr, SMCMR_REN | SMCMR_TEN);
45470 -#else
45471 -       setbits32(bcsr_io,BCSR1_RS232EN_1);
45472 -       out_be16(&cp->cp_smc[0].smc_smcmr, 0);
45473 -       out_8(&cp->cp_smc[0].smc_smce, 0);
45474 -#endif
45475 -
45476 -#ifdef CONFIG_SERIAL_CPM_SMC2
45477 -       clrbits32(bcsr_io,BCSR1_RS232EN_2);
45478 -       clrbits32(&cp->cp_simode, 0xe0000000 >> 1);
45479 -       setbits32(&cp->cp_simode, 0x20000000 >> 1);     /* brg2 */
45480 -       tmpval8 = in_8(&(cp->cp_smc[1].smc_smcm)) | (SMCM_RX | SMCM_TX);
45481 -       out_8(&(cp->cp_smc[1].smc_smcm), tmpval8);
45482 -       clrbits16(&cp->cp_smc[1].smc_smcmr, SMCMR_REN | SMCMR_TEN);
45483 -
45484 -       init_smc2_uart_ioports(0);
45485 -#else
45486 -       setbits32(bcsr_io,BCSR1_RS232EN_2);
45487 -       out_be16(&cp->cp_smc[1].smc_smcmr, 0);
45488 -       out_8(&cp->cp_smc[1].smc_smce, 0);
45489 -#endif
45490 -       immr_unmap(cp);
45491 -       iounmap(bcsr_io);
45492 -}
45493 +struct cpm_pin {
45494 +       int port, pin, flags;
45495 +};
45496  
45497 +static struct cpm_pin mpc866ads_pins[] = {
45498 +       /* SMC1 */
45499 +       {CPM_PORTB, 24, CPM_PIN_INPUT}, /* RX */
45500 +       {CPM_PORTB, 25, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
45501 +
45502 +       /* SMC2 */
45503 +       {CPM_PORTB, 21, CPM_PIN_INPUT}, /* RX */
45504 +       {CPM_PORTB, 20, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TX */
45505 +
45506 +       /* SCC1 */
45507 +       {CPM_PORTA, 6, CPM_PIN_INPUT}, /* CLK1 */
45508 +       {CPM_PORTA, 7, CPM_PIN_INPUT}, /* CLK2 */
45509 +       {CPM_PORTA, 14, CPM_PIN_INPUT}, /* TX */
45510 +       {CPM_PORTA, 15, CPM_PIN_INPUT}, /* RX */
45511 +       {CPM_PORTB, 19, CPM_PIN_INPUT | CPM_PIN_SECONDARY}, /* TENA */
45512 +       {CPM_PORTC, 10, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO}, /* RENA */
45513 +       {CPM_PORTC, 11, CPM_PIN_INPUT | CPM_PIN_SECONDARY | CPM_PIN_GPIO}, /* CLSN */
45514 +
45515 +       /* MII */
45516 +       {CPM_PORTD, 3, CPM_PIN_OUTPUT},
45517 +       {CPM_PORTD, 4, CPM_PIN_OUTPUT},
45518 +       {CPM_PORTD, 5, CPM_PIN_OUTPUT},
45519 +       {CPM_PORTD, 6, CPM_PIN_OUTPUT},
45520 +       {CPM_PORTD, 7, CPM_PIN_OUTPUT},
45521 +       {CPM_PORTD, 8, CPM_PIN_OUTPUT},
45522 +       {CPM_PORTD, 9, CPM_PIN_OUTPUT},
45523 +       {CPM_PORTD, 10, CPM_PIN_OUTPUT},
45524 +       {CPM_PORTD, 11, CPM_PIN_OUTPUT},
45525 +       {CPM_PORTD, 12, CPM_PIN_OUTPUT},
45526 +       {CPM_PORTD, 13, CPM_PIN_OUTPUT},
45527 +       {CPM_PORTD, 14, CPM_PIN_OUTPUT},
45528 +       {CPM_PORTD, 15, CPM_PIN_OUTPUT},
45529 +};
45530  
45531 -static void init_fec1_ioports(struct fs_platform_info* ptr)
45532 +static void __init init_ioports(void)
45533  {
45534 -       iop8xx_t *io_port = (iop8xx_t *)immr_map(im_ioport);
45535 +       int i;
45536  
45537 -       /* configure FEC1 pins  */
45538 +       for (i = 0; i < ARRAY_SIZE(mpc866ads_pins); i++) {
45539 +               struct cpm_pin *pin = &mpc866ads_pins[i];
45540 +               cpm1_set_pin(pin->port, pin->pin, pin->flags);
45541 +       }
45542  
45543 -       setbits16(&io_port->iop_pdpar, 0x1fff);
45544 -       setbits16(&io_port->iop_pddir, 0x1fff);
45545 +       cpm1_clk_setup(CPM_CLK_SMC1, CPM_BRG1, CPM_CLK_RTX);
45546 +       cpm1_clk_setup(CPM_CLK_SMC2, CPM_BRG2, CPM_CLK_RTX);
45547 +       cpm1_clk_setup(CPM_CLK_SCC1, CPM_CLK1, CPM_CLK_TX);
45548 +       cpm1_clk_setup(CPM_CLK_SCC1, CPM_CLK2, CPM_CLK_RX);
45549  
45550 -       immr_unmap(io_port);
45551 +       /* Set FEC1 and FEC2 to MII mode */
45552 +       clrbits32(&mpc8xx_immr->im_cpm.cp_cptr, 0x00000180);
45553  }
45554  
45555 -void init_fec_ioports(struct fs_platform_info *fpi)
45556 +static void __init mpc86xads_setup_arch(void)
45557  {
45558 -       int fec_no = fs_get_fec_index(fpi->fs_no);
45559 +       struct device_node *np;
45560 +       u32 __iomem *bcsr_io;
45561 +
45562 +       cpm_reset();
45563 +       init_ioports();
45564  
45565 -       switch (fec_no) {
45566 -       case 0:
45567 -               init_fec1_ioports(fpi);
45568 -               break;
45569 -       default:
45570 -               printk(KERN_ERR "init_fec_ioports: invalid FEC number\n");
45571 +       np = of_find_compatible_node(NULL, NULL, "fsl,mpc866ads-bcsr");
45572 +       if (!np) {
45573 +               printk(KERN_CRIT "Could not find fsl,mpc866ads-bcsr node\n");
45574                 return;
45575         }
45576 -}
45577  
45578 -static void init_scc1_ioports(struct fs_platform_info* fpi)
45579 -{
45580 -       unsigned *bcsr_io;
45581 -       iop8xx_t *io_port;
45582 -       cpm8xx_t *cp;
45583 -
45584 -       bcsr_io = ioremap(BCSR_ADDR, BCSR_SIZE);
45585 -       io_port = (iop8xx_t *)immr_map(im_ioport);
45586 -       cp = (cpm8xx_t *)immr_map(im_cpm);
45587 +       bcsr_io = of_iomap(np, 0);
45588 +       of_node_put(np);
45589  
45590         if (bcsr_io == NULL) {
45591                 printk(KERN_CRIT "Could not remap BCSR\n");
45592                 return;
45593         }
45594  
45595 -       /* Configure port A pins for Txd and Rxd.
45596 -        */
45597 -       setbits16(&io_port->iop_papar, PA_ENET_RXD | PA_ENET_TXD);
45598 -       clrbits16(&io_port->iop_padir, PA_ENET_RXD | PA_ENET_TXD);
45599 -       clrbits16(&io_port->iop_paodr, PA_ENET_TXD);
45600 -
45601 -       /* Configure port C pins to enable CLSN and RENA.
45602 -        */
45603 -       clrbits16(&io_port->iop_pcpar, PC_ENET_CLSN | PC_ENET_RENA);
45604 -       clrbits16(&io_port->iop_pcdir, PC_ENET_CLSN | PC_ENET_RENA);
45605 -       setbits16(&io_port->iop_pcso, PC_ENET_CLSN | PC_ENET_RENA);
45606 -
45607 -       /* Configure port A for TCLK and RCLK.
45608 -        */
45609 -       setbits16(&io_port->iop_papar, PA_ENET_TCLK | PA_ENET_RCLK);
45610 -        clrbits16(&io_port->iop_padir, PA_ENET_TCLK | PA_ENET_RCLK);
45611 -        clrbits32(&cp->cp_pbpar, PB_ENET_TENA);
45612 -        clrbits32(&cp->cp_pbdir, PB_ENET_TENA);
45613 -
45614 -       /* Configure Serial Interface clock routing.
45615 -        * First, clear all SCC bits to zero, then set the ones we want.
45616 -        */
45617 -       clrbits32(&cp->cp_sicr, SICR_ENET_MASK);
45618 -       setbits32(&cp->cp_sicr, SICR_ENET_CLKRT);
45619 -
45620 -       /* In the original SCC enet driver the following code is placed at
45621 -          the end of the initialization */
45622 -        setbits32(&cp->cp_pbpar, PB_ENET_TENA);
45623 -        setbits32(&cp->cp_pbdir, PB_ENET_TENA);
45624 -
45625 -       clrbits32(bcsr_io+1, BCSR1_ETHEN);
45626 +       clrbits32(bcsr_io, BCSR1_RS232EN_1 | BCSR1_RS232EN_2 | BCSR1_ETHEN);
45627         iounmap(bcsr_io);
45628 -       immr_unmap(cp);
45629 -       immr_unmap(io_port);
45630 -}
45631 -
45632 -void init_scc_ioports(struct fs_platform_info *fpi)
45633 -{
45634 -       int scc_no = fs_get_scc_index(fpi->fs_no);
45635 -
45636 -       switch (scc_no) {
45637 -       case 0:
45638 -               init_scc1_ioports(fpi);
45639 -               break;
45640 -       default:
45641 -               printk(KERN_ERR "init_scc_ioports: invalid SCC number\n");
45642 -               return;
45643 -       }
45644  }
45645  
45646 -
45647 -
45648 -static void init_smc1_uart_ioports(struct fs_uart_platform_info* ptr)
45649 +static int __init mpc86xads_probe(void)
45650  {
45651 -        unsigned *bcsr_io;
45652 -       cpm8xx_t *cp = (cpm8xx_t *)immr_map(im_cpm);
45653 -
45654 -       setbits32(&cp->cp_pbpar, 0x000000c0);
45655 -       clrbits32(&cp->cp_pbdir, 0x000000c0);
45656 -       clrbits16(&cp->cp_pbodr, 0x00c0);
45657 -       immr_unmap(cp);
45658 -
45659 -        bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
45660 -
45661 -        if (bcsr_io == NULL) {
45662 -                printk(KERN_CRIT "Could not remap BCSR1\n");
45663 -                return;
45664 -        }
45665 -        clrbits32(bcsr_io,BCSR1_RS232EN_1);
45666 -        iounmap(bcsr_io);
45667 +       unsigned long root = of_get_flat_dt_root();
45668 +       return of_flat_dt_is_compatible(root, "fsl,mpc866ads");
45669  }
45670  
45671 -static void init_smc2_uart_ioports(struct fs_uart_platform_info* fpi)
45672 -{
45673 -        unsigned *bcsr_io;
45674 -       cpm8xx_t *cp = (cpm8xx_t *)immr_map(im_cpm);
45675 -
45676 -       setbits32(&cp->cp_pbpar, 0x00000c00);
45677 -       clrbits32(&cp->cp_pbdir, 0x00000c00);
45678 -       clrbits16(&cp->cp_pbodr, 0x0c00);
45679 -       immr_unmap(cp);
45680 -
45681 -        bcsr_io = ioremap(BCSR1, sizeof(unsigned long));
45682 -
45683 -        if (bcsr_io == NULL) {
45684 -                printk(KERN_CRIT "Could not remap BCSR1\n");
45685 -                return;
45686 -        }
45687 -        clrbits32(bcsr_io,BCSR1_RS232EN_2);
45688 -        iounmap(bcsr_io);
45689 -}
45690 +static struct of_device_id __initdata of_bus_ids[] = {
45691 +       { .name = "soc", },
45692 +       { .name = "cpm", },
45693 +       { .name = "localbus", },
45694 +       {},
45695 +};
45696  
45697 -void init_smc_ioports(struct fs_uart_platform_info *data)
45698 +static int __init declare_of_platform_devices(void)
45699  {
45700 -       int smc_no = fs_uart_id_fsid2smc(data->fs_no);
45701 -
45702 -       switch (smc_no) {
45703 -       case 0:
45704 -               init_smc1_uart_ioports(data);
45705 -               data->brg = data->clk_rx;
45706 -               break;
45707 -       case 1:
45708 -               init_smc2_uart_ioports(data);
45709 -               data->brg = data->clk_rx;
45710 -               break;
45711 -       default:
45712 -               printk(KERN_ERR "init_scc_ioports: invalid SCC number\n");
45713 -               return;
45714 -       }
45715 -}
45716 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
45717  
45718 -int platform_device_skip(const char *model, int id)
45719 -{
45720         return 0;
45721  }
45722 -
45723 -static void __init mpc86xads_setup_arch(void)
45724 -{
45725 -       cpm_reset();
45726 -
45727 -       mpc86xads_board_setup();
45728 -
45729 -       ROOT_DEV = Root_NFS;
45730 -}
45731 -
45732 -static int __init mpc86xads_probe(void)
45733 -{
45734 -       char *model = of_get_flat_dt_prop(of_get_flat_dt_root(),
45735 -                                         "model", NULL);
45736 -       if (model == NULL)
45737 -               return 0;
45738 -       if (strcmp(model, "MPC866ADS"))
45739 -               return 0;
45740 -
45741 -       return 1;
45742 -}
45743 +machine_device_initcall(mpc86x_ads, declare_of_platform_devices);
45744  
45745  define_machine(mpc86x_ads) {
45746         .name                   = "MPC86x ADS",
45747 @@ -275,4 +144,5 @@
45748         .calibrate_decr         = mpc8xx_calibrate_decr,
45749         .set_rtc_time           = mpc8xx_set_rtc_time,
45750         .get_rtc_time           = mpc8xx_get_rtc_time,
45751 +       .progress               = udbg_progress,
45752  };
45753 --- a/arch/powerpc/platforms/8xx/mpc885ads_setup.c
45754 +++ b/arch/powerpc/platforms/8xx/mpc885ads_setup.c
45755 @@ -264,12 +264,11 @@
45756  static int __init declare_of_platform_devices(void)
45757  {
45758         /* Publish the QE devices */
45759 -       if (machine_is(mpc885_ads))
45760 -               of_platform_bus_probe(NULL, of_bus_ids, NULL);
45761 +       of_platform_bus_probe(NULL, of_bus_ids, NULL);
45762  
45763         return 0;
45764  }
45765 -device_initcall(declare_of_platform_devices);
45766 +machine_device_initcall(mpc885_ads, declare_of_platform_devices);
45767  
45768  define_machine(mpc885_ads) {
45769         .name                   = "Freescale MPC885 ADS",
45770 --- a/arch/powerpc/platforms/Kconfig
45771 +++ b/arch/powerpc/platforms/Kconfig
45772 @@ -22,6 +22,7 @@
45773         depends on 6xx
45774         select FSL_SOC
45775         select 83xx
45776 +       select IPIC
45777         select WANT_DEVICE_TREE
45778  
45779  config PPC_86xx
45780 @@ -80,6 +81,10 @@
45781         bool
45782         default y
45783  
45784 +config IPIC
45785 +       bool
45786 +       default n
45787 +
45788  config MPIC
45789         bool
45790         default n
45791 @@ -265,6 +270,7 @@
45792  config QUICC_ENGINE
45793         bool
45794         select PPC_LIB_RHEAP
45795 +       select CRC32
45796         help
45797           The QUICC Engine (QE) is a new generation of communications
45798           coprocessors on Freescale embedded CPUs (akin to CPM in older chips).
45799 @@ -315,6 +321,12 @@
45800  config CPM
45801         bool
45802  
45803 +config OF_RTC
45804 +       bool
45805 +       help
45806 +         Uses information from the OF or flattened device tree to instatiate
45807 +         platform devices for direct mapped RTC chips like the DS1742 or DS1743.
45808 +
45809  source "arch/powerpc/sysdev/bestcomm/Kconfig"
45810  
45811  endmenu
45812 --- a/arch/powerpc/platforms/Kconfig.cputype
45813 +++ b/arch/powerpc/platforms/Kconfig.cputype
45814 @@ -43,6 +43,7 @@
45815         bool "AMCC 40x"
45816         select PPC_DCR_NATIVE
45817         select WANT_DEVICE_TREE
45818 +       select PPC_UDBG_16550
45819  
45820  config 44x
45821         bool "AMCC 44x"
45822 --- a/arch/powerpc/platforms/cell/Makefile
45823 +++ b/arch/powerpc/platforms/cell/Makefile
45824 @@ -20,7 +20,7 @@
45825  
45826  obj-$(CONFIG_SPU_BASE)                 += spu_callbacks.o spu_base.o \
45827                                            spu_notify.o \
45828 -                                          spu_syscalls.o \
45829 +                                          spu_syscalls.o spu_fault.o \
45830                                            $(spu-priv1-y) \
45831                                            $(spu-manage-y) \
45832                                            spufs/
45833 --- a/arch/powerpc/platforms/cell/cbe_cpufreq.c
45834 +++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c
45835 @@ -21,8 +21,9 @@
45836   */
45837  
45838  #include <linux/cpufreq.h>
45839 +#include <linux/of_platform.h>
45840 +
45841  #include <asm/machdep.h>
45842 -#include <asm/of_platform.h>
45843  #include <asm/prom.h>
45844  #include <asm/cell-regs.h>
45845  #include "cbe_cpufreq.h"
45846 --- a/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
45847 +++ b/arch/powerpc/platforms/cell/cbe_cpufreq_pmi.c
45848 @@ -23,7 +23,8 @@
45849  #include <linux/kernel.h>
45850  #include <linux/types.h>
45851  #include <linux/timer.h>
45852 -#include <asm/of_platform.h>
45853 +#include <linux/of_platform.h>
45854 +
45855  #include <asm/processor.h>
45856  #include <asm/prom.h>
45857  #include <asm/pmi.h>
45858 --- a/arch/powerpc/platforms/cell/cbe_regs.c
45859 +++ b/arch/powerpc/platforms/cell/cbe_regs.c
45860 @@ -9,13 +9,13 @@
45861  #include <linux/percpu.h>
45862  #include <linux/types.h>
45863  #include <linux/module.h>
45864 +#include <linux/of_device.h>
45865 +#include <linux/of_platform.h>
45866  
45867  #include <asm/io.h>
45868  #include <asm/pgtable.h>
45869  #include <asm/prom.h>
45870  #include <asm/ptrace.h>
45871 -#include <asm/of_device.h>
45872 -#include <asm/of_platform.h>
45873  #include <asm/cell-regs.h>
45874  
45875  /*
45876 @@ -256,6 +256,7 @@
45877                         printk(KERN_ERR "cbe_regs: More BE chips than supported"
45878                                "!\n");
45879                         cbe_regs_map_count--;
45880 +                       of_node_put(cpu);
45881                         return;
45882                 }
45883                 map->cpu_node = cpu;
45884 --- a/arch/powerpc/platforms/cell/io-workarounds.c
45885 +++ b/arch/powerpc/platforms/cell/io-workarounds.c
45886 @@ -238,7 +238,7 @@
45887  static void __init spider_pci_add_one(struct pci_controller *phb)
45888  {
45889         struct spider_pci_bus *bus = &spider_pci_busses[spider_pci_count];
45890 -       struct device_node *np = phb->arch_data;
45891 +       struct device_node *np = phb->dn;
45892         struct resource rsrc;
45893         void __iomem *regs;
45894  
45895 @@ -309,15 +309,12 @@
45896  {
45897         struct pci_controller *phb;
45898  
45899 -       if (!machine_is(cell))
45900 -               return 0;
45901 -
45902         /* Find spider bridges. We assume they have been all probed
45903          * in setup_arch(). If that was to change, we would need to
45904          * update this code to cope with dynamically added busses
45905          */
45906         list_for_each_entry(phb, &hose_list, list_node) {
45907 -               struct device_node *np = phb->arch_data;
45908 +               struct device_node *np = phb->dn;
45909                 const char *model = of_get_property(np, "model", NULL);
45910  
45911                 /* If no model property or name isn't exactly "pci", skip */
45912 @@ -343,4 +340,4 @@
45913  
45914         return 0;
45915  }
45916 -arch_initcall(spider_pci_workaround_init);
45917 +machine_arch_initcall(cell, spider_pci_workaround_init);
45918 --- a/arch/powerpc/platforms/cell/iommu.c
45919 +++ b/arch/powerpc/platforms/cell/iommu.c
45920 @@ -26,14 +26,15 @@
45921  #include <linux/init.h>
45922  #include <linux/interrupt.h>
45923  #include <linux/notifier.h>
45924 +#include <linux/of_platform.h>
45925  
45926  #include <asm/prom.h>
45927  #include <asm/iommu.h>
45928  #include <asm/machdep.h>
45929  #include <asm/pci-bridge.h>
45930  #include <asm/udbg.h>
45931 -#include <asm/of_platform.h>
45932  #include <asm/lmb.h>
45933 +#include <asm/firmware.h>
45934  #include <asm/cell-regs.h>
45935  
45936  #include "interrupt.h"
45937 @@ -309,8 +310,8 @@
45938  {
45939         struct page *page;
45940         int ret, i;
45941 -       unsigned long reg, segments, pages_per_segment, ptab_size, n_pte_pages;
45942 -       unsigned long xlate_base;
45943 +       unsigned long reg, segments, pages_per_segment, ptab_size, stab_size,
45944 +                     n_pte_pages, xlate_base;
45945         unsigned int virq;
45946  
45947         if (cell_iommu_find_ioc(iommu->nid, &xlate_base))
45948 @@ -327,7 +328,8 @@
45949                         __FUNCTION__, iommu->nid, segments, pages_per_segment);
45950  
45951         /* set up the segment table */
45952 -       page = alloc_pages_node(iommu->nid, GFP_KERNEL, 0);
45953 +       stab_size = segments * sizeof(unsigned long);
45954 +       page = alloc_pages_node(iommu->nid, GFP_KERNEL, get_order(stab_size));
45955         BUG_ON(!page);
45956         iommu->stab = page_address(page);
45957         clear_page(iommu->stab);
45958 @@ -489,15 +491,18 @@
45959         return NULL;
45960  }
45961  
45962 +static unsigned long cell_dma_direct_offset;
45963 +
45964  static void cell_dma_dev_setup(struct device *dev)
45965  {
45966         struct iommu_window *window;
45967         struct cbe_iommu *iommu;
45968         struct dev_archdata *archdata = &dev->archdata;
45969  
45970 -       /* If we run without iommu, no need to do anything */
45971 -       if (get_pci_dma_ops() == &dma_direct_ops)
45972 +       if (get_pci_dma_ops() == &dma_direct_ops) {
45973 +               archdata->dma_data = (void *)cell_dma_direct_offset;
45974                 return;
45975 +       }
45976  
45977         /* Current implementation uses the first window available in that
45978          * node's iommu. We -might- do something smarter later though it may
45979 @@ -653,7 +658,7 @@
45980  
45981         /* If we have no Axon, we set up the spider DMA magic offset */
45982         if (of_find_node_by_name(NULL, "axon") == NULL)
45983 -               dma_direct_offset = SPIDER_DMA_OFFSET;
45984 +               cell_dma_direct_offset = SPIDER_DMA_OFFSET;
45985  
45986         /* Now we need to check to see where the memory is mapped
45987          * in PCI space. We assume that all busses use the same dma
45988 @@ -687,10 +692,13 @@
45989                 return -ENODEV;
45990         }
45991  
45992 -       dma_direct_offset += base;
45993 +       cell_dma_direct_offset += base;
45994 +
45995 +       if (cell_dma_direct_offset != 0)
45996 +               ppc_md.pci_dma_dev_setup = cell_pci_dma_dev_setup;
45997  
45998         printk("iommu: disabled, direct DMA offset is 0x%lx\n",
45999 -              dma_direct_offset);
46000 +              cell_dma_direct_offset);
46001  
46002         return 0;
46003  }
46004 @@ -699,9 +707,6 @@
46005  {
46006         struct device_node *np;
46007  
46008 -       if (!machine_is(cell))
46009 -               return -ENODEV;
46010 -
46011         /* If IOMMU is disabled or we have little enough RAM to not need
46012          * to enable it, we setup a direct mapping.
46013          *
46014 @@ -744,5 +749,6 @@
46015  
46016         return 0;
46017  }
46018 -arch_initcall(cell_iommu_init);
46019 +machine_arch_initcall(cell, cell_iommu_init);
46020 +machine_arch_initcall(celleb_native, cell_iommu_init);
46021  
46022 --- a/arch/powerpc/platforms/cell/pmu.c
46023 +++ b/arch/powerpc/platforms/cell/pmu.c
46024 @@ -213,7 +213,7 @@
46025                 break;
46026  
46027         case pm_interval:
46028 -               READ_SHADOW_REG(val, pm_interval);
46029 +               READ_MMIO_UPPER32(val, pm_interval);
46030                 break;
46031  
46032         case pm_start_stop:
46033 @@ -381,9 +381,6 @@
46034         unsigned int irq;
46035         int rc, node;
46036  
46037 -       if (!machine_is(cell))
46038 -               return 0;
46039 -
46040         for_each_node(node) {
46041                 irq = irq_create_mapping(NULL, IIC_IRQ_IOEX_PMI |
46042                                                (node << IIC_IRQ_NODE_SHIFT));
46043 @@ -404,7 +401,7 @@
46044  
46045         return 0;
46046  }
46047 -arch_initcall(cbe_init_pm_irq);
46048 +machine_arch_initcall(cell, cbe_init_pm_irq);
46049  
46050  void cbe_sync_irq(int node)
46051  {
46052 --- a/arch/powerpc/platforms/cell/setup.c
46053 +++ b/arch/powerpc/platforms/cell/setup.c
46054 @@ -30,6 +30,7 @@
46055  #include <linux/console.h>
46056  #include <linux/mutex.h>
46057  #include <linux/memory_hotplug.h>
46058 +#include <linux/of_platform.h>
46059  
46060  #include <asm/mmu.h>
46061  #include <asm/processor.h>
46062 @@ -51,7 +52,6 @@
46063  #include <asm/spu_priv1.h>
46064  #include <asm/udbg.h>
46065  #include <asm/mpic.h>
46066 -#include <asm/of_platform.h>
46067  #include <asm/cell-regs.h>
46068  
46069  #include "interrupt.h"
46070 @@ -85,9 +85,6 @@
46071  {
46072         int node;
46073  
46074 -       if (!machine_is(cell))
46075 -               return 0;
46076 -
46077         /* Publish OF platform devices for southbridge IOs */
46078         of_platform_bus_probe(NULL, NULL, NULL);
46079  
46080 @@ -101,7 +98,7 @@
46081         }
46082         return 0;
46083  }
46084 -device_initcall(cell_publish_devices);
46085 +machine_device_initcall(cell, cell_publish_devices);
46086  
46087  static void cell_mpic_cascade(unsigned int irq, struct irq_desc *desc)
46088  {
46089 --- a/arch/powerpc/platforms/cell/smp.c
46090 +++ b/arch/powerpc/platforms/cell/smp.c
46091 @@ -42,6 +42,7 @@
46092  #include <asm/firmware.h>
46093  #include <asm/system.h>
46094  #include <asm/rtas.h>
46095 +#include <asm/cputhreads.h>
46096  
46097  #include "interrupt.h"
46098  #include <asm/udbg.h>
46099 @@ -182,7 +183,7 @@
46100          */
46101         if (system_state < SYSTEM_RUNNING &&
46102             cpu_has_feature(CPU_FTR_SMT) &&
46103 -           !smt_enabled_at_boot && nr % 2 != 0)
46104 +           !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
46105                 return 0;
46106  
46107         return 1;
46108 --- a/arch/powerpc/platforms/cell/spu_base.c
46109 +++ b/arch/powerpc/platforms/cell/spu_base.c
46110 @@ -34,6 +34,7 @@
46111  #include <linux/linux_logo.h>
46112  #include <asm/spu.h>
46113  #include <asm/spu_priv1.h>
46114 +#include <asm/spu_csa.h>
46115  #include <asm/xmon.h>
46116  #include <asm/prom.h>
46117  
46118 @@ -47,6 +48,13 @@
46119  EXPORT_SYMBOL_GPL(cbe_spu_info);
46120  
46121  /*
46122 + * The spufs fault-handling code needs to call force_sig_info to raise signals
46123 + * on DMA errors. Export it here to avoid general kernel-wide access to this
46124 + * function
46125 + */
46126 +EXPORT_SYMBOL_GPL(force_sig_info);
46127 +
46128 +/*
46129   * Protects cbe_spu_info and spu->number.
46130   */
46131  static DEFINE_SPINLOCK(spu_lock);
46132 @@ -66,6 +74,10 @@
46133  static DEFINE_SPINLOCK(spu_full_list_lock);
46134  static DEFINE_MUTEX(spu_full_list_mutex);
46135  
46136 +struct spu_slb {
46137 +       u64 esid, vsid;
46138 +};
46139 +
46140  void spu_invalidate_slbs(struct spu *spu)
46141  {
46142         struct spu_priv2 __iomem *priv2 = spu->priv2;
46143 @@ -114,40 +126,36 @@
46144  }
46145  EXPORT_SYMBOL_GPL(spu_associate_mm);
46146  
46147 -static int __spu_trap_invalid_dma(struct spu *spu)
46148 +int spu_64k_pages_available(void)
46149  {
46150 -       pr_debug("%s\n", __FUNCTION__);
46151 -       spu->dma_callback(spu, SPE_EVENT_INVALID_DMA);
46152 -       return 0;
46153 +       return mmu_psize_defs[MMU_PAGE_64K].shift != 0;
46154  }
46155 +EXPORT_SYMBOL_GPL(spu_64k_pages_available);
46156  
46157 -static int __spu_trap_dma_align(struct spu *spu)
46158 +static void spu_restart_dma(struct spu *spu)
46159  {
46160 -       pr_debug("%s\n", __FUNCTION__);
46161 -       spu->dma_callback(spu, SPE_EVENT_DMA_ALIGNMENT);
46162 -       return 0;
46163 -}
46164 +       struct spu_priv2 __iomem *priv2 = spu->priv2;
46165  
46166 -static int __spu_trap_error(struct spu *spu)
46167 -{
46168 -       pr_debug("%s\n", __FUNCTION__);
46169 -       spu->dma_callback(spu, SPE_EVENT_SPE_ERROR);
46170 -       return 0;
46171 +       if (!test_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags))
46172 +               out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESTART_DMA_COMMAND);
46173  }
46174  
46175 -static void spu_restart_dma(struct spu *spu)
46176 +static inline void spu_load_slb(struct spu *spu, int slbe, struct spu_slb *slb)
46177  {
46178         struct spu_priv2 __iomem *priv2 = spu->priv2;
46179  
46180 -       if (!test_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags))
46181 -               out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESTART_DMA_COMMAND);
46182 +       pr_debug("%s: adding SLB[%d] 0x%016lx 0x%016lx\n",
46183 +                       __func__, slbe, slb->vsid, slb->esid);
46184 +
46185 +       out_be64(&priv2->slb_index_W, slbe);
46186 +       out_be64(&priv2->slb_vsid_RW, slb->vsid);
46187 +       out_be64(&priv2->slb_esid_RW, slb->esid);
46188  }
46189  
46190  static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
46191  {
46192 -       struct spu_priv2 __iomem *priv2 = spu->priv2;
46193         struct mm_struct *mm = spu->mm;
46194 -       u64 esid, vsid, llp;
46195 +       struct spu_slb slb;
46196         int psize;
46197  
46198         pr_debug("%s\n", __FUNCTION__);
46199 @@ -159,7 +167,7 @@
46200                 printk("%s: invalid access during switch!\n", __func__);
46201                 return 1;
46202         }
46203 -       esid = (ea & ESID_MASK) | SLB_ESID_V;
46204 +       slb.esid = (ea & ESID_MASK) | SLB_ESID_V;
46205  
46206         switch(REGION_ID(ea)) {
46207         case USER_REGION_ID:
46208 @@ -168,21 +176,21 @@
46209  #else
46210                 psize = mm->context.user_psize;
46211  #endif
46212 -               vsid = (get_vsid(mm->context.id, ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
46213 -                               SLB_VSID_USER;
46214 +               slb.vsid = (get_vsid(mm->context.id, ea, MMU_SEGSIZE_256M)
46215 +                               << SLB_VSID_SHIFT) | SLB_VSID_USER;
46216                 break;
46217         case VMALLOC_REGION_ID:
46218                 if (ea < VMALLOC_END)
46219                         psize = mmu_vmalloc_psize;
46220                 else
46221                         psize = mmu_io_psize;
46222 -               vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
46223 -                       SLB_VSID_KERNEL;
46224 +               slb.vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M)
46225 +                               << SLB_VSID_SHIFT) | SLB_VSID_KERNEL;
46226                 break;
46227         case KERNEL_REGION_ID:
46228                 psize = mmu_linear_psize;
46229 -               vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
46230 -                       SLB_VSID_KERNEL;
46231 +               slb.vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M)
46232 +                               << SLB_VSID_SHIFT) | SLB_VSID_KERNEL;
46233                 break;
46234         default:
46235                 /* Future: support kernel segments so that drivers
46236 @@ -191,11 +199,9 @@
46237                 pr_debug("invalid region access at %016lx\n", ea);
46238                 return 1;
46239         }
46240 -       llp = mmu_psize_defs[psize].sllp;
46241 +       slb.vsid |= mmu_psize_defs[psize].sllp;
46242  
46243 -       out_be64(&priv2->slb_index_W, spu->slb_replace);
46244 -       out_be64(&priv2->slb_vsid_RW, vsid | llp);
46245 -       out_be64(&priv2->slb_esid_RW, esid);
46246 +       spu_load_slb(spu, spu->slb_replace, &slb);
46247  
46248         spu->slb_replace++;
46249         if (spu->slb_replace >= 8)
46250 @@ -225,13 +231,83 @@
46251                 return 1;
46252         }
46253  
46254 +       spu->class_0_pending = 0;
46255         spu->dar = ea;
46256         spu->dsisr = dsisr;
46257 -       mb();
46258 +
46259         spu->stop_callback(spu);
46260 +
46261         return 0;
46262  }
46263  
46264 +static void __spu_kernel_slb(void *addr, struct spu_slb *slb)
46265 +{
46266 +       unsigned long ea = (unsigned long)addr;
46267 +       u64 llp;
46268 +
46269 +       if (REGION_ID(ea) == KERNEL_REGION_ID)
46270 +               llp = mmu_psize_defs[mmu_linear_psize].sllp;
46271 +       else
46272 +               llp = mmu_psize_defs[mmu_virtual_psize].sllp;
46273 +
46274 +       slb->vsid = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
46275 +               SLB_VSID_KERNEL | llp;
46276 +       slb->esid = (ea & ESID_MASK) | SLB_ESID_V;
46277 +}
46278 +
46279 +/**
46280 + * Given an array of @nr_slbs SLB entries, @slbs, return non-zero if the
46281 + * address @new_addr is present.
46282 + */
46283 +static inline int __slb_present(struct spu_slb *slbs, int nr_slbs,
46284 +               void *new_addr)
46285 +{
46286 +       unsigned long ea = (unsigned long)new_addr;
46287 +       int i;
46288 +
46289 +       for (i = 0; i < nr_slbs; i++)
46290 +               if (!((slbs[i].esid ^ ea) & ESID_MASK))
46291 +                       return 1;
46292 +
46293 +       return 0;
46294 +}
46295 +
46296 +/**
46297 + * Setup the SPU kernel SLBs, in preparation for a context save/restore. We
46298 + * need to map both the context save area, and the save/restore code.
46299 + *
46300 + * Because the lscsa and code may cross segment boundaires, we check to see
46301 + * if mappings are required for the start and end of each range. We currently
46302 + * assume that the mappings are smaller that one segment - if not, something
46303 + * is seriously wrong.
46304 + */
46305 +void spu_setup_kernel_slbs(struct spu *spu, struct spu_lscsa *lscsa,
46306 +               void *code, int code_size)
46307 +{
46308 +       struct spu_slb slbs[4];
46309 +       int i, nr_slbs = 0;
46310 +       /* start and end addresses of both mappings */
46311 +       void *addrs[] = {
46312 +               lscsa, (void *)lscsa + sizeof(*lscsa) - 1,
46313 +               code, code + code_size - 1
46314 +       };
46315 +
46316 +       /* check the set of addresses, and create a new entry in the slbs array
46317 +        * if there isn't already a SLB for that address */
46318 +       for (i = 0; i < ARRAY_SIZE(addrs); i++) {
46319 +               if (__slb_present(slbs, nr_slbs, addrs[i]))
46320 +                       continue;
46321 +
46322 +               __spu_kernel_slb(addrs[i], &slbs[nr_slbs]);
46323 +               nr_slbs++;
46324 +       }
46325 +
46326 +       /* Add the set of SLBs */
46327 +       for (i = 0; i < nr_slbs; i++)
46328 +               spu_load_slb(spu, i, &slbs[i]);
46329 +}
46330 +EXPORT_SYMBOL_GPL(spu_setup_kernel_slbs);
46331 +
46332  static irqreturn_t
46333  spu_irq_class_0(int irq, void *data)
46334  {
46335 @@ -240,12 +316,13 @@
46336  
46337         spu = data;
46338  
46339 +       spin_lock(&spu->register_lock);
46340         mask = spu_int_mask_get(spu, 0);
46341 -       stat = spu_int_stat_get(spu, 0);
46342 -       stat &= mask;
46343 +       stat = spu_int_stat_get(spu, 0) & mask;
46344  
46345 -       spin_lock(&spu->register_lock);
46346         spu->class_0_pending |= stat;
46347 +       spu->dsisr = spu_mfc_dsisr_get(spu);
46348 +       spu->dar = spu_mfc_dar_get(spu);
46349         spin_unlock(&spu->register_lock);
46350  
46351         spu->stop_callback(spu);
46352 @@ -255,31 +332,6 @@
46353         return IRQ_HANDLED;
46354  }
46355  
46356 -int
46357 -spu_irq_class_0_bottom(struct spu *spu)
46358 -{
46359 -       unsigned long flags;
46360 -       unsigned long stat;
46361 -
46362 -       spin_lock_irqsave(&spu->register_lock, flags);
46363 -       stat = spu->class_0_pending;
46364 -       spu->class_0_pending = 0;
46365 -
46366 -       if (stat & 1) /* invalid DMA alignment */
46367 -               __spu_trap_dma_align(spu);
46368 -
46369 -       if (stat & 2) /* invalid MFC DMA */
46370 -               __spu_trap_invalid_dma(spu);
46371 -
46372 -       if (stat & 4) /* error on SPU */
46373 -               __spu_trap_error(spu);
46374 -
46375 -       spin_unlock_irqrestore(&spu->register_lock, flags);
46376 -
46377 -       return (stat & 0x7) ? -EIO : 0;
46378 -}
46379 -EXPORT_SYMBOL_GPL(spu_irq_class_0_bottom);
46380 -
46381  static irqreturn_t
46382  spu_irq_class_1(int irq, void *data)
46383  {
46384 @@ -294,24 +346,23 @@
46385         stat  = spu_int_stat_get(spu, 1) & mask;
46386         dar   = spu_mfc_dar_get(spu);
46387         dsisr = spu_mfc_dsisr_get(spu);
46388 -       if (stat & 2) /* mapping fault */
46389 +       if (stat & CLASS1_STORAGE_FAULT_INTR)
46390                 spu_mfc_dsisr_set(spu, 0ul);
46391         spu_int_stat_clear(spu, 1, stat);
46392         spin_unlock(&spu->register_lock);
46393         pr_debug("%s: %lx %lx %lx %lx\n", __FUNCTION__, mask, stat,
46394                         dar, dsisr);
46395  
46396 -       if (stat & 1) /* segment fault */
46397 +       if (stat & CLASS1_SEGMENT_FAULT_INTR)
46398                 __spu_trap_data_seg(spu, dar);
46399  
46400 -       if (stat & 2) { /* mapping fault */
46401 +       if (stat & CLASS1_STORAGE_FAULT_INTR)
46402                 __spu_trap_data_map(spu, dar, dsisr);
46403 -       }
46404  
46405 -       if (stat & 4) /* ls compare & suspend on get */
46406 +       if (stat & CLASS1_LS_COMPARE_SUSPEND_ON_GET_INTR)
46407                 ;
46408  
46409 -       if (stat & 8) /* ls compare & suspend on put */
46410 +       if (stat & CLASS1_LS_COMPARE_SUSPEND_ON_PUT_INTR)
46411                 ;
46412  
46413         return stat ? IRQ_HANDLED : IRQ_NONE;
46414 @@ -323,6 +374,8 @@
46415         struct spu *spu;
46416         unsigned long stat;
46417         unsigned long mask;
46418 +       const int mailbox_intrs =
46419 +               CLASS2_MAILBOX_THRESHOLD_INTR | CLASS2_MAILBOX_INTR;
46420  
46421         spu = data;
46422         spin_lock(&spu->register_lock);
46423 @@ -330,31 +383,30 @@
46424         mask = spu_int_mask_get(spu, 2);
46425         /* ignore interrupts we're not waiting for */
46426         stat &= mask;
46427 -       /*
46428 -        * mailbox interrupts (0x1 and 0x10) are level triggered.
46429 -        * mask them now before acknowledging.
46430 -        */
46431 -       if (stat & 0x11)
46432 -               spu_int_mask_and(spu, 2, ~(stat & 0x11));
46433 +
46434 +       /* mailbox interrupts are level triggered. mask them now before
46435 +        * acknowledging */
46436 +       if (stat & mailbox_intrs)
46437 +               spu_int_mask_and(spu, 2, ~(stat & mailbox_intrs));
46438         /* acknowledge all interrupts before the callbacks */
46439         spu_int_stat_clear(spu, 2, stat);
46440         spin_unlock(&spu->register_lock);
46441  
46442         pr_debug("class 2 interrupt %d, %lx, %lx\n", irq, stat, mask);
46443  
46444 -       if (stat & 1)  /* PPC core mailbox */
46445 +       if (stat & CLASS2_MAILBOX_INTR)
46446                 spu->ibox_callback(spu);
46447  
46448 -       if (stat & 2) /* SPU stop-and-signal */
46449 +       if (stat & CLASS2_SPU_STOP_INTR)
46450                 spu->stop_callback(spu);
46451  
46452 -       if (stat & 4) /* SPU halted */
46453 +       if (stat & CLASS2_SPU_HALT_INTR)
46454                 spu->stop_callback(spu);
46455  
46456 -       if (stat & 8) /* DMA tag group complete */
46457 +       if (stat & CLASS2_SPU_DMA_TAG_GROUP_COMPLETE_INTR)
46458                 spu->mfc_callback(spu);
46459  
46460 -       if (stat & 0x10) /* SPU mailbox threshold */
46461 +       if (stat & CLASS2_MAILBOX_THRESHOLD_INTR)
46462                 spu->wbox_callback(spu);
46463  
46464         spu->stats.class2_intr++;
46465 @@ -479,13 +531,27 @@
46466  int spu_add_sysdev_attr_group(struct attribute_group *attrs)
46467  {
46468         struct spu *spu;
46469 +       int rc = 0;
46470  
46471         mutex_lock(&spu_full_list_mutex);
46472 -       list_for_each_entry(spu, &spu_full_list, full_list)
46473 -               sysfs_create_group(&spu->sysdev.kobj, attrs);
46474 +       list_for_each_entry(spu, &spu_full_list, full_list) {
46475 +               rc = sysfs_create_group(&spu->sysdev.kobj, attrs);
46476 +
46477 +               /* we're in trouble here, but try unwinding anyway */
46478 +               if (rc) {
46479 +                       printk(KERN_ERR "%s: can't create sysfs group '%s'\n",
46480 +                                       __func__, attrs->name);
46481 +
46482 +                       list_for_each_entry_continue_reverse(spu,
46483 +                                       &spu_full_list, full_list)
46484 +                               sysfs_remove_group(&spu->sysdev.kobj, attrs);
46485 +                       break;
46486 +               }
46487 +       }
46488 +
46489         mutex_unlock(&spu_full_list_mutex);
46490  
46491 -       return 0;
46492 +       return rc;
46493  }
46494  EXPORT_SYMBOL_GPL(spu_add_sysdev_attr_group);
46495  
46496 --- /dev/null
46497 +++ b/arch/powerpc/platforms/cell/spu_fault.c
46498 @@ -0,0 +1,98 @@
46499 +/*
46500 + * SPU mm fault handler
46501 + *
46502 + * (C) Copyright IBM Deutschland Entwicklung GmbH 2007
46503 + *
46504 + * Author: Arnd Bergmann <arndb@de.ibm.com>
46505 + * Author: Jeremy Kerr <jk@ozlabs.org>
46506 + *
46507 + * This program is free software; you can redistribute it and/or modify
46508 + * it under the terms of the GNU General Public License as published by
46509 + * the Free Software Foundation; either version 2, or (at your option)
46510 + * any later version.
46511 + *
46512 + * This program is distributed in the hope that it will be useful,
46513 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
46514 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
46515 + * GNU General Public License for more details.
46516 + *
46517 + * You should have received a copy of the GNU General Public License
46518 + * along with this program; if not, write to the Free Software
46519 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
46520 + */
46521 +#include <linux/sched.h>
46522 +#include <linux/mm.h>
46523 +#include <linux/module.h>
46524 +
46525 +#include <asm/spu.h>
46526 +#include <asm/spu_csa.h>
46527 +
46528 +/*
46529 + * This ought to be kept in sync with the powerpc specific do_page_fault
46530 + * function. Currently, there are a few corner cases that we haven't had
46531 + * to handle fortunately.
46532 + */
46533 +int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
46534 +               unsigned long dsisr, unsigned *flt)
46535 +{
46536 +       struct vm_area_struct *vma;
46537 +       unsigned long is_write;
46538 +       int ret;
46539 +
46540 +#if 0
46541 +       if (!IS_VALID_EA(ea)) {
46542 +               return -EFAULT;
46543 +       }
46544 +#endif /* XXX */
46545 +       if (mm == NULL) {
46546 +               return -EFAULT;
46547 +       }
46548 +       if (mm->pgd == NULL) {
46549 +               return -EFAULT;
46550 +       }
46551 +
46552 +       down_read(&mm->mmap_sem);
46553 +       vma = find_vma(mm, ea);
46554 +       if (!vma)
46555 +               goto bad_area;
46556 +       if (vma->vm_start <= ea)
46557 +               goto good_area;
46558 +       if (!(vma->vm_flags & VM_GROWSDOWN))
46559 +               goto bad_area;
46560 +       if (expand_stack(vma, ea))
46561 +               goto bad_area;
46562 +good_area:
46563 +       is_write = dsisr & MFC_DSISR_ACCESS_PUT;
46564 +       if (is_write) {
46565 +               if (!(vma->vm_flags & VM_WRITE))
46566 +                       goto bad_area;
46567 +       } else {
46568 +               if (dsisr & MFC_DSISR_ACCESS_DENIED)
46569 +                       goto bad_area;
46570 +               if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
46571 +                       goto bad_area;
46572 +       }
46573 +       ret = 0;
46574 +       *flt = handle_mm_fault(mm, vma, ea, is_write);
46575 +       if (unlikely(*flt & VM_FAULT_ERROR)) {
46576 +               if (*flt & VM_FAULT_OOM) {
46577 +                       ret = -ENOMEM;
46578 +                       goto bad_area;
46579 +               } else if (*flt & VM_FAULT_SIGBUS) {
46580 +                       ret = -EFAULT;
46581 +                       goto bad_area;
46582 +               }
46583 +               BUG();
46584 +       }
46585 +       if (*flt & VM_FAULT_MAJOR)
46586 +               current->maj_flt++;
46587 +       else
46588 +               current->min_flt++;
46589 +       up_read(&mm->mmap_sem);
46590 +       return ret;
46591 +
46592 +bad_area:
46593 +       up_read(&mm->mmap_sem);
46594 +       return -EFAULT;
46595 +}
46596 +EXPORT_SYMBOL_GPL(spu_handle_mm_fault);
46597 --- a/arch/powerpc/platforms/cell/spu_manage.c
46598 +++ b/arch/powerpc/platforms/cell/spu_manage.c
46599 @@ -35,6 +35,7 @@
46600  #include <asm/firmware.h>
46601  #include <asm/prom.h>
46602  
46603 +#include "spufs/spufs.h"
46604  #include "interrupt.h"
46605  
46606  struct device_node *spu_devnode(struct spu *spu)
46607 @@ -345,7 +346,7 @@
46608                 }
46609                 ret = spu_map_interrupts_old(spu, spe);
46610                 if (ret) {
46611 -                       printk(KERN_ERR "%s: could not map interrupts",
46612 +                       printk(KERN_ERR "%s: could not map interrupts\n",
46613                                 spu->name);
46614                         goto out_unmap;
46615                 }
46616 @@ -369,6 +370,16 @@
46617         return 0;
46618  }
46619  
46620 +static void enable_spu_by_master_run(struct spu_context *ctx)
46621 +{
46622 +       ctx->ops->master_start(ctx);
46623 +}
46624 +
46625 +static void disable_spu_by_master_run(struct spu_context *ctx)
46626 +{
46627 +       ctx->ops->master_stop(ctx);
46628 +}
46629 +
46630  /* Hardcoded affinity idxs for qs20 */
46631  #define QS20_SPES_PER_BE 8
46632  static int qs20_reg_idxs[QS20_SPES_PER_BE] =   { 0, 2, 4, 6, 7, 5, 3, 1 };
46633 @@ -411,10 +422,15 @@
46634  
46635  static int of_has_vicinity(void)
46636  {
46637 -       struct spu* spu;
46638 +       struct device_node *dn;
46639  
46640 -       spu = list_first_entry(&cbe_spu_info[0].spus, struct spu, cbe_list);
46641 -       return of_find_property(spu_devnode(spu), "vicinity", NULL) != NULL;
46642 +       for_each_node_by_type(dn, "spe") {
46643 +               if (of_find_property(dn, "vicinity", NULL))  {
46644 +                       of_node_put(dn);
46645 +                       return 1;
46646 +               }
46647 +       }
46648 +       return 0;
46649  }
46650  
46651  static struct spu *devnode_spu(int cbe, struct device_node *dn)
46652 @@ -525,7 +541,7 @@
46653                 if (of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
46654                         init_affinity_qs20_harcoded();
46655                 else
46656 -                       printk("No affinity configuration found");
46657 +                       printk("No affinity configuration found\n");
46658         }
46659  
46660         return 0;
46661 @@ -535,5 +551,7 @@
46662         .enumerate_spus = of_enumerate_spus,
46663         .create_spu = of_create_spu,
46664         .destroy_spu = of_destroy_spu,
46665 +       .enable_spu = enable_spu_by_master_run,
46666 +       .disable_spu = disable_spu_by_master_run,
46667         .init_affinity = init_affinity,
46668  };
46669 --- a/arch/powerpc/platforms/cell/spufs/Makefile
46670 +++ b/arch/powerpc/platforms/cell/spufs/Makefile
46671 @@ -1,8 +1,8 @@
46672 -obj-y += switch.o fault.o lscsa_alloc.o
46673  
46674  obj-$(CONFIG_SPU_FS) += spufs.o
46675  spufs-y += inode.o file.o context.o syscalls.o coredump.o
46676  spufs-y += sched.o backing_ops.o hw_ops.o run.o gang.o
46677 +spufs-y += switch.o fault.o lscsa_alloc.o
46678  
46679  # Rules to build switch.o with the help of SPU tool chain
46680  SPU_CROSS      := spu-
46681 --- a/arch/powerpc/platforms/cell/spufs/backing_ops.c
46682 +++ b/arch/powerpc/platforms/cell/spufs/backing_ops.c
46683 @@ -106,16 +106,20 @@
46684                 if (stat & 0xff0000)
46685                         ret |= POLLIN | POLLRDNORM;
46686                 else {
46687 -                       ctx->csa.priv1.int_stat_class0_RW &= ~0x1;
46688 -                       ctx->csa.priv1.int_mask_class2_RW |= 0x1;
46689 +                       ctx->csa.priv1.int_stat_class2_RW &=
46690 +                               ~CLASS2_MAILBOX_INTR;
46691 +                       ctx->csa.priv1.int_mask_class2_RW |=
46692 +                               CLASS2_ENABLE_MAILBOX_INTR;
46693                 }
46694         }
46695         if (events & (POLLOUT | POLLWRNORM)) {
46696                 if (stat & 0x00ff00)
46697                         ret = POLLOUT | POLLWRNORM;
46698                 else {
46699 -                       ctx->csa.priv1.int_stat_class0_RW &= ~0x10;
46700 -                       ctx->csa.priv1.int_mask_class2_RW |= 0x10;
46701 +                       ctx->csa.priv1.int_stat_class2_RW &=
46702 +                               ~CLASS2_MAILBOX_THRESHOLD_INTR;
46703 +                       ctx->csa.priv1.int_mask_class2_RW |=
46704 +                               CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR;
46705                 }
46706         }
46707         spin_unlock_irq(&ctx->csa.register_lock);
46708 @@ -139,7 +143,7 @@
46709                 ret = 4;
46710         } else {
46711                 /* make sure we get woken up by the interrupt */
46712 -               ctx->csa.priv1.int_mask_class2_RW |= 0x1UL;
46713 +               ctx->csa.priv1.int_mask_class2_RW |= CLASS2_ENABLE_MAILBOX_INTR;
46714                 ret = 0;
46715         }
46716         spin_unlock(&ctx->csa.register_lock);
46717 @@ -169,7 +173,8 @@
46718         } else {
46719                 /* make sure we get woken up by the interrupt when space
46720                    becomes available */
46721 -               ctx->csa.priv1.int_mask_class2_RW |= 0x10;
46722 +               ctx->csa.priv1.int_mask_class2_RW |=
46723 +                       CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR;
46724                 ret = 0;
46725         }
46726         spin_unlock(&ctx->csa.register_lock);
46727 @@ -268,6 +273,11 @@
46728         return ctx->csa.lscsa->ls;
46729  }
46730  
46731 +static void spu_backing_privcntl_write(struct spu_context *ctx, u64 val)
46732 +{
46733 +       ctx->csa.priv2.spu_privcntl_RW = val;
46734 +}
46735 +
46736  static u32 spu_backing_runcntl_read(struct spu_context *ctx)
46737  {
46738         return ctx->csa.prob.spu_runcntl_RW;
46739 @@ -285,6 +295,11 @@
46740         spin_unlock(&ctx->csa.register_lock);
46741  }
46742  
46743 +static void spu_backing_runcntl_stop(struct spu_context *ctx)
46744 +{
46745 +       spu_backing_runcntl_write(ctx, SPU_RUNCNTL_STOP);
46746 +}
46747 +
46748  static void spu_backing_master_start(struct spu_context *ctx)
46749  {
46750         struct spu_state *csa = &ctx->csa;
46751 @@ -358,7 +373,7 @@
46752  
46753  static void spu_backing_restart_dma(struct spu_context *ctx)
46754  {
46755 -       /* nothing to do here */
46756 +       ctx->csa.priv2.mfc_control_RW |= MFC_CNTL_RESTART_DMA_COMMAND;
46757  }
46758  
46759  struct spu_context_ops spu_backing_ops = {
46760 @@ -379,8 +394,10 @@
46761         .npc_write = spu_backing_npc_write,
46762         .status_read = spu_backing_status_read,
46763         .get_ls = spu_backing_get_ls,
46764 +       .privcntl_write = spu_backing_privcntl_write,
46765         .runcntl_read = spu_backing_runcntl_read,
46766         .runcntl_write = spu_backing_runcntl_write,
46767 +       .runcntl_stop = spu_backing_runcntl_stop,
46768         .master_start = spu_backing_master_start,
46769         .master_stop = spu_backing_master_stop,
46770         .set_mfc_query = spu_backing_set_mfc_query,
46771 --- a/arch/powerpc/platforms/cell/spufs/context.c
46772 +++ b/arch/powerpc/platforms/cell/spufs/context.c
46773 @@ -52,6 +52,7 @@
46774         init_waitqueue_head(&ctx->wbox_wq);
46775         init_waitqueue_head(&ctx->stop_wq);
46776         init_waitqueue_head(&ctx->mfc_wq);
46777 +       init_waitqueue_head(&ctx->run_wq);
46778         ctx->state = SPU_STATE_SAVED;
46779         ctx->ops = &spu_backing_ops;
46780         ctx->owner = get_task_mm(current);
46781 @@ -105,7 +106,17 @@
46782  void spu_forget(struct spu_context *ctx)
46783  {
46784         struct mm_struct *mm;
46785 -       spu_acquire_saved(ctx);
46786 +
46787 +       /*
46788 +        * This is basically an open-coded spu_acquire_saved, except that
46789 +        * we don't acquire the state mutex interruptible.
46790 +        */
46791 +       mutex_lock(&ctx->state_mutex);
46792 +       if (ctx->state != SPU_STATE_SAVED) {
46793 +               set_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags);
46794 +               spu_deactivate(ctx);
46795 +       }
46796 +
46797         mm = ctx->owner;
46798         ctx->owner = NULL;
46799         mmput(mm);
46800 @@ -133,47 +144,23 @@
46801  }
46802  
46803  /**
46804 - * spu_acquire_runnable - lock spu contex and make sure it is in runnable state
46805 + * spu_acquire_saved - lock spu contex and make sure it is in saved state
46806   * @ctx:       spu contex to lock
46807 - *
46808 - * Note:
46809 - *     Returns 0 and with the context locked on success
46810 - *     Returns negative error and with the context _unlocked_ on failure.
46811   */
46812 -int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags)
46813 +int spu_acquire_saved(struct spu_context *ctx)
46814  {
46815 -       int ret = -EINVAL;
46816 +       int ret;
46817  
46818 -       spu_acquire(ctx);
46819 -       if (ctx->state == SPU_STATE_SAVED) {
46820 -               /*
46821 -                * Context is about to be freed, so we can't acquire it anymore.
46822 -                */
46823 -               if (!ctx->owner)
46824 -                       goto out_unlock;
46825 -               ret = spu_activate(ctx, flags);
46826 -               if (ret)
46827 -                       goto out_unlock;
46828 -       }
46829 -
46830 -       return 0;
46831 +       ret = spu_acquire(ctx);
46832 +       if (ret)
46833 +               return ret;
46834  
46835 - out_unlock:
46836 -       spu_release(ctx);
46837 -       return ret;
46838 -}
46839 -
46840 -/**
46841 - * spu_acquire_saved - lock spu contex and make sure it is in saved state
46842 - * @ctx:       spu contex to lock
46843 - */
46844 -void spu_acquire_saved(struct spu_context *ctx)
46845 -{
46846 -       spu_acquire(ctx);
46847         if (ctx->state != SPU_STATE_SAVED) {
46848                 set_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags);
46849                 spu_deactivate(ctx);
46850         }
46851 +
46852 +       return 0;
46853  }
46854  
46855  /**
46856 --- a/arch/powerpc/platforms/cell/spufs/coredump.c
46857 +++ b/arch/powerpc/platforms/cell/spufs/coredump.c
46858 @@ -148,7 +148,9 @@
46859  
46860         fd = 0;
46861         while ((ctx = coredump_next_context(&fd)) != NULL) {
46862 -               spu_acquire_saved(ctx);
46863 +               rc = spu_acquire_saved(ctx);
46864 +               if (rc)
46865 +                       break;
46866                 rc = spufs_ctx_note_size(ctx, fd);
46867                 spu_release_saved(ctx);
46868                 if (rc < 0)
46869 @@ -224,7 +226,9 @@
46870  
46871         fd = 0;
46872         while ((ctx = coredump_next_context(&fd)) != NULL) {
46873 -               spu_acquire_saved(ctx);
46874 +               rc = spu_acquire_saved(ctx);
46875 +               if (rc)
46876 +                       return rc;
46877  
46878                 for (j = 0; spufs_coredump_read[j].name != NULL; j++) {
46879                         rc = spufs_arch_write_note(ctx, j, file, fd, foffset);
46880 --- a/arch/powerpc/platforms/cell/spufs/fault.c
46881 +++ b/arch/powerpc/platforms/cell/spufs/fault.c
46882 @@ -28,117 +28,71 @@
46883  
46884  #include "spufs.h"
46885  
46886 -/*
46887 - * This ought to be kept in sync with the powerpc specific do_page_fault
46888 - * function. Currently, there are a few corner cases that we haven't had
46889 - * to handle fortunately.
46890 +/**
46891 + * Handle an SPE event, depending on context SPU_CREATE_EVENTS_ENABLED flag.
46892 + *
46893 + * If the context was created with events, we just set the return event.
46894 + * Otherwise, send an appropriate signal to the process.
46895   */
46896 -static int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
46897 -               unsigned long dsisr, unsigned *flt)
46898 -{
46899 -       struct vm_area_struct *vma;
46900 -       unsigned long is_write;
46901 -       int ret;
46902 -
46903 -#if 0
46904 -       if (!IS_VALID_EA(ea)) {
46905 -               return -EFAULT;
46906 -       }
46907 -#endif /* XXX */
46908 -       if (mm == NULL) {
46909 -               return -EFAULT;
46910 -       }
46911 -       if (mm->pgd == NULL) {
46912 -               return -EFAULT;
46913 -       }
46914 -
46915 -       down_read(&mm->mmap_sem);
46916 -       vma = find_vma(mm, ea);
46917 -       if (!vma)
46918 -               goto bad_area;
46919 -       if (vma->vm_start <= ea)
46920 -               goto good_area;
46921 -       if (!(vma->vm_flags & VM_GROWSDOWN))
46922 -               goto bad_area;
46923 -       if (expand_stack(vma, ea))
46924 -               goto bad_area;
46925 -good_area:
46926 -       is_write = dsisr & MFC_DSISR_ACCESS_PUT;
46927 -       if (is_write) {
46928 -               if (!(vma->vm_flags & VM_WRITE))
46929 -                       goto bad_area;
46930 -       } else {
46931 -               if (dsisr & MFC_DSISR_ACCESS_DENIED)
46932 -                       goto bad_area;
46933 -               if (!(vma->vm_flags & (VM_READ | VM_EXEC)))
46934 -                       goto bad_area;
46935 -       }
46936 -       ret = 0;
46937 -       *flt = handle_mm_fault(mm, vma, ea, is_write);
46938 -       if (unlikely(*flt & VM_FAULT_ERROR)) {
46939 -               if (*flt & VM_FAULT_OOM) {
46940 -                       ret = -ENOMEM;
46941 -                       goto bad_area;
46942 -               } else if (*flt & VM_FAULT_SIGBUS) {
46943 -                       ret = -EFAULT;
46944 -                       goto bad_area;
46945 -               }
46946 -               BUG();
46947 -       }
46948 -       if (*flt & VM_FAULT_MAJOR)
46949 -               current->maj_flt++;
46950 -       else
46951 -               current->min_flt++;
46952 -       up_read(&mm->mmap_sem);
46953 -       return ret;
46954 -
46955 -bad_area:
46956 -       up_read(&mm->mmap_sem);
46957 -       return -EFAULT;
46958 -}
46959 -
46960 -static void spufs_handle_dma_error(struct spu_context *ctx,
46961 +static void spufs_handle_event(struct spu_context *ctx,
46962                                 unsigned long ea, int type)
46963  {
46964 +       siginfo_t info;
46965 +
46966         if (ctx->flags & SPU_CREATE_EVENTS_ENABLED) {
46967                 ctx->event_return |= type;
46968                 wake_up_all(&ctx->stop_wq);
46969 -       } else {
46970 -               siginfo_t info;
46971 -               memset(&info, 0, sizeof(info));
46972 -
46973 -               switch (type) {
46974 -               case SPE_EVENT_INVALID_DMA:
46975 -                       info.si_signo = SIGBUS;
46976 -                       info.si_code = BUS_OBJERR;
46977 -                       break;
46978 -               case SPE_EVENT_SPE_DATA_STORAGE:
46979 -                       info.si_signo = SIGBUS;
46980 -                       info.si_addr = (void __user *)ea;
46981 -                       info.si_code = BUS_ADRERR;
46982 -                       break;
46983 -               case SPE_EVENT_DMA_ALIGNMENT:
46984 -                       info.si_signo = SIGBUS;
46985 -                       /* DAR isn't set for an alignment fault :( */
46986 -                       info.si_code = BUS_ADRALN;
46987 -                       break;
46988 -               case SPE_EVENT_SPE_ERROR:
46989 -                       info.si_signo = SIGILL;
46990 -                       info.si_addr = (void __user *)(unsigned long)
46991 -                               ctx->ops->npc_read(ctx) - 4;
46992 -                       info.si_code = ILL_ILLOPC;
46993 -                       break;
46994 -               }
46995 -               if (info.si_signo)
46996 -                       force_sig_info(info.si_signo, &info, current);
46997 +               return;
46998         }
46999 +
47000 +       memset(&info, 0, sizeof(info));
47001 +
47002 +       switch (type) {
47003 +       case SPE_EVENT_INVALID_DMA:
47004 +               info.si_signo = SIGBUS;
47005 +               info.si_code = BUS_OBJERR;
47006 +               break;
47007 +       case SPE_EVENT_SPE_DATA_STORAGE:
47008 +               info.si_signo = SIGSEGV;
47009 +               info.si_addr = (void __user *)ea;
47010 +               info.si_code = SEGV_ACCERR;
47011 +               ctx->ops->restart_dma(ctx);
47012 +               break;
47013 +       case SPE_EVENT_DMA_ALIGNMENT:
47014 +               info.si_signo = SIGBUS;
47015 +               /* DAR isn't set for an alignment fault :( */
47016 +               info.si_code = BUS_ADRALN;
47017 +               break;
47018 +       case SPE_EVENT_SPE_ERROR:
47019 +               info.si_signo = SIGILL;
47020 +               info.si_addr = (void __user *)(unsigned long)
47021 +                       ctx->ops->npc_read(ctx) - 4;
47022 +               info.si_code = ILL_ILLOPC;
47023 +               break;
47024 +       }
47025 +
47026 +       if (info.si_signo)
47027 +               force_sig_info(info.si_signo, &info, current);
47028  }
47029  
47030 -void spufs_dma_callback(struct spu *spu, int type)
47031 +int spufs_handle_class0(struct spu_context *ctx)
47032  {
47033 -       spufs_handle_dma_error(spu->ctx, spu->dar, type);
47034 +       unsigned long stat = ctx->csa.class_0_pending & CLASS0_INTR_MASK;
47035 +
47036 +       if (likely(!stat))
47037 +               return 0;
47038 +
47039 +       if (stat & CLASS0_DMA_ALIGNMENT_INTR)
47040 +               spufs_handle_event(ctx, ctx->csa.dar, SPE_EVENT_DMA_ALIGNMENT);
47041 +
47042 +       if (stat & CLASS0_INVALID_DMA_COMMAND_INTR)
47043 +               spufs_handle_event(ctx, ctx->csa.dar, SPE_EVENT_INVALID_DMA);
47044 +
47045 +       if (stat & CLASS0_SPU_ERROR_INTR)
47046 +               spufs_handle_event(ctx, ctx->csa.dar, SPE_EVENT_SPE_ERROR);
47047 +
47048 +       return -EIO;
47049  }
47050 -EXPORT_SYMBOL_GPL(spufs_dma_callback);
47051  
47052  /*
47053   * bottom half handler for page faults, we can't do this from
47054 @@ -154,7 +108,7 @@
47055         u64 ea, dsisr, access;
47056         unsigned long flags;
47057         unsigned flt = 0;
47058 -       int ret;
47059 +       int ret, ret2;
47060  
47061         /*
47062          * dar and dsisr get passed from the registers
47063 @@ -165,16 +119,8 @@
47064          * in time, we can still expect to get the same fault
47065          * the immediately after the context restore.
47066          */
47067 -       if (ctx->state == SPU_STATE_RUNNABLE) {
47068 -               ea = ctx->spu->dar;
47069 -               dsisr = ctx->spu->dsisr;
47070 -               ctx->spu->dar= ctx->spu->dsisr = 0;
47071 -       } else {
47072 -               ea = ctx->csa.priv1.mfc_dar_RW;
47073 -               dsisr = ctx->csa.priv1.mfc_dsisr_RW;
47074 -               ctx->csa.priv1.mfc_dar_RW = 0;
47075 -               ctx->csa.priv1.mfc_dsisr_RW = 0;
47076 -       }
47077 +       ea = ctx->csa.dar;
47078 +       dsisr = ctx->csa.dsisr;
47079  
47080         if (!(dsisr & (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED)))
47081                 return 0;
47082 @@ -201,7 +147,22 @@
47083         if (ret)
47084                 ret = spu_handle_mm_fault(current->mm, ea, dsisr, &flt);
47085  
47086 -       spu_acquire(ctx);
47087 +       /*
47088 +        * If spu_acquire fails due to a pending signal we just want to return
47089 +        * EINTR to userspace even if that means missing the dma restart or
47090 +        * updating the page fault statistics.
47091 +        */
47092 +       ret2 = spu_acquire(ctx);
47093 +       if (ret2)
47094 +               goto out;
47095 +
47096 +       /*
47097 +        * Clear dsisr under ctxt lock after handling the fault, so that
47098 +        * time slicing will not preempt the context while the page fault
47099 +        * handler is running. Context switch code removes mappings.
47100 +        */
47101 +       ctx->csa.dar = ctx->csa.dsisr = 0;
47102 +
47103         /*
47104          * If we handled the fault successfully and are in runnable
47105          * state, restart the DMA.
47106 @@ -222,9 +183,9 @@
47107                 if (ctx->spu)
47108                         ctx->ops->restart_dma(ctx);
47109         } else
47110 -               spufs_handle_dma_error(ctx, ea, SPE_EVENT_SPE_DATA_STORAGE);
47111 +               spufs_handle_event(ctx, ea, SPE_EVENT_SPE_DATA_STORAGE);
47112  
47113 + out:
47114         spuctx_switch_state(ctx, SPU_UTIL_SYSTEM);
47115         return ret;
47116  }
47117 -EXPORT_SYMBOL_GPL(spufs_handle_class1);
47118 --- a/arch/powerpc/platforms/cell/spufs/file.c
47119 +++ b/arch/powerpc/platforms/cell/spufs/file.c
47120 @@ -40,6 +40,120 @@
47121  
47122  #define SPUFS_MMAP_4K (PAGE_SIZE == 0x1000)
47123  
47124 +/* Simple attribute files */
47125 +struct spufs_attr {
47126 +       int (*get)(void *, u64 *);
47127 +       int (*set)(void *, u64);
47128 +       char get_buf[24];       /* enough to store a u64 and "\n\0" */
47129 +       char set_buf[24];
47130 +       void *data;
47131 +       const char *fmt;        /* format for read operation */
47132 +       struct mutex mutex;     /* protects access to these buffers */
47133 +};
47134 +
47135 +static int spufs_attr_open(struct inode *inode, struct file *file,
47136 +               int (*get)(void *, u64 *), int (*set)(void *, u64),
47137 +               const char *fmt)
47138 +{
47139 +       struct spufs_attr *attr;
47140 +
47141 +       attr = kmalloc(sizeof(*attr), GFP_KERNEL);
47142 +       if (!attr)
47143 +               return -ENOMEM;
47144 +
47145 +       attr->get = get;
47146 +       attr->set = set;
47147 +       attr->data = inode->i_private;
47148 +       attr->fmt = fmt;
47149 +       mutex_init(&attr->mutex);
47150 +       file->private_data = attr;
47151 +
47152 +       return nonseekable_open(inode, file);
47153 +}
47154 +
47155 +static int spufs_attr_release(struct inode *inode, struct file *file)
47156 +{
47157 +       kfree(file->private_data);
47158 +       return 0;
47159 +}
47160 +
47161 +static ssize_t spufs_attr_read(struct file *file, char __user *buf,
47162 +               size_t len, loff_t *ppos)
47163 +{
47164 +       struct spufs_attr *attr;
47165 +       size_t size;
47166 +       ssize_t ret;
47167 +
47168 +       attr = file->private_data;
47169 +       if (!attr->get)
47170 +               return -EACCES;
47171 +
47172 +       ret = mutex_lock_interruptible(&attr->mutex);
47173 +       if (ret)
47174 +               return ret;
47175 +
47176 +       if (*ppos) {            /* continued read */
47177 +               size = strlen(attr->get_buf);
47178 +       } else {                /* first read */
47179 +               u64 val;
47180 +               ret = attr->get(attr->data, &val);
47181 +               if (ret)
47182 +                       goto out;
47183 +
47184 +               size = scnprintf(attr->get_buf, sizeof(attr->get_buf),
47185 +                                attr->fmt, (unsigned long long)val);
47186 +       }
47187 +
47188 +       ret = simple_read_from_buffer(buf, len, ppos, attr->get_buf, size);
47189 +out:
47190 +       mutex_unlock(&attr->mutex);
47191 +       return ret;
47192 +}
47193 +
47194 +static ssize_t spufs_attr_write(struct file *file, const char __user *buf,
47195 +               size_t len, loff_t *ppos)
47196 +{
47197 +       struct spufs_attr *attr;
47198 +       u64 val;
47199 +       size_t size;
47200 +       ssize_t ret;
47201 +
47202 +       attr = file->private_data;
47203 +       if (!attr->set)
47204 +               return -EACCES;
47205 +
47206 +       ret = mutex_lock_interruptible(&attr->mutex);
47207 +       if (ret)
47208 +               return ret;
47209 +
47210 +       ret = -EFAULT;
47211 +       size = min(sizeof(attr->set_buf) - 1, len);
47212 +       if (copy_from_user(attr->set_buf, buf, size))
47213 +               goto out;
47214 +
47215 +       ret = len; /* claim we got the whole input */
47216 +       attr->set_buf[size] = '\0';
47217 +       val = simple_strtol(attr->set_buf, NULL, 0);
47218 +       attr->set(attr->data, val);
47219 +out:
47220 +       mutex_unlock(&attr->mutex);
47221 +       return ret;
47222 +}
47223 +
47224 +#define DEFINE_SPUFS_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt)     \
47225 +static int __fops ## _open(struct inode *inode, struct file *file)     \
47226 +{                                                                      \
47227 +       __simple_attr_check_format(__fmt, 0ull);                        \
47228 +       return spufs_attr_open(inode, file, __get, __set, __fmt);       \
47229 +}                                                                      \
47230 +static struct file_operations __fops = {                               \
47231 +       .owner   = THIS_MODULE,                                         \
47232 +       .open    = __fops ## _open,                                     \
47233 +       .release = spufs_attr_release,                                  \
47234 +       .read    = spufs_attr_read,                                     \
47235 +       .write   = spufs_attr_write,                                    \
47236 +};
47237 +
47238  
47239  static int
47240  spufs_mem_open(struct inode *inode, struct file *file)
47241 @@ -84,9 +198,12 @@
47242         struct spu_context *ctx = file->private_data;
47243         ssize_t ret;
47244  
47245 -       spu_acquire(ctx);
47246 +       ret = spu_acquire(ctx);
47247 +       if (ret)
47248 +               return ret;
47249         ret = __spufs_mem_read(ctx, buffer, size, pos);
47250         spu_release(ctx);
47251 +
47252         return ret;
47253  }
47254  
47255 @@ -106,7 +223,10 @@
47256         if (size > LS_SIZE - pos)
47257                 size = LS_SIZE - pos;
47258  
47259 -       spu_acquire(ctx);
47260 +       ret = spu_acquire(ctx);
47261 +       if (ret)
47262 +               return ret;
47263 +
47264         local_store = ctx->ops->get_ls(ctx);
47265         ret = copy_from_user(local_store + pos, buffer, size);
47266         spu_release(ctx);
47267 @@ -146,7 +266,8 @@
47268         pr_debug("spufs_mem_mmap_nopfn address=0x%lx -> 0x%lx, offset=0x%lx\n",
47269                  addr0, address, offset);
47270  
47271 -       spu_acquire(ctx);
47272 +       if (spu_acquire(ctx))
47273 +               return NOPFN_REFAULT;
47274  
47275         if (ctx->state == SPU_STATE_SAVED) {
47276                 vma->vm_page_prot = __pgprot(pgprot_val(vma->vm_page_prot)
47277 @@ -236,23 +357,32 @@
47278  {
47279         struct spu_context *ctx = vma->vm_file->private_data;
47280         unsigned long area, offset = address - vma->vm_start;
47281 -       int ret;
47282  
47283         offset += vma->vm_pgoff << PAGE_SHIFT;
47284         if (offset >= ps_size)
47285                 return NOPFN_SIGBUS;
47286  
47287 -       /* error here usually means a signal.. we might want to test
47288 -        * the error code more precisely though
47289 +       /*
47290 +        * We have to wait for context to be loaded before we have
47291 +        * pages to hand out to the user, but we don't want to wait
47292 +        * with the mmap_sem held.
47293 +        * It is possible to drop the mmap_sem here, but then we need
47294 +        * to return NOPFN_REFAULT because the mappings may have
47295 +        * hanged.
47296          */
47297 -       ret = spu_acquire_runnable(ctx, 0);
47298 -       if (ret)
47299 +       if (spu_acquire(ctx))
47300                 return NOPFN_REFAULT;
47301  
47302 -       area = ctx->spu->problem_phys + ps_offs;
47303 -       vm_insert_pfn(vma, address, (area + offset) >> PAGE_SHIFT);
47304 -       spu_release(ctx);
47305 +       if (ctx->state == SPU_STATE_SAVED) {
47306 +               up_read(&current->mm->mmap_sem);
47307 +               spufs_wait(ctx->run_wq, ctx->state == SPU_STATE_RUNNABLE);
47308 +               down_read(&current->mm->mmap_sem);
47309 +       } else {
47310 +               area = ctx->spu->problem_phys + ps_offs;
47311 +               vm_insert_pfn(vma, address, (area + offset) >> PAGE_SHIFT);
47312 +       }
47313  
47314 +       spu_release(ctx);
47315         return NOPFN_REFAULT;
47316  }
47317  
47318 @@ -286,25 +416,32 @@
47319  #define spufs_cntl_mmap NULL
47320  #endif /* !SPUFS_MMAP_4K */
47321  
47322 -static u64 spufs_cntl_get(void *data)
47323 +static int spufs_cntl_get(void *data, u64 *val)
47324  {
47325         struct spu_context *ctx = data;
47326 -       u64 val;
47327 +       int ret;
47328  
47329 -       spu_acquire(ctx);
47330 -       val = ctx->ops->status_read(ctx);
47331 +       ret = spu_acquire(ctx);
47332 +       if (ret)
47333 +               return ret;
47334 +       *val = ctx->ops->status_read(ctx);
47335         spu_release(ctx);
47336  
47337 -       return val;
47338 +       return 0;
47339  }
47340  
47341 -static void spufs_cntl_set(void *data, u64 val)
47342 +static int spufs_cntl_set(void *data, u64 val)
47343  {
47344         struct spu_context *ctx = data;
47345 +       int ret;
47346  
47347 -       spu_acquire(ctx);
47348 +       ret = spu_acquire(ctx);
47349 +       if (ret)
47350 +               return ret;
47351         ctx->ops->runcntl_write(ctx, val);
47352         spu_release(ctx);
47353 +
47354 +       return 0;
47355  }
47356  
47357  static int spufs_cntl_open(struct inode *inode, struct file *file)
47358 @@ -317,7 +454,7 @@
47359         if (!i->i_openers++)
47360                 ctx->cntl = inode->i_mapping;
47361         mutex_unlock(&ctx->mapping_lock);
47362 -       return simple_attr_open(inode, file, spufs_cntl_get,
47363 +       return spufs_attr_open(inode, file, spufs_cntl_get,
47364                                         spufs_cntl_set, "0x%08lx");
47365  }
47366  
47367 @@ -327,7 +464,7 @@
47368         struct spufs_inode_info *i = SPUFS_I(inode);
47369         struct spu_context *ctx = i->i_ctx;
47370  
47371 -       simple_attr_close(inode, file);
47372 +       spufs_attr_release(inode, file);
47373  
47374         mutex_lock(&ctx->mapping_lock);
47375         if (!--i->i_openers)
47376 @@ -339,8 +476,8 @@
47377  static const struct file_operations spufs_cntl_fops = {
47378         .open = spufs_cntl_open,
47379         .release = spufs_cntl_release,
47380 -       .read = simple_attr_read,
47381 -       .write = simple_attr_write,
47382 +       .read = spufs_attr_read,
47383 +       .write = spufs_attr_write,
47384         .mmap = spufs_cntl_mmap,
47385  };
47386  
47387 @@ -368,7 +505,9 @@
47388         int ret;
47389         struct spu_context *ctx = file->private_data;
47390  
47391 -       spu_acquire_saved(ctx);
47392 +       ret = spu_acquire_saved(ctx);
47393 +       if (ret)
47394 +               return ret;
47395         ret = __spufs_regs_read(ctx, buffer, size, pos);
47396         spu_release_saved(ctx);
47397         return ret;
47398 @@ -387,7 +526,9 @@
47399                 return -EFBIG;
47400         *pos += size;
47401  
47402 -       spu_acquire_saved(ctx);
47403 +       ret = spu_acquire_saved(ctx);
47404 +       if (ret)
47405 +               return ret;
47406  
47407         ret = copy_from_user(lscsa->gprs + *pos - size,
47408                              buffer, size) ? -EFAULT : size;
47409 @@ -419,7 +560,9 @@
47410         int ret;
47411         struct spu_context *ctx = file->private_data;
47412  
47413 -       spu_acquire_saved(ctx);
47414 +       ret = spu_acquire_saved(ctx);
47415 +       if (ret)
47416 +               return ret;
47417         ret = __spufs_fpcr_read(ctx, buffer, size, pos);
47418         spu_release_saved(ctx);
47419         return ret;
47420 @@ -436,10 +579,12 @@
47421         size = min_t(ssize_t, sizeof(lscsa->fpcr) - *pos, size);
47422         if (size <= 0)
47423                 return -EFBIG;
47424 -       *pos += size;
47425  
47426 -       spu_acquire_saved(ctx);
47427 +       ret = spu_acquire_saved(ctx);
47428 +       if (ret)
47429 +               return ret;
47430  
47431 +       *pos += size;
47432         ret = copy_from_user((char *)&lscsa->fpcr + *pos - size,
47433                              buffer, size) ? -EFAULT : size;
47434  
47435 @@ -486,7 +631,10 @@
47436  
47437         udata = (void __user *)buf;
47438  
47439 -       spu_acquire(ctx);
47440 +       count = spu_acquire(ctx);
47441 +       if (count)
47442 +               return count;
47443 +
47444         for (count = 0; (count + 4) <= len; count += 4, udata++) {
47445                 int ret;
47446                 ret = ctx->ops->mbox_read(ctx, &mbox_data);
47447 @@ -522,12 +670,15 @@
47448                         size_t len, loff_t *pos)
47449  {
47450         struct spu_context *ctx = file->private_data;
47451 +       ssize_t ret;
47452         u32 mbox_stat;
47453  
47454         if (len < 4)
47455                 return -EINVAL;
47456  
47457 -       spu_acquire(ctx);
47458 +       ret = spu_acquire(ctx);
47459 +       if (ret)
47460 +               return ret;
47461  
47462         mbox_stat = ctx->ops->mbox_stat_read(ctx) & 0xff;
47463  
47464 @@ -562,6 +713,9 @@
47465  {
47466         struct spu_context *ctx = spu->ctx;
47467  
47468 +       if (!ctx)
47469 +               return;
47470 +
47471         wake_up_all(&ctx->ibox_wq);
47472         kill_fasync(&ctx->ibox_fasync, SIGIO, POLLIN);
47473  }
47474 @@ -593,7 +747,9 @@
47475  
47476         udata = (void __user *)buf;
47477  
47478 -       spu_acquire(ctx);
47479 +       count = spu_acquire(ctx);
47480 +       if (count)
47481 +               return count;
47482  
47483         /* wait only for the first element */
47484         count = 0;
47485 @@ -639,7 +795,11 @@
47486  
47487         poll_wait(file, &ctx->ibox_wq, wait);
47488  
47489 -       spu_acquire(ctx);
47490 +       /*
47491 +        * For now keep this uninterruptible and also ignore the rule
47492 +        * that poll should not sleep.  Will be fixed later.
47493 +        */
47494 +       mutex_lock(&ctx->state_mutex);
47495         mask = ctx->ops->mbox_stat_poll(ctx, POLLIN | POLLRDNORM);
47496         spu_release(ctx);
47497  
47498 @@ -657,12 +817,15 @@
47499                         size_t len, loff_t *pos)
47500  {
47501         struct spu_context *ctx = file->private_data;
47502 +       ssize_t ret;
47503         u32 ibox_stat;
47504  
47505         if (len < 4)
47506                 return -EINVAL;
47507  
47508 -       spu_acquire(ctx);
47509 +       ret = spu_acquire(ctx);
47510 +       if (ret)
47511 +               return ret;
47512         ibox_stat = (ctx->ops->mbox_stat_read(ctx) >> 16) & 0xff;
47513         spu_release(ctx);
47514  
47515 @@ -698,6 +861,9 @@
47516  {
47517         struct spu_context *ctx = spu->ctx;
47518  
47519 +       if (!ctx)
47520 +               return;
47521 +
47522         wake_up_all(&ctx->wbox_wq);
47523         kill_fasync(&ctx->wbox_fasync, SIGIO, POLLOUT);
47524  }
47525 @@ -731,7 +897,9 @@
47526         if (__get_user(wbox_data, udata))
47527                 return -EFAULT;
47528  
47529 -       spu_acquire(ctx);
47530 +       count = spu_acquire(ctx);
47531 +       if (count)
47532 +               return count;
47533  
47534         /*
47535          * make sure we can at least write one element, by waiting
47536 @@ -772,7 +940,11 @@
47537  
47538         poll_wait(file, &ctx->wbox_wq, wait);
47539  
47540 -       spu_acquire(ctx);
47541 +       /*
47542 +        * For now keep this uninterruptible and also ignore the rule
47543 +        * that poll should not sleep.  Will be fixed later.
47544 +        */
47545 +       mutex_lock(&ctx->state_mutex);
47546         mask = ctx->ops->mbox_stat_poll(ctx, POLLOUT | POLLWRNORM);
47547         spu_release(ctx);
47548  
47549 @@ -790,12 +962,15 @@
47550                         size_t len, loff_t *pos)
47551  {
47552         struct spu_context *ctx = file->private_data;
47553 +       ssize_t ret;
47554         u32 wbox_stat;
47555  
47556         if (len < 4)
47557                 return -EINVAL;
47558  
47559 -       spu_acquire(ctx);
47560 +       ret = spu_acquire(ctx);
47561 +       if (ret)
47562 +               return ret;
47563         wbox_stat = (ctx->ops->mbox_stat_read(ctx) >> 8) & 0xff;
47564         spu_release(ctx);
47565  
47566 @@ -866,7 +1041,9 @@
47567         int ret;
47568         struct spu_context *ctx = file->private_data;
47569  
47570 -       spu_acquire_saved(ctx);
47571 +       ret = spu_acquire_saved(ctx);
47572 +       if (ret)
47573 +               return ret;
47574         ret = __spufs_signal1_read(ctx, buf, len, pos);
47575         spu_release_saved(ctx);
47576  
47577 @@ -877,6 +1054,7 @@
47578                         size_t len, loff_t *pos)
47579  {
47580         struct spu_context *ctx;
47581 +       ssize_t ret;
47582         u32 data;
47583  
47584         ctx = file->private_data;
47585 @@ -887,7 +1065,9 @@
47586         if (copy_from_user(&data, buf, 4))
47587                 return -EFAULT;
47588  
47589 -       spu_acquire(ctx);
47590 +       ret = spu_acquire(ctx);
47591 +       if (ret)
47592 +               return ret;
47593         ctx->ops->signal1_write(ctx, data);
47594         spu_release(ctx);
47595  
47596 @@ -997,7 +1177,9 @@
47597         struct spu_context *ctx = file->private_data;
47598         int ret;
47599  
47600 -       spu_acquire_saved(ctx);
47601 +       ret = spu_acquire_saved(ctx);
47602 +       if (ret)
47603 +               return ret;
47604         ret = __spufs_signal2_read(ctx, buf, len, pos);
47605         spu_release_saved(ctx);
47606  
47607 @@ -1008,6 +1190,7 @@
47608                         size_t len, loff_t *pos)
47609  {
47610         struct spu_context *ctx;
47611 +       ssize_t ret;
47612         u32 data;
47613  
47614         ctx = file->private_data;
47615 @@ -1018,7 +1201,9 @@
47616         if (copy_from_user(&data, buf, 4))
47617                 return -EFAULT;
47618  
47619 -       spu_acquire(ctx);
47620 +       ret = spu_acquire(ctx);
47621 +       if (ret)
47622 +               return ret;
47623         ctx->ops->signal2_write(ctx, data);
47624         spu_release(ctx);
47625  
47626 @@ -1086,33 +1271,42 @@
47627  #define SPU_ATTR_ACQUIRE_SAVED 2
47628  
47629  #define DEFINE_SPUFS_ATTRIBUTE(__name, __get, __set, __fmt, __acquire) \
47630 -static u64 __##__get(void *data)                                       \
47631 +static int __##__get(void *data, u64 *val)                             \
47632  {                                                                      \
47633         struct spu_context *ctx = data;                                 \
47634 -       u64 ret;                                                        \
47635 +       int ret = 0;                                                    \
47636                                                                         \
47637         if (__acquire == SPU_ATTR_ACQUIRE) {                            \
47638 -               spu_acquire(ctx);                                       \
47639 -               ret = __get(ctx);                                       \
47640 +               ret = spu_acquire(ctx);                                 \
47641 +               if (ret)                                                \
47642 +                       return ret;                                     \
47643 +               *val = __get(ctx);                                      \
47644                 spu_release(ctx);                                       \
47645         } else if (__acquire == SPU_ATTR_ACQUIRE_SAVED) {               \
47646 -               spu_acquire_saved(ctx);                                 \
47647 -               ret = __get(ctx);                                       \
47648 +               ret = spu_acquire_saved(ctx);                           \
47649 +               if (ret)                                                \
47650 +                       return ret;                                     \
47651 +               *val = __get(ctx);                                      \
47652                 spu_release_saved(ctx);                                 \
47653         } else                                                          \
47654 -               ret = __get(ctx);                                       \
47655 +               *val = __get(ctx);                                      \
47656                                                                         \
47657 -       return ret;                                                     \
47658 +       return 0;                                                       \
47659  }                                                                      \
47660 -DEFINE_SIMPLE_ATTRIBUTE(__name, __##__get, __set, __fmt);
47661 +DEFINE_SPUFS_SIMPLE_ATTRIBUTE(__name, __##__get, __set, __fmt);
47662  
47663 -static void spufs_signal1_type_set(void *data, u64 val)
47664 +static int spufs_signal1_type_set(void *data, u64 val)
47665  {
47666         struct spu_context *ctx = data;
47667 +       int ret;
47668  
47669 -       spu_acquire(ctx);
47670 +       ret = spu_acquire(ctx);
47671 +       if (ret)
47672 +               return ret;
47673         ctx->ops->signal1_type_set(ctx, val);
47674         spu_release(ctx);
47675 +
47676 +       return 0;
47677  }
47678  
47679  static u64 spufs_signal1_type_get(struct spu_context *ctx)
47680 @@ -1123,13 +1317,18 @@
47681                        spufs_signal1_type_set, "%llu", SPU_ATTR_ACQUIRE);
47682  
47683  
47684 -static void spufs_signal2_type_set(void *data, u64 val)
47685 +static int spufs_signal2_type_set(void *data, u64 val)
47686  {
47687         struct spu_context *ctx = data;
47688 +       int ret;
47689  
47690 -       spu_acquire(ctx);
47691 +       ret = spu_acquire(ctx);
47692 +       if (ret)
47693 +               return ret;
47694         ctx->ops->signal2_type_set(ctx, val);
47695         spu_release(ctx);
47696 +
47697 +       return 0;
47698  }
47699  
47700  static u64 spufs_signal2_type_get(struct spu_context *ctx)
47701 @@ -1329,6 +1528,9 @@
47702  {
47703         struct spu_context *ctx = spu->ctx;
47704  
47705 +       if (!ctx)
47706 +               return;
47707 +
47708         wake_up_all(&ctx->mfc_wq);
47709  
47710         pr_debug("%s %s\n", __FUNCTION__, spu->name);
47711 @@ -1375,12 +1577,17 @@
47712         if (size != 4)
47713                 goto out;
47714  
47715 -       spu_acquire(ctx);
47716 +       ret = spu_acquire(ctx);
47717 +       if (ret)
47718 +               return ret;
47719 +
47720 +       ret = -EINVAL;
47721         if (file->f_flags & O_NONBLOCK) {
47722                 status = ctx->ops->read_mfc_tagstatus(ctx);
47723                 if (!(status & ctx->tagwait))
47724                         ret = -EAGAIN;
47725                 else
47726 +                       /* XXX(hch): shouldn't we clear ret here? */
47727                         ctx->tagwait &= ~status;
47728         } else {
47729                 ret = spufs_wait(ctx->mfc_wq,
47730 @@ -1505,7 +1712,11 @@
47731         if (ret)
47732                 goto out;
47733  
47734 -       ret = spu_acquire_runnable(ctx, 0);
47735 +       ret = spu_acquire(ctx);
47736 +       if (ret)
47737 +               goto out;
47738 +
47739 +       ret = spufs_wait(ctx->run_wq, ctx->state == SPU_STATE_RUNNABLE);
47740         if (ret)
47741                 goto out;
47742  
47743 @@ -1539,7 +1750,11 @@
47744  
47745         poll_wait(file, &ctx->mfc_wq, wait);
47746  
47747 -       spu_acquire(ctx);
47748 +       /*
47749 +        * For now keep this uninterruptible and also ignore the rule
47750 +        * that poll should not sleep.  Will be fixed later.
47751 +        */
47752 +       mutex_lock(&ctx->state_mutex);
47753         ctx->ops->set_mfc_query(ctx, ctx->tagwait, 2);
47754         free_elements = ctx->ops->get_mfc_free_elements(ctx);
47755         tagstatus = ctx->ops->read_mfc_tagstatus(ctx);
47756 @@ -1562,7 +1777,9 @@
47757         struct spu_context *ctx = file->private_data;
47758         int ret;
47759  
47760 -       spu_acquire(ctx);
47761 +       ret = spu_acquire(ctx);
47762 +       if (ret)
47763 +               return ret;
47764  #if 0
47765  /* this currently hangs */
47766         ret = spufs_wait(ctx->mfc_wq,
47767 @@ -1605,12 +1822,18 @@
47768         .mmap    = spufs_mfc_mmap,
47769  };
47770  
47771 -static void spufs_npc_set(void *data, u64 val)
47772 +static int spufs_npc_set(void *data, u64 val)
47773  {
47774         struct spu_context *ctx = data;
47775 -       spu_acquire(ctx);
47776 +       int ret;
47777 +
47778 +       ret = spu_acquire(ctx);
47779 +       if (ret)
47780 +               return ret;
47781         ctx->ops->npc_write(ctx, val);
47782         spu_release(ctx);
47783 +
47784 +       return 0;
47785  }
47786  
47787  static u64 spufs_npc_get(struct spu_context *ctx)
47788 @@ -1620,13 +1843,19 @@
47789  DEFINE_SPUFS_ATTRIBUTE(spufs_npc_ops, spufs_npc_get, spufs_npc_set,
47790                        "0x%llx\n", SPU_ATTR_ACQUIRE);
47791  
47792 -static void spufs_decr_set(void *data, u64 val)
47793 +static int spufs_decr_set(void *data, u64 val)
47794  {
47795         struct spu_context *ctx = data;
47796         struct spu_lscsa *lscsa = ctx->csa.lscsa;
47797 -       spu_acquire_saved(ctx);
47798 +       int ret;
47799 +
47800 +       ret = spu_acquire_saved(ctx);
47801 +       if (ret)
47802 +               return ret;
47803         lscsa->decr.slot[0] = (u32) val;
47804         spu_release_saved(ctx);
47805 +
47806 +       return 0;
47807  }
47808  
47809  static u64 spufs_decr_get(struct spu_context *ctx)
47810 @@ -1637,15 +1866,21 @@
47811  DEFINE_SPUFS_ATTRIBUTE(spufs_decr_ops, spufs_decr_get, spufs_decr_set,
47812                        "0x%llx\n", SPU_ATTR_ACQUIRE_SAVED);
47813  
47814 -static void spufs_decr_status_set(void *data, u64 val)
47815 +static int spufs_decr_status_set(void *data, u64 val)
47816  {
47817         struct spu_context *ctx = data;
47818 -       spu_acquire_saved(ctx);
47819 +       int ret;
47820 +
47821 +       ret = spu_acquire_saved(ctx);
47822 +       if (ret)
47823 +               return ret;
47824         if (val)
47825                 ctx->csa.priv2.mfc_control_RW |= MFC_CNTL_DECREMENTER_RUNNING;
47826         else
47827                 ctx->csa.priv2.mfc_control_RW &= ~MFC_CNTL_DECREMENTER_RUNNING;
47828         spu_release_saved(ctx);
47829 +
47830 +       return 0;
47831  }
47832  
47833  static u64 spufs_decr_status_get(struct spu_context *ctx)
47834 @@ -1659,13 +1894,19 @@
47835                        spufs_decr_status_set, "0x%llx\n",
47836                        SPU_ATTR_ACQUIRE_SAVED);
47837  
47838 -static void spufs_event_mask_set(void *data, u64 val)
47839 +static int spufs_event_mask_set(void *data, u64 val)
47840  {
47841         struct spu_context *ctx = data;
47842         struct spu_lscsa *lscsa = ctx->csa.lscsa;
47843 -       spu_acquire_saved(ctx);
47844 +       int ret;
47845 +
47846 +       ret = spu_acquire_saved(ctx);
47847 +       if (ret)
47848 +               return ret;
47849         lscsa->event_mask.slot[0] = (u32) val;
47850         spu_release_saved(ctx);
47851 +
47852 +       return 0;
47853  }
47854  
47855  static u64 spufs_event_mask_get(struct spu_context *ctx)
47856 @@ -1690,13 +1931,19 @@
47857  DEFINE_SPUFS_ATTRIBUTE(spufs_event_status_ops, spufs_event_status_get,
47858                        NULL, "0x%llx\n", SPU_ATTR_ACQUIRE_SAVED)
47859  
47860 -static void spufs_srr0_set(void *data, u64 val)
47861 +static int spufs_srr0_set(void *data, u64 val)
47862  {
47863         struct spu_context *ctx = data;
47864         struct spu_lscsa *lscsa = ctx->csa.lscsa;
47865 -       spu_acquire_saved(ctx);
47866 +       int ret;
47867 +
47868 +       ret = spu_acquire_saved(ctx);
47869 +       if (ret)
47870 +               return ret;
47871         lscsa->srr0.slot[0] = (u32) val;
47872         spu_release_saved(ctx);
47873 +
47874 +       return 0;
47875  }
47876  
47877  static u64 spufs_srr0_get(struct spu_context *ctx)
47878 @@ -1727,10 +1974,12 @@
47879         return ctx->object_id;
47880  }
47881  
47882 -static void spufs_object_id_set(void *data, u64 id)
47883 +static int spufs_object_id_set(void *data, u64 id)
47884  {
47885         struct spu_context *ctx = data;
47886         ctx->object_id = id;
47887 +
47888 +       return 0;
47889  }
47890  
47891  DEFINE_SPUFS_ATTRIBUTE(spufs_object_id_ops, spufs_object_id_get,
47892 @@ -1777,13 +2026,13 @@
47893  static ssize_t __spufs_mbox_info_read(struct spu_context *ctx,
47894                         char __user *buf, size_t len, loff_t *pos)
47895  {
47896 -       u32 mbox_stat;
47897         u32 data;
47898  
47899 -       mbox_stat = ctx->csa.prob.mb_stat_R;
47900 -       if (mbox_stat & 0x0000ff) {
47901 -               data = ctx->csa.prob.pu_mb_R;
47902 -       }
47903 +       /* EOF if there's no entry in the mbox */
47904 +       if (!(ctx->csa.prob.mb_stat_R & 0x0000ff))
47905 +               return 0;
47906 +
47907 +       data = ctx->csa.prob.pu_mb_R;
47908  
47909         return simple_read_from_buffer(buf, len, pos, &data, sizeof data);
47910  }
47911 @@ -1797,7 +2046,9 @@
47912         if (!access_ok(VERIFY_WRITE, buf, len))
47913                 return -EFAULT;
47914  
47915 -       spu_acquire_saved(ctx);
47916 +       ret = spu_acquire_saved(ctx);
47917 +       if (ret)
47918 +               return ret;
47919         spin_lock(&ctx->csa.register_lock);
47920         ret = __spufs_mbox_info_read(ctx, buf, len, pos);
47921         spin_unlock(&ctx->csa.register_lock);
47922 @@ -1815,13 +2066,13 @@
47923  static ssize_t __spufs_ibox_info_read(struct spu_context *ctx,
47924                                 char __user *buf, size_t len, loff_t *pos)
47925  {
47926 -       u32 ibox_stat;
47927         u32 data;
47928  
47929 -       ibox_stat = ctx->csa.prob.mb_stat_R;
47930 -       if (ibox_stat & 0xff0000) {
47931 -               data = ctx->csa.priv2.puint_mb_R;
47932 -       }
47933 +       /* EOF if there's no entry in the ibox */
47934 +       if (!(ctx->csa.prob.mb_stat_R & 0xff0000))
47935 +               return 0;
47936 +
47937 +       data = ctx->csa.priv2.puint_mb_R;
47938  
47939         return simple_read_from_buffer(buf, len, pos, &data, sizeof data);
47940  }
47941 @@ -1835,7 +2086,9 @@
47942         if (!access_ok(VERIFY_WRITE, buf, len))
47943                 return -EFAULT;
47944  
47945 -       spu_acquire_saved(ctx);
47946 +       ret = spu_acquire_saved(ctx);
47947 +       if (ret)
47948 +               return ret;
47949         spin_lock(&ctx->csa.register_lock);
47950         ret = __spufs_ibox_info_read(ctx, buf, len, pos);
47951         spin_unlock(&ctx->csa.register_lock);
47952 @@ -1876,7 +2129,9 @@
47953         if (!access_ok(VERIFY_WRITE, buf, len))
47954                 return -EFAULT;
47955  
47956 -       spu_acquire_saved(ctx);
47957 +       ret = spu_acquire_saved(ctx);
47958 +       if (ret)
47959 +               return ret;
47960         spin_lock(&ctx->csa.register_lock);
47961         ret = __spufs_wbox_info_read(ctx, buf, len, pos);
47962         spin_unlock(&ctx->csa.register_lock);
47963 @@ -1926,7 +2181,9 @@
47964         if (!access_ok(VERIFY_WRITE, buf, len))
47965                 return -EFAULT;
47966  
47967 -       spu_acquire_saved(ctx);
47968 +       ret = spu_acquire_saved(ctx);
47969 +       if (ret)
47970 +               return ret;
47971         spin_lock(&ctx->csa.register_lock);
47972         ret = __spufs_dma_info_read(ctx, buf, len, pos);
47973         spin_unlock(&ctx->csa.register_lock);
47974 @@ -1977,7 +2234,9 @@
47975         struct spu_context *ctx = file->private_data;
47976         int ret;
47977  
47978 -       spu_acquire_saved(ctx);
47979 +       ret = spu_acquire_saved(ctx);
47980 +       if (ret)
47981 +               return ret;
47982         spin_lock(&ctx->csa.register_lock);
47983         ret = __spufs_proxydma_info_read(ctx, buf, len, pos);
47984         spin_unlock(&ctx->csa.register_lock);
47985 @@ -2066,8 +2325,12 @@
47986  static int spufs_show_stat(struct seq_file *s, void *private)
47987  {
47988         struct spu_context *ctx = s->private;
47989 +       int ret;
47990 +
47991 +       ret = spu_acquire(ctx);
47992 +       if (ret)
47993 +               return ret;
47994  
47995 -       spu_acquire(ctx);
47996         seq_printf(s, "%s %llu %llu %llu %llu "
47997                       "%llu %llu %llu %llu %llu %llu %llu %llu\n",
47998                 ctx_state_names[ctx->stats.util_state],
47999 --- a/arch/powerpc/platforms/cell/spufs/hw_ops.c
48000 +++ b/arch/powerpc/platforms/cell/spufs/hw_ops.c
48001 @@ -76,16 +76,18 @@
48002                 if (stat & 0xff0000)
48003                         ret |= POLLIN | POLLRDNORM;
48004                 else {
48005 -                       spu_int_stat_clear(spu, 2, 0x1);
48006 -                       spu_int_mask_or(spu, 2, 0x1);
48007 +                       spu_int_stat_clear(spu, 2, CLASS2_MAILBOX_INTR);
48008 +                       spu_int_mask_or(spu, 2, CLASS2_ENABLE_MAILBOX_INTR);
48009                 }
48010         }
48011         if (events & (POLLOUT | POLLWRNORM)) {
48012                 if (stat & 0x00ff00)
48013                         ret = POLLOUT | POLLWRNORM;
48014                 else {
48015 -                       spu_int_stat_clear(spu, 2, 0x10);
48016 -                       spu_int_mask_or(spu, 2, 0x10);
48017 +                       spu_int_stat_clear(spu, 2,
48018 +                                       CLASS2_MAILBOX_THRESHOLD_INTR);
48019 +                       spu_int_mask_or(spu, 2,
48020 +                                       CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR);
48021                 }
48022         }
48023         spin_unlock_irq(&spu->register_lock);
48024 @@ -106,7 +108,7 @@
48025                 ret = 4;
48026         } else {
48027                 /* make sure we get woken up by the interrupt */
48028 -               spu_int_mask_or(spu, 2, 0x1);
48029 +               spu_int_mask_or(spu, 2, CLASS2_ENABLE_MAILBOX_INTR);
48030                 ret = 0;
48031         }
48032         spin_unlock_irq(&spu->register_lock);
48033 @@ -127,7 +129,7 @@
48034         } else {
48035                 /* make sure we get woken up by the interrupt when space
48036                    becomes available */
48037 -               spu_int_mask_or(spu, 2, 0x10);
48038 +               spu_int_mask_or(spu, 2, CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR);
48039                 ret = 0;
48040         }
48041         spin_unlock_irq(&spu->register_lock);
48042 @@ -206,6 +208,11 @@
48043         return ctx->spu->local_store;
48044  }
48045  
48046 +static void spu_hw_privcntl_write(struct spu_context *ctx, u64 val)
48047 +{
48048 +       out_be64(&ctx->spu->priv2->spu_privcntl_RW, val);
48049 +}
48050 +
48051  static u32 spu_hw_runcntl_read(struct spu_context *ctx)
48052  {
48053         return in_be32(&ctx->spu->problem->spu_runcntl_RW);
48054 @@ -215,11 +222,21 @@
48055  {
48056         spin_lock_irq(&ctx->spu->register_lock);
48057         if (val & SPU_RUNCNTL_ISOLATE)
48058 -               out_be64(&ctx->spu->priv2->spu_privcntl_RW, 4LL);
48059 +               spu_hw_privcntl_write(ctx,
48060 +                       SPU_PRIVCNT_LOAD_REQUEST_ENABLE_MASK);
48061         out_be32(&ctx->spu->problem->spu_runcntl_RW, val);
48062         spin_unlock_irq(&ctx->spu->register_lock);
48063  }
48064  
48065 +static void spu_hw_runcntl_stop(struct spu_context *ctx)
48066 +{
48067 +       spin_lock_irq(&ctx->spu->register_lock);
48068 +       out_be32(&ctx->spu->problem->spu_runcntl_RW, SPU_RUNCNTL_STOP);
48069 +       while (in_be32(&ctx->spu->problem->spu_status_R) & SPU_STATUS_RUNNING)
48070 +               cpu_relax();
48071 +       spin_unlock_irq(&ctx->spu->register_lock);
48072 +}
48073 +
48074  static void spu_hw_master_start(struct spu_context *ctx)
48075  {
48076         struct spu *spu = ctx->spu;
48077 @@ -319,8 +336,10 @@
48078         .npc_write = spu_hw_npc_write,
48079         .status_read = spu_hw_status_read,
48080         .get_ls = spu_hw_get_ls,
48081 +       .privcntl_write = spu_hw_privcntl_write,
48082         .runcntl_read = spu_hw_runcntl_read,
48083         .runcntl_write = spu_hw_runcntl_write,
48084 +       .runcntl_stop = spu_hw_runcntl_stop,
48085         .master_start = spu_hw_master_start,
48086         .master_stop = spu_hw_master_stop,
48087         .set_mfc_query = spu_hw_set_mfc_query,
48088 --- a/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
48089 +++ b/arch/powerpc/platforms/cell/spufs/lscsa_alloc.c
48090 @@ -28,6 +28,8 @@
48091  #include <asm/spu_csa.h>
48092  #include <asm/mmu.h>
48093  
48094 +#include "spufs.h"
48095 +
48096  static int spu_alloc_lscsa_std(struct spu_state *csa)
48097  {
48098         struct spu_lscsa *lscsa;
48099 @@ -73,7 +75,7 @@
48100         int             i, j, n_4k;
48101  
48102         /* Check availability of 64K pages */
48103 -       if (mmu_psize_defs[MMU_PAGE_64K].shift == 0)
48104 +       if (!spu_64k_pages_available())
48105                 goto fail;
48106  
48107         csa->use_big_pages = 1;
48108 --- a/arch/powerpc/platforms/cell/spufs/run.c
48109 +++ b/arch/powerpc/platforms/cell/spufs/run.c
48110 @@ -15,24 +15,55 @@
48111  {
48112         struct spu_context *ctx = spu->ctx;
48113  
48114 -       wake_up_all(&ctx->stop_wq);
48115 +       /*
48116 +        * It should be impossible to preempt a context while an exception
48117 +        * is being processed, since the context switch code is specially
48118 +        * coded to deal with interrupts ... But, just in case, sanity check
48119 +        * the context pointer.  It is OK to return doing nothing since
48120 +        * the exception will be regenerated when the context is resumed.
48121 +        */
48122 +       if (ctx) {
48123 +               /* Copy exception arguments into module specific structure */
48124 +               ctx->csa.class_0_pending = spu->class_0_pending;
48125 +               ctx->csa.dsisr = spu->dsisr;
48126 +               ctx->csa.dar = spu->dar;
48127 +
48128 +               /* ensure that the exception status has hit memory before a
48129 +                * thread waiting on the context's stop queue is woken */
48130 +               smp_wmb();
48131 +
48132 +               wake_up_all(&ctx->stop_wq);
48133 +       }
48134 +
48135 +       /* Clear callback arguments from spu structure */
48136 +       spu->class_0_pending = 0;
48137 +       spu->dsisr = 0;
48138 +       spu->dar = 0;
48139  }
48140  
48141 -static inline int spu_stopped(struct spu_context *ctx, u32 *stat)
48142 +int spu_stopped(struct spu_context *ctx, u32 *stat)
48143  {
48144 -       struct spu *spu;
48145 -       u64 pte_fault;
48146 +       u64 dsisr;
48147 +       u32 stopped;
48148  
48149         *stat = ctx->ops->status_read(ctx);
48150  
48151 -       spu = ctx->spu;
48152 -       if (ctx->state != SPU_STATE_RUNNABLE ||
48153 -           test_bit(SPU_SCHED_NOTIFY_ACTIVE, &ctx->sched_flags))
48154 +       if (test_bit(SPU_SCHED_NOTIFY_ACTIVE, &ctx->sched_flags))
48155 +               return 1;
48156 +
48157 +       stopped = SPU_STATUS_INVALID_INSTR | SPU_STATUS_SINGLE_STEP |
48158 +               SPU_STATUS_STOPPED_BY_HALT | SPU_STATUS_STOPPED_BY_STOP;
48159 +       if (*stat & stopped)
48160 +               return 1;
48161 +
48162 +       dsisr = ctx->csa.dsisr;
48163 +       if (dsisr & (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED))
48164                 return 1;
48165 -       pte_fault = spu->dsisr &
48166 -           (MFC_DSISR_PTE_NOT_FOUND | MFC_DSISR_ACCESS_DENIED);
48167 -       return (!(*stat & SPU_STATUS_RUNNING) || pte_fault || spu->class_0_pending) ?
48168 -               1 : 0;
48169 +
48170 +       if (ctx->csa.class_0_pending)
48171 +               return 1;
48172 +
48173 +       return 0;
48174  }
48175  
48176  static int spu_setup_isolated(struct spu_context *ctx)
48177 @@ -128,34 +159,66 @@
48178  
48179  static int spu_run_init(struct spu_context *ctx, u32 *npc)
48180  {
48181 +       unsigned long runcntl = SPU_RUNCNTL_RUNNABLE;
48182 +       int ret;
48183 +
48184         spuctx_switch_state(ctx, SPU_UTIL_SYSTEM);
48185  
48186 -       if (ctx->flags & SPU_CREATE_ISOLATE) {
48187 -               unsigned long runcntl;
48188 +       /*
48189 +        * NOSCHED is synchronous scheduling with respect to the caller.
48190 +        * The caller waits for the context to be loaded.
48191 +        */
48192 +       if (ctx->flags & SPU_CREATE_NOSCHED) {
48193 +               if (ctx->state == SPU_STATE_SAVED) {
48194 +                       ret = spu_activate(ctx, 0);
48195 +                       if (ret)
48196 +                               return ret;
48197 +               }
48198 +       }
48199  
48200 +       /*
48201 +        * Apply special setup as required.
48202 +        */
48203 +       if (ctx->flags & SPU_CREATE_ISOLATE) {
48204                 if (!(ctx->ops->status_read(ctx) & SPU_STATUS_ISOLATED_STATE)) {
48205 -                       int ret = spu_setup_isolated(ctx);
48206 +                       ret = spu_setup_isolated(ctx);
48207                         if (ret)
48208                                 return ret;
48209                 }
48210  
48211 -               /* if userspace has set the runcntrl register (eg, to issue an
48212 -                * isolated exit), we need to re-set it here */
48213 +               /*
48214 +                * If userspace has set the runcntrl register (eg, to
48215 +                * issue an isolated exit), we need to re-set it here
48216 +                */
48217                 runcntl = ctx->ops->runcntl_read(ctx) &
48218                         (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE);
48219                 if (runcntl == 0)
48220                         runcntl = SPU_RUNCNTL_RUNNABLE;
48221 +       }
48222 +
48223 +       if (ctx->flags & SPU_CREATE_NOSCHED) {
48224 +               spuctx_switch_state(ctx, SPU_UTIL_USER);
48225                 ctx->ops->runcntl_write(ctx, runcntl);
48226         } else {
48227 -               unsigned long mode = SPU_PRIVCNTL_MODE_NORMAL;
48228 -               ctx->ops->npc_write(ctx, *npc);
48229 +               unsigned long privcntl;
48230 +
48231                 if (test_thread_flag(TIF_SINGLESTEP))
48232 -                       mode = SPU_PRIVCNTL_MODE_SINGLE_STEP;
48233 -               out_be64(&ctx->spu->priv2->spu_privcntl_RW, mode);
48234 -               ctx->ops->runcntl_write(ctx, SPU_RUNCNTL_RUNNABLE);
48235 -       }
48236 +                       privcntl = SPU_PRIVCNTL_MODE_SINGLE_STEP;
48237 +               else
48238 +                       privcntl = SPU_PRIVCNTL_MODE_NORMAL;
48239  
48240 -       spuctx_switch_state(ctx, SPU_UTIL_USER);
48241 +               ctx->ops->npc_write(ctx, *npc);
48242 +               ctx->ops->privcntl_write(ctx, privcntl);
48243 +               ctx->ops->runcntl_write(ctx, runcntl);
48244 +
48245 +               if (ctx->state == SPU_STATE_SAVED) {
48246 +                       ret = spu_activate(ctx, 0);
48247 +                       if (ret)
48248 +                               return ret;
48249 +               } else {
48250 +                       spuctx_switch_state(ctx, SPU_UTIL_USER);
48251 +               }
48252 +       }
48253  
48254         return 0;
48255  }
48256 @@ -165,6 +228,8 @@
48257  {
48258         int ret = 0;
48259  
48260 +       spu_del_from_rq(ctx);
48261 +
48262         *status = ctx->ops->status_read(ctx);
48263         *npc = ctx->ops->npc_read(ctx);
48264  
48265 @@ -177,26 +242,6 @@
48266         return ret;
48267  }
48268  
48269 -static int spu_reacquire_runnable(struct spu_context *ctx, u32 *npc,
48270 -                                        u32 *status)
48271 -{
48272 -       int ret;
48273 -
48274 -       ret = spu_run_fini(ctx, npc, status);
48275 -       if (ret)
48276 -               return ret;
48277 -
48278 -       if (*status & (SPU_STATUS_STOPPED_BY_STOP | SPU_STATUS_STOPPED_BY_HALT))
48279 -               return *status;
48280 -
48281 -       ret = spu_acquire_runnable(ctx, 0);
48282 -       if (ret)
48283 -               return ret;
48284 -
48285 -       spuctx_switch_state(ctx, SPU_UTIL_USER);
48286 -       return 0;
48287 -}
48288 -
48289  /*
48290   * SPU syscall restarting is tricky because we violate the basic
48291   * assumption that the signal handler is running on the interrupted
48292 @@ -247,7 +292,7 @@
48293         u32 ls_pointer, npc;
48294         void __iomem *ls;
48295         long spu_ret;
48296 -       int ret;
48297 +       int ret, ret2;
48298  
48299         /* get syscall block from local store */
48300         npc = ctx->ops->npc_read(ctx) & ~3;
48301 @@ -269,9 +314,11 @@
48302                 if (spu_ret <= -ERESTARTSYS) {
48303                         ret = spu_handle_restartsys(ctx, &spu_ret, &npc);
48304                 }
48305 -               spu_acquire(ctx);
48306 +               ret2 = spu_acquire(ctx);
48307                 if (ret == -ERESTARTSYS)
48308                         return ret;
48309 +               if (ret2)
48310 +                       return -EINTR;
48311         }
48312  
48313         /* write result, jump over indirect pointer */
48314 @@ -281,18 +328,6 @@
48315         return ret;
48316  }
48317  
48318 -static inline int spu_process_events(struct spu_context *ctx)
48319 -{
48320 -       struct spu *spu = ctx->spu;
48321 -       int ret = 0;
48322 -
48323 -       if (spu->class_0_pending)
48324 -               ret = spu_irq_class_0_bottom(spu);
48325 -       if (!ret && signal_pending(current))
48326 -               ret = -ERESTARTSYS;
48327 -       return ret;
48328 -}
48329 -
48330  long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
48331  {
48332         int ret;
48333 @@ -302,29 +337,14 @@
48334         if (mutex_lock_interruptible(&ctx->run_mutex))
48335                 return -ERESTARTSYS;
48336  
48337 -       ctx->ops->master_start(ctx);
48338 +       spu_enable_spu(ctx);
48339         ctx->event_return = 0;
48340  
48341 -       spu_acquire(ctx);
48342 -       if (ctx->state == SPU_STATE_SAVED) {
48343 -               __spu_update_sched_info(ctx);
48344 -               spu_set_timeslice(ctx);
48345 -
48346 -               ret = spu_activate(ctx, 0);
48347 -               if (ret) {
48348 -                       spu_release(ctx);
48349 -                       goto out;
48350 -               }
48351 -       } else {
48352 -               /*
48353 -                * We have to update the scheduling priority under active_mutex
48354 -                * to protect against find_victim().
48355 -                *
48356 -                * No need to update the timeslice ASAP, it will get updated
48357 -                * once the current one has expired.
48358 -                */
48359 -               spu_update_sched_info(ctx);
48360 -       }
48361 +       ret = spu_acquire(ctx);
48362 +       if (ret)
48363 +               goto out_unlock;
48364 +
48365 +       spu_update_sched_info(ctx);
48366  
48367         ret = spu_run_init(ctx, npc);
48368         if (ret) {
48369 @@ -358,14 +378,12 @@
48370                 if (ret)
48371                         break;
48372  
48373 -               if (unlikely(ctx->state != SPU_STATE_RUNNABLE)) {
48374 -                       ret = spu_reacquire_runnable(ctx, npc, &status);
48375 -                       if (ret)
48376 -                               goto out2;
48377 -                       continue;
48378 -               }
48379 -               ret = spu_process_events(ctx);
48380 +               ret = spufs_handle_class0(ctx);
48381 +               if (ret)
48382 +                       break;
48383  
48384 +               if (signal_pending(current))
48385 +                       ret = -ERESTARTSYS;
48386         } while (!ret && !(status & (SPU_STATUS_STOPPED_BY_STOP |
48387                                       SPU_STATUS_STOPPED_BY_HALT |
48388                                        SPU_STATUS_SINGLE_STEP)));
48389 @@ -376,11 +394,10 @@
48390                 ctx->stats.libassist++;
48391  
48392  
48393 -       ctx->ops->master_stop(ctx);
48394 +       spu_disable_spu(ctx);
48395         ret = spu_run_fini(ctx, npc, &status);
48396         spu_yield(ctx);
48397  
48398 -out2:
48399         if ((ret == 0) ||
48400             ((ret == -ERESTARTSYS) &&
48401              ((status & SPU_STATUS_STOPPED_BY_HALT) ||
48402 @@ -401,6 +418,7 @@
48403  
48404  out:
48405         *event = ctx->event_return;
48406 +out_unlock:
48407         mutex_unlock(&ctx->run_mutex);
48408         return ret;
48409  }
48410 --- a/arch/powerpc/platforms/cell/spufs/sched.c
48411 +++ b/arch/powerpc/platforms/cell/spufs/sched.c
48412 @@ -58,6 +58,7 @@
48413  static struct spu_prio_array *spu_prio;
48414  static struct task_struct *spusched_task;
48415  static struct timer_list spusched_timer;
48416 +static struct timer_list spuloadavg_timer;
48417  
48418  /*
48419   * Priority of a normal, non-rt, non-niced'd process (aka nice level 0).
48420 @@ -105,15 +106,21 @@
48421  void __spu_update_sched_info(struct spu_context *ctx)
48422  {
48423         /*
48424 -        * 32-Bit assignment are atomic on powerpc, and we don't care about
48425 -        * memory ordering here because retriving the controlling thread is
48426 -        * per defintion racy.
48427 +        * assert that the context is not on the runqueue, so it is safe
48428 +        * to change its scheduling parameters.
48429 +        */
48430 +       BUG_ON(!list_empty(&ctx->rq));
48431 +
48432 +       /*
48433 +        * 32-Bit assignments are atomic on powerpc, and we don't care about
48434 +        * memory ordering here because retrieving the controlling thread is
48435 +        * per definition racy.
48436          */
48437         ctx->tid = current->pid;
48438  
48439         /*
48440          * We do our own priority calculations, so we normally want
48441 -        * ->static_prio to start with. Unfortunately thies field
48442 +        * ->static_prio to start with. Unfortunately this field
48443          * contains junk for threads with a realtime scheduling
48444          * policy so we have to look at ->prio in this case.
48445          */
48446 @@ -124,23 +131,32 @@
48447         ctx->policy = current->policy;
48448  
48449         /*
48450 -        * A lot of places that don't hold list_mutex poke into
48451 -        * cpus_allowed, including grab_runnable_context which
48452 -        * already holds the runq_lock.  So abuse runq_lock
48453 -        * to protect this field aswell.
48454 +        * TO DO: the context may be loaded, so we may need to activate
48455 +        * it again on a different node. But it shouldn't hurt anything
48456 +        * to update its parameters, because we know that the scheduler
48457 +        * is not actively looking at this field, since it is not on the
48458 +        * runqueue. The context will be rescheduled on the proper node
48459 +        * if it is timesliced or preempted.
48460          */
48461 -       spin_lock(&spu_prio->runq_lock);
48462         ctx->cpus_allowed = current->cpus_allowed;
48463 -       spin_unlock(&spu_prio->runq_lock);
48464  }
48465  
48466  void spu_update_sched_info(struct spu_context *ctx)
48467  {
48468 -       int node = ctx->spu->node;
48469 +       int node;
48470  
48471 -       mutex_lock(&cbe_spu_info[node].list_mutex);
48472 -       __spu_update_sched_info(ctx);
48473 -       mutex_unlock(&cbe_spu_info[node].list_mutex);
48474 +       if (ctx->state == SPU_STATE_RUNNABLE) {
48475 +               node = ctx->spu->node;
48476 +
48477 +               /*
48478 +                * Take list_mutex to sync with find_victim().
48479 +                */
48480 +               mutex_lock(&cbe_spu_info[node].list_mutex);
48481 +               __spu_update_sched_info(ctx);
48482 +               mutex_unlock(&cbe_spu_info[node].list_mutex);
48483 +       } else {
48484 +               __spu_update_sched_info(ctx);
48485 +       }
48486  }
48487  
48488  static int __node_allowed(struct spu_context *ctx, int node)
48489 @@ -174,7 +190,7 @@
48490          * Wake up the active spu_contexts.
48491          *
48492          * When the awakened processes see their "notify_active" flag is set,
48493 -        * they will call spu_switch_notify();
48494 +        * they will call spu_switch_notify().
48495          */
48496         for_each_online_node(node) {
48497                 struct spu *spu;
48498 @@ -221,7 +237,6 @@
48499         spu->wbox_callback = spufs_wbox_callback;
48500         spu->stop_callback = spufs_stop_callback;
48501         spu->mfc_callback = spufs_mfc_callback;
48502 -       spu->dma_callback = spufs_dma_callback;
48503         mb();
48504         spu_unmap_mappings(ctx);
48505         spu_restore(&ctx->csa, spu);
48506 @@ -409,7 +424,6 @@
48507         spu->wbox_callback = NULL;
48508         spu->stop_callback = NULL;
48509         spu->mfc_callback = NULL;
48510 -       spu->dma_callback = NULL;
48511         spu_associate_mm(spu, NULL);
48512         spu->pid = 0;
48513         spu->tgid = 0;
48514 @@ -454,6 +468,13 @@
48515         }
48516  }
48517  
48518 +static void spu_add_to_rq(struct spu_context *ctx)
48519 +{
48520 +       spin_lock(&spu_prio->runq_lock);
48521 +       __spu_add_to_rq(ctx);
48522 +       spin_unlock(&spu_prio->runq_lock);
48523 +}
48524 +
48525  static void __spu_del_from_rq(struct spu_context *ctx)
48526  {
48527         int prio = ctx->prio;
48528 @@ -468,10 +489,24 @@
48529         }
48530  }
48531  
48532 +void spu_del_from_rq(struct spu_context *ctx)
48533 +{
48534 +       spin_lock(&spu_prio->runq_lock);
48535 +       __spu_del_from_rq(ctx);
48536 +       spin_unlock(&spu_prio->runq_lock);
48537 +}
48538 +
48539  static void spu_prio_wait(struct spu_context *ctx)
48540  {
48541         DEFINE_WAIT(wait);
48542  
48543 +       /*
48544 +        * The caller must explicitly wait for a context to be loaded
48545 +        * if the nosched flag is set.  If NOSCHED is not set, the caller
48546 +        * queues the context and waits for an spu event or error.
48547 +        */
48548 +       BUG_ON(!(ctx->flags & SPU_CREATE_NOSCHED));
48549 +
48550         spin_lock(&spu_prio->runq_lock);
48551         prepare_to_wait_exclusive(&ctx->stop_wq, &wait, TASK_INTERRUPTIBLE);
48552         if (!signal_pending(current)) {
48553 @@ -555,7 +590,7 @@
48554         /*
48555          * Look for a possible preemption candidate on the local node first.
48556          * If there is no candidate look at the other nodes.  This isn't
48557 -        * exactly fair, but so far the whole spu schedule tries to keep
48558 +        * exactly fair, but so far the whole spu scheduler tries to keep
48559          * a strong node affinity.  We might want to fine-tune this in
48560          * the future.
48561          */
48562 @@ -571,6 +606,7 @@
48563                         struct spu_context *tmp = spu->ctx;
48564  
48565                         if (tmp && tmp->prio > ctx->prio &&
48566 +                           !(tmp->flags & SPU_CREATE_NOSCHED) &&
48567                             (!victim || tmp->prio > victim->prio))
48568                                 victim = spu->ctx;
48569                 }
48570 @@ -582,6 +618,10 @@
48571                          * higher priority contexts before lower priority
48572                          * ones, so this is safe until we introduce
48573                          * priority inheritance schemes.
48574 +                        *
48575 +                        * XXX if the highest priority context is locked,
48576 +                        * this can loop a long time.  Might be better to
48577 +                        * look at another context or give up after X retries.
48578                          */
48579                         if (!mutex_trylock(&victim->state_mutex)) {
48580                                 victim = NULL;
48581 @@ -589,10 +629,10 @@
48582                         }
48583  
48584                         spu = victim->spu;
48585 -                       if (!spu) {
48586 +                       if (!spu || victim->prio <= ctx->prio) {
48587                                 /*
48588                                  * This race can happen because we've dropped
48589 -                                * the active list mutex.  No a problem, just
48590 +                                * the active list mutex.  Not a problem, just
48591                                  * restart the search.
48592                                  */
48593                                 mutex_unlock(&victim->state_mutex);
48594 @@ -607,13 +647,10 @@
48595  
48596                         victim->stats.invol_ctx_switch++;
48597                         spu->stats.invol_ctx_switch++;
48598 +                       spu_add_to_rq(victim);
48599 +
48600                         mutex_unlock(&victim->state_mutex);
48601 -                       /*
48602 -                        * We need to break out of the wait loop in spu_run
48603 -                        * manually to ensure this context gets put on the
48604 -                        * runqueue again ASAP.
48605 -                        */
48606 -                       wake_up(&victim->stop_wq);
48607 +
48608                         return spu;
48609                 }
48610         }
48611 @@ -621,6 +658,50 @@
48612         return NULL;
48613  }
48614  
48615 +static void __spu_schedule(struct spu *spu, struct spu_context *ctx)
48616 +{
48617 +       int node = spu->node;
48618 +       int success = 0;
48619 +
48620 +       spu_set_timeslice(ctx);
48621 +
48622 +       mutex_lock(&cbe_spu_info[node].list_mutex);
48623 +       if (spu->ctx == NULL) {
48624 +               spu_bind_context(spu, ctx);
48625 +               cbe_spu_info[node].nr_active++;
48626 +               spu->alloc_state = SPU_USED;
48627 +               success = 1;
48628 +       }
48629 +       mutex_unlock(&cbe_spu_info[node].list_mutex);
48630 +
48631 +       if (success)
48632 +               wake_up_all(&ctx->run_wq);
48633 +       else
48634 +               spu_add_to_rq(ctx);
48635 +}
48636 +
48637 +static void spu_schedule(struct spu *spu, struct spu_context *ctx)
48638 +{
48639 +       /* not a candidate for interruptible because it's called either
48640 +          from the scheduler thread or from spu_deactivate */
48641 +       mutex_lock(&ctx->state_mutex);
48642 +       __spu_schedule(spu, ctx);
48643 +       spu_release(ctx);
48644 +}
48645 +
48646 +static void spu_unschedule(struct spu *spu, struct spu_context *ctx)
48647 +{
48648 +       int node = spu->node;
48649 +
48650 +       mutex_lock(&cbe_spu_info[node].list_mutex);
48651 +       cbe_spu_info[node].nr_active--;
48652 +       spu->alloc_state = SPU_FREE;
48653 +       spu_unbind_context(spu, ctx);
48654 +       ctx->stats.invol_ctx_switch++;
48655 +       spu->stats.invol_ctx_switch++;
48656 +       mutex_unlock(&cbe_spu_info[node].list_mutex);
48657 +}
48658 +
48659  /**
48660   * spu_activate - find a free spu for a context and execute it
48661   * @ctx:       spu context to schedule
48662 @@ -632,39 +713,47 @@
48663   */
48664  int spu_activate(struct spu_context *ctx, unsigned long flags)
48665  {
48666 -       do {
48667 -               struct spu *spu;
48668 +       struct spu *spu;
48669  
48670 -               /*
48671 -                * If there are multiple threads waiting for a single context
48672 -                * only one actually binds the context while the others will
48673 -                * only be able to acquire the state_mutex once the context
48674 -                * already is in runnable state.
48675 -                */
48676 -               if (ctx->spu)
48677 -                       return 0;
48678 +       /*
48679 +        * If there are multiple threads waiting for a single context
48680 +        * only one actually binds the context while the others will
48681 +        * only be able to acquire the state_mutex once the context
48682 +        * already is in runnable state.
48683 +        */
48684 +       if (ctx->spu)
48685 +               return 0;
48686  
48687 -               spu = spu_get_idle(ctx);
48688 -               /*
48689 -                * If this is a realtime thread we try to get it running by
48690 -                * preempting a lower priority thread.
48691 -                */
48692 -               if (!spu && rt_prio(ctx->prio))
48693 -                       spu = find_victim(ctx);
48694 -               if (spu) {
48695 -                       int node = spu->node;
48696 +spu_activate_top:
48697 +       if (signal_pending(current))
48698 +               return -ERESTARTSYS;
48699  
48700 -                       mutex_lock(&cbe_spu_info[node].list_mutex);
48701 -                       spu_bind_context(spu, ctx);
48702 -                       cbe_spu_info[node].nr_active++;
48703 -                       mutex_unlock(&cbe_spu_info[node].list_mutex);
48704 -                       return 0;
48705 -               }
48706 +       spu = spu_get_idle(ctx);
48707 +       /*
48708 +        * If this is a realtime thread we try to get it running by
48709 +        * preempting a lower priority thread.
48710 +        */
48711 +       if (!spu && rt_prio(ctx->prio))
48712 +               spu = find_victim(ctx);
48713 +       if (spu) {
48714 +               unsigned long runcntl;
48715  
48716 +               runcntl = ctx->ops->runcntl_read(ctx);
48717 +               __spu_schedule(spu, ctx);
48718 +               if (runcntl & SPU_RUNCNTL_RUNNABLE)
48719 +                       spuctx_switch_state(ctx, SPU_UTIL_USER);
48720 +
48721 +               return 0;
48722 +       }
48723 +
48724 +       if (ctx->flags & SPU_CREATE_NOSCHED) {
48725                 spu_prio_wait(ctx);
48726 -       } while (!signal_pending(current));
48727 +               goto spu_activate_top;
48728 +       }
48729 +
48730 +       spu_add_to_rq(ctx);
48731  
48732 -       return -ERESTARTSYS;
48733 +       return 0;
48734  }
48735  
48736  /**
48737 @@ -706,21 +795,19 @@
48738         if (spu) {
48739                 new = grab_runnable_context(max_prio, spu->node);
48740                 if (new || force) {
48741 -                       int node = spu->node;
48742 -
48743 -                       mutex_lock(&cbe_spu_info[node].list_mutex);
48744 -                       spu_unbind_context(spu, ctx);
48745 -                       spu->alloc_state = SPU_FREE;
48746 -                       cbe_spu_info[node].nr_active--;
48747 -                       mutex_unlock(&cbe_spu_info[node].list_mutex);
48748 -
48749 -                       ctx->stats.vol_ctx_switch++;
48750 -                       spu->stats.vol_ctx_switch++;
48751 -
48752 -                       if (new)
48753 -                               wake_up(&new->stop_wq);
48754 +                       spu_unschedule(spu, ctx);
48755 +                       if (new) {
48756 +                               if (new->flags & SPU_CREATE_NOSCHED)
48757 +                                       wake_up(&new->stop_wq);
48758 +                               else {
48759 +                                       spu_release(ctx);
48760 +                                       spu_schedule(spu, new);
48761 +                                       /* this one can't easily be made
48762 +                                          interruptible */
48763 +                                       mutex_lock(&ctx->state_mutex);
48764 +                               }
48765 +                       }
48766                 }
48767 -
48768         }
48769  
48770         return new != NULL;
48771 @@ -757,43 +844,38 @@
48772  
48773  static noinline void spusched_tick(struct spu_context *ctx)
48774  {
48775 +       struct spu_context *new = NULL;
48776 +       struct spu *spu = NULL;
48777 +       u32 status;
48778 +
48779 +       if (spu_acquire(ctx))
48780 +               BUG();  /* a kernel thread never has signals pending */
48781 +
48782 +       if (ctx->state != SPU_STATE_RUNNABLE)
48783 +               goto out;
48784 +       if (spu_stopped(ctx, &status))
48785 +               goto out;
48786         if (ctx->flags & SPU_CREATE_NOSCHED)
48787 -               return;
48788 +               goto out;
48789         if (ctx->policy == SCHED_FIFO)
48790 -               return;
48791 +               goto out;
48792  
48793         if (--ctx->time_slice)
48794 -               return;
48795 -
48796 -       /*
48797 -        * Unfortunately list_mutex ranks outside of state_mutex, so
48798 -        * we have to trylock here.  If we fail give the context another
48799 -        * tick and try again.
48800 -        */
48801 -       if (mutex_trylock(&ctx->state_mutex)) {
48802 -               struct spu *spu = ctx->spu;
48803 -               struct spu_context *new;
48804 +               goto out;
48805  
48806 -               new = grab_runnable_context(ctx->prio + 1, spu->node);
48807 -               if (new) {
48808 -                       spu_unbind_context(spu, ctx);
48809 -                       ctx->stats.invol_ctx_switch++;
48810 -                       spu->stats.invol_ctx_switch++;
48811 -                       spu->alloc_state = SPU_FREE;
48812 -                       cbe_spu_info[spu->node].nr_active--;
48813 -                       wake_up(&new->stop_wq);
48814 -                       /*
48815 -                        * We need to break out of the wait loop in
48816 -                        * spu_run manually to ensure this context
48817 -                        * gets put on the runqueue again ASAP.
48818 -                        */
48819 -                       wake_up(&ctx->stop_wq);
48820 -               }
48821 -               spu_set_timeslice(ctx);
48822 -               mutex_unlock(&ctx->state_mutex);
48823 +       spu = ctx->spu;
48824 +       new = grab_runnable_context(ctx->prio + 1, spu->node);
48825 +       if (new) {
48826 +               spu_unschedule(spu, ctx);
48827 +               spu_add_to_rq(ctx);
48828         } else {
48829                 ctx->time_slice++;
48830         }
48831 +out:
48832 +       spu_release(ctx);
48833 +
48834 +       if (new)
48835 +               spu_schedule(spu, new);
48836  }
48837  
48838  /**
48839 @@ -817,35 +899,31 @@
48840  }
48841  
48842  /**
48843 - * spu_calc_load - given tick count, update the avenrun load estimates.
48844 - * @tick:      tick count
48845 + * spu_calc_load - update the avenrun load estimates.
48846   *
48847   * No locking against reading these values from userspace, as for
48848   * the CPU loadavg code.
48849   */
48850 -static void spu_calc_load(unsigned long ticks)
48851 +static void spu_calc_load(void)
48852  {
48853         unsigned long active_tasks; /* fixed-point */
48854 -       static int count = LOAD_FREQ;
48855  
48856 -       count -= ticks;
48857 -
48858 -       if (unlikely(count < 0)) {
48859 -               active_tasks = count_active_contexts() * FIXED_1;
48860 -               do {
48861 -                       CALC_LOAD(spu_avenrun[0], EXP_1, active_tasks);
48862 -                       CALC_LOAD(spu_avenrun[1], EXP_5, active_tasks);
48863 -                       CALC_LOAD(spu_avenrun[2], EXP_15, active_tasks);
48864 -                       count += LOAD_FREQ;
48865 -               } while (count < 0);
48866 -       }
48867 +       active_tasks = count_active_contexts() * FIXED_1;
48868 +       CALC_LOAD(spu_avenrun[0], EXP_1, active_tasks);
48869 +       CALC_LOAD(spu_avenrun[1], EXP_5, active_tasks);
48870 +       CALC_LOAD(spu_avenrun[2], EXP_15, active_tasks);
48871  }
48872  
48873  static void spusched_wake(unsigned long data)
48874  {
48875         mod_timer(&spusched_timer, jiffies + SPUSCHED_TICK);
48876         wake_up_process(spusched_task);
48877 -       spu_calc_load(SPUSCHED_TICK);
48878 +}
48879 +
48880 +static void spuloadavg_wake(unsigned long data)
48881 +{
48882 +       mod_timer(&spuloadavg_timer, jiffies + LOAD_FREQ);
48883 +       spu_calc_load();
48884  }
48885  
48886  static int spusched_thread(void *unused)
48887 @@ -857,17 +935,58 @@
48888                 set_current_state(TASK_INTERRUPTIBLE);
48889                 schedule();
48890                 for (node = 0; node < MAX_NUMNODES; node++) {
48891 -                       mutex_lock(&cbe_spu_info[node].list_mutex);
48892 -                       list_for_each_entry(spu, &cbe_spu_info[node].spus, cbe_list)
48893 -                               if (spu->ctx)
48894 -                                       spusched_tick(spu->ctx);
48895 -                       mutex_unlock(&cbe_spu_info[node].list_mutex);
48896 +                       struct mutex *mtx = &cbe_spu_info[node].list_mutex;
48897 +
48898 +                       mutex_lock(mtx);
48899 +                       list_for_each_entry(spu, &cbe_spu_info[node].spus,
48900 +                                       cbe_list) {
48901 +                               struct spu_context *ctx = spu->ctx;
48902 +
48903 +                               if (ctx) {
48904 +                                       mutex_unlock(mtx);
48905 +                                       spusched_tick(ctx);
48906 +                                       mutex_lock(mtx);
48907 +                               }
48908 +                       }
48909 +                       mutex_unlock(mtx);
48910                 }
48911         }
48912  
48913         return 0;
48914  }
48915  
48916 +void spuctx_switch_state(struct spu_context *ctx,
48917 +               enum spu_utilization_state new_state)
48918 +{
48919 +       unsigned long long curtime;
48920 +       signed long long delta;
48921 +       struct timespec ts;
48922 +       struct spu *spu;
48923 +       enum spu_utilization_state old_state;
48924 +
48925 +       ktime_get_ts(&ts);
48926 +       curtime = timespec_to_ns(&ts);
48927 +       delta = curtime - ctx->stats.tstamp;
48928 +
48929 +       WARN_ON(!mutex_is_locked(&ctx->state_mutex));
48930 +       WARN_ON(delta < 0);
48931 +
48932 +       spu = ctx->spu;
48933 +       old_state = ctx->stats.util_state;
48934 +       ctx->stats.util_state = new_state;
48935 +       ctx->stats.tstamp = curtime;
48936 +
48937 +       /*
48938 +        * Update the physical SPU utilization statistics.
48939 +        */
48940 +       if (spu) {
48941 +               ctx->stats.times[old_state] += delta;
48942 +               spu->stats.times[old_state] += delta;
48943 +               spu->stats.util_state = new_state;
48944 +               spu->stats.tstamp = curtime;
48945 +       }
48946 +}
48947 +
48948  #define LOAD_INT(x) ((x) >> FSHIFT)
48949  #define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100)
48950  
48951 @@ -881,7 +1000,7 @@
48952  
48953         /*
48954          * Note that last_pid doesn't really make much sense for the
48955 -        * SPU loadavg (it even seems very odd on the CPU side..),
48956 +        * SPU loadavg (it even seems very odd on the CPU side...),
48957          * but we include it here to have a 100% compatible interface.
48958          */
48959         seq_printf(s, "%d.%02d %d.%02d %d.%02d %ld/%d %d\n",
48960 @@ -922,6 +1041,7 @@
48961         spin_lock_init(&spu_prio->runq_lock);
48962  
48963         setup_timer(&spusched_timer, spusched_wake, 0);
48964 +       setup_timer(&spuloadavg_timer, spuloadavg_wake, 0);
48965  
48966         spusched_task = kthread_run(spusched_thread, NULL, "spusched");
48967         if (IS_ERR(spusched_task)) {
48968 @@ -929,6 +1049,8 @@
48969                 goto out_free_spu_prio;
48970         }
48971  
48972 +       mod_timer(&spuloadavg_timer, 0);
48973 +
48974         entry = create_proc_entry("spu_loadavg", 0, NULL);
48975         if (!entry)
48976                 goto out_stop_kthread;
48977 @@ -954,6 +1076,7 @@
48978         remove_proc_entry("spu_loadavg", NULL);
48979  
48980         del_timer_sync(&spusched_timer);
48981 +       del_timer_sync(&spuloadavg_timer);
48982         kthread_stop(spusched_task);
48983  
48984         for (node = 0; node < MAX_NUMNODES; node++) {
48985 --- a/arch/powerpc/platforms/cell/spufs/spufs.h
48986 +++ b/arch/powerpc/platforms/cell/spufs/spufs.h
48987 @@ -71,6 +71,7 @@
48988         wait_queue_head_t wbox_wq;
48989         wait_queue_head_t stop_wq;
48990         wait_queue_head_t mfc_wq;
48991 +       wait_queue_head_t run_wq;
48992         struct fasync_struct *ibox_fasync;
48993         struct fasync_struct *wbox_fasync;
48994         struct fasync_struct *mfc_fasync;
48995 @@ -168,8 +169,10 @@
48996         void (*npc_write) (struct spu_context * ctx, u32 data);
48997          u32(*status_read) (struct spu_context * ctx);
48998         char*(*get_ls) (struct spu_context * ctx);
48999 +       void (*privcntl_write) (struct spu_context *ctx, u64 data);
49000          u32 (*runcntl_read) (struct spu_context * ctx);
49001         void (*runcntl_write) (struct spu_context * ctx, u32 data);
49002 +       void (*runcntl_stop) (struct spu_context * ctx);
49003         void (*master_start) (struct spu_context * ctx);
49004         void (*master_stop) (struct spu_context * ctx);
49005         int (*set_mfc_query)(struct spu_context * ctx, u32 mask, u32 mode);
49006 @@ -219,15 +222,16 @@
49007  
49008  /* fault handling */
49009  int spufs_handle_class1(struct spu_context *ctx);
49010 +int spufs_handle_class0(struct spu_context *ctx);
49011  
49012  /* affinity */
49013  struct spu *affinity_check(struct spu_context *ctx);
49014  
49015  /* context management */
49016  extern atomic_t nr_spu_contexts;
49017 -static inline void spu_acquire(struct spu_context *ctx)
49018 +static inline int __must_check spu_acquire(struct spu_context *ctx)
49019  {
49020 -       mutex_lock(&ctx->state_mutex);
49021 +       return mutex_lock_interruptible(&ctx->state_mutex);
49022  }
49023  
49024  static inline void spu_release(struct spu_context *ctx)
49025 @@ -242,10 +246,11 @@
49026  void spu_unmap_mappings(struct spu_context *ctx);
49027  
49028  void spu_forget(struct spu_context *ctx);
49029 -int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags);
49030 -void spu_acquire_saved(struct spu_context *ctx);
49031 +int __must_check spu_acquire_saved(struct spu_context *ctx);
49032  void spu_release_saved(struct spu_context *ctx);
49033  
49034 +int spu_stopped(struct spu_context *ctx, u32 * stat);
49035 +void spu_del_from_rq(struct spu_context *ctx);
49036  int spu_activate(struct spu_context *ctx, unsigned long flags);
49037  void spu_deactivate(struct spu_context *ctx);
49038  void spu_yield(struct spu_context *ctx);
49039 @@ -279,7 +284,9 @@
49040                 }                                                       \
49041                 spu_release(ctx);                                       \
49042                 schedule();                                             \
49043 -               spu_acquire(ctx);                                       \
49044 +               __ret = spu_acquire(ctx);                               \
49045 +               if (__ret)                                              \
49046 +                       break;                                          \
49047         }                                                               \
49048         finish_wait(&(wq), &__wait);                                    \
49049         __ret;                                                          \
49050 @@ -306,41 +313,16 @@
49051  extern struct spufs_coredump_reader spufs_coredump_read[];
49052  extern int spufs_coredump_num_notes;
49053  
49054 -/*
49055 - * This function is a little bit too large for an inline, but
49056 - * as fault.c is built into the kernel we can't move it out of
49057 - * line.
49058 - */
49059 -static inline void spuctx_switch_state(struct spu_context *ctx,
49060 -               enum spu_utilization_state new_state)
49061 -{
49062 -       unsigned long long curtime;
49063 -       signed long long delta;
49064 -       struct timespec ts;
49065 -       struct spu *spu;
49066 -       enum spu_utilization_state old_state;
49067 -
49068 -       ktime_get_ts(&ts);
49069 -       curtime = timespec_to_ns(&ts);
49070 -       delta = curtime - ctx->stats.tstamp;
49071 -
49072 -       WARN_ON(!mutex_is_locked(&ctx->state_mutex));
49073 -       WARN_ON(delta < 0);
49074 -
49075 -       spu = ctx->spu;
49076 -       old_state = ctx->stats.util_state;
49077 -       ctx->stats.util_state = new_state;
49078 -       ctx->stats.tstamp = curtime;
49079 -
49080 -       /*
49081 -        * Update the physical SPU utilization statistics.
49082 -        */
49083 -       if (spu) {
49084 -               ctx->stats.times[old_state] += delta;
49085 -               spu->stats.times[old_state] += delta;
49086 -               spu->stats.util_state = new_state;
49087 -               spu->stats.tstamp = curtime;
49088 -       }
49089 -}
49090 +extern int spu_init_csa(struct spu_state *csa);
49091 +extern void spu_fini_csa(struct spu_state *csa);
49092 +extern int spu_save(struct spu_state *prev, struct spu *spu);
49093 +extern int spu_restore(struct spu_state *new, struct spu *spu);
49094 +extern int spu_switch(struct spu_state *prev, struct spu_state *new,
49095 +                     struct spu *spu);
49096 +extern int spu_alloc_lscsa(struct spu_state *csa);
49097 +extern void spu_free_lscsa(struct spu_state *csa);
49098 +
49099 +extern void spuctx_switch_state(struct spu_context *ctx,
49100 +               enum spu_utilization_state new_state);
49101  
49102  #endif
49103 --- a/arch/powerpc/platforms/cell/spufs/switch.c
49104 +++ b/arch/powerpc/platforms/cell/spufs/switch.c
49105 @@ -48,6 +48,8 @@
49106  #include <asm/spu_csa.h>
49107  #include <asm/mmu_context.h>
49108  
49109 +#include "spufs.h"
49110 +
49111  #include "spu_save_dump.h"
49112  #include "spu_restore_dump.h"
49113  
49114 @@ -691,35 +693,9 @@
49115         out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESUME_DMA_QUEUE);
49116  }
49117  
49118 -static inline void get_kernel_slb(u64 ea, u64 slb[2])
49119 +static inline void setup_mfc_slbs(struct spu_state *csa, struct spu *spu,
49120 +               unsigned int *code, int code_size)
49121  {
49122 -       u64 llp;
49123 -
49124 -       if (REGION_ID(ea) == KERNEL_REGION_ID)
49125 -               llp = mmu_psize_defs[mmu_linear_psize].sllp;
49126 -       else
49127 -               llp = mmu_psize_defs[mmu_virtual_psize].sllp;
49128 -       slb[0] = (get_kernel_vsid(ea, MMU_SEGSIZE_256M) << SLB_VSID_SHIFT) |
49129 -               SLB_VSID_KERNEL | llp;
49130 -       slb[1] = (ea & ESID_MASK) | SLB_ESID_V;
49131 -}
49132 -
49133 -static inline void load_mfc_slb(struct spu *spu, u64 slb[2], int slbe)
49134 -{
49135 -       struct spu_priv2 __iomem *priv2 = spu->priv2;
49136 -
49137 -       out_be64(&priv2->slb_index_W, slbe);
49138 -       eieio();
49139 -       out_be64(&priv2->slb_vsid_RW, slb[0]);
49140 -       out_be64(&priv2->slb_esid_RW, slb[1]);
49141 -       eieio();
49142 -}
49143 -
49144 -static inline void setup_mfc_slbs(struct spu_state *csa, struct spu *spu)
49145 -{
49146 -       u64 code_slb[2];
49147 -       u64 lscsa_slb[2];
49148 -
49149         /* Save, Step 47:
49150          * Restore, Step 30.
49151          *     If MFC_SR1[R]=1, write 0 to SLB_Invalidate_All
49152 @@ -735,11 +711,7 @@
49153          *     translation is desired by OS environment).
49154          */
49155         spu_invalidate_slbs(spu);
49156 -       get_kernel_slb((unsigned long)&spu_save_code[0], code_slb);
49157 -       get_kernel_slb((unsigned long)csa->lscsa, lscsa_slb);
49158 -       load_mfc_slb(spu, code_slb, 0);
49159 -       if ((lscsa_slb[0] != code_slb[0]) || (lscsa_slb[1] != code_slb[1]))
49160 -               load_mfc_slb(spu, lscsa_slb, 1);
49161 +       spu_setup_kernel_slbs(spu, csa->lscsa, code, code_size);
49162  }
49163  
49164  static inline void set_switch_active(struct spu_state *csa, struct spu *spu)
49165 @@ -768,9 +740,9 @@
49166          *     (translation) interrupts.
49167          */
49168         spin_lock_irq(&spu->register_lock);
49169 -       spu_int_stat_clear(spu, 0, ~0ul);
49170 -       spu_int_stat_clear(spu, 1, ~0ul);
49171 -       spu_int_stat_clear(spu, 2, ~0ul);
49172 +       spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
49173 +       spu_int_stat_clear(spu, 1, CLASS1_INTR_MASK);
49174 +       spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
49175         spu_int_mask_set(spu, 0, 0ul);
49176         spu_int_mask_set(spu, 1, class1_mask);
49177         spu_int_mask_set(spu, 2, 0ul);
49178 @@ -927,8 +899,8 @@
49179         POLL_WHILE_FALSE(in_be32(&prob->dma_tagstatus_R) & mask);
49180  
49181         local_irq_save(flags);
49182 -       spu_int_stat_clear(spu, 0, ~(0ul));
49183 -       spu_int_stat_clear(spu, 2, ~(0ul));
49184 +       spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
49185 +       spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
49186         local_irq_restore(flags);
49187  }
49188  
49189 @@ -946,8 +918,8 @@
49190         POLL_WHILE_TRUE(in_be32(&prob->spu_status_R) & SPU_STATUS_RUNNING);
49191  
49192         local_irq_save(flags);
49193 -       spu_int_stat_clear(spu, 0, ~(0ul));
49194 -       spu_int_stat_clear(spu, 2, ~(0ul));
49195 +       spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
49196 +       spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
49197         local_irq_restore(flags);
49198  }
49199  
49200 @@ -1423,9 +1395,9 @@
49201         spu_int_mask_set(spu, 0, 0ul);
49202         spu_int_mask_set(spu, 1, 0ul);
49203         spu_int_mask_set(spu, 2, 0ul);
49204 -       spu_int_stat_clear(spu, 0, ~0ul);
49205 -       spu_int_stat_clear(spu, 1, ~0ul);
49206 -       spu_int_stat_clear(spu, 2, ~0ul);
49207 +       spu_int_stat_clear(spu, 0, CLASS0_INTR_MASK);
49208 +       spu_int_stat_clear(spu, 1, CLASS1_INTR_MASK);
49209 +       spu_int_stat_clear(spu, 2, CLASS2_INTR_MASK);
49210         spin_unlock_irq(&spu->register_lock);
49211  }
49212  
49213 @@ -1866,7 +1838,8 @@
49214          */
49215  
49216         resume_mfc_queue(prev, spu);    /* Step 46. */
49217 -       setup_mfc_slbs(prev, spu);      /* Step 47. */
49218 +       /* Step 47. */
49219 +       setup_mfc_slbs(prev, spu, spu_save_code, sizeof(spu_save_code));
49220         set_switch_active(prev, spu);   /* Step 48. */
49221         enable_interrupts(prev, spu);   /* Step 49. */
49222         save_ls_16kb(prev, spu);        /* Step 50. */
49223 @@ -1971,7 +1944,8 @@
49224         setup_spu_status_part1(next, spu);      /* Step 27. */
49225         setup_spu_status_part2(next, spu);      /* Step 28. */
49226         restore_mfc_rag(next, spu);             /* Step 29. */
49227 -       setup_mfc_slbs(next, spu);              /* Step 30. */
49228 +       /* Step 30. */
49229 +       setup_mfc_slbs(next, spu, spu_restore_code, sizeof(spu_restore_code));
49230         set_spu_npc(next, spu);                 /* Step 31. */
49231         set_signot1(next, spu);                 /* Step 32. */
49232         set_signot2(next, spu);                 /* Step 33. */
49233 @@ -2103,10 +2077,6 @@
49234         int rc;
49235  
49236         acquire_spu_lock(spu);          /* Step 1.     */
49237 -       prev->dar = spu->dar;
49238 -       prev->dsisr = spu->dsisr;
49239 -       spu->dar = 0;
49240 -       spu->dsisr = 0;
49241         rc = __do_spu_save(prev, spu);  /* Steps 2-53. */
49242         release_spu_lock(spu);
49243         if (rc != 0 && rc != 2 && rc != 6) {
49244 @@ -2133,9 +2103,6 @@
49245         acquire_spu_lock(spu);
49246         harvest(NULL, spu);
49247         spu->slb_replace = 0;
49248 -       new->dar = 0;
49249 -       new->dsisr = 0;
49250 -       spu->class_0_pending = 0;
49251         rc = __do_spu_restore(new, spu);
49252         release_spu_lock(spu);
49253         if (rc) {
49254 @@ -2215,10 +2182,8 @@
49255  
49256         return 0;
49257  }
49258 -EXPORT_SYMBOL_GPL(spu_init_csa);
49259  
49260  void spu_fini_csa(struct spu_state *csa)
49261  {
49262         spu_free_lscsa(csa);
49263  }
49264 -EXPORT_SYMBOL_GPL(spu_fini_csa);
49265 --- a/arch/powerpc/platforms/celleb/Kconfig
49266 +++ b/arch/powerpc/platforms/celleb/Kconfig
49267 @@ -2,6 +2,8 @@
49268         bool "Toshiba's Cell Reference Set 'Celleb' Architecture"
49269         depends on PPC_MULTIPLATFORM && PPC64
49270         select PPC_CELL
49271 +       select PPC_CELL_NATIVE
49272 +       select PPC_RTAS
49273         select PPC_INDIRECT_IO
49274         select PPC_OF_PLATFORM_PCI
49275         select HAS_TXX9_SERIAL
49276 --- a/arch/powerpc/platforms/celleb/io-workarounds.c
49277 +++ b/arch/powerpc/platforms/celleb/io-workarounds.c
49278 @@ -22,6 +22,7 @@
49279  
49280  #undef DEBUG
49281  
49282 +#include <linux/of.h>
49283  #include <linux/of_device.h>
49284  #include <linux/irq.h>
49285  
49286 @@ -222,7 +223,7 @@
49287                                void (*dummy_read)(struct pci_controller *))
49288  {
49289         struct celleb_pci_bus *bus = &celleb_pci_busses[celleb_pci_count];
49290 -       struct device_node *np = phb->arch_data;
49291 +       struct device_node *np = phb->dn;
49292  
49293         if (celleb_pci_count >= MAX_CELLEB_PCI_BUS) {
49294                 printk(KERN_ERR "Too many pci bridges, workarounds"
49295 @@ -256,13 +257,13 @@
49296  
49297         celleb_dummy_page_va = kmalloc(PAGE_SIZE, GFP_KERNEL);
49298         if (!celleb_dummy_page_va) {
49299 -               printk(KERN_ERR "Celleb: dummy read disabled."
49300 +               printk(KERN_ERR "Celleb: dummy read disabled. "
49301                         "Alloc celleb_dummy_page_va failed\n");
49302                 return 1;
49303         }
49304  
49305         list_for_each_entry(phb, &hose_list, list_node) {
49306 -               node = phb->arch_data;
49307 +               node = phb->dn;
49308                 match = of_match_node(celleb_pci_workaround_match, node);
49309  
49310                 if (match) {
49311 --- a/arch/powerpc/platforms/celleb/iommu.c
49312 +++ b/arch/powerpc/platforms/celleb/iommu.c
49313 @@ -22,8 +22,9 @@
49314  #include <linux/init.h>
49315  #include <linux/dma-mapping.h>
49316  #include <linux/pci.h>
49317 +#include <linux/of_platform.h>
49318  
49319 -#include <asm/of_platform.h>
49320 +#include <asm/machdep.h>
49321  
49322  #include "beat_wrapper.h"
49323  
49324 @@ -51,6 +52,8 @@
49325         return 0;
49326  }
49327  
49328 +static unsigned long celleb_dma_direct_offset;
49329 +
49330  static void __init celleb_init_direct_mapping(void)
49331  {
49332         u64 lpar_addr, io_addr;
49333 @@ -68,7 +71,18 @@
49334                                      ioid, DMA_FLAGS);
49335         }
49336  
49337 -       dma_direct_offset = dma_base;
49338 +       celleb_dma_direct_offset = dma_base;
49339 +}
49340 +
49341 +static void celleb_dma_dev_setup(struct device *dev)
49342 +{
49343 +       dev->archdata.dma_ops = get_pci_dma_ops();
49344 +       dev->archdata.dma_data = (void *)celleb_dma_direct_offset;
49345 +}
49346 +
49347 +static void celleb_pci_dma_dev_setup(struct pci_dev *pdev)
49348 +{
49349 +       celleb_dma_dev_setup(&pdev->dev);
49350  }
49351  
49352  static int celleb_of_bus_notify(struct notifier_block *nb,
49353 @@ -80,7 +94,7 @@
49354         if (action != BUS_NOTIFY_ADD_DEVICE)
49355                 return 0;
49356  
49357 -       dev->archdata.dma_ops = get_pci_dma_ops();
49358 +       celleb_dma_dev_setup(dev);
49359  
49360         return 0;
49361  }
49362 @@ -91,14 +105,12 @@
49363  
49364  static int __init celleb_init_iommu(void)
49365  {
49366 -       if (!machine_is(celleb))
49367 -               return -ENODEV;
49368 -
49369         celleb_init_direct_mapping();
49370         set_pci_dma_ops(&dma_direct_ops);
49371 +       ppc_md.pci_dma_dev_setup = celleb_pci_dma_dev_setup;
49372         bus_register_notifier(&of_platform_bus_type, &celleb_of_bus_notifier);
49373  
49374         return 0;
49375  }
49376  
49377 -arch_initcall(celleb_init_iommu);
49378 +machine_arch_initcall(celleb_beat, celleb_init_iommu);
49379 --- a/arch/powerpc/platforms/celleb/pci.c
49380 +++ b/arch/powerpc/platforms/celleb/pci.c
49381 @@ -31,6 +31,7 @@
49382  #include <linux/init.h>
49383  #include <linux/bootmem.h>
49384  #include <linux/pci_regs.h>
49385 +#include <linux/of.h>
49386  #include <linux/of_device.h>
49387  
49388  #include <asm/io.h>
49389 @@ -138,8 +139,6 @@
49390                 *val = celleb_fake_config_readl(p);
49391                 break;
49392         }
49393 -
49394 -       return;
49395  }
49396  
49397  static void celleb_config_write_fake(unsigned char *config, int where,
49398 @@ -158,7 +157,6 @@
49399                 celleb_fake_config_writel(val, p);
49400                 break;
49401         }
49402 -       return;
49403  }
49404  
49405  static int celleb_fake_pci_read_config(struct pci_bus *bus,
49406 @@ -351,6 +349,10 @@
49407         wi1 = of_get_property(node, "vendor-id", NULL);
49408         wi2 = of_get_property(node, "class-code", NULL);
49409         wi3 = of_get_property(node, "revision-id", NULL);
49410 +       if (!wi0 || !wi1 || !wi2 || !wi3) {
49411 +               printk(KERN_ERR "PCI: Missing device tree properties.\n");
49412 +               goto error;
49413 +       }
49414  
49415         celleb_config_write_fake(*config, PCI_DEVICE_ID, 2, wi0[0] & 0xffff);
49416         celleb_config_write_fake(*config, PCI_VENDOR_ID, 2, wi1[0] & 0xffff);
49417 @@ -372,6 +374,10 @@
49418         celleb_setup_pci_base_addrs(hose, devno, fn, num_base_addr);
49419  
49420         li = of_get_property(node, "interrupts", &rlen);
49421 +       if (!li) {
49422 +               printk(KERN_ERR "PCI: interrupts not found.\n");
49423 +               goto error;
49424 +       }
49425         val = li[0];
49426         celleb_config_write_fake(*config, PCI_INTERRUPT_PIN, 1, 1);
49427         celleb_config_write_fake(*config, PCI_INTERRUPT_LINE, 1, val);
49428 @@ -475,7 +481,7 @@
49429  
49430  int __init celleb_setup_phb(struct pci_controller *phb)
49431  {
49432 -       struct device_node *dev = phb->arch_data;
49433 +       struct device_node *dev = phb->dn;
49434         const struct of_device_id *match;
49435         int (*setup_func)(struct device_node *, struct pci_controller *);
49436  
49437 --- a/arch/powerpc/platforms/celleb/scc_epci.c
49438 +++ b/arch/powerpc/platforms/celleb/scc_epci.c
49439 @@ -95,7 +95,7 @@
49440         private->dummy_page_da = dma_map_single(hose->parent,
49441                 celleb_dummy_page_va, PAGE_SIZE, DMA_FROM_DEVICE);
49442         if (private->dummy_page_da == DMA_ERROR_CODE) {
49443 -               printk(KERN_ERR "EPCI: dummy read disabled."
49444 +               printk(KERN_ERR "EPCI: dummy read disabled. "
49445                        "Map dummy page failed.\n");
49446                 return;
49447         }
49448 --- a/arch/powerpc/platforms/celleb/scc_uhc.c
49449 +++ b/arch/powerpc/platforms/celleb/scc_uhc.c
49450 @@ -47,7 +47,8 @@
49451         u32 val = 0;
49452         int i;
49453  
49454 -       if (!machine_is(celleb))
49455 +       if (!machine_is(celleb_beat) &&
49456 +           !machine_is(celleb_native))
49457                 return;
49458  
49459         uhc_base = ioremap(pci_resource_start(dev, 0),
49460 --- a/arch/powerpc/platforms/celleb/setup.c
49461 +++ b/arch/powerpc/platforms/celleb/setup.c
49462 @@ -40,6 +40,7 @@
49463  #include <linux/seq_file.h>
49464  #include <linux/root_dev.h>
49465  #include <linux/console.h>
49466 +#include <linux/of_platform.h>
49467  
49468  #include <asm/mmu.h>
49469  #include <asm/processor.h>
49470 @@ -52,12 +53,16 @@
49471  #include <asm/time.h>
49472  #include <asm/spu_priv1.h>
49473  #include <asm/firmware.h>
49474 -#include <asm/of_platform.h>
49475 +#include <asm/rtas.h>
49476 +#include <asm/cell-regs.h>
49477  
49478  #include "interrupt.h"
49479  #include "beat_wrapper.h"
49480  #include "beat.h"
49481  #include "pci.h"
49482 +#include "../cell/interrupt.h"
49483 +#include "../cell/pervasive.h"
49484 +#include "../cell/ras.h"
49485  
49486  static char celleb_machine_type[128] = "Celleb";
49487  
49488 @@ -88,61 +93,122 @@
49489         printk("*** %04x : %s\n", hex, s ? s : "");
49490  }
49491  
49492 -static void __init celleb_setup_arch(void)
49493 +static void __init celleb_setup_arch_common(void)
49494 +{
49495 +       /* init to some ~sane value until calibrate_delay() runs */
49496 +       loops_per_jiffy = 50000000;
49497 +
49498 +#ifdef CONFIG_DUMMY_CONSOLE
49499 +       conswitchp = &dummy_con;
49500 +#endif
49501 +}
49502 +
49503 +static struct of_device_id celleb_bus_ids[] __initdata = {
49504 +       { .type = "scc", },
49505 +       { .type = "ioif", },    /* old style */
49506 +       {},
49507 +};
49508 +
49509 +static int __init celleb_publish_devices(void)
49510 +{
49511 +       /* Publish OF platform devices for southbridge IOs */
49512 +       of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
49513 +
49514 +       celleb_pci_workaround_init();
49515 +
49516 +       return 0;
49517 +}
49518 +machine_device_initcall(celleb_beat, celleb_publish_devices);
49519 +machine_device_initcall(celleb_native, celleb_publish_devices);
49520 +
49521 +
49522 +/*
49523 + * functions for Celleb-Beat
49524 + */
49525 +static void __init celleb_setup_arch_beat(void)
49526  {
49527  #ifdef CONFIG_SPU_BASE
49528 -       spu_priv1_ops = &spu_priv1_beat_ops;
49529 -       spu_management_ops = &spu_management_of_ops;
49530 +       spu_priv1_ops           = &spu_priv1_beat_ops;
49531 +       spu_management_ops      = &spu_management_of_ops;
49532  #endif
49533  
49534  #ifdef CONFIG_SMP
49535         smp_init_celleb();
49536  #endif
49537  
49538 -       /* init to some ~sane value until calibrate_delay() runs */
49539 -       loops_per_jiffy = 50000000;
49540 -
49541 -#ifdef CONFIG_DUMMY_CONSOLE
49542 -       conswitchp = &dummy_con;
49543 -#endif
49544 +       celleb_setup_arch_common();
49545  }
49546  
49547 -static int __init celleb_probe(void)
49548 +static int __init celleb_probe_beat(void)
49549  {
49550         unsigned long root = of_get_flat_dt_root();
49551  
49552         if (!of_flat_dt_is_compatible(root, "Beat"))
49553                 return 0;
49554  
49555 -       powerpc_firmware_features |= FW_FEATURE_CELLEB_POSSIBLE;
49556 +       powerpc_firmware_features |= FW_FEATURE_CELLEB_ALWAYS
49557 +               | FW_FEATURE_BEAT | FW_FEATURE_LPAR;
49558         hpte_init_beat_v3();
49559 +
49560         return 1;
49561  }
49562  
49563 -static struct of_device_id celleb_bus_ids[] __initdata = {
49564 -       { .type = "scc", },
49565 -       { .type = "ioif", },    /* old style */
49566 -       {},
49567 -};
49568  
49569 -static int __init celleb_publish_devices(void)
49570 +/*
49571 + * functions for Celleb-native
49572 + */
49573 +static void __init celleb_init_IRQ_native(void)
49574  {
49575 -       if (!machine_is(celleb))
49576 -               return 0;
49577 +       iic_init_IRQ();
49578 +       spider_init_IRQ();
49579 +}
49580  
49581 -       /* Publish OF platform devices for southbridge IOs */
49582 -       of_platform_bus_probe(NULL, celleb_bus_ids, NULL);
49583 +static void __init celleb_setup_arch_native(void)
49584 +{
49585 +#ifdef CONFIG_SPU_BASE
49586 +       spu_priv1_ops           = &spu_priv1_mmio_ops;
49587 +       spu_management_ops      = &spu_management_of_ops;
49588 +#endif
49589  
49590 -       celleb_pci_workaround_init();
49591 +       cbe_regs_init();
49592  
49593 -       return 0;
49594 +#ifdef CONFIG_CBE_RAS
49595 +       cbe_ras_init();
49596 +#endif
49597 +
49598 +#ifdef CONFIG_SMP
49599 +       smp_init_cell();
49600 +#endif
49601 +
49602 +       cbe_pervasive_init();
49603 +
49604 +       /* XXX: nvram initialization should be added */
49605 +
49606 +       celleb_setup_arch_common();
49607 +}
49608 +
49609 +static int __init celleb_probe_native(void)
49610 +{
49611 +       unsigned long root = of_get_flat_dt_root();
49612 +
49613 +       if (of_flat_dt_is_compatible(root, "Beat") ||
49614 +           !of_flat_dt_is_compatible(root, "TOSHIBA,Celleb"))
49615 +               return 0;
49616 +
49617 +       powerpc_firmware_features |= FW_FEATURE_CELLEB_ALWAYS;
49618 +       hpte_init_native();
49619 +
49620 +       return 1;
49621  }
49622 -device_initcall(celleb_publish_devices);
49623  
49624 -define_machine(celleb) {
49625 -       .name                   = "Cell Reference Set",
49626 -       .probe                  = celleb_probe,
49627 -       .setup_arch             = celleb_setup_arch,
49628 +
49629 +/*
49630 + * machine definitions
49631 + */
49632 +define_machine(celleb_beat) {
49633 +       .name                   = "Cell Reference Set (Beat)",
49634 +       .probe                  = celleb_probe_beat,
49635 +       .setup_arch             = celleb_setup_arch_beat,
49636         .show_cpuinfo           = celleb_show_cpuinfo,
49637         .restart                = beat_restart,
49638         .power_off              = beat_power_off,
49639 @@ -167,3 +233,26 @@
49640         .machine_crash_shutdown = default_machine_crash_shutdown,
49641  #endif
49642  };
49643 +
49644 +define_machine(celleb_native) {
49645 +       .name                   = "Cell Reference Set (native)",
49646 +       .probe                  = celleb_probe_native,
49647 +       .setup_arch             = celleb_setup_arch_native,
49648 +       .show_cpuinfo           = celleb_show_cpuinfo,
49649 +       .restart                = rtas_restart,
49650 +       .power_off              = rtas_power_off,
49651 +       .halt                   = rtas_halt,
49652 +       .get_boot_time          = rtas_get_boot_time,
49653 +       .get_rtc_time           = rtas_get_rtc_time,
49654 +       .set_rtc_time           = rtas_set_rtc_time,
49655 +       .calibrate_decr         = generic_calibrate_decr,
49656 +       .progress               = celleb_progress,
49657 +       .pci_probe_mode         = celleb_pci_probe_mode,
49658 +       .pci_setup_phb          = celleb_setup_phb,
49659 +       .init_IRQ               = celleb_init_IRQ_native,
49660 +#ifdef CONFIG_KEXEC
49661 +       .machine_kexec          = default_machine_kexec,
49662 +       .machine_kexec_prepare  = default_machine_kexec_prepare,
49663 +       .machine_crash_shutdown = default_machine_crash_shutdown,
49664 +#endif
49665 +};
49666 --- a/arch/powerpc/platforms/chrp/pci.c
49667 +++ b/arch/powerpc/platforms/chrp/pci.c
49668 @@ -198,7 +198,7 @@
49669                 printk ("RTAS supporting Pegasos OF not found, please upgrade"
49670                         " your firmware\n");
49671         }
49672 -       pci_assign_all_buses = 1;
49673 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
49674         /* keep the reference to the root node */
49675  }
49676  
49677 --- a/arch/powerpc/platforms/chrp/setup.c
49678 +++ b/arch/powerpc/platforms/chrp/setup.c
49679 @@ -115,7 +115,7 @@
49680         seq_printf(m, "machine\t\t: CHRP %s\n", model);
49681  
49682         /* longtrail (goldengate) stuff */
49683 -       if (!strncmp(model, "IBM,LongTrail", 13)) {
49684 +       if (model && !strncmp(model, "IBM,LongTrail", 13)) {
49685                 /* VLSI VAS96011/12 `Golden Gate 2' */
49686                 /* Memory banks */
49687                 sdramen = (in_le32(gg2_pci_config_base + GG2_PCI_DRAM_CTRL)
49688 @@ -203,15 +203,20 @@
49689  static void __init sio_init(void)
49690  {
49691         struct device_node *root;
49692 +       const char *model;
49693  
49694 -       if ((root = of_find_node_by_path("/")) &&
49695 -           !strncmp(of_get_property(root, "model", NULL),
49696 -                       "IBM,LongTrail", 13)) {
49697 +       root = of_find_node_by_path("/");
49698 +       if (!root)
49699 +               return;
49700 +
49701 +       model = of_get_property(root, "model", NULL);
49702 +       if (model && !strncmp(model, "IBM,LongTrail", 13)) {
49703                 /* logical device 0 (KBC/Keyboard) */
49704                 sio_fixup_irq("keyboard", 0, 1, 2);
49705                 /* select logical device 1 (KBC/Mouse) */
49706                 sio_fixup_irq("mouse", 1, 12, 2);
49707         }
49708 +
49709         of_node_put(root);
49710  }
49711  
49712 @@ -251,6 +256,57 @@
49713         for(;;);
49714  }
49715  
49716 +/*
49717 + * Per default, input/output-device points to the keyboard/screen
49718 + * If no card is installed, the built-in serial port is used as a fallback.
49719 + * But unfortunately, the firmware does not connect /chosen/{stdin,stdout}
49720 + * the the built-in serial node. Instead, a /failsafe node is created.
49721 + */
49722 +static void chrp_init_early(void)
49723 +{
49724 +       struct device_node *node;
49725 +       const char *property;
49726 +
49727 +       if (strstr(cmd_line, "console="))
49728 +               return;
49729 +       /* find the boot console from /chosen/stdout */
49730 +       if (!of_chosen)
49731 +               return;
49732 +       node = of_find_node_by_path("/");
49733 +       if (!node)
49734 +               return;
49735 +       property = of_get_property(node, "model", NULL);
49736 +       if (!property)
49737 +               goto out_put;
49738 +       if (strcmp(property, "Pegasos2"))
49739 +               goto out_put;
49740 +       /* this is a Pegasos2 */
49741 +       property = of_get_property(of_chosen, "linux,stdout-path", NULL);
49742 +       if (!property)
49743 +               goto out_put;
49744 +       of_node_put(node);
49745 +       node = of_find_node_by_path(property);
49746 +       if (!node)
49747 +               return;
49748 +       property = of_get_property(node, "device_type", NULL);
49749 +       if (!property)
49750 +               goto out_put;
49751 +       if (strcmp(property, "serial"))
49752 +               goto out_put;
49753 +       /*
49754 +        * The 9pin connector is either /failsafe
49755 +        * or /pci@80000000/isa@C/serial@i2F8
49756 +        * The optional graphics card has also type 'serial' in VGA mode.
49757 +        */
49758 +       property = of_get_property(node, "name", NULL);
49759 +       if (!property)
49760 +               goto out_put;
49761 +       if (!strcmp(property, "failsafe") || !strcmp(property, "serial"))
49762 +               add_preferred_console("ttyS", 0, NULL);
49763 +out_put:
49764 +       of_node_put(node);
49765 +}
49766 +
49767  void __init chrp_setup_arch(void)
49768  {
49769         struct device_node *root = of_find_node_by_path("/");
49770 @@ -594,6 +650,7 @@
49771         .probe                  = chrp_probe,
49772         .setup_arch             = chrp_setup_arch,
49773         .init                   = chrp_init2,
49774 +       .init_early             = chrp_init_early,
49775         .show_cpuinfo           = chrp_show_cpuinfo,
49776         .init_IRQ               = chrp_init_IRQ,
49777         .restart                = rtas_restart,
49778 --- a/arch/powerpc/platforms/embedded6xx/Kconfig
49779 +++ b/arch/powerpc/platforms/embedded6xx/Kconfig
49780 @@ -9,6 +9,8 @@
49781         select FSL_SOC
49782         select PPC_UDBG_16550 if SERIAL_8250
49783         select DEFAULT_UIMAGE
49784 +       select MPC10X_OPENPIC
49785 +       select MPC10X_BRIDGE
49786         help
49787           Select LINKSTATION if configuring for one of PPC- (MPC8241)
49788           based NAS systems from Buffalo Technology. So far only
49789 @@ -16,6 +18,19 @@
49790           Linkstation-I HD-HLAN and HD-HGLAN versions, and PPC-based
49791           Terastation systems should be supported too.
49792  
49793 +config STORCENTER
49794 +       bool "IOMEGA StorCenter"
49795 +       depends on EMBEDDED6xx
49796 +       select MPIC
49797 +       select FSL_SOC
49798 +       select PPC_UDBG_16550 if SERIAL_8250
49799 +       select WANT_DEVICE_TREE
49800 +       select MPC10X_OPENPIC
49801 +       select MPC10X_BRIDGE
49802 +       help
49803 +         Select STORCENTER if configuring for the iomega StorCenter
49804 +         with an 8241 CPU in it.
49805 +
49806  config MPC7448HPC2
49807         bool "Freescale MPC7448HPC2(Taiga)"
49808         depends on EMBEDDED6xx
49809 @@ -23,6 +38,7 @@
49810         select DEFAULT_UIMAGE
49811         select PPC_UDBG_16550
49812         select WANT_DEVICE_TREE
49813 +       select TSI108_BRIDGE
49814         help
49815           Select MPC7448HPC2 if configuring for Freescale MPC7448HPC2 (Taiga)
49816           platform
49817 @@ -33,6 +49,7 @@
49818         select TSI108_BRIDGE
49819         select PPC_UDBG_16550
49820         select WANT_DEVICE_TREE
49821 +       select TSI108_BRIDGE
49822         help
49823           Select PPC_HOLLY if configuring for an IBM 750GX/CL Eval
49824           Board with TSI108/9 bridge (Hickory/Holly)
49825 @@ -48,17 +65,13 @@
49826  
49827  config TSI108_BRIDGE
49828         bool
49829 -       depends on MPC7448HPC2 || PPC_HOLLY
49830         select PCI
49831         select MPIC
49832         select MPIC_WEIRD
49833 -       default y
49834  
49835  config MPC10X_BRIDGE
49836         bool
49837 -       depends on LINKSTATION
49838         select PPC_INDIRECT_PCI
49839 -       default y
49840  
49841  config MV64X60
49842         bool
49843 @@ -67,8 +80,6 @@
49844  
49845  config MPC10X_OPENPIC
49846         bool
49847 -       depends on LINKSTATION
49848 -       default y
49849  
49850  config MPC10X_STORE_GATHERING
49851         bool "Enable MPC10x store gathering"
49852 --- a/arch/powerpc/platforms/embedded6xx/Makefile
49853 +++ b/arch/powerpc/platforms/embedded6xx/Makefile
49854 @@ -3,5 +3,6 @@
49855  #
49856  obj-$(CONFIG_MPC7448HPC2)      += mpc7448_hpc2.o
49857  obj-$(CONFIG_LINKSTATION)      += linkstation.o ls_uart.o
49858 +obj-$(CONFIG_STORCENTER)       += storcenter.o
49859  obj-$(CONFIG_PPC_HOLLY)                += holly.o
49860  obj-$(CONFIG_PPC_PRPMC2800)    += prpmc2800.o
49861 --- a/arch/powerpc/platforms/embedded6xx/holly.c
49862 +++ b/arch/powerpc/platforms/embedded6xx/holly.c
49863 @@ -20,12 +20,12 @@
49864  #include <linux/console.h>
49865  #include <linux/delay.h>
49866  #include <linux/irq.h>
49867 -#include <linux/ide.h>
49868  #include <linux/seq_file.h>
49869  #include <linux/root_dev.h>
49870  #include <linux/serial.h>
49871  #include <linux/tty.h>
49872  #include <linux/serial_core.h>
49873 +#include <linux/of_platform.h>
49874  
49875  #include <asm/system.h>
49876  #include <asm/time.h>
49877 @@ -39,7 +39,6 @@
49878  #include <asm/tsi108_irq.h>
49879  #include <asm/tsi108_pci.h>
49880  #include <asm/mpic.h>
49881 -#include <asm/of_platform.h>
49882  
49883  #undef DEBUG
49884  
49885 --- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
49886 +++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
49887 @@ -53,8 +53,6 @@
49888  
49889  #define MPC7448HPC2_PCI_CFG_PHYS 0xfb000000
49890  
49891 -extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
49892 -
49893  int mpc7448_hpc2_exclude_device(struct pci_controller *hose,
49894                                 u_char bus, u_char devfn)
49895  {
49896 --- /dev/null
49897 +++ b/arch/powerpc/platforms/embedded6xx/storcenter.c
49898 @@ -0,0 +1,192 @@
49899 +/*
49900 + * Board setup routines for the storcenter
49901 + *
49902 + * Copyright 2007 (C) Oyvind Repvik (nail@nslu2-linux.org)
49903 + * Copyright 2007 Andy Wilcox, Jon Loeliger
49904 + *
49905 + * Based on linkstation.c by G. Liakhovetski
49906 + *
49907 + * This file is licensed under the terms of the GNU General Public License
49908 + * version 2.  This program is licensed "as is" without any warranty of
49909 + * any kind, whether express or implied.
49910 + */
49911 +
49912 +#include <linux/kernel.h>
49913 +#include <linux/pci.h>
49914 +#include <linux/initrd.h>
49915 +#include <linux/mtd/physmap.h>
49916 +#include <linux/of_platform.h>
49917 +
49918 +#include <asm/system.h>
49919 +#include <asm/time.h>
49920 +#include <asm/prom.h>
49921 +#include <asm/mpic.h>
49922 +#include <asm/pci-bridge.h>
49923 +
49924 +#include "mpc10x.h"
49925 +
49926 +
49927 +#ifdef CONFIG_MTD_PHYSMAP
49928 +static struct mtd_partition storcenter_physmap_partitions[] = {
49929 +       {
49930 +               .name   = "kernel",
49931 +               .offset = 0x000000,
49932 +               .size   = 0x170000,
49933 +       },
49934 +       {
49935 +               .name   = "rootfs",
49936 +               .offset = 0x170000,
49937 +               .size   = 0x590000,
49938 +       },
49939 +       {
49940 +               .name   = "uboot",
49941 +               .offset = 0x700000,
49942 +               .size   = 0x040000,
49943 +       },
49944 +       {
49945 +               .name   = "config",
49946 +               .offset = 0x740000,
49947 +               .size   = 0x0c0000,
49948 +       },
49949 +};
49950 +#endif
49951 +
49952 +
49953 +static __initdata struct of_device_id storcenter_of_bus[] = {
49954 +       { .name = "soc", },
49955 +       {},
49956 +};
49957 +
49958 +static int __init storcenter_device_probe(void)
49959 +{
49960 +       of_platform_bus_probe(NULL, storcenter_of_bus, NULL);
49961 +       return 0;
49962 +}
49963 +machine_device_initcall(storcenter, storcenter_device_probe);
49964 +
49965 +
49966 +static int __init storcenter_add_bridge(struct device_node *dev)
49967 +{
49968 +#ifdef CONFIG_PCI
49969 +       int len;
49970 +       struct pci_controller *hose;
49971 +       const int *bus_range;
49972 +
49973 +       printk("Adding PCI host bridge %s\n", dev->full_name);
49974 +
49975 +       hose = pcibios_alloc_controller(dev);
49976 +       if (hose == NULL)
49977 +               return -ENOMEM;
49978 +
49979 +       bus_range = of_get_property(dev, "bus-range", &len);
49980 +       hose->first_busno = bus_range ? bus_range[0] : 0;
49981 +       hose->last_busno = bus_range ? bus_range[1] : 0xff;
49982 +
49983 +       setup_indirect_pci(hose, MPC10X_MAPB_CNFG_ADDR, MPC10X_MAPB_CNFG_DATA, 0);
49984 +
49985 +       /* Interpret the "ranges" property */
49986 +       /* This also maps the I/O region and sets isa_io/mem_base */
49987 +       pci_process_bridge_OF_ranges(hose, dev, 1);
49988 +#endif
49989 +
49990 +       return 0;
49991 +}
49992 +
49993 +static void __init storcenter_setup_arch(void)
49994 +{
49995 +       struct device_node *np;
49996 +
49997 +#ifdef CONFIG_MTD_PHYSMAP
49998 +       physmap_set_partitions(storcenter_physmap_partitions,
49999 +                              ARRAY_SIZE(storcenter_physmap_partitions));
50000 +#endif
50001 +
50002 +       /* Lookup PCI host bridges */
50003 +       for_each_compatible_node(np, "pci", "mpc10x-pci")
50004 +               storcenter_add_bridge(np);
50005 +
50006 +       printk(KERN_INFO "IOMEGA StorCenter\n");
50007 +}
50008 +
50009 +/*
50010 + * Interrupt setup and service.  Interrrupts on the turbostation come
50011 + * from the four PCI slots plus onboard 8241 devices: I2C, DUART.
50012 + */
50013 +static void __init storcenter_init_IRQ(void)
50014 +{
50015 +       struct mpic *mpic;
50016 +       struct device_node *dnp;
50017 +       const void *prop;
50018 +       int size;
50019 +       phys_addr_t paddr;
50020 +
50021 +       dnp = of_find_node_by_type(NULL, "open-pic");
50022 +       if (dnp == NULL)
50023 +               return;
50024 +
50025 +       prop = of_get_property(dnp, "reg", &size);
50026 +       if (prop == NULL) {
50027 +               of_node_put(dnp);
50028 +               return;
50029 +       }
50030 +
50031 +       paddr = (phys_addr_t)of_translate_address(dnp, prop);
50032 +       mpic = mpic_alloc(dnp, paddr, MPIC_PRIMARY | MPIC_WANTS_RESET,
50033 +                       4, 32, " EPIC     ");
50034 +
50035 +       of_node_put(dnp);
50036 +
50037 +       BUG_ON(mpic == NULL);
50038 +
50039 +       /* PCI IRQs */
50040 +       /*
50041 +        * 2.6.12 patch:
50042 +        *         openpic_set_sources(0, 5, OpenPIC_Addr + 0x10200);
50043 +        *         openpic_set_sources(5, 2, OpenPIC_Addr + 0x11120);
50044 +        *         first_irq, num_irqs, __iomem first_ISR
50045 +        *         o_ss: i, src: 0, fdf50200
50046 +        *         o_ss: i, src: 1, fdf50220
50047 +        *         o_ss: i, src: 2, fdf50240
50048 +        *         o_ss: i, src: 3, fdf50260
50049 +        *         o_ss: i, src: 4, fdf50280
50050 +        *         o_ss: i, src: 5, fdf51120
50051 +        *         o_ss: i, src: 6, fdf51140
50052 +        */
50053 +       mpic_assign_isu(mpic, 0, paddr + 0x10200);
50054 +       mpic_assign_isu(mpic, 1, paddr + 0x10220);
50055 +       mpic_assign_isu(mpic, 2, paddr + 0x10240);
50056 +       mpic_assign_isu(mpic, 3, paddr + 0x10260);
50057 +       mpic_assign_isu(mpic, 4, paddr + 0x10280);
50058 +       mpic_assign_isu(mpic, 5, paddr + 0x11120);
50059 +       mpic_assign_isu(mpic, 6, paddr + 0x11140);
50060 +
50061 +       mpic_init(mpic);
50062 +}
50063 +
50064 +static void storcenter_restart(char *cmd)
50065 +{
50066 +       local_irq_disable();
50067 +
50068 +       /* Set exception prefix high - to the firmware */
50069 +       _nmask_and_or_msr(0, MSR_IP);
50070 +
50071 +       /* Wait for reset to happen */
50072 +       for (;;) ;
50073 +}
50074 +
50075 +static int __init storcenter_probe(void)
50076 +{
50077 +       unsigned long root = of_get_flat_dt_root();
50078 +
50079 +       return of_flat_dt_is_compatible(root, "storcenter");
50080 +}
50081 +
50082 +define_machine(storcenter){
50083 +       .name                   = "IOMEGA StorCenter",
50084 +       .probe                  = storcenter_probe,
50085 +       .setup_arch             = storcenter_setup_arch,
50086 +       .init_IRQ               = storcenter_init_IRQ,
50087 +       .get_irq                = mpic_get_irq,
50088 +       .restart                = storcenter_restart,
50089 +       .calibrate_decr         = generic_calibrate_decr,
50090 +};
50091 --- a/arch/powerpc/platforms/iseries/Makefile
50092 +++ b/arch/powerpc/platforms/iseries/Makefile
50093 @@ -5,7 +5,7 @@
50094  obj-y += exception.o
50095  obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o dt_mod.o mf.o lpevents.o \
50096         hvcall.o proc.o htab.o iommu.o misc.o irq.o
50097 -obj-$(CONFIG_PCI) += pci.o vpdinfo.o
50098 +obj-$(CONFIG_PCI) += pci.o
50099  obj-$(CONFIG_SMP) += smp.o
50100  obj-$(CONFIG_VIOPATH) += viopath.o vio.o
50101  obj-$(CONFIG_MODULES) += ksyms.o
50102 --- a/arch/powerpc/platforms/iseries/iommu.c
50103 +++ b/arch/powerpc/platforms/iseries/iommu.c
50104 @@ -163,8 +163,10 @@
50105                     (it->it_type == TCE_PCI) &&
50106                     (it->it_offset == tbl->it_offset) &&
50107                     (it->it_index == tbl->it_index) &&
50108 -                   (it->it_size == tbl->it_size))
50109 +                   (it->it_size == tbl->it_size)) {
50110 +                       of_node_put(node);
50111                         return it;
50112 +               }
50113         }
50114         return NULL;
50115  }
50116 --- a/arch/powerpc/platforms/iseries/lpevents.c
50117 +++ b/arch/powerpc/platforms/iseries/lpevents.c
50118 @@ -239,7 +239,7 @@
50119                          * other CPUs, and that the deleted handler isn't
50120                          * still running on another CPU when we return.
50121                          */
50122 -                       synchronize_rcu();
50123 +                       synchronize_sched();
50124                         return 0;
50125                 }
50126         }
50127 --- a/arch/powerpc/platforms/iseries/pci.c
50128 +++ b/arch/powerpc/platforms/iseries/pci.c
50129 @@ -1,5 +1,6 @@
50130  /*
50131   * Copyright (C) 2001 Allan Trautman, IBM Corporation
50132 + * Copyright (C) 2005,2007  Stephen Rothwell, IBM Corp
50133   *
50134   * iSeries specific routines for PCI.
50135   *
50136 @@ -19,13 +20,18 @@
50137   * along with this program; if not, write to the Free Software
50138   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
50139   */
50140 +
50141 +#undef DEBUG
50142 +
50143  #include <linux/kernel.h>
50144  #include <linux/list.h>
50145  #include <linux/string.h>
50146  #include <linux/init.h>
50147  #include <linux/module.h>
50148  #include <linux/pci.h>
50149 +#include <linux/of.h>
50150  
50151 +#include <asm/types.h>
50152  #include <asm/io.h>
50153  #include <asm/irq.h>
50154  #include <asm/prom.h>
50155 @@ -35,6 +41,7 @@
50156  #include <asm/abs_addr.h>
50157  #include <asm/firmware.h>
50158  
50159 +#include <asm/iseries/hv_types.h>
50160  #include <asm/iseries/hv_call_xm.h>
50161  #include <asm/iseries/mf.h>
50162  #include <asm/iseries/iommu.h>
50163 @@ -45,15 +52,8 @@
50164  #include "pci.h"
50165  #include "call_pci.h"
50166  
50167 -/*
50168 - * Forward declares of prototypes.
50169 - */
50170 -static struct device_node *find_Device_Node(int bus, int devfn);
50171 -
50172 -static int Pci_Retry_Max = 3;  /* Only retry 3 times  */
50173 -static int Pci_Error_Flag = 1; /* Set Retry Error on. */
50174 -
50175 -static struct pci_ops iSeries_pci_ops;
50176 +#define PCI_RETRY_MAX  3
50177 +static int limit_pci_retries = 1;      /* Set Retry Error on. */
50178  
50179  /*
50180   * Table defines
50181 @@ -62,6 +62,7 @@
50182  #define IOMM_TABLE_MAX_ENTRIES 1024
50183  #define IOMM_TABLE_ENTRY_SIZE  0x0000000000400000UL
50184  #define BASE_IO_MEMORY         0xE000000000000000UL
50185 +#define END_IO_MEMORY          0xEFFFFFFFFFFFFFFFUL
50186  
50187  static unsigned long max_io_memory = BASE_IO_MEMORY;
50188  static long current_iomm_table_entry;
50189 @@ -70,12 +71,237 @@
50190   * Lookup Tables.
50191   */
50192  static struct device_node *iomm_table[IOMM_TABLE_MAX_ENTRIES];
50193 -static u8 iobar_table[IOMM_TABLE_MAX_ENTRIES];
50194 +static u64 ds_addr_table[IOMM_TABLE_MAX_ENTRIES];
50195  
50196 -static const char pci_io_text[] = "iSeries PCI I/O";
50197  static DEFINE_SPINLOCK(iomm_table_lock);
50198  
50199  /*
50200 + * Generate a Direct Select Address for the Hypervisor
50201 + */
50202 +static inline u64 iseries_ds_addr(struct device_node *node)
50203 +{
50204 +       struct pci_dn *pdn = PCI_DN(node);
50205 +       const u32 *sbp = of_get_property(node, "linux,subbus", NULL);
50206 +
50207 +       return ((u64)pdn->busno << 48) + ((u64)(sbp ? *sbp : 0) << 40)
50208 +                       + ((u64)0x10 << 32);
50209 +}
50210 +
50211 +/*
50212 + * Size of Bus VPD data
50213 + */
50214 +#define BUS_VPDSIZE      1024
50215 +
50216 +/*
50217 + * Bus Vpd Tags
50218 + */
50219 +#define VPD_END_OF_AREA                0x79
50220 +#define VPD_ID_STRING          0x82
50221 +#define VPD_VENDOR_AREA                0x84
50222 +
50223 +/*
50224 + * Mfg Area Tags
50225 + */
50226 +#define VPD_FRU_FRAME_ID       0x4649  /* "FI" */
50227 +#define VPD_SLOT_MAP_FORMAT    0x4D46  /* "MF" */
50228 +#define VPD_SLOT_MAP           0x534D  /* "SM" */
50229 +
50230 +/*
50231 + * Structures of the areas
50232 + */
50233 +struct mfg_vpd_area {
50234 +       u16     tag;
50235 +       u8      length;
50236 +       u8      data1;
50237 +       u8      data2;
50238 +};
50239 +#define MFG_ENTRY_SIZE   3
50240 +
50241 +struct slot_map {
50242 +       u8      agent;
50243 +       u8      secondary_agent;
50244 +       u8      phb;
50245 +       char    card_location[3];
50246 +       char    parms[8];
50247 +       char    reserved[2];
50248 +};
50249 +#define SLOT_ENTRY_SIZE   16
50250 +
50251 +/*
50252 + * Parse the Slot Area
50253 + */
50254 +static void __init iseries_parse_slot_area(struct slot_map *map, int len,
50255 +               HvAgentId agent, u8 *phb, char card[4])
50256 +{
50257 +       /*
50258 +        * Parse Slot label until we find the one requested
50259 +        */
50260 +       while (len > 0) {
50261 +               if (map->agent == agent) {
50262 +                       /*
50263 +                        * If Phb wasn't found, grab the entry first one found.
50264 +                        */
50265 +                       if (*phb == 0xff)
50266 +                               *phb = map->phb;
50267 +                       /* Found it, extract the data. */
50268 +                       if (map->phb == *phb) {
50269 +                               memcpy(card, &map->card_location, 3);
50270 +                               card[3]  = 0;
50271 +                               break;
50272 +                       }
50273 +               }
50274 +               /* Point to the next Slot */
50275 +               map = (struct slot_map *)((char *)map + SLOT_ENTRY_SIZE);
50276 +               len -= SLOT_ENTRY_SIZE;
50277 +       }
50278 +}
50279 +
50280 +/*
50281 + * Parse the Mfg Area
50282 + */
50283 +static void __init iseries_parse_mfg_area(struct mfg_vpd_area *area, int len,
50284 +               HvAgentId agent, u8 *phb, u8 *frame, char card[4])
50285 +{
50286 +       u16 slot_map_fmt = 0;
50287 +
50288 +       /* Parse Mfg Data */
50289 +       while (len > 0) {
50290 +               int mfg_tag_len = area->length;
50291 +               /* Frame ID         (FI 4649020310 ) */
50292 +               if (area->tag == VPD_FRU_FRAME_ID)
50293 +                       *frame = area->data1;
50294 +               /* Slot Map Format  (MF 4D46020004 ) */
50295 +               else if (area->tag == VPD_SLOT_MAP_FORMAT)
50296 +                       slot_map_fmt = (area->data1 * 256)
50297 +                               + area->data2;
50298 +               /* Slot Map         (SM 534D90 */
50299 +               else if (area->tag == VPD_SLOT_MAP) {
50300 +                       struct slot_map *slot_map;
50301 +
50302 +                       if (slot_map_fmt == 0x1004)
50303 +                               slot_map = (struct slot_map *)((char *)area
50304 +                                               + MFG_ENTRY_SIZE + 1);
50305 +                       else
50306 +                               slot_map = (struct slot_map *)((char *)area
50307 +                                               + MFG_ENTRY_SIZE);
50308 +                       iseries_parse_slot_area(slot_map, mfg_tag_len,
50309 +                                       agent, phb, card);
50310 +               }
50311 +               /*
50312 +                * Point to the next Mfg Area
50313 +                * Use defined size, sizeof give wrong answer
50314 +                */
50315 +               area = (struct mfg_vpd_area *)((char *)area + mfg_tag_len
50316 +                               + MFG_ENTRY_SIZE);
50317 +               len -= (mfg_tag_len + MFG_ENTRY_SIZE);
50318 +       }
50319 +}
50320 +
50321 +/*
50322 + * Look for "BUS".. Data is not Null terminated.
50323 + * PHBID of 0xFF indicates PHB was not found in VPD Data.
50324 + */
50325 +static u8 __init iseries_parse_phbid(u8 *area, int len)
50326 +{
50327 +       while (len > 0) {
50328 +               if ((*area == 'B') && (*(area + 1) == 'U')
50329 +                               && (*(area + 2) == 'S')) {
50330 +                       area += 3;
50331 +                       while (*area == ' ')
50332 +                               area++;
50333 +                       return *area & 0x0F;
50334 +               }
50335 +               area++;
50336 +               len--;
50337 +       }
50338 +       return 0xff;
50339 +}
50340 +
50341 +/*
50342 + * Parse out the VPD Areas
50343 + */
50344 +static void __init iseries_parse_vpd(u8 *data, int data_len,
50345 +               HvAgentId agent, u8 *frame, char card[4])
50346 +{
50347 +       u8 phb = 0xff;
50348 +
50349 +       while (data_len > 0) {
50350 +               int len;
50351 +               u8 tag = *data;
50352 +
50353 +               if (tag == VPD_END_OF_AREA)
50354 +                       break;
50355 +               len = *(data + 1) + (*(data + 2) * 256);
50356 +               data += 3;
50357 +               data_len -= 3;
50358 +               if (tag == VPD_ID_STRING)
50359 +                       phb = iseries_parse_phbid(data, len);
50360 +               else if (tag == VPD_VENDOR_AREA)
50361 +                       iseries_parse_mfg_area((struct mfg_vpd_area *)data, len,
50362 +                                       agent, &phb, frame, card);
50363 +               /* Point to next Area. */
50364 +               data += len;
50365 +               data_len -= len;
50366 +       }
50367 +}
50368 +
50369 +static int __init iseries_get_location_code(u16 bus, HvAgentId agent,
50370 +               u8 *frame, char card[4])
50371 +{
50372 +       int status = 0;
50373 +       int bus_vpd_len = 0;
50374 +       u8 *bus_vpd = kmalloc(BUS_VPDSIZE, GFP_KERNEL);
50375 +
50376 +       if (bus_vpd == NULL) {
50377 +               printk("PCI: Bus VPD Buffer allocation failure.\n");
50378 +               return 0;
50379 +       }
50380 +       bus_vpd_len = HvCallPci_getBusVpd(bus, iseries_hv_addr(bus_vpd),
50381 +                                       BUS_VPDSIZE);
50382 +       if (bus_vpd_len == 0) {
50383 +               printk("PCI: Bus VPD Buffer zero length.\n");
50384 +               goto out_free;
50385 +       }
50386 +       /* printk("PCI: bus_vpd: %p, %d\n",bus_vpd, bus_vpd_len); */
50387 +       /* Make sure this is what I think it is */
50388 +       if (*bus_vpd != VPD_ID_STRING) {
50389 +               printk("PCI: Bus VPD Buffer missing starting tag.\n");
50390 +               goto out_free;
50391 +       }
50392 +       iseries_parse_vpd(bus_vpd, bus_vpd_len, agent, frame, card);
50393 +       status = 1;
50394 +out_free:
50395 +       kfree(bus_vpd);
50396 +       return status;
50397 +}
50398 +
50399 +/*
50400 + * Prints the device information.
50401 + * - Pass in pci_dev* pointer to the device.
50402 + * - Pass in the device count
50403 + *
50404 + * Format:
50405 + * PCI: Bus  0, Device 26, Vendor 0x12AE  Frame  1, Card  C10  Ethernet
50406 + * controller
50407 + */
50408 +static void __init iseries_device_information(struct pci_dev *pdev,
50409 +                                             u16 bus, HvSubBusNumber subbus)
50410 +{
50411 +       u8 frame = 0;
50412 +       char card[4];
50413 +       HvAgentId agent;
50414 +
50415 +       agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
50416 +                       ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
50417 +
50418 +       if (iseries_get_location_code(bus, agent, &frame, card)) {
50419 +               printk(KERN_INFO "PCI: %s, Vendor %04X Frame%3d, "
50420 +                      "Card %4s  0x%04X\n", pci_name(pdev), pdev->vendor,
50421 +                      frame, card, (int)(pdev->class >> 8));
50422 +       }
50423 +}
50424 +
50425 +/*
50426   * iomm_table_allocate_entry
50427   *
50428   * Adds pci_dev entry in address translation table
50429 @@ -87,7 +313,7 @@
50430   * - CurrentIndex is incremented to keep track of the last entry.
50431   * - Builds the resource entry for allocated BARs.
50432   */
50433 -static void iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
50434 +static void __init iomm_table_allocate_entry(struct pci_dev *dev, int bar_num)
50435  {
50436         struct resource *bar_res = &dev->resource[bar_num];
50437         long bar_size = pci_resource_len(dev, bar_num);
50438 @@ -101,7 +327,6 @@
50439          * Set Resource values.
50440          */
50441         spin_lock(&iomm_table_lock);
50442 -       bar_res->name = pci_io_text;
50443         bar_res->start = BASE_IO_MEMORY +
50444                 IOMM_TABLE_ENTRY_SIZE * current_iomm_table_entry;
50445         bar_res->end = bar_res->start + bar_size - 1;
50446 @@ -110,7 +335,8 @@
50447          */
50448         while (bar_size > 0 ) {
50449                 iomm_table[current_iomm_table_entry] = dev->sysdata;
50450 -               iobar_table[current_iomm_table_entry] = bar_num;
50451 +               ds_addr_table[current_iomm_table_entry] =
50452 +                       iseries_ds_addr(dev->sysdata) | (bar_num << 24);
50453                 bar_size -= IOMM_TABLE_ENTRY_SIZE;
50454                 ++current_iomm_table_entry;
50455         }
50456 @@ -130,7 +356,7 @@
50457   * - Loops through The Bar resources(0 - 5) including the ROM
50458   *   is resource(6).
50459   */
50460 -static void allocate_device_bars(struct pci_dev *dev)
50461 +static void __init allocate_device_bars(struct pci_dev *dev)
50462  {
50463         int bar_num;
50464  
50465 @@ -145,79 +371,19 @@
50466   * PCI: Read Vendor Failed 0x18.58.10 Rc: 0x00xx
50467   * PCI: Connect Bus Unit Failed 0x18.58.10 Rc: 0x00xx
50468   */
50469 -static void pci_Log_Error(char *Error_Text, int Bus, int SubBus,
50470 -               int AgentId, int HvRc)
50471 +static void pci_log_error(char *error, int bus, int subbus,
50472 +               int agent, int hv_res)
50473  {
50474 -       if (HvRc == 0x0302)
50475 +       if (hv_res == 0x0302)
50476                 return;
50477         printk(KERN_ERR "PCI: %s Failed: 0x%02X.%02X.%02X Rc: 0x%04X",
50478 -              Error_Text, Bus, SubBus, AgentId, HvRc);
50479 -}
50480 -
50481 -/*
50482 - * iSeries_pci_final_fixup(void)
50483 - */
50484 -void __init iSeries_pci_final_fixup(void)
50485 -{
50486 -       struct pci_dev *pdev = NULL;
50487 -       struct device_node *node;
50488 -       int DeviceCount = 0;
50489 -
50490 -       /* Fix up at the device node and pci_dev relationship */
50491 -       mf_display_src(0xC9000100);
50492 -
50493 -       printk("pcibios_final_fixup\n");
50494 -       for_each_pci_dev(pdev) {
50495 -               node = find_Device_Node(pdev->bus->number, pdev->devfn);
50496 -               printk("pci dev %p (%x.%x), node %p\n", pdev,
50497 -                      pdev->bus->number, pdev->devfn, node);
50498 -
50499 -               if (node != NULL) {
50500 -                       struct pci_dn *pdn = PCI_DN(node);
50501 -                       const u32 *agent;
50502 -
50503 -                       agent = of_get_property(node, "linux,agent-id", NULL);
50504 -                       if ((pdn != NULL) && (agent != NULL)) {
50505 -                               u8 irq = iSeries_allocate_IRQ(pdn->busno, 0,
50506 -                                               pdn->bussubno);
50507 -                               int err;
50508 -
50509 -                               err = HvCallXm_connectBusUnit(pdn->busno, pdn->bussubno,
50510 -                                               *agent, irq);
50511 -                               if (err)
50512 -                                       pci_Log_Error("Connect Bus Unit",
50513 -                                               pdn->busno, pdn->bussubno, *agent, err);
50514 -                               else {
50515 -                                       err = HvCallPci_configStore8(pdn->busno, pdn->bussubno,
50516 -                                                       *agent,
50517 -                                                       PCI_INTERRUPT_LINE,
50518 -                                                       irq);
50519 -                                       if (err)
50520 -                                               pci_Log_Error("PciCfgStore Irq Failed!",
50521 -                                                       pdn->busno, pdn->bussubno, *agent, err);
50522 -                               }
50523 -                               if (!err)
50524 -                                       pdev->irq = irq;
50525 -                       }
50526 -
50527 -                       ++DeviceCount;
50528 -                       pdev->sysdata = (void *)node;
50529 -                       PCI_DN(node)->pcidev = pdev;
50530 -                       allocate_device_bars(pdev);
50531 -                       iSeries_Device_Information(pdev, DeviceCount);
50532 -                       iommu_devnode_init_iSeries(pdev, node);
50533 -               } else
50534 -                       printk("PCI: Device Tree not found for 0x%016lX\n",
50535 -                                       (unsigned long)pdev);
50536 -       }
50537 -       iSeries_activate_IRQs();
50538 -       mf_display_src(0xC9000200);
50539 +              error, bus, subbus, agent, hv_res);
50540  }
50541  
50542  /*
50543   * Look down the chain to find the matching Device Device
50544   */
50545 -static struct device_node *find_Device_Node(int bus, int devfn)
50546 +static struct device_node *find_device_node(int bus, int devfn)
50547  {
50548         struct device_node *node;
50549  
50550 @@ -230,22 +396,66 @@
50551         return NULL;
50552  }
50553  
50554 -#if 0
50555  /*
50556 - * Returns the device node for the passed pci_dev
50557 - * Sanity Check Node PciDev to passed pci_dev
50558 - * If none is found, returns a NULL which the client must handle.
50559 + * iSeries_pcibios_fixup_resources
50560 + *
50561 + * Fixes up all resources for devices
50562   */
50563 -static struct device_node *get_Device_Node(struct pci_dev *pdev)
50564 +void __init iSeries_pcibios_fixup_resources(struct pci_dev *pdev)
50565  {
50566 +       const u32 *agent;
50567 +       const u32 *sub_bus;
50568 +       unsigned char bus = pdev->bus->number;
50569         struct device_node *node;
50570 +       int i;
50571 +
50572 +       node = find_device_node(bus, pdev->devfn);
50573 +       pr_debug("PCI: iSeries %s, pdev %p, node %p\n",
50574 +                pci_name(pdev), pdev, node);
50575 +       if (!node) {
50576 +               printk("PCI: %s disabled, device tree entry not found !\n",
50577 +                      pci_name(pdev));
50578 +               for (i = 0; i <= PCI_ROM_RESOURCE; i++)
50579 +                       pdev->resource[i].flags = 0;
50580 +               return;
50581 +       }
50582 +       sub_bus = of_get_property(node, "linux,subbus", NULL);
50583 +       agent = of_get_property(node, "linux,agent-id", NULL);
50584 +       if (agent && sub_bus) {
50585 +               u8 irq = iSeries_allocate_IRQ(bus, 0, *sub_bus);
50586 +               int err;
50587 +
50588 +               err = HvCallXm_connectBusUnit(bus, *sub_bus, *agent, irq);
50589 +               if (err)
50590 +                       pci_log_error("Connect Bus Unit",
50591 +                                     bus, *sub_bus, *agent, err);
50592 +               else {
50593 +                       err = HvCallPci_configStore8(bus, *sub_bus,
50594 +                                       *agent, PCI_INTERRUPT_LINE, irq);
50595 +                       if (err)
50596 +                               pci_log_error("PciCfgStore Irq Failed!",
50597 +                                               bus, *sub_bus, *agent, err);
50598 +                       else
50599 +                               pdev->irq = irq;
50600 +               }
50601 +       }
50602  
50603 -       node = pdev->sysdata;
50604 -       if (node == NULL || PCI_DN(node)->pcidev != pdev)
50605 -               node = find_Device_Node(pdev->bus->number, pdev->devfn);
50606 -       return node;
50607 +       pdev->sysdata = node;
50608 +       allocate_device_bars(pdev);
50609 +       iseries_device_information(pdev, bus, *sub_bus);
50610 +       iommu_devnode_init_iSeries(pdev, node);
50611 +}
50612 +
50613 +/*
50614 + * iSeries_pci_final_fixup(void)
50615 + */
50616 +void __init iSeries_pci_final_fixup(void)
50617 +{
50618 +       /* Fix up at the device node and pci_dev relationship */
50619 +       mf_display_src(0xC9000100);
50620 +       iSeries_activate_IRQs();
50621 +       mf_display_src(0xC9000200);
50622  }
50623 -#endif
50624  
50625  /*
50626   * Config space read and write functions.
50627 @@ -269,7 +479,7 @@
50628  static int iSeries_pci_read_config(struct pci_bus *bus, unsigned int devfn,
50629                 int offset, int size, u32 *val)
50630  {
50631 -       struct device_node *node = find_Device_Node(bus->number, devfn);
50632 +       struct device_node *node = find_device_node(bus->number, devfn);
50633         u64 fn;
50634         struct HvCallPci_LoadReturn ret;
50635  
50636 @@ -299,7 +509,7 @@
50637  static int iSeries_pci_write_config(struct pci_bus *bus, unsigned int devfn,
50638                 int offset, int size, u32 val)
50639  {
50640 -       struct device_node *node = find_Device_Node(bus->number, devfn);
50641 +       struct device_node *node = find_device_node(bus->number, devfn);
50642         u64 fn;
50643         u64 ret;
50644  
50645 @@ -331,22 +541,22 @@
50646   * PCI: Device 23.90 ReadL Retry( 1)
50647   * PCI: Device 23.90 ReadL Retry Successful(1)
50648   */
50649 -static int CheckReturnCode(char *TextHdr, struct device_node *DevNode,
50650 +static int check_return_code(char *type, struct device_node *dn,
50651                 int *retry, u64 ret)
50652  {
50653         if (ret != 0)  {
50654 -               struct pci_dn *pdn = PCI_DN(DevNode);
50655 +               struct pci_dn *pdn = PCI_DN(dn);
50656  
50657                 (*retry)++;
50658                 printk("PCI: %s: Device 0x%04X:%02X  I/O Error(%2d): 0x%04X\n",
50659 -                               TextHdr, pdn->busno, pdn->devfn,
50660 +                               type, pdn->busno, pdn->devfn,
50661                                 *retry, (int)ret);
50662                 /*
50663                  * Bump the retry and check for retry count exceeded.
50664                  * If, Exceeded, panic the system.
50665                  */
50666 -               if (((*retry) > Pci_Retry_Max) &&
50667 -                               (Pci_Error_Flag > 0)) {
50668 +               if (((*retry) > PCI_RETRY_MAX) &&
50669 +                               (limit_pci_retries > 0)) {
50670                         mf_display_src(0xB6000103);
50671                         panic_timeout = 0;
50672                         panic("PCI: Hardware I/O Error, SRC B6000103, "
50673 @@ -363,28 +573,39 @@
50674   * the exposure of being device global.
50675   */
50676  static inline struct device_node *xlate_iomm_address(
50677 -               const volatile void __iomem *IoAddress,
50678 -               u64 *dsaptr, u64 *BarOffsetPtr)
50679 +               const volatile void __iomem *addr,
50680 +               u64 *dsaptr, u64 *bar_offset, const char *func)
50681  {
50682 -       unsigned long OrigIoAddr;
50683 -       unsigned long BaseIoAddr;
50684 -       unsigned long TableIndex;
50685 -       struct device_node *DevNode;
50686 +       unsigned long orig_addr;
50687 +       unsigned long base_addr;
50688 +       unsigned long ind;
50689 +       struct device_node *dn;
50690  
50691 -       OrigIoAddr = (unsigned long __force)IoAddress;
50692 -       if ((OrigIoAddr < BASE_IO_MEMORY) || (OrigIoAddr >= max_io_memory))
50693 +       orig_addr = (unsigned long __force)addr;
50694 +       if ((orig_addr < BASE_IO_MEMORY) || (orig_addr >= max_io_memory)) {
50695 +               static unsigned long last_jiffies;
50696 +               static int num_printed;
50697 +
50698 +               if ((jiffies - last_jiffies) > 60 * HZ) {
50699 +                       last_jiffies = jiffies;
50700 +                       num_printed = 0;
50701 +               }
50702 +               if (num_printed++ < 10)
50703 +                       printk(KERN_ERR
50704 +                               "iSeries_%s: invalid access at IO address %p\n",
50705 +                               func, addr);
50706                 return NULL;
50707 -       BaseIoAddr = OrigIoAddr - BASE_IO_MEMORY;
50708 -       TableIndex = BaseIoAddr / IOMM_TABLE_ENTRY_SIZE;
50709 -       DevNode = iomm_table[TableIndex];
50710 -
50711 -       if (DevNode != NULL) {
50712 -               int barnum = iobar_table[TableIndex];
50713 -               *dsaptr = iseries_ds_addr(DevNode) | (barnum << 24);
50714 -               *BarOffsetPtr = BaseIoAddr % IOMM_TABLE_ENTRY_SIZE;
50715 +       }
50716 +       base_addr = orig_addr - BASE_IO_MEMORY;
50717 +       ind = base_addr / IOMM_TABLE_ENTRY_SIZE;
50718 +       dn = iomm_table[ind];
50719 +
50720 +       if (dn != NULL) {
50721 +               *dsaptr = ds_addr_table[ind];
50722 +               *bar_offset = base_addr % IOMM_TABLE_ENTRY_SIZE;
50723         } else
50724 -               panic("PCI: Invalid PCI IoAddress detected!\n");
50725 -       return DevNode;
50726 +               panic("PCI: Invalid PCI IO address detected!\n");
50727 +       return dn;
50728  }
50729  
50730  /*
50731 @@ -392,91 +613,58 @@
50732   * On MM I/O error, all ones are returned and iSeries_pci_IoError is cal
50733   * else, data is returned in Big Endian format.
50734   */
50735 -static u8 iSeries_Read_Byte(const volatile void __iomem *IoAddress)
50736 +static u8 iseries_readb(const volatile void __iomem *addr)
50737  {
50738 -       u64 BarOffset;
50739 +       u64 bar_offset;
50740         u64 dsa;
50741         int retry = 0;
50742         struct HvCallPci_LoadReturn ret;
50743 -       struct device_node *DevNode =
50744 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
50745 -
50746 -       if (DevNode == NULL) {
50747 -               static unsigned long last_jiffies;
50748 -               static int num_printed;
50749 +       struct device_node *dn =
50750 +               xlate_iomm_address(addr, &dsa, &bar_offset, "read_byte");
50751  
50752 -               if ((jiffies - last_jiffies) > 60 * HZ) {
50753 -                       last_jiffies = jiffies;
50754 -                       num_printed = 0;
50755 -               }
50756 -               if (num_printed++ < 10)
50757 -                       printk(KERN_ERR "iSeries_Read_Byte: invalid access at IO address %p\n",
50758 -                              IoAddress);
50759 +       if (dn == NULL)
50760                 return 0xff;
50761 -       }
50762         do {
50763 -               HvCall3Ret16(HvCallPciBarLoad8, &ret, dsa, BarOffset, 0);
50764 -       } while (CheckReturnCode("RDB", DevNode, &retry, ret.rc) != 0);
50765 +               HvCall3Ret16(HvCallPciBarLoad8, &ret, dsa, bar_offset, 0);
50766 +       } while (check_return_code("RDB", dn, &retry, ret.rc) != 0);
50767  
50768         return ret.value;
50769  }
50770  
50771 -static u16 iSeries_Read_Word(const volatile void __iomem *IoAddress)
50772 +static u16 iseries_readw_be(const volatile void __iomem *addr)
50773  {
50774 -       u64 BarOffset;
50775 +       u64 bar_offset;
50776         u64 dsa;
50777         int retry = 0;
50778         struct HvCallPci_LoadReturn ret;
50779 -       struct device_node *DevNode =
50780 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
50781 -
50782 -       if (DevNode == NULL) {
50783 -               static unsigned long last_jiffies;
50784 -               static int num_printed;
50785 +       struct device_node *dn =
50786 +               xlate_iomm_address(addr, &dsa, &bar_offset, "read_word");
50787  
50788 -               if ((jiffies - last_jiffies) > 60 * HZ) {
50789 -                       last_jiffies = jiffies;
50790 -                       num_printed = 0;
50791 -               }
50792 -               if (num_printed++ < 10)
50793 -                       printk(KERN_ERR "iSeries_Read_Word: invalid access at IO address %p\n",
50794 -                              IoAddress);
50795 +       if (dn == NULL)
50796                 return 0xffff;
50797 -       }
50798         do {
50799                 HvCall3Ret16(HvCallPciBarLoad16, &ret, dsa,
50800 -                               BarOffset, 0);
50801 -       } while (CheckReturnCode("RDW", DevNode, &retry, ret.rc) != 0);
50802 +                               bar_offset, 0);
50803 +       } while (check_return_code("RDW", dn, &retry, ret.rc) != 0);
50804  
50805         return ret.value;
50806  }
50807  
50808 -static u32 iSeries_Read_Long(const volatile void __iomem *IoAddress)
50809 +static u32 iseries_readl_be(const volatile void __iomem *addr)
50810  {
50811 -       u64 BarOffset;
50812 +       u64 bar_offset;
50813         u64 dsa;
50814         int retry = 0;
50815         struct HvCallPci_LoadReturn ret;
50816 -       struct device_node *DevNode =
50817 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
50818 +       struct device_node *dn =
50819 +               xlate_iomm_address(addr, &dsa, &bar_offset, "read_long");
50820  
50821 -       if (DevNode == NULL) {
50822 -               static unsigned long last_jiffies;
50823 -               static int num_printed;
50824 -
50825 -               if ((jiffies - last_jiffies) > 60 * HZ) {
50826 -                       last_jiffies = jiffies;
50827 -                       num_printed = 0;
50828 -               }
50829 -               if (num_printed++ < 10)
50830 -                       printk(KERN_ERR "iSeries_Read_Long: invalid access at IO address %p\n",
50831 -                              IoAddress);
50832 +       if (dn == NULL)
50833                 return 0xffffffff;
50834 -       }
50835         do {
50836                 HvCall3Ret16(HvCallPciBarLoad32, &ret, dsa,
50837 -                               BarOffset, 0);
50838 -       } while (CheckReturnCode("RDL", DevNode, &retry, ret.rc) != 0);
50839 +                               bar_offset, 0);
50840 +       } while (check_return_code("RDL", dn, &retry, ret.rc) != 0);
50841  
50842         return ret.value;
50843  }
50844 @@ -485,134 +673,72 @@
50845   * Write MM I/O Instructions for the iSeries
50846   *
50847   */
50848 -static void iSeries_Write_Byte(u8 data, volatile void __iomem *IoAddress)
50849 +static void iseries_writeb(u8 data, volatile void __iomem *addr)
50850  {
50851 -       u64 BarOffset;
50852 +       u64 bar_offset;
50853         u64 dsa;
50854         int retry = 0;
50855         u64 rc;
50856 -       struct device_node *DevNode =
50857 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
50858 -
50859 -       if (DevNode == NULL) {
50860 -               static unsigned long last_jiffies;
50861 -               static int num_printed;
50862 +       struct device_node *dn =
50863 +               xlate_iomm_address(addr, &dsa, &bar_offset, "write_byte");
50864  
50865 -               if ((jiffies - last_jiffies) > 60 * HZ) {
50866 -                       last_jiffies = jiffies;
50867 -                       num_printed = 0;
50868 -               }
50869 -               if (num_printed++ < 10)
50870 -                       printk(KERN_ERR "iSeries_Write_Byte: invalid access at IO address %p\n", IoAddress);
50871 +       if (dn == NULL)
50872                 return;
50873 -       }
50874         do {
50875 -               rc = HvCall4(HvCallPciBarStore8, dsa, BarOffset, data, 0);
50876 -       } while (CheckReturnCode("WWB", DevNode, &retry, rc) != 0);
50877 +               rc = HvCall4(HvCallPciBarStore8, dsa, bar_offset, data, 0);
50878 +       } while (check_return_code("WWB", dn, &retry, rc) != 0);
50879  }
50880  
50881 -static void iSeries_Write_Word(u16 data, volatile void __iomem *IoAddress)
50882 +static void iseries_writew_be(u16 data, volatile void __iomem *addr)
50883  {
50884 -       u64 BarOffset;
50885 +       u64 bar_offset;
50886         u64 dsa;
50887         int retry = 0;
50888         u64 rc;
50889 -       struct device_node *DevNode =
50890 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
50891 +       struct device_node *dn =
50892 +               xlate_iomm_address(addr, &dsa, &bar_offset, "write_word");
50893  
50894 -       if (DevNode == NULL) {
50895 -               static unsigned long last_jiffies;
50896 -               static int num_printed;
50897 -
50898 -               if ((jiffies - last_jiffies) > 60 * HZ) {
50899 -                       last_jiffies = jiffies;
50900 -                       num_printed = 0;
50901 -               }
50902 -               if (num_printed++ < 10)
50903 -                       printk(KERN_ERR "iSeries_Write_Word: invalid access at IO address %p\n",
50904 -                              IoAddress);
50905 +       if (dn == NULL)
50906                 return;
50907 -       }
50908         do {
50909 -               rc = HvCall4(HvCallPciBarStore16, dsa, BarOffset, data, 0);
50910 -       } while (CheckReturnCode("WWW", DevNode, &retry, rc) != 0);
50911 +               rc = HvCall4(HvCallPciBarStore16, dsa, bar_offset, data, 0);
50912 +       } while (check_return_code("WWW", dn, &retry, rc) != 0);
50913  }
50914  
50915 -static void iSeries_Write_Long(u32 data, volatile void __iomem *IoAddress)
50916 +static void iseries_writel_be(u32 data, volatile void __iomem *addr)
50917  {
50918 -       u64 BarOffset;
50919 +       u64 bar_offset;
50920         u64 dsa;
50921         int retry = 0;
50922         u64 rc;
50923 -       struct device_node *DevNode =
50924 -               xlate_iomm_address(IoAddress, &dsa, &BarOffset);
50925 -
50926 -       if (DevNode == NULL) {
50927 -               static unsigned long last_jiffies;
50928 -               static int num_printed;
50929 +       struct device_node *dn =
50930 +               xlate_iomm_address(addr, &dsa, &bar_offset, "write_long");
50931  
50932 -               if ((jiffies - last_jiffies) > 60 * HZ) {
50933 -                       last_jiffies = jiffies;
50934 -                       num_printed = 0;
50935 -               }
50936 -               if (num_printed++ < 10)
50937 -                       printk(KERN_ERR "iSeries_Write_Long: invalid access at IO address %p\n",
50938 -                              IoAddress);
50939 +       if (dn == NULL)
50940                 return;
50941 -       }
50942         do {
50943 -               rc = HvCall4(HvCallPciBarStore32, dsa, BarOffset, data, 0);
50944 -       } while (CheckReturnCode("WWL", DevNode, &retry, rc) != 0);
50945 -}
50946 -
50947 -static u8 iseries_readb(const volatile void __iomem *addr)
50948 -{
50949 -       return iSeries_Read_Byte(addr);
50950 +               rc = HvCall4(HvCallPciBarStore32, dsa, bar_offset, data, 0);
50951 +       } while (check_return_code("WWL", dn, &retry, rc) != 0);
50952  }
50953  
50954  static u16 iseries_readw(const volatile void __iomem *addr)
50955  {
50956 -       return le16_to_cpu(iSeries_Read_Word(addr));
50957 +       return le16_to_cpu(iseries_readw_be(addr));
50958  }
50959  
50960  static u32 iseries_readl(const volatile void __iomem *addr)
50961  {
50962 -       return le32_to_cpu(iSeries_Read_Long(addr));
50963 -}
50964 -
50965 -static u16 iseries_readw_be(const volatile void __iomem *addr)
50966 -{
50967 -       return iSeries_Read_Word(addr);
50968 -}
50969 -
50970 -static u32 iseries_readl_be(const volatile void __iomem *addr)
50971 -{
50972 -       return iSeries_Read_Long(addr);
50973 -}
50974 -
50975 -static void iseries_writeb(u8 data, volatile void __iomem *addr)
50976 -{
50977 -       iSeries_Write_Byte(data, addr);
50978 +       return le32_to_cpu(iseries_readl_be(addr));
50979  }
50980  
50981  static void iseries_writew(u16 data, volatile void __iomem *addr)
50982  {
50983 -       iSeries_Write_Word(cpu_to_le16(data), addr);
50984 +       iseries_writew_be(cpu_to_le16(data), addr);
50985  }
50986  
50987  static void iseries_writel(u32 data, volatile void __iomem *addr)
50988  {
50989 -       iSeries_Write_Long(cpu_to_le32(data), addr);
50990 -}
50991 -
50992 -static void iseries_writew_be(u16 data, volatile void __iomem *addr)
50993 -{
50994 -       iSeries_Write_Word(data, addr);
50995 -}
50996 -
50997 -static void iseries_writel_be(u32 data, volatile void __iomem *addr)
50998 -{
50999 -       iSeries_Write_Long(data, addr);
51000 +       iseries_writel(cpu_to_le32(data), addr);
51001  }
51002  
51003  static void iseries_readsb(const volatile void __iomem *addr, void *buf,
51004 @@ -620,7 +746,7 @@
51005  {
51006         u8 *dst = buf;
51007         while(count-- > 0)
51008 -               *(dst++) = iSeries_Read_Byte(addr);
51009 +               *(dst++) = iseries_readb(addr);
51010  }
51011  
51012  static void iseries_readsw(const volatile void __iomem *addr, void *buf,
51013 @@ -628,7 +754,7 @@
51014  {
51015         u16 *dst = buf;
51016         while(count-- > 0)
51017 -               *(dst++) = iSeries_Read_Word(addr);
51018 +               *(dst++) = iseries_readw_be(addr);
51019  }
51020  
51021  static void iseries_readsl(const volatile void __iomem *addr, void *buf,
51022 @@ -636,7 +762,7 @@
51023  {
51024         u32 *dst = buf;
51025         while(count-- > 0)
51026 -               *(dst++) = iSeries_Read_Long(addr);
51027 +               *(dst++) = iseries_readl_be(addr);
51028  }
51029  
51030  static void iseries_writesb(volatile void __iomem *addr, const void *buf,
51031 @@ -644,7 +770,7 @@
51032  {
51033         const u8 *src = buf;
51034         while(count-- > 0)
51035 -               iSeries_Write_Byte(*(src++), addr);
51036 +               iseries_writeb(*(src++), addr);
51037  }
51038  
51039  static void iseries_writesw(volatile void __iomem *addr, const void *buf,
51040 @@ -652,7 +778,7 @@
51041  {
51042         const u16 *src = buf;
51043         while(count-- > 0)
51044 -               iSeries_Write_Word(*(src++), addr);
51045 +               iseries_writew_be(*(src++), addr);
51046  }
51047  
51048  static void iseries_writesl(volatile void __iomem *addr, const void *buf,
51049 @@ -660,7 +786,7 @@
51050  {
51051         const u32 *src = buf;
51052         while(count-- > 0)
51053 -               iSeries_Write_Long(*(src++), addr);
51054 +               iseries_writel_be(*(src++), addr);
51055  }
51056  
51057  static void iseries_memset_io(volatile void __iomem *addr, int c,
51058 @@ -669,7 +795,7 @@
51059         volatile char __iomem *d = addr;
51060  
51061         while (n-- > 0)
51062 -               iSeries_Write_Byte(c, d++);
51063 +               iseries_writeb(c, d++);
51064  }
51065  
51066  static void iseries_memcpy_fromio(void *dest, const volatile void __iomem *src,
51067 @@ -679,7 +805,7 @@
51068         const volatile char __iomem *s = src;
51069  
51070         while (n-- > 0)
51071 -               *d++ = iSeries_Read_Byte(s++);
51072 +               *d++ = iseries_readb(s++);
51073  }
51074  
51075  static void iseries_memcpy_toio(volatile void __iomem *dest, const void *src,
51076 @@ -689,7 +815,7 @@
51077         volatile char __iomem *d = dest;
51078  
51079         while (n-- > 0)
51080 -               iSeries_Write_Byte(*s++, d++);
51081 +               iseries_writeb(*s++, d++);
51082  }
51083  
51084  /* We only set MMIO ops. The default PIO ops will be default
51085 @@ -742,6 +868,8 @@
51086         /* Install IO hooks */
51087         ppc_pci_io = iseries_pci_io;
51088  
51089 +       pci_probe_only = 1;
51090 +
51091         /* iSeries has no IO space in the common sense, it needs to set
51092          * the IO base to 0
51093          */
51094 @@ -767,11 +895,21 @@
51095                 phb = pcibios_alloc_controller(node);
51096                 if (phb == NULL)
51097                         continue;
51098 +               /* All legacy iSeries PHBs are in domain zero */
51099 +               phb->global_number = 0;
51100  
51101 -               phb->pci_mem_offset = bus;
51102                 phb->first_busno = bus;
51103                 phb->last_busno = bus;
51104                 phb->ops = &iSeries_pci_ops;
51105 +               phb->io_base_virt = (void __iomem *)_IO_BASE;
51106 +               phb->io_resource.flags = IORESOURCE_IO;
51107 +               phb->io_resource.start = BASE_IO_MEMORY;
51108 +               phb->io_resource.end = END_IO_MEMORY;
51109 +               phb->io_resource.name = "iSeries PCI IO";
51110 +               phb->mem_resources[0].flags = IORESOURCE_MEM;
51111 +               phb->mem_resources[0].start = BASE_IO_MEMORY;
51112 +               phb->mem_resources[0].end = END_IO_MEMORY;
51113 +               phb->mem_resources[0].name = "Series PCI MEM";
51114         }
51115  
51116         of_node_put(root);
51117 --- a/arch/powerpc/platforms/iseries/pci.h
51118 +++ b/arch/powerpc/platforms/iseries/pci.h
51119 @@ -30,10 +30,6 @@
51120   * End Change Activity
51121   */
51122  
51123 -#include <asm/pci-bridge.h>
51124 -
51125 -struct pci_dev;                                /* For Forward Reference */
51126 -
51127  /*
51128   * Decodes Linux DevFn to iSeries DevFn, bridge device, or function.
51129   * For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h
51130 @@ -47,17 +43,16 @@
51131  #define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus)         ((subbus >> 5) & 0x7)
51132  #define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus)       ((subbus >> 2) & 0x7)
51133  
51134 -/*
51135 - * Generate a Direct Select Address for the Hypervisor
51136 - */
51137 -static inline u64 iseries_ds_addr(struct device_node *node)
51138 -{
51139 -       struct pci_dn *pdn = PCI_DN(node);
51140 -
51141 -       return ((u64)pdn->busno << 48) + ((u64)pdn->bussubno << 40)
51142 -                       + ((u64)0x10 << 32);
51143 -}
51144 +struct pci_dev;
51145  
51146 -extern void    iSeries_Device_Information(struct pci_dev*, int);
51147 +#ifdef CONFIG_PCI
51148 +extern void    iSeries_pcibios_init(void);
51149 +extern void    iSeries_pci_final_fixup(void);
51150 +extern void    iSeries_pcibios_fixup_resources(struct pci_dev *dev);
51151 +#else
51152 +static inline void     iSeries_pcibios_init(void) { }
51153 +static inline void     iSeries_pci_final_fixup(void) { }
51154 +static inline void     iSeries_pcibios_fixup_resources(struct pci_dev *dev) {}
51155 +#endif
51156  
51157  #endif /* _PLATFORMS_ISERIES_PCI_H */
51158 --- a/arch/powerpc/platforms/iseries/setup.c
51159 +++ b/arch/powerpc/platforms/iseries/setup.c
51160 @@ -63,6 +63,7 @@
51161  #include "main_store.h"
51162  #include "call_sm.h"
51163  #include "call_hpt.h"
51164 +#include "pci.h"
51165  
51166  #ifdef DEBUG
51167  #define DBG(fmt...) udbg_printf(fmt)
51168 @@ -74,11 +75,6 @@
51169  static unsigned long build_iSeries_Memory_Map(void);
51170  static void iseries_shared_idle(void);
51171  static void iseries_dedicated_idle(void);
51172 -#ifdef CONFIG_PCI
51173 -extern void iSeries_pci_final_fixup(void);
51174 -#else
51175 -static void iSeries_pci_final_fixup(void) { }
51176 -#endif
51177  
51178  
51179  struct MemoryBlock {
51180 @@ -112,13 +108,13 @@
51181          * correctly.
51182          */
51183         mb_array[0].logicalStart = 0;
51184 -       mb_array[0].logicalEnd = 0x100000000;
51185 +       mb_array[0].logicalEnd = 0x100000000UL;
51186         mb_array[0].absStart = 0;
51187 -       mb_array[0].absEnd = 0x100000000;
51188 +       mb_array[0].absEnd = 0x100000000UL;
51189  
51190         if (holeSize) {
51191                 numMemoryBlocks = 2;
51192 -               holeStart = holeStart & 0x000fffffffffffff;
51193 +               holeStart = holeStart & 0x000fffffffffffffUL;
51194                 holeStart = addr_to_chunk(holeStart);
51195                 holeFirstChunk = holeStart;
51196                 holeSize = addr_to_chunk(holeSize);
51197 @@ -128,9 +124,9 @@
51198                 mb_array[0].logicalEnd = holeFirstChunk;
51199                 mb_array[0].absEnd = holeFirstChunk;
51200                 mb_array[1].logicalStart = holeFirstChunk;
51201 -               mb_array[1].logicalEnd = 0x100000000 - holeSizeChunks;
51202 +               mb_array[1].logicalEnd = 0x100000000UL - holeSizeChunks;
51203                 mb_array[1].absStart = holeFirstChunk + holeSizeChunks;
51204 -               mb_array[1].absEnd = 0x100000000;
51205 +               mb_array[1].absEnd = 0x100000000UL;
51206         }
51207         return numMemoryBlocks;
51208  }
51209 @@ -234,9 +230,9 @@
51210                                 mb_array[i].logicalEnd,
51211                                 mb_array[i].absStart, mb_array[i].absEnd);
51212                 mb_array[i].absStart = addr_to_chunk(mb_array[i].absStart &
51213 -                               0x000fffffffffffff);
51214 +                               0x000fffffffffffffUL);
51215                 mb_array[i].absEnd = addr_to_chunk(mb_array[i].absEnd &
51216 -                               0x000fffffffffffff);
51217 +                               0x000fffffffffffffUL);
51218                 mb_array[i].logicalStart =
51219                         addr_to_chunk(mb_array[i].logicalStart);
51220                 mb_array[i].logicalEnd = addr_to_chunk(mb_array[i].logicalEnd);
51221 @@ -320,7 +316,7 @@
51222  };
51223  EXPORT_SYMBOL(mschunks_map);
51224  
51225 -void mschunks_alloc(unsigned long num_chunks)
51226 +static void mschunks_alloc(unsigned long num_chunks)
51227  {
51228         klimit = _ALIGN(klimit, sizeof(u32));
51229         mschunks_map.mapping = (u32 *)klimit;
51230 @@ -499,6 +495,8 @@
51231                         itVpdAreas.xSlicMaxLogicalProcs);
51232         printk("Max physical processors = %d\n",
51233                         itVpdAreas.xSlicMaxPhysicalProcs);
51234 +
51235 +       iSeries_pcibios_init();
51236  }
51237  
51238  static void iSeries_show_cpuinfo(struct seq_file *m)
51239 @@ -641,24 +639,25 @@
51240  }
51241  
51242  define_machine(iseries) {
51243 -       .name           = "iSeries",
51244 -       .setup_arch     = iSeries_setup_arch,
51245 -       .show_cpuinfo   = iSeries_show_cpuinfo,
51246 -       .init_IRQ       = iSeries_init_IRQ,
51247 -       .get_irq        = iSeries_get_irq,
51248 -       .init_early     = iSeries_init_early,
51249 -       .pcibios_fixup  = iSeries_pci_final_fixup,
51250 -       .restart        = mf_reboot,
51251 -       .power_off      = mf_power_off,
51252 -       .halt           = mf_power_off,
51253 -       .get_boot_time  = iSeries_get_boot_time,
51254 -       .set_rtc_time   = iSeries_set_rtc_time,
51255 -       .get_rtc_time   = iSeries_get_rtc_time,
51256 -       .calibrate_decr = generic_calibrate_decr,
51257 -       .progress       = iSeries_progress,
51258 -       .probe          = iseries_probe,
51259 -       .ioremap        = iseries_ioremap,
51260 -       .iounmap        = iseries_iounmap,
51261 +       .name                   = "iSeries",
51262 +       .setup_arch             = iSeries_setup_arch,
51263 +       .show_cpuinfo           = iSeries_show_cpuinfo,
51264 +       .init_IRQ               = iSeries_init_IRQ,
51265 +       .get_irq                = iSeries_get_irq,
51266 +       .init_early             = iSeries_init_early,
51267 +       .pcibios_fixup          = iSeries_pci_final_fixup,
51268 +       .pcibios_fixup_resources= iSeries_pcibios_fixup_resources,
51269 +       .restart                = mf_reboot,
51270 +       .power_off              = mf_power_off,
51271 +       .halt                   = mf_power_off,
51272 +       .get_boot_time          = iSeries_get_boot_time,
51273 +       .set_rtc_time           = iSeries_set_rtc_time,
51274 +       .get_rtc_time           = iSeries_get_rtc_time,
51275 +       .calibrate_decr         = generic_calibrate_decr,
51276 +       .progress               = iSeries_progress,
51277 +       .probe                  = iseries_probe,
51278 +       .ioremap                = iseries_ioremap,
51279 +       .iounmap                = iseries_iounmap,
51280         /* XXX Implement enable_pmcs for iSeries */
51281  };
51282  
51283 --- a/arch/powerpc/platforms/iseries/setup.h
51284 +++ b/arch/powerpc/platforms/iseries/setup.h
51285 @@ -17,6 +17,7 @@
51286  #ifndef        __ISERIES_SETUP_H__
51287  #define        __ISERIES_SETUP_H__
51288  
51289 +extern void *iSeries_early_setup(void);
51290  extern unsigned long iSeries_get_boot_time(void);
51291  extern int iSeries_set_rtc_time(struct rtc_time *tm);
51292  extern void iSeries_get_rtc_time(struct rtc_time *tm);
51293 --- a/arch/powerpc/platforms/iseries/vpdinfo.c
51294 +++ /dev/null
51295 @@ -1,275 +0,0 @@
51296 -/*
51297 - * This code gets the card location of the hardware
51298 - * Copyright (C) 2001  <Allan H Trautman> <IBM Corp>
51299 - * Copyright (C) 2005  Stephen Rothwel, IBM Corp
51300 - *
51301 - * This program is free software; you can redistribute it and/or modify
51302 - * it under the terms of the GNU General Public License as published by
51303 - * the Free Software Foundation; either version 2 of the License, or
51304 - * (at your option) any later version.
51305 - *
51306 - * This program is distributed in the hope that it will be useful,
51307 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
51308 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
51309 - * GNU General Public License for more details.
51310 - *
51311 - * You should have received a copy of the GNU General Public License
51312 - * along with this program; if not, write to the:
51313 - * Free Software Foundation, Inc.,
51314 - * 59 Temple Place, Suite 330,
51315 - * Boston, MA  02111-1307  USA
51316 - *
51317 - * Change Activity:
51318 - *   Created, Feb 2, 2001
51319 - *   Ported to ppc64, August 20, 2001
51320 - * End Change Activity
51321 - */
51322 -#include <linux/init.h>
51323 -#include <linux/module.h>
51324 -#include <linux/pci.h>
51325 -
51326 -#include <asm/types.h>
51327 -#include <asm/resource.h>
51328 -#include <asm/abs_addr.h>
51329 -#include <asm/pci-bridge.h>
51330 -#include <asm/iseries/hv_types.h>
51331 -
51332 -#include "pci.h"
51333 -#include "call_pci.h"
51334 -
51335 -/*
51336 - * Size of Bus VPD data
51337 - */
51338 -#define BUS_VPDSIZE      1024
51339 -
51340 -/*
51341 - * Bus Vpd Tags
51342 - */
51343 -#define  VpdEndOfAreaTag   0x79
51344 -#define  VpdIdStringTag    0x82
51345 -#define  VpdVendorAreaTag  0x84
51346 -
51347 -/*
51348 - * Mfg Area Tags
51349 - */
51350 -#define  VpdFruFrameId    0x4649     // "FI"
51351 -#define  VpdSlotMapFormat 0x4D46     // "MF"
51352 -#define  VpdSlotMap       0x534D     // "SM"
51353 -
51354 -/*
51355 - * Structures of the areas
51356 - */
51357 -struct MfgVpdAreaStruct {
51358 -       u16 Tag;
51359 -       u8  TagLength;
51360 -       u8  AreaData1;
51361 -       u8  AreaData2;
51362 -};
51363 -typedef struct MfgVpdAreaStruct MfgArea;
51364 -#define MFG_ENTRY_SIZE   3
51365 -
51366 -struct SlotMapStruct {
51367 -       u8   AgentId;
51368 -       u8   SecondaryAgentId;
51369 -       u8   PhbId;
51370 -       char CardLocation[3];
51371 -       char Parms[8];
51372 -       char Reserved[2];
51373 -};
51374 -typedef struct SlotMapStruct SlotMap;
51375 -#define SLOT_ENTRY_SIZE   16
51376 -
51377 -/*
51378 - * Parse the Slot Area
51379 - */
51380 -static void __init iSeries_Parse_SlotArea(SlotMap *MapPtr, int MapLen,
51381 -               HvAgentId agent, u8 *PhbId, char card[4])
51382 -{
51383 -       int SlotMapLen = MapLen;
51384 -       SlotMap *SlotMapPtr = MapPtr;
51385 -
51386 -       /*
51387 -        * Parse Slot label until we find the one requested
51388 -        */
51389 -       while (SlotMapLen > 0) {
51390 -               if (SlotMapPtr->AgentId == agent) {
51391 -                       /*
51392 -                        * If Phb wasn't found, grab the entry first one found.
51393 -                        */
51394 -                       if (*PhbId == 0xff)
51395 -                               *PhbId = SlotMapPtr->PhbId;
51396 -                       /* Found it, extract the data. */
51397 -                       if (SlotMapPtr->PhbId == *PhbId) {
51398 -                               memcpy(card, &SlotMapPtr->CardLocation, 3);
51399 -                               card[3]  = 0;
51400 -                               break;
51401 -                       }
51402 -               }
51403 -               /* Point to the next Slot */
51404 -               SlotMapPtr = (SlotMap *)((char *)SlotMapPtr + SLOT_ENTRY_SIZE);
51405 -               SlotMapLen -= SLOT_ENTRY_SIZE;
51406 -       }
51407 -}
51408 -
51409 -/*
51410 - * Parse the Mfg Area
51411 - */
51412 -static void __init iSeries_Parse_MfgArea(u8 *AreaData, int AreaLen,
51413 -               HvAgentId agent, u8 *PhbId,
51414 -               u8 *frame, char card[4])
51415 -{
51416 -       MfgArea *MfgAreaPtr = (MfgArea *)AreaData;
51417 -       int MfgAreaLen = AreaLen;
51418 -       u16 SlotMapFmt = 0;
51419 -
51420 -       /* Parse Mfg Data */
51421 -       while (MfgAreaLen > 0) {
51422 -               int MfgTagLen = MfgAreaPtr->TagLength;
51423 -               /* Frame ID         (FI 4649020310 ) */
51424 -               if (MfgAreaPtr->Tag == VpdFruFrameId)           /* FI  */
51425 -                       *frame = MfgAreaPtr->AreaData1;
51426 -               /* Slot Map Format  (MF 4D46020004 ) */
51427 -               else if (MfgAreaPtr->Tag == VpdSlotMapFormat)   /* MF  */
51428 -                       SlotMapFmt = (MfgAreaPtr->AreaData1 * 256)
51429 -                               + MfgAreaPtr->AreaData2;
51430 -               /* Slot Map         (SM 534D90 */
51431 -               else if (MfgAreaPtr->Tag == VpdSlotMap) {       /* SM  */
51432 -                       SlotMap *SlotMapPtr;
51433 -
51434 -                       if (SlotMapFmt == 0x1004)
51435 -                               SlotMapPtr = (SlotMap *)((char *)MfgAreaPtr
51436 -                                               + MFG_ENTRY_SIZE + 1);
51437 -                       else
51438 -                               SlotMapPtr = (SlotMap *)((char *)MfgAreaPtr
51439 -                                               + MFG_ENTRY_SIZE);
51440 -                       iSeries_Parse_SlotArea(SlotMapPtr, MfgTagLen,
51441 -                                       agent, PhbId, card);
51442 -               }
51443 -               /*
51444 -                * Point to the next Mfg Area
51445 -                * Use defined size, sizeof give wrong answer
51446 -                */
51447 -               MfgAreaPtr = (MfgArea *)((char *)MfgAreaPtr + MfgTagLen
51448 -                               + MFG_ENTRY_SIZE);
51449 -               MfgAreaLen -= (MfgTagLen + MFG_ENTRY_SIZE);
51450 -       }
51451 -}
51452 -
51453 -/*
51454 - * Look for "BUS".. Data is not Null terminated.
51455 - * PHBID of 0xFF indicates PHB was not found in VPD Data.
51456 - */
51457 -static int __init iSeries_Parse_PhbId(u8 *AreaPtr, int AreaLength)
51458 -{
51459 -       u8 *PhbPtr = AreaPtr;
51460 -       int DataLen = AreaLength;
51461 -       char PhbId = 0xFF;
51462 -
51463 -       while (DataLen > 0) {
51464 -               if ((*PhbPtr == 'B') && (*(PhbPtr + 1) == 'U')
51465 -                               && (*(PhbPtr + 2) == 'S')) {
51466 -                       PhbPtr += 3;
51467 -                       while (*PhbPtr == ' ')
51468 -                               ++PhbPtr;
51469 -                       PhbId = (*PhbPtr & 0x0F);
51470 -                       break;
51471 -               }
51472 -               ++PhbPtr;
51473 -               --DataLen;
51474 -       }
51475 -       return PhbId;
51476 -}
51477 -
51478 -/*
51479 - * Parse out the VPD Areas
51480 - */
51481 -static void __init iSeries_Parse_Vpd(u8 *VpdData, int VpdDataLen,
51482 -               HvAgentId agent, u8 *frame, char card[4])
51483 -{
51484 -       u8 *TagPtr = VpdData;
51485 -       int DataLen = VpdDataLen - 3;
51486 -       u8 PhbId = 0xff;
51487 -
51488 -       while ((*TagPtr != VpdEndOfAreaTag) && (DataLen > 0)) {
51489 -               int AreaLen = *(TagPtr + 1) + (*(TagPtr + 2) * 256);
51490 -               u8 *AreaData  = TagPtr + 3;
51491 -
51492 -               if (*TagPtr == VpdIdStringTag)
51493 -                       PhbId = iSeries_Parse_PhbId(AreaData, AreaLen);
51494 -               else if (*TagPtr == VpdVendorAreaTag)
51495 -                       iSeries_Parse_MfgArea(AreaData, AreaLen,
51496 -                                       agent, &PhbId, frame, card);
51497 -               /* Point to next Area. */
51498 -               TagPtr  = AreaData + AreaLen;
51499 -               DataLen -= AreaLen;
51500 -       }
51501 -}
51502 -
51503 -static int __init iSeries_Get_Location_Code(u16 bus, HvAgentId agent,
51504 -               u8 *frame, char card[4])
51505 -{
51506 -       int status = 0;
51507 -       int BusVpdLen = 0;
51508 -       u8 *BusVpdPtr = kmalloc(BUS_VPDSIZE, GFP_KERNEL);
51509 -
51510 -       if (BusVpdPtr == NULL) {
51511 -               printk("PCI: Bus VPD Buffer allocation failure.\n");
51512 -               return 0;
51513 -       }
51514 -       BusVpdLen = HvCallPci_getBusVpd(bus, iseries_hv_addr(BusVpdPtr),
51515 -                                       BUS_VPDSIZE);
51516 -       if (BusVpdLen == 0) {
51517 -               printk("PCI: Bus VPD Buffer zero length.\n");
51518 -               goto out_free;
51519 -       }
51520 -       /* printk("PCI: BusVpdPtr: %p, %d\n",BusVpdPtr, BusVpdLen); */
51521 -       /* Make sure this is what I think it is */
51522 -       if (*BusVpdPtr != VpdIdStringTag) {     /* 0x82 */
51523 -               printk("PCI: Bus VPD Buffer missing starting tag.\n");
51524 -               goto out_free;
51525 -       }
51526 -       iSeries_Parse_Vpd(BusVpdPtr, BusVpdLen, agent, frame, card);
51527 -       status = 1;
51528 -out_free:
51529 -       kfree(BusVpdPtr);
51530 -       return status;
51531 -}
51532 -
51533 -/*
51534 - * Prints the device information.
51535 - * - Pass in pci_dev* pointer to the device.
51536 - * - Pass in the device count
51537 - *
51538 - * Format:
51539 - * PCI: Bus  0, Device 26, Vendor 0x12AE  Frame  1, Card  C10  Ethernet
51540 - * controller
51541 - */
51542 -void __init iSeries_Device_Information(struct pci_dev *PciDev, int count)
51543 -{
51544 -       struct device_node *DevNode = PciDev->sysdata;
51545 -       struct pci_dn *pdn;
51546 -       u16 bus;
51547 -       u8 frame = 0;
51548 -       char card[4];
51549 -       HvSubBusNumber subbus;
51550 -       HvAgentId agent;
51551 -
51552 -       if (DevNode == NULL) {
51553 -               printk("%d. PCI: iSeries_Device_Information DevNode is NULL\n",
51554 -                               count);
51555 -               return;
51556 -       }
51557 -
51558 -       pdn = PCI_DN(DevNode);
51559 -       bus = pdn->busno;
51560 -       subbus = pdn->bussubno;
51561 -       agent = ISERIES_PCI_AGENTID(ISERIES_GET_DEVICE_FROM_SUBBUS(subbus),
51562 -                       ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus));
51563 -
51564 -       if (iSeries_Get_Location_Code(bus, agent, &frame, card)) {
51565 -               printk("%d. PCI: Bus%3d, Device%3d, Vendor %04X Frame%3d, "
51566 -                       "Card %4s  0x%04X\n", count, bus,
51567 -                       PCI_SLOT(PciDev->devfn), PciDev->vendor, frame,
51568 -                       card, (int)(PciDev->class >> 8));
51569 -       }
51570 -}
51571 --- a/arch/powerpc/platforms/maple/Kconfig
51572 +++ b/arch/powerpc/platforms/maple/Kconfig
51573 @@ -1,6 +1,7 @@
51574  config PPC_MAPLE
51575         depends on PPC_MULTIPLATFORM && PPC64
51576         bool "Maple 970FX Evaluation Board"
51577 +       select PCI
51578         select MPIC
51579         select U3_DART
51580         select MPIC_U3_HT_IRQS
51581 --- a/arch/powerpc/platforms/maple/pci.c
51582 +++ b/arch/powerpc/platforms/maple/pci.c
51583 @@ -558,7 +558,7 @@
51584          * safe assumptions hopefully.
51585          */
51586         if (u3_agp) {
51587 -               struct device_node *np = u3_agp->arch_data;
51588 +               struct device_node *np = u3_agp->dn;
51589                 PCI_DN(np)->busno = 0xf0;
51590                 for (np = np->child; np; np = np->sibling)
51591                         PCI_DN(np)->busno = 0xf0;
51592 --- a/arch/powerpc/platforms/maple/setup.c
51593 +++ b/arch/powerpc/platforms/maple/setup.c
51594 @@ -42,6 +42,7 @@
51595  #include <linux/serial.h>
51596  #include <linux/smp.h>
51597  #include <linux/bitops.h>
51598 +#include <linux/of_device.h>
51599  
51600  #include <asm/processor.h>
51601  #include <asm/sections.h>
51602 @@ -56,7 +57,6 @@
51603  #include <asm/dma.h>
51604  #include <asm/cputable.h>
51605  #include <asm/time.h>
51606 -#include <asm/of_device.h>
51607  #include <asm/lmb.h>
51608  #include <asm/mpic.h>
51609  #include <asm/rtas.h>
51610 --- a/arch/powerpc/platforms/pasemi/Kconfig
51611 +++ b/arch/powerpc/platforms/pasemi/Kconfig
51612 @@ -3,6 +3,7 @@
51613         bool "PA Semi SoC-based platforms"
51614         default n
51615         select MPIC
51616 +       select PCI
51617         select PPC_UDBG_16550
51618         select PPC_NATIVE
51619         select MPIC_BROKEN_REGREAD
51620 @@ -17,7 +18,7 @@
51621         bool "PA Semi IOMMU support"
51622         depends on PPC_PASEMI
51623         help
51624 -         IOMMU support for PA6T-1682M
51625 +         IOMMU support for PA Semi PWRficient
51626  
51627  config PPC_PASEMI_IOMMU_DMA_FORCE
51628         bool "Force DMA engine to use IOMMU"
51629 @@ -36,13 +37,4 @@
51630         help
51631           Driver for MDIO via GPIO on PWRficient platforms
51632  
51633 -config ELECTRA_IDE
51634 -      tristate "Electra IDE driver"
51635 -      default y
51636 -      depends on PPC_PASEMI && ATA
51637 -      select PATA_PLATFORM
51638 -      help
51639 -       This includes driver support for the Electra on-board IDE
51640 -       interface.
51641 -
51642  endmenu
51643 --- a/arch/powerpc/platforms/pasemi/Makefile
51644 +++ b/arch/powerpc/platforms/pasemi/Makefile
51645 @@ -1,4 +1,3 @@
51646  obj-y  += setup.o pci.o time.o idle.o powersave.o iommu.o
51647  obj-$(CONFIG_PPC_PASEMI_MDIO)  += gpio_mdio.o
51648 -obj-$(CONFIG_ELECTRA_IDE) += electra_ide.o
51649  obj-$(CONFIG_PPC_PASEMI_CPUFREQ) += cpufreq.o
51650 --- a/arch/powerpc/platforms/pasemi/cpufreq.c
51651 +++ b/arch/powerpc/platforms/pasemi/cpufreq.c
51652 @@ -32,6 +32,7 @@
51653  #include <asm/io.h>
51654  #include <asm/prom.h>
51655  #include <asm/time.h>
51656 +#include <asm/smp.h>
51657  
51658  #define SDCASR_REG             0x0100
51659  #define SDCASR_REG_STRIDE      0x1000
51660 @@ -124,6 +125,11 @@
51661         local_irq_restore(flags);
51662  }
51663  
51664 +int check_astate(void)
51665 +{
51666 +       return get_cur_astate(hard_smp_processor_id());
51667 +}
51668 +
51669  void restore_astate(int cpu)
51670  {
51671         set_astate(cpu, current_astate);
51672 @@ -147,7 +153,10 @@
51673         if (!cpu)
51674                 goto out;
51675  
51676 -       dn = of_find_compatible_node(NULL, "sdc", "1682m-sdc");
51677 +       dn = of_find_compatible_node(NULL, NULL, "1682m-sdc");
51678 +       if (!dn)
51679 +               dn = of_find_compatible_node(NULL, NULL,
51680 +                                            "pasemi,pwrficient-sdc");
51681         if (!dn)
51682                 goto out;
51683         err = of_address_to_resource(dn, 0, &res);
51684 @@ -160,7 +169,10 @@
51685                 goto out;
51686         }
51687  
51688 -       dn = of_find_compatible_node(NULL, "gizmo", "1682m-gizmo");
51689 +       dn = of_find_compatible_node(NULL, NULL, "1682m-gizmo");
51690 +       if (!dn)
51691 +               dn = of_find_compatible_node(NULL, NULL,
51692 +                                            "pasemi,pwrficient-gizmo");
51693         if (!dn) {
51694                 err = -ENODEV;
51695                 goto out_unmap_sdcasr;
51696 @@ -292,7 +304,8 @@
51697  
51698  static int __init pas_cpufreq_init(void)
51699  {
51700 -       if (!machine_is_compatible("PA6T-1682M"))
51701 +       if (!machine_is_compatible("PA6T-1682M") &&
51702 +           !machine_is_compatible("pasemi,pwrficient"))
51703                 return -ENODEV;
51704  
51705         return cpufreq_register_driver(&pas_cpufreq_driver);
51706 --- a/arch/powerpc/platforms/pasemi/electra_ide.c
51707 +++ /dev/null
51708 @@ -1,96 +0,0 @@
51709 -/*
51710 - * Copyright (C) 2007 PA Semi, Inc
51711 - *
51712 - * Maintained by: Olof Johansson <olof@lixom.net>
51713 - *
51714 - * This program is free software; you can redistribute it and/or modify
51715 - * it under the terms of the GNU General Public License version 2 as
51716 - * published by the Free Software Foundation.
51717 - *
51718 - * This program is distributed in the hope that it will be useful,
51719 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
51720 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
51721 - * GNU General Public License for more details.
51722 - *
51723 - * You should have received a copy of the GNU General Public License
51724 - * along with this program; if not, write to the Free Software
51725 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
51726 - */
51727 -
51728 -#include <linux/platform_device.h>
51729 -
51730 -#include <asm/prom.h>
51731 -#include <asm/system.h>
51732 -
51733 -/* The electra IDE interface is incredibly simple: Just a device on the localbus
51734 - * with interrupts hooked up to one of the GPIOs. The device tree contains the
51735 - * address window and interrupt mappings already, and the pata_platform driver handles
51736 - * the rest. We just need to hook the two up.
51737 - */
51738 -
51739 -#define MAX_IFS        4       /* really, we have only one */
51740 -
51741 -static struct platform_device *pdevs[MAX_IFS];
51742 -
51743 -static int __devinit electra_ide_init(void)
51744 -{
51745 -       struct device_node *np;
51746 -       struct resource r[3];
51747 -       int ret = 0;
51748 -       int i;
51749 -
51750 -       np = of_find_compatible_node(NULL, "ide", "electra-ide");
51751 -       i = 0;
51752 -
51753 -       while (np && i < MAX_IFS) {
51754 -               memset(r, 0, sizeof(r));
51755 -
51756 -               /* pata_platform wants two address ranges: one for the base registers,
51757 -                * another for the control (altstatus). It's located at offset 0x3f6 in
51758 -                * the window, but the device tree only has one large register window
51759 -                * that covers both ranges. So we need to split it up by hand here:
51760 -                */
51761 -
51762 -               ret = of_address_to_resource(np, 0, &r[0]);
51763 -               if (ret)
51764 -                       goto out;
51765 -               ret = of_address_to_resource(np, 0, &r[1]);
51766 -               if (ret)
51767 -                       goto out;
51768 -
51769 -               r[1].start += 0x3f6;
51770 -               r[0].end = r[1].start-1;
51771 -
51772 -               r[2].start = irq_of_parse_and_map(np, 0);
51773 -               r[2].end = irq_of_parse_and_map(np, 0);
51774 -               r[2].flags = IORESOURCE_IRQ;
51775 -
51776 -               pr_debug("registering platform device at 0x%lx/0x%lx, irq is %ld\n",
51777 -                        r[0].start, r[1].start, r[2].start);
51778 -               pdevs[i] = platform_device_register_simple("pata_platform", i, r, 3);
51779 -               if (IS_ERR(pdevs[i])) {
51780 -                       ret = PTR_ERR(pdevs[i]);
51781 -                       pdevs[i] = NULL;
51782 -                       goto out;
51783 -               }
51784 -               np = of_find_compatible_node(np, "ide", "electra-ide");
51785 -       }
51786 -out:
51787 -       return ret;
51788 -}
51789 -module_init(electra_ide_init);
51790 -
51791 -static void __devexit electra_ide_exit(void)
51792 -{
51793 -       int i;
51794 -
51795 -       for (i = 0; i < MAX_IFS; i++)
51796 -               if (pdevs[i])
51797 -                       platform_device_unregister(pdevs[i]);
51798 -}
51799 -module_exit(electra_ide_exit);
51800 -
51801 -
51802 -MODULE_LICENSE("GPL");
51803 -MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>");
51804 -MODULE_DESCRIPTION("PA Semi Electra IDE driver");
51805 --- a/arch/powerpc/platforms/pasemi/gpio_mdio.c
51806 +++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c
51807 @@ -30,7 +30,7 @@
51808  #include <linux/interrupt.h>
51809  #include <linux/phy.h>
51810  #include <linux/platform_device.h>
51811 -#include <asm/of_platform.h>
51812 +#include <linux/of_platform.h>
51813  
51814  #define DELAY 1
51815  
51816 @@ -218,45 +218,27 @@
51817                                      const struct of_device_id *match)
51818  {
51819         struct device *dev = &ofdev->dev;
51820 -       struct device_node *np = ofdev->node;
51821 -       struct device_node *gpio_np;
51822 +       struct device_node *phy_dn, *np = ofdev->node;
51823         struct mii_bus *new_bus;
51824 -       struct resource res;
51825         struct gpio_priv *priv;
51826         const unsigned int *prop;
51827 -       int err = 0;
51828 +       int err;
51829         int i;
51830  
51831 -       gpio_np = of_find_compatible_node(NULL, "gpio", "1682m-gpio");
51832 -
51833 -       if (!gpio_np)
51834 -               return -ENODEV;
51835 -
51836 -       err = of_address_to_resource(gpio_np, 0, &res);
51837 -       of_node_put(gpio_np);
51838 -
51839 -       if (err)
51840 -               return -EINVAL;
51841 -
51842 -       if (!gpio_regs)
51843 -               gpio_regs = ioremap(res.start, 0x100);
51844 -
51845 -       if (!gpio_regs)
51846 -               return -EPERM;
51847 -
51848 +       err = -ENOMEM;
51849         priv = kzalloc(sizeof(struct gpio_priv), GFP_KERNEL);
51850 -       if (priv == NULL)
51851 -               return -ENOMEM;
51852 +       if (!priv)
51853 +               goto out;
51854  
51855         new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
51856  
51857 -       if (new_bus == NULL)
51858 -               return -ENOMEM;
51859 +       if (!new_bus)
51860 +               goto out_free_priv;
51861  
51862 -       new_bus->name = "pasemi gpio mdio bus",
51863 -       new_bus->read = &gpio_mdio_read,
51864 -       new_bus->write = &gpio_mdio_write,
51865 -       new_bus->reset = &gpio_mdio_reset,
51866 +       new_bus->name = "pasemi gpio mdio bus";
51867 +       new_bus->read = &gpio_mdio_read;
51868 +       new_bus->write = &gpio_mdio_write;
51869 +       new_bus->reset = &gpio_mdio_reset;
51870  
51871         prop = of_get_property(np, "reg", NULL);
51872         new_bus->id = *prop;
51873 @@ -265,9 +247,24 @@
51874         new_bus->phy_mask = 0;
51875  
51876         new_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
51877 -       for(i = 0; i < PHY_MAX_ADDR; ++i)
51878 -               new_bus->irq[i] = irq_create_mapping(NULL, 10);
51879  
51880 +       if (!new_bus->irq)
51881 +               goto out_free_bus;
51882 +
51883 +       for (i = 0; i < PHY_MAX_ADDR; i++)
51884 +               new_bus->irq[i] = NO_IRQ;
51885 +
51886 +       for (phy_dn = of_get_next_child(np, NULL);
51887 +            phy_dn != NULL;
51888 +            phy_dn = of_get_next_child(np, phy_dn)) {
51889 +               const unsigned int *ip, *regp;
51890 +
51891 +               ip = of_get_property(phy_dn, "interrupts", NULL);
51892 +               regp = of_get_property(phy_dn, "reg", NULL);
51893 +               if (!ip || !regp || *regp >= PHY_MAX_ADDR)
51894 +                       continue;
51895 +               new_bus->irq[*regp] = irq_create_mapping(NULL, *ip);
51896 +       }
51897  
51898         prop = of_get_property(np, "mdc-pin", NULL);
51899         priv->mdc_pin = *prop;
51900 @@ -280,17 +277,21 @@
51901  
51902         err = mdiobus_register(new_bus);
51903  
51904 -       if (0 != err) {
51905 +       if (err != 0) {
51906                 printk(KERN_ERR "%s: Cannot register as MDIO bus, err %d\n",
51907                                 new_bus->name, err);
51908 -               goto bus_register_fail;
51909 +               goto out_free_irq;
51910         }
51911  
51912         return 0;
51913  
51914 -bus_register_fail:
51915 +out_free_irq:
51916 +       kfree(new_bus->irq);
51917 +out_free_bus:
51918         kfree(new_bus);
51919 -
51920 +out_free_priv:
51921 +       kfree(priv);
51922 +out:
51923         return err;
51924  }
51925  
51926 @@ -317,6 +318,7 @@
51927         },
51928         {},
51929  };
51930 +MODULE_DEVICE_TABLE(of, gpio_mdio_match);
51931  
51932  static struct of_platform_driver gpio_mdio_driver =
51933  {
51934 @@ -330,12 +332,32 @@
51935  
51936  int gpio_mdio_init(void)
51937  {
51938 +       struct device_node *np;
51939 +
51940 +       np = of_find_compatible_node(NULL, NULL, "1682m-gpio");
51941 +       if (!np)
51942 +               np = of_find_compatible_node(NULL, NULL,
51943 +                                            "pasemi,pwrficient-gpio");
51944 +       if (!np)
51945 +               return -ENODEV;
51946 +       gpio_regs = of_iomap(np, 0);
51947 +       of_node_put(np);
51948 +
51949 +       if (!gpio_regs)
51950 +               return -ENODEV;
51951 +
51952         return of_register_platform_driver(&gpio_mdio_driver);
51953  }
51954 +module_init(gpio_mdio_init);
51955  
51956  void gpio_mdio_exit(void)
51957  {
51958         of_unregister_platform_driver(&gpio_mdio_driver);
51959 +       if (gpio_regs)
51960 +               iounmap(gpio_regs);
51961  }
51962 -device_initcall(gpio_mdio_init);
51963 +module_exit(gpio_mdio_exit);
51964  
51965 +MODULE_LICENSE("GPL");
51966 +MODULE_AUTHOR("Olof Johansson <olof@lixom.net>");
51967 +MODULE_DESCRIPTION("Driver for MDIO over GPIO on PA Semi PWRficient-based boards");
51968 --- a/arch/powerpc/platforms/pasemi/idle.c
51969 +++ b/arch/powerpc/platforms/pasemi/idle.c
51970 @@ -74,9 +74,6 @@
51971  
51972  static int __init pasemi_idle_init(void)
51973  {
51974 -       if (!machine_is(pasemi))
51975 -               return -ENODEV;
51976 -
51977  #ifndef CONFIG_PPC_PASEMI_CPUFREQ
51978         printk(KERN_WARNING "No cpufreq driver, powersavings modes disabled\n");
51979         current_mode = 0;
51980 @@ -88,7 +85,7 @@
51981  
51982         return 0;
51983  }
51984 -late_initcall(pasemi_idle_init);
51985 +machine_late_initcall(pasemi, pasemi_idle_init);
51986  
51987  static int __init idle_param(char *p)
51988  {
51989 --- a/arch/powerpc/platforms/pasemi/pasemi.h
51990 +++ b/arch/powerpc/platforms/pasemi/pasemi.h
51991 @@ -16,8 +16,14 @@
51992  
51993  /* Restore astate to last set */
51994  #ifdef CONFIG_PPC_PASEMI_CPUFREQ
51995 +extern int check_astate(void);
51996  extern void restore_astate(int cpu);
51997  #else
51998 +static inline int check_astate(void)
51999 +{
52000 +       /* Always return >0 so we never power save */
52001 +       return 1;
52002 +}
52003  static inline void restore_astate(int cpu)
52004  {
52005  }
52006 --- a/arch/powerpc/platforms/pasemi/powersave.S
52007 +++ b/arch/powerpc/platforms/pasemi/powersave.S
52008 @@ -62,7 +62,16 @@
52009         mflr    r0
52010         std     r0, 16(r1)
52011         stdu    r1,-64(r1)
52012 +#ifdef CONFIG_PPC_PASEMI_CPUFREQ
52013 +       std     r3, 48(r1)
52014  
52015 +       /* Only do power savings when in astate 0 */
52016 +       bl      .check_astate
52017 +       cmpwi   r3,0
52018 +       bne     1f
52019 +
52020 +       ld      r3, 48(r1)
52021 +#endif
52022         LOAD_REG_IMMEDIATE(r6,MSR_DR|MSR_IR|MSR_ME|MSR_EE)
52023         mfmsr   r4
52024         andc    r5,r4,r6
52025 @@ -73,7 +82,7 @@
52026  
52027         mtmsrd  r4,0
52028  
52029 -       addi    r1,r1,64
52030 +1:     addi    r1,r1,64
52031         ld      r0,16(r1)
52032         mtlr    r0
52033         blr
52034 --- a/arch/powerpc/platforms/pasemi/setup.c
52035 +++ b/arch/powerpc/platforms/pasemi/setup.c
52036 @@ -27,6 +27,7 @@
52037  #include <linux/delay.h>
52038  #include <linux/console.h>
52039  #include <linux/pci.h>
52040 +#include <linux/of_platform.h>
52041  
52042  #include <asm/prom.h>
52043  #include <asm/system.h>
52044 @@ -35,7 +36,7 @@
52045  #include <asm/mpic.h>
52046  #include <asm/smp.h>
52047  #include <asm/time.h>
52048 -#include <asm/of_platform.h>
52049 +#include <asm/mmu.h>
52050  
52051  #include <pcmcia/ss.h>
52052  #include <pcmcia/cistpl.h>
52053 @@ -43,6 +44,10 @@
52054  
52055  #include "pasemi.h"
52056  
52057 +#if !defined(CONFIG_SMP)
52058 +static void smp_send_stop(void) {}
52059 +#endif
52060 +
52061  /* SDC reset register, must be pre-mapped at reset time */
52062  static void __iomem *reset_reg;
52063  
52064 @@ -56,10 +61,14 @@
52065  
52066  static struct mce_regs mce_regs[MAX_MCE_REGS];
52067  static int num_mce_regs;
52068 +static int nmi_virq = NO_IRQ;
52069  
52070  
52071  static void pas_restart(char *cmd)
52072  {
52073 +       /* Need to put others cpu in hold loop so they're not sleeping */
52074 +       smp_send_stop();
52075 +       udelay(10000);
52076         printk("Restarting...\n");
52077         while (1)
52078                 out_le32(reset_reg, 0x6000000);
52079 @@ -126,9 +135,6 @@
52080         struct pci_dev *dev;
52081         int reg;
52082  
52083 -       if (!machine_is(pasemi))
52084 -               return -ENODEV;
52085 -
52086         /* Remap various SoC status registers for use by the MCE handler */
52087  
52088         reg = 0;
52089 @@ -172,7 +178,7 @@
52090  
52091         return 0;
52092  }
52093 -device_initcall(pas_setup_mce_regs);
52094 +machine_device_initcall(pasemi, pas_setup_mce_regs);
52095  
52096  static __init void pas_init_IRQ(void)
52097  {
52098 @@ -181,6 +187,8 @@
52099         unsigned long openpic_addr;
52100         const unsigned int *opprop;
52101         int naddr, opplen;
52102 +       int mpic_flags;
52103 +       const unsigned int *nmiprop;
52104         struct mpic *mpic;
52105  
52106         mpic_node = NULL;
52107 @@ -213,13 +221,26 @@
52108         openpic_addr = of_read_number(opprop, naddr);
52109         printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
52110  
52111 +       mpic_flags = MPIC_PRIMARY | MPIC_LARGE_VECTORS | MPIC_NO_BIAS;
52112 +
52113 +       nmiprop = of_get_property(mpic_node, "nmi-source", NULL);
52114 +       if (nmiprop)
52115 +               mpic_flags |= MPIC_ENABLE_MCK;
52116 +
52117         mpic = mpic_alloc(mpic_node, openpic_addr,
52118 -                         MPIC_PRIMARY|MPIC_LARGE_VECTORS,
52119 -                         0, 0, " PAS-OPIC  ");
52120 +                         mpic_flags, 0, 0, "PASEMI-OPIC");
52121         BUG_ON(!mpic);
52122  
52123         mpic_assign_isu(mpic, 0, openpic_addr + 0x10000);
52124         mpic_init(mpic);
52125 +       /* The NMI/MCK source needs to be prio 15 */
52126 +       if (nmiprop) {
52127 +               nmi_virq = irq_create_mapping(NULL, *nmiprop);
52128 +               mpic_irq_set_priority(nmi_virq, 15);
52129 +               set_irq_type(nmi_virq, IRQ_TYPE_EDGE_RISING);
52130 +               mpic_unmask_irq(nmi_virq);
52131 +       }
52132 +
52133         of_node_put(mpic_node);
52134         of_node_put(root);
52135  }
52136 @@ -239,6 +260,14 @@
52137  
52138         srr0 = regs->nip;
52139         srr1 = regs->msr;
52140 +
52141 +       if (nmi_virq != NO_IRQ && mpic_get_mcirq() == nmi_virq) {
52142 +               printk(KERN_ERR "NMI delivered\n");
52143 +               debugger(regs);
52144 +               mpic_end_irq(nmi_virq);
52145 +               goto out;
52146 +       }
52147 +
52148         dsisr = mfspr(SPRN_DSISR);
52149         printk(KERN_ERR "Machine Check on CPU %d\n", cpu);
52150         printk(KERN_ERR "SRR0  0x%016lx SRR1 0x%016lx\n", srr0, srr1);
52151 @@ -295,14 +324,14 @@
52152                 int i;
52153  
52154                 printk(KERN_ERR "slb contents:\n");
52155 -               for (i = 0; i < SLB_NUM_ENTRIES; i++) {
52156 +               for (i = 0; i < mmu_slb_size; i++) {
52157                         asm volatile("slbmfee  %0,%1" : "=r" (e) : "r" (i));
52158                         asm volatile("slbmfev  %0,%1" : "=r" (v) : "r" (i));
52159                         printk(KERN_ERR "%02d %016lx %016lx\n", i, e, v);
52160                 }
52161         }
52162  
52163 -
52164 +out:
52165         /* SRR1[62] is from MSR[62] if recoverable, so pass that back */
52166         return !!(srr1 & 0x2);
52167  }
52168 @@ -362,16 +391,17 @@
52169  
52170  
52171  static struct of_device_id pasemi_bus_ids[] = {
52172 +       /* Unfortunately needed for legacy firmwares */
52173         { .type = "localbus", },
52174         { .type = "sdc", },
52175 +       /* These are the proper entries, which newer firmware uses */
52176 +       { .compatible = "pasemi,localbus", },
52177 +       { .compatible = "pasemi,sdc", },
52178         {},
52179  };
52180  
52181  static int __init pasemi_publish_devices(void)
52182  {
52183 -       if (!machine_is(pasemi))
52184 -               return 0;
52185 -
52186         pasemi_pcmcia_init();
52187  
52188         /* Publish OF platform devices for SDC and other non-PCI devices */
52189 @@ -379,7 +409,7 @@
52190  
52191         return 0;
52192  }
52193 -device_initcall(pasemi_publish_devices);
52194 +machine_device_initcall(pasemi, pasemi_publish_devices);
52195  
52196  
52197  /*
52198 @@ -389,7 +419,8 @@
52199  {
52200         unsigned long root = of_get_flat_dt_root();
52201  
52202 -       if (!of_flat_dt_is_compatible(root, "PA6T-1682M"))
52203 +       if (!of_flat_dt_is_compatible(root, "PA6T-1682M") &&
52204 +           !of_flat_dt_is_compatible(root, "pasemi,pwrficient"))
52205                 return 0;
52206  
52207         hpte_init_native();
52208 @@ -400,7 +431,7 @@
52209  }
52210  
52211  define_machine(pasemi) {
52212 -       .name                   = "PA Semi PA6T-1682M",
52213 +       .name                   = "PA Semi PWRficient",
52214         .probe                  = pas_probe,
52215         .setup_arch             = pas_setup_arch,
52216         .init_early             = pas_init_early,
52217 --- a/arch/powerpc/platforms/powermac/low_i2c.c
52218 +++ b/arch/powerpc/platforms/powermac/low_i2c.c
52219 @@ -585,8 +585,7 @@
52220         struct device_node *np, *child, *parent;
52221  
52222         /* Probe keywest-i2c busses */
52223 -       for (np = NULL;
52224 -            (np = of_find_compatible_node(np, "i2c","keywest-i2c")) != NULL;){
52225 +       for_each_compatible_node(np, "i2c","keywest-i2c") {
52226                 struct pmac_i2c_host_kw *host;
52227                 int multibus, chans, i;
52228  
52229 @@ -1462,9 +1461,6 @@
52230                 return 0;
52231         i2c_inited = 1;
52232  
52233 -       if (!machine_is(powermac))
52234 -               return 0;
52235 -
52236         /* Probe keywest-i2c busses */
52237         kw_i2c_probe();
52238  
52239 @@ -1483,7 +1479,7 @@
52240  
52241         return 0;
52242  }
52243 -arch_initcall(pmac_i2c_init);
52244 +machine_arch_initcall(powermac, pmac_i2c_init);
52245  
52246  /* Since pmac_i2c_init can be called too early for the platform device
52247   * registration, we need to do it at a later time. In our case, subsys
52248 @@ -1515,4 +1511,4 @@
52249  
52250         return 0;
52251  }
52252 -subsys_initcall(pmac_i2c_create_platform_devices);
52253 +machine_subsys_initcall(powermac, pmac_i2c_create_platform_devices);
52254 --- a/arch/powerpc/platforms/powermac/pci.c
52255 +++ b/arch/powerpc/platforms/powermac/pci.c
52256 @@ -40,8 +40,6 @@
52257  static int has_uninorth;
52258  #ifdef CONFIG_PPC64
52259  static struct pci_controller *u3_agp;
52260 -static struct pci_controller *u4_pcie;
52261 -static struct pci_controller *u3_ht;
52262  #else
52263  static int has_second_ohare;
52264  #endif /* CONFIG_PPC64 */
52265 @@ -314,12 +312,15 @@
52266  
52267         /* We only allow config cycles to devices that are in OF device-tree
52268          * as we are apparently having some weird things going on with some
52269 -        * revs of K2 on recent G5s
52270 +        * revs of K2 on recent G5s, except for the host bridge itself, which
52271 +        * is missing from the tree but we know we can probe.
52272          */
52273         if (bus->self)
52274                 busdn = pci_device_to_OF_node(bus->self);
52275 +       else if (devfn == 0)
52276 +               return 0;
52277         else
52278 -               busdn = hose->arch_data;
52279 +               busdn = hose->dn;
52280         for (dn = busdn->child; dn; dn = dn->sibling)
52281                 if (PCI_DN(dn) && PCI_DN(dn)->devfn == devfn)
52282                         break;
52283 @@ -344,14 +345,15 @@
52284                 + (((unsigned int)bus) << 16) \
52285                 + 0x01000000UL)
52286  
52287 -static volatile void __iomem *u3_ht_cfg_access(struct pci_controller* hose,
52288 -                                            u8 bus, u8 devfn, u8 offset)
52289 +static void __iomem *u3_ht_cfg_access(struct pci_controller *hose, u8 bus,
52290 +                                     u8 devfn, u8 offset, int *swap)
52291  {
52292 +       *swap = 1;
52293         if (bus == hose->first_busno) {
52294 -               /* For now, we don't self probe U3 HT bridge */
52295 -               if (PCI_SLOT(devfn) == 0)
52296 -                       return NULL;
52297 -               return hose->cfg_data + U3_HT_CFA0(devfn, offset);
52298 +               if (devfn != 0)
52299 +                       return hose->cfg_data + U3_HT_CFA0(devfn, offset);
52300 +               *swap = 0;
52301 +               return ((void __iomem *)hose->cfg_addr) + (offset << 2);
52302         } else
52303                 return hose->cfg_data + U3_HT_CFA1(bus, devfn, offset);
52304  }
52305 @@ -360,14 +362,15 @@
52306                                     int offset, int len, u32 *val)
52307  {
52308         struct pci_controller *hose;
52309 -       volatile void __iomem *addr;
52310 +       void __iomem *addr;
52311 +       int swap;
52312  
52313         hose = pci_bus_to_host(bus);
52314         if (hose == NULL)
52315                 return PCIBIOS_DEVICE_NOT_FOUND;
52316         if (offset >= 0x100)
52317                 return  PCIBIOS_BAD_REGISTER_NUMBER;
52318 -       addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
52319 +       addr = u3_ht_cfg_access(hose, bus->number, devfn, offset, &swap);
52320         if (!addr)
52321                 return PCIBIOS_DEVICE_NOT_FOUND;
52322  
52323 @@ -397,10 +400,10 @@
52324                 *val = in_8(addr);
52325                 break;
52326         case 2:
52327 -               *val = in_le16(addr);
52328 +               *val = swap ? in_le16(addr) : in_be16(addr);
52329                 break;
52330         default:
52331 -               *val = in_le32(addr);
52332 +               *val = swap ? in_le32(addr) : in_be32(addr);
52333                 break;
52334         }
52335         return PCIBIOS_SUCCESSFUL;
52336 @@ -410,14 +413,15 @@
52337                                      int offset, int len, u32 val)
52338  {
52339         struct pci_controller *hose;
52340 -       volatile void __iomem *addr;
52341 +       void __iomem *addr;
52342 +       int swap;
52343  
52344         hose = pci_bus_to_host(bus);
52345         if (hose == NULL)
52346                 return PCIBIOS_DEVICE_NOT_FOUND;
52347         if (offset >= 0x100)
52348                 return  PCIBIOS_BAD_REGISTER_NUMBER;
52349 -       addr = u3_ht_cfg_access(hose, bus->number, devfn, offset);
52350 +       addr = u3_ht_cfg_access(hose, bus->number, devfn, offset, &swap);
52351         if (!addr)
52352                 return PCIBIOS_DEVICE_NOT_FOUND;
52353  
52354 @@ -439,10 +443,10 @@
52355                 out_8(addr, val);
52356                 break;
52357         case 2:
52358 -               out_le16(addr, val);
52359 +               swap ? out_le16(addr, val) : out_be16(addr, val);
52360                 break;
52361         default:
52362 -               out_le32((u32 __iomem *)addr, val);
52363 +               swap ? out_le32(addr, val) : out_be32(addr, val);
52364                 break;
52365         }
52366         return PCIBIOS_SUCCESSFUL;
52367 @@ -725,7 +729,7 @@
52368  static int __init setup_uninorth(struct pci_controller *hose,
52369                                  struct resource *addr)
52370  {
52371 -       pci_assign_all_buses = 1;
52372 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
52373         has_uninorth = 1;
52374         hose->ops = &macrisc_pci_ops;
52375         hose->cfg_addr = ioremap(addr->start + 0x800000, 0x1000);
52376 @@ -773,31 +777,72 @@
52377          */
52378         hose->first_busno = 0x00;
52379         hose->last_busno = 0xff;
52380 -       u4_pcie = hose;
52381  }
52382  
52383 -static void __init setup_u3_ht(struct pci_controller* hose)
52384 +static void __init parse_region_decode(struct pci_controller *hose,
52385 +                                      u32 decode)
52386  {
52387 -       struct device_node *np = (struct device_node *)hose->arch_data;
52388 -       struct pci_controller *other = NULL;
52389 -       int i, cur;
52390 +       unsigned long base, end, next = -1;
52391 +       int i, cur = -1;
52392  
52393 +       /* Iterate through all bits. We ignore the last bit as this region is
52394 +        * reserved for the ROM among other niceties
52395 +        */
52396 +       for (i = 0; i < 31; i++) {
52397 +               if ((decode & (0x80000000 >> i)) == 0)
52398 +                       continue;
52399 +               if (i < 16) {
52400 +                       base = 0xf0000000 | (((u32)i) << 24);
52401 +                       end = base + 0x00ffffff;
52402 +               } else {
52403 +                       base = ((u32)i-16) << 28;
52404 +                       end = base + 0x0fffffff;
52405 +               }
52406 +               if (base != next) {
52407 +                       if (++cur >= 3) {
52408 +                               printk(KERN_WARNING "PCI: Too many ranges !\n");
52409 +                               break;
52410 +                       }
52411 +                       hose->mem_resources[cur].flags = IORESOURCE_MEM;
52412 +                       hose->mem_resources[cur].name = hose->dn->full_name;
52413 +                       hose->mem_resources[cur].start = base;
52414 +                       hose->mem_resources[cur].end = end;
52415 +                       DBG("  %d: 0x%08lx-0x%08lx\n", cur, base, end);
52416 +               } else {
52417 +                       DBG("   :           -0x%08lx\n", end);
52418 +                       hose->mem_resources[cur].end = end;
52419 +               }
52420 +               next = end + 1;
52421 +       }
52422 +}
52423 +
52424 +static void __init setup_u3_ht(struct pci_controller* hose)
52425 +{
52426 +       struct device_node *np = hose->dn;
52427 +       struct resource cfg_res, self_res;
52428 +       u32 decode;
52429  
52430         hose->ops = &u3_ht_pci_ops;
52431  
52432 -       /* We hard code the address because of the different size of
52433 -        * the reg address cell, we shall fix that by killing struct
52434 -        * reg_property and using some accessor functions instead
52435 +       /* Get base addresses from OF tree
52436          */
52437 -       hose->cfg_data = ioremap(0xf2000000, 0x02000000);
52438 +       if (of_address_to_resource(np, 0, &cfg_res) ||
52439 +           of_address_to_resource(np, 1, &self_res)) {
52440 +               printk(KERN_ERR "PCI: Failed to get U3/U4 HT resources !\n");
52441 +               return;
52442 +       }
52443 +
52444 +       /* Map external cfg space access into cfg_data and self registers
52445 +        * into cfg_addr
52446 +        */
52447 +       hose->cfg_data = ioremap(cfg_res.start, 0x02000000);
52448 +       hose->cfg_addr = ioremap(self_res.start,
52449 +                                self_res.end - self_res.start + 1);
52450  
52451         /*
52452 -        * /ht node doesn't expose a "ranges" property, so we "remove"
52453 -        * regions that have been allocated to AGP. So far, this version of
52454 -        * the code doesn't assign any of the 0xfxxxxxxx "fine" memory regions
52455 -        * to /ht. We need to fix that sooner or later by either parsing all
52456 -        * child "ranges" properties or figuring out the U3 address space
52457 -        * decoding logic and then read its configuration register (if any).
52458 +        * /ht node doesn't expose a "ranges" property, we read the register
52459 +        * that controls the decoding logic and use that for memory regions.
52460 +        * The IO region is hard coded since it is fixed in HW as well.
52461          */
52462         hose->io_base_phys = 0xf4000000;
52463         hose->pci_io_size = 0x00400000;
52464 @@ -808,76 +853,33 @@
52465         hose->pci_mem_offset = 0;
52466         hose->first_busno = 0;
52467         hose->last_busno = 0xef;
52468 -       hose->mem_resources[0].name = np->full_name;
52469 -       hose->mem_resources[0].start = 0x80000000;
52470 -       hose->mem_resources[0].end = 0xefffffff;
52471 -       hose->mem_resources[0].flags = IORESOURCE_MEM;
52472 -
52473 -       u3_ht = hose;
52474 -
52475 -       if (u3_agp != NULL)
52476 -               other = u3_agp;
52477 -       else if (u4_pcie != NULL)
52478 -               other = u4_pcie;
52479  
52480 -       if (other == NULL) {
52481 -               DBG("U3/4 has no AGP/PCIE, using full resource range\n");
52482 -               return;
52483 -       }
52484 +       /* Note: fix offset when cfg_addr becomes a void * */
52485 +       decode = in_be32(hose->cfg_addr + 0x80);
52486  
52487 -       /* Fixup bus range vs. PCIE */
52488 -       if (u4_pcie)
52489 -               hose->last_busno = u4_pcie->first_busno - 1;
52490 -
52491 -       /* We "remove" the AGP resources from the resources allocated to HT,
52492 -        * that is we create "holes". However, that code does assumptions
52493 -        * that so far happen to be true (cross fingers...), typically that
52494 -        * resources in the AGP node are properly ordered
52495 -        */
52496 -       cur = 0;
52497 -       for (i=0; i<3; i++) {
52498 -               struct resource *res = &other->mem_resources[i];
52499 -               if (res->flags != IORESOURCE_MEM)
52500 -                       continue;
52501 -               /* We don't care about "fine" resources */
52502 -               if (res->start >= 0xf0000000)
52503 -                       continue;
52504 -               /* Check if it's just a matter of "shrinking" us in one
52505 -                * direction
52506 -                */
52507 -               if (hose->mem_resources[cur].start == res->start) {
52508 -                       DBG("U3/HT: shrink start of %d, %08lx -> %08lx\n",
52509 -                           cur, hose->mem_resources[cur].start,
52510 -                           res->end + 1);
52511 -                       hose->mem_resources[cur].start = res->end + 1;
52512 -                       continue;
52513 -               }
52514 -               if (hose->mem_resources[cur].end == res->end) {
52515 -                       DBG("U3/HT: shrink end of %d, %08lx -> %08lx\n",
52516 -                           cur, hose->mem_resources[cur].end,
52517 -                           res->start - 1);
52518 -                       hose->mem_resources[cur].end = res->start - 1;
52519 -                       continue;
52520 -               }
52521 -               /* No, it's not the case, we need a hole */
52522 -               if (cur == 2) {
52523 -                       /* not enough resources for a hole, we drop part
52524 -                        * of the range
52525 -                        */
52526 -                       printk(KERN_WARNING "Running out of resources"
52527 -                              " for /ht host !\n");
52528 -                       hose->mem_resources[cur].end = res->start - 1;
52529 -                       continue;
52530 -               }
52531 -               cur++;
52532 -               DBG("U3/HT: hole, %d end at %08lx, %d start at %08lx\n",
52533 -                   cur-1, res->start - 1, cur, res->end + 1);
52534 -               hose->mem_resources[cur].name = np->full_name;
52535 -               hose->mem_resources[cur].flags = IORESOURCE_MEM;
52536 -               hose->mem_resources[cur].start = res->end + 1;
52537 -               hose->mem_resources[cur].end = hose->mem_resources[cur-1].end;
52538 -               hose->mem_resources[cur-1].end = res->start - 1;
52539 -       }
52540 +       DBG("PCI: Apple HT bridge decode register: 0x%08x\n", decode);
52541 +
52542 +       /* NOTE: The decode register setup is a bit weird... region
52543 +        * 0xf8000000 for example is marked as enabled in there while it's
52544 +        & actually the memory controller registers.
52545 +        * That means that we are incorrectly attributing it to HT.
52546 +        *
52547 +        * In a similar vein, region 0xf4000000 is actually the HT IO space but
52548 +        * also marked as enabled in here and 0xf9000000 is used by some other
52549 +        * internal bits of the northbridge.
52550 +        *
52551 +        * Unfortunately, we can't just mask out those bit as we would end
52552 +        * up with more regions than we can cope (linux can only cope with
52553 +        * 3 memory regions for a PHB at this stage).
52554 +        *
52555 +        * So for now, we just do a little hack. We happen to -know- that
52556 +        * Apple firmware doesn't assign things below 0xfa000000 for that
52557 +        * bridge anyway so we mask out all bits we don't want.
52558 +        */
52559 +       decode &= 0x003fffff;
52560 +
52561 +       /* Now parse the resulting bits and build resources */
52562 +       parse_region_decode(hose, decode);
52563  }
52564  #endif /* CONFIG_PPC64 */
52565  
52566 @@ -994,6 +996,8 @@
52567         struct device_node *np, *root;
52568         struct device_node *ht = NULL;
52569  
52570 +       ppc_pci_flags = PPC_PCI_CAN_SKIP_ISA_ALIGN;
52571 +
52572         root = of_find_node_by_path("/");
52573         if (root == NULL) {
52574                 printk(KERN_CRIT "pmac_pci_init: can't find root "
52575 @@ -1032,15 +1036,15 @@
52576          * future though
52577          */
52578         if (u3_agp) {
52579 -               struct device_node *np = u3_agp->arch_data;
52580 +               struct device_node *np = u3_agp->dn;
52581                 PCI_DN(np)->busno = 0xf0;
52582                 for (np = np->child; np; np = np->sibling)
52583                         PCI_DN(np)->busno = 0xf0;
52584         }
52585         /* pmac_check_ht_link(); */
52586  
52587 -       /* Tell pci.c to not use the common resource allocation mechanism */
52588 -       pci_probe_only = 1;
52589 +       /* We can allocate missing resources if any */
52590 +       pci_probe_only = 0;
52591  
52592  #else /* CONFIG_PPC64 */
52593         init_p2pbridge();
52594 @@ -1051,13 +1055,13 @@
52595          * some offset between bus number and domains for now when we
52596          * assign all busses should help for now
52597          */
52598 -       if (pci_assign_all_buses)
52599 +       if (ppc_pci_flags & PPC_PCI_REASSIGN_ALL_BUS)
52600                 pcibios_assign_bus_offset = 0x10;
52601  #endif
52602  }
52603  
52604 -int
52605 -pmac_pci_enable_device_hook(struct pci_dev *dev, int initial)
52606 +#ifdef CONFIG_PPC32
52607 +int pmac_pci_enable_device_hook(struct pci_dev *dev)
52608  {
52609         struct device_node* node;
52610         int updatecfg = 0;
52611 @@ -1099,24 +1103,21 @@
52612                 updatecfg = 1;
52613         }
52614  
52615 +       /*
52616 +        * Fixup various header fields on 32 bits. We don't do that on
52617 +        * 64 bits as some of these have strange values behind the HT
52618 +        * bridge and we must not, for example, enable MWI or set the
52619 +        * cache line size on them.
52620 +        */
52621         if (updatecfg) {
52622                 u16 cmd;
52623  
52624 -               /*
52625 -                * Make sure PCI is correctly configured
52626 -                *
52627 -                * We use old pci_bios versions of the function since, by
52628 -                * default, gmac is not powered up, and so will be absent
52629 -                * from the kernel initial PCI lookup.
52630 -                *
52631 -                * Should be replaced by 2.4 new PCI mechanisms and really
52632 -                * register the device.
52633 -                */
52634                 pci_read_config_word(dev, PCI_COMMAND, &cmd);
52635                 cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER
52636                         | PCI_COMMAND_INVALIDATE;
52637                 pci_write_config_word(dev, PCI_COMMAND, cmd);
52638                 pci_write_config_byte(dev, PCI_LATENCY_TIMER, 16);
52639 +
52640                 pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE,
52641                                       L1_CACHE_BYTES >> 2);
52642         }
52643 @@ -1124,6 +1125,18 @@
52644         return 0;
52645  }
52646  
52647 +void __devinit pmac_pci_fixup_ohci(struct pci_dev *dev)
52648 +{
52649 +       struct device_node *node = pci_device_to_OF_node(dev);
52650 +
52651 +       /* We don't want to assign resources to USB controllers
52652 +        * absent from the OF tree (iBook second controller)
52653 +        */
52654 +       if (dev->class == PCI_CLASS_SERIAL_USB_OHCI && !node)
52655 +               dev->resource[0].flags = 0;
52656 +}
52657 +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_APPLE, PCI_ANY_ID, pmac_pci_fixup_ohci);
52658 +
52659  /* We power down some devices after they have been probed. They'll
52660   * be powered back on later on
52661   */
52662 @@ -1171,7 +1184,6 @@
52663         of_node_put(nd);
52664  }
52665  
52666 -#ifdef CONFIG_PPC32
52667  void pmac_pci_fixup_cardbus(struct pci_dev* dev)
52668  {
52669         if (!machine_is(powermac))
52670 @@ -1259,7 +1271,7 @@
52671         }
52672  }
52673  DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, pmac_pci_fixup_pciata);
52674 -#endif
52675 +#endif /* CONFIG_PPC32 */
52676  
52677  /*
52678   * Disable second function on K2-SATA, it's broken
52679 --- a/arch/powerpc/platforms/powermac/pfunc_base.c
52680 +++ b/arch/powerpc/platforms/powermac/pfunc_base.c
52681 @@ -363,8 +363,7 @@
52682  
52683         return 0;
52684  }
52685 -
52686 -arch_initcall(pmac_pfunc_base_install);
52687 +machine_arch_initcall(powermac, pmac_pfunc_base_install);
52688  
52689  #ifdef CONFIG_PM
52690  
52691 --- a/arch/powerpc/platforms/powermac/pic.c
52692 +++ b/arch/powerpc/platforms/powermac/pic.c
52693 @@ -690,6 +690,5 @@
52694         sysdev_driver_register(&pmacpic_sysclass, &driver_pmacpic);
52695         return 0;
52696  }
52697 -
52698 -subsys_initcall(init_pmacpic_sysfs);
52699 +machine_subsys_initcall(powermac, init_pmacpic_sysfs);
52700  
52701 --- a/arch/powerpc/platforms/powermac/pmac.h
52702 +++ b/arch/powerpc/platforms/powermac/pmac.h
52703 @@ -26,7 +26,7 @@
52704  extern void pmac_nvram_update(void);
52705  extern unsigned char pmac_nvram_read_byte(int addr);
52706  extern void pmac_nvram_write_byte(int addr, unsigned char val);
52707 -extern int pmac_pci_enable_device_hook(struct pci_dev *dev, int initial);
52708 +extern int pmac_pci_enable_device_hook(struct pci_dev *dev);
52709  extern void pmac_pcibios_after_init(void);
52710  extern int of_show_percpuinfo(struct seq_file *m, int i);
52711  
52712 --- a/arch/powerpc/platforms/powermac/setup.c
52713 +++ b/arch/powerpc/platforms/powermac/setup.c
52714 @@ -51,6 +51,8 @@
52715  #include <linux/root_dev.h>
52716  #include <linux/bitops.h>
52717  #include <linux/suspend.h>
52718 +#include <linux/of_device.h>
52719 +#include <linux/of_platform.h>
52720  
52721  #include <asm/reg.h>
52722  #include <asm/sections.h>
52723 @@ -68,8 +70,6 @@
52724  #include <asm/btext.h>
52725  #include <asm/pmac_feature.h>
52726  #include <asm/time.h>
52727 -#include <asm/of_device.h>
52728 -#include <asm/of_platform.h>
52729  #include <asm/mmu_context.h>
52730  #include <asm/iommu.h>
52731  #include <asm/smu.h>
52732 @@ -94,7 +94,6 @@
52733  #define DEFAULT_ROOT_DEVICE Root_SDA1  /* sda1 - slightly silly choice */
52734  
52735  #ifdef CONFIG_PPC64
52736 -#include <asm/udbg.h>
52737  int sccdbg;
52738  #endif
52739  
52740 @@ -398,17 +397,13 @@
52741  
52742  static int pmac_late_init(void)
52743  {
52744 -       if (!machine_is(powermac))
52745 -               return -ENODEV;
52746 -
52747         initializing = 0;
52748         /* this is udbg (which is __init) and we can later use it during
52749          * cpu hotplug (in smp_core99_kick_cpu) */
52750         ppc_md.progress = NULL;
52751         return 0;
52752  }
52753 -
52754 -late_initcall(pmac_late_init);
52755 +machine_late_initcall(powermac, pmac_late_init);
52756  
52757  /*
52758   * This is __init_refok because we check for "initializing" before
52759 @@ -535,9 +530,6 @@
52760         if (machine_is(chrp))
52761                 return -1;
52762  
52763 -       if (!machine_is(powermac))
52764 -               return 0;
52765 -
52766         np = of_find_node_by_name(NULL, "valkyrie");
52767         if (np)
52768                 of_platform_device_create(np, "valkyrie", NULL);
52769 @@ -552,8 +544,7 @@
52770  
52771         return 0;
52772  }
52773 -
52774 -device_initcall(pmac_declare_of_platform_devices);
52775 +machine_device_initcall(powermac, pmac_declare_of_platform_devices);
52776  
52777  /*
52778   * Called very early, MMU is off, device-tree isn't unflattened
52779 @@ -613,9 +604,11 @@
52780  
52781         /* We need to use normal PCI probing for the AGP bus,
52782          * since the device for the AGP bridge isn't in the tree.
52783 +        * Same for the PCIe host on U4 and the HT host bridge.
52784          */
52785         if (bus->self == NULL && (of_device_is_compatible(node, "u3-agp") ||
52786 -                                 of_device_is_compatible(node, "u4-pcie")))
52787 +                                 of_device_is_compatible(node, "u4-pcie") ||
52788 +                                 of_device_is_compatible(node, "u3-ht")))
52789                 return PCI_PROBE_NORMAL;
52790         return PCI_PROBE_DEVTREE;
52791  }
52792 --- a/arch/powerpc/platforms/powermac/time.c
52793 +++ b/arch/powerpc/platforms/powermac/time.c
52794 @@ -84,12 +84,14 @@
52795         return delta;
52796  }
52797  
52798 +#if defined(CONFIG_ADB_CUDA) || defined(CONFIG_ADB_PMU)
52799  static void to_rtc_time(unsigned long now, struct rtc_time *tm)
52800  {
52801         to_tm(now, tm);
52802         tm->tm_year -= 1900;
52803         tm->tm_mon -= 1;
52804  }
52805 +#endif
52806  
52807  static unsigned long from_rtc_time(struct rtc_time *tm)
52808  {
52809 --- a/arch/powerpc/platforms/ps3/Kconfig
52810 +++ b/arch/powerpc/platforms/ps3/Kconfig
52811 @@ -61,17 +61,6 @@
52812           This support is mainly for Linux kernel development.  If unsure,
52813           say N.
52814  
52815 -config PS3_USE_LPAR_ADDR
52816 -       depends on PPC_PS3 && EXPERIMENTAL
52817 -       bool "PS3 use lpar address space"
52818 -       default y
52819 -       help
52820 -         This option is solely for experimentation by experts.  Disables
52821 -         translation of lpar addresses.  SPE support currently won't work
52822 -         without this set to y.
52823 -
52824 -         If you have any doubt, choose the default y.
52825 -
52826  config PS3_VUART
52827         depends on PPC_PS3
52828         tristate
52829 @@ -138,4 +127,17 @@
52830           be disabled on the kernel command line using "ps3flash=off", to
52831           not allocate this fixed buffer.
52832  
52833 +config PS3_LPM
52834 +       tristate "PS3 Logical Performance Monitor support"
52835 +       depends on PPC_PS3
52836 +       help
52837 +         Include support for the PS3 Logical Performance Monitor.
52838 +
52839 +         This support is required to use the logical performance monitor
52840 +         of the PS3's LV1 hypervisor.
52841 +
52842 +         If you intend to use the advanced performance monitoring and
52843 +         profiling support of the Cell processor with programs like
52844 +         oprofile and perfmon2, then say Y or M, otherwise say N.
52845 +
52846  endmenu
52847 --- a/arch/powerpc/platforms/ps3/device-init.c
52848 +++ b/arch/powerpc/platforms/ps3/device-init.c
52849 @@ -23,6 +23,7 @@
52850  #include <linux/kernel.h>
52851  #include <linux/kthread.h>
52852  #include <linux/init.h>
52853 +#include <linux/reboot.h>
52854  
52855  #include <asm/firmware.h>
52856  #include <asm/lv1call.h>
52857 @@ -30,6 +31,89 @@
52858  
52859  #include "platform.h"
52860  
52861 +static int __init ps3_register_lpm_devices(void)
52862 +{
52863 +       int result;
52864 +       u64 tmp1;
52865 +       u64 tmp2;
52866 +       struct ps3_system_bus_device *dev;
52867 +
52868 +       pr_debug(" -> %s:%d\n", __func__, __LINE__);
52869 +
52870 +       dev = kzalloc(sizeof(*dev), GFP_KERNEL);
52871 +       if (!dev)
52872 +               return -ENOMEM;
52873 +
52874 +       dev->match_id = PS3_MATCH_ID_LPM;
52875 +       dev->dev_type = PS3_DEVICE_TYPE_LPM;
52876 +
52877 +       /* The current lpm driver only supports a single BE processor. */
52878 +
52879 +       result = ps3_repository_read_be_node_id(0, &dev->lpm.node_id);
52880 +
52881 +       if (result) {
52882 +               pr_debug("%s:%d: ps3_repository_read_be_node_id failed \n",
52883 +                       __func__, __LINE__);
52884 +               goto fail_read_repo;
52885 +       }
52886 +
52887 +       result = ps3_repository_read_lpm_privileges(dev->lpm.node_id, &tmp1,
52888 +               &dev->lpm.rights);
52889 +
52890 +       if (result) {
52891 +               pr_debug("%s:%d: ps3_repository_read_lpm_privleges failed \n",
52892 +                       __func__, __LINE__);
52893 +               goto fail_read_repo;
52894 +       }
52895 +
52896 +       lv1_get_logical_partition_id(&tmp2);
52897 +
52898 +       if (tmp1 != tmp2) {
52899 +               pr_debug("%s:%d: wrong lpar\n",
52900 +                       __func__, __LINE__);
52901 +               result = -ENODEV;
52902 +               goto fail_rights;
52903 +       }
52904 +
52905 +       if (!(dev->lpm.rights & PS3_LPM_RIGHTS_USE_LPM)) {
52906 +               pr_debug("%s:%d: don't have rights to use lpm\n",
52907 +                       __func__, __LINE__);
52908 +               result = -EPERM;
52909 +               goto fail_rights;
52910 +       }
52911 +
52912 +       pr_debug("%s:%d: pu_id %lu, rights %lu(%lxh)\n",
52913 +               __func__, __LINE__, dev->lpm.pu_id, dev->lpm.rights,
52914 +               dev->lpm.rights);
52915 +
52916 +       result = ps3_repository_read_pu_id(0, &dev->lpm.pu_id);
52917 +
52918 +       if (result) {
52919 +               pr_debug("%s:%d: ps3_repository_read_pu_id failed \n",
52920 +                       __func__, __LINE__);
52921 +               goto fail_read_repo;
52922 +       }
52923 +
52924 +       result = ps3_system_bus_device_register(dev);
52925 +
52926 +       if (result) {
52927 +               pr_debug("%s:%d ps3_system_bus_device_register failed\n",
52928 +                       __func__, __LINE__);
52929 +               goto fail_register;
52930 +       }
52931 +
52932 +       pr_debug(" <- %s:%d\n", __func__, __LINE__);
52933 +       return 0;
52934 +
52935 +
52936 +fail_register:
52937 +fail_rights:
52938 +fail_read_repo:
52939 +       kfree(dev);
52940 +       pr_debug(" <- %s:%d: failed\n", __func__, __LINE__);
52941 +       return result;
52942 +}
52943 +
52944  /**
52945   * ps3_setup_gelic_device - Setup and register a gelic device instance.
52946   *
52947 @@ -238,166 +322,6 @@
52948         return result;
52949  }
52950  
52951 -static int ps3stor_wait_for_completion(u64 dev_id, u64 tag,
52952 -                                      unsigned int timeout)
52953 -{
52954 -       int result = -1;
52955 -       unsigned int retries = 0;
52956 -       u64 status;
52957 -
52958 -       for (retries = 0; retries < timeout; retries++) {
52959 -               result = lv1_storage_check_async_status(dev_id, tag, &status);
52960 -               if (!result)
52961 -                       break;
52962 -
52963 -               msleep(1);
52964 -       }
52965 -
52966 -       if (result)
52967 -               pr_debug("%s:%u: check_async_status: %s, status %lx\n",
52968 -                        __func__, __LINE__, ps3_result(result), status);
52969 -
52970 -       return result;
52971 -}
52972 -
52973 -/**
52974 - * ps3_storage_wait_for_device - Wait for a storage device to become ready.
52975 - * @repo: The repository device to wait for.
52976 - *
52977 - * Uses the hypervisor's storage device notification mechanism to wait until
52978 - * a storage device is ready.  The device notification mechanism uses a
52979 - * psuedo device (id = -1) to asynchronously notify the guest when storage
52980 - * devices become ready.  The notification device has a block size of 512
52981 - * bytes.
52982 - */
52983 -
52984 -static int ps3_storage_wait_for_device(const struct ps3_repository_device *repo)
52985 -{
52986 -       int error = -ENODEV;
52987 -       int result;
52988 -       const u64 notification_dev_id = (u64)-1LL;
52989 -       const unsigned int timeout = HZ;
52990 -       u64 lpar;
52991 -       u64 tag;
52992 -       void *buf;
52993 -       enum ps3_notify_type {
52994 -               notify_device_ready = 0,
52995 -               notify_region_probe = 1,
52996 -               notify_region_update = 2,
52997 -       };
52998 -       struct {
52999 -               u64 operation_code;     /* must be zero */
53000 -               u64 event_mask;         /* OR of 1UL << enum ps3_notify_type */
53001 -       } *notify_cmd;
53002 -       struct {
53003 -               u64 event_type;         /* enum ps3_notify_type */
53004 -               u64 bus_id;
53005 -               u64 dev_id;
53006 -               u64 dev_type;
53007 -               u64 dev_port;
53008 -       } *notify_event;
53009 -
53010 -       pr_debug(" -> %s:%u: (%u:%u:%u)\n", __func__, __LINE__, repo->bus_id,
53011 -                repo->dev_id, repo->dev_type);
53012 -
53013 -       buf = kzalloc(512, GFP_KERNEL);
53014 -       if (!buf)
53015 -               return -ENOMEM;
53016 -
53017 -       lpar = ps3_mm_phys_to_lpar(__pa(buf));
53018 -       notify_cmd = buf;
53019 -       notify_event = buf;
53020 -
53021 -       result = lv1_open_device(repo->bus_id, notification_dev_id, 0);
53022 -       if (result) {
53023 -               printk(KERN_ERR "%s:%u: lv1_open_device %s\n", __func__,
53024 -                      __LINE__, ps3_result(result));
53025 -               goto fail_free;
53026 -       }
53027 -
53028 -       /* Setup and write the request for device notification. */
53029 -
53030 -       notify_cmd->operation_code = 0; /* must be zero */
53031 -       notify_cmd->event_mask = 1UL << notify_region_probe;
53032 -
53033 -       result = lv1_storage_write(notification_dev_id, 0, 0, 1, 0, lpar,
53034 -                                  &tag);
53035 -       if (result) {
53036 -               printk(KERN_ERR "%s:%u: write failed %s\n", __func__, __LINE__,
53037 -                      ps3_result(result));
53038 -               goto fail_close;
53039 -       }
53040 -
53041 -       /* Wait for the write completion */
53042 -
53043 -       result = ps3stor_wait_for_completion(notification_dev_id, tag,
53044 -                                            timeout);
53045 -       if (result) {
53046 -               printk(KERN_ERR "%s:%u: write not completed %s\n", __func__,
53047 -                      __LINE__, ps3_result(result));
53048 -               goto fail_close;
53049 -       }
53050 -
53051 -       /* Loop here processing the requested notification events. */
53052 -
53053 -       while (1) {
53054 -               memset(notify_event, 0, sizeof(*notify_event));
53055 -
53056 -               result = lv1_storage_read(notification_dev_id, 0, 0, 1, 0,
53057 -                                         lpar, &tag);
53058 -               if (result) {
53059 -                       printk(KERN_ERR "%s:%u: write failed %s\n", __func__,
53060 -                              __LINE__, ps3_result(result));
53061 -                       break;
53062 -               }
53063 -
53064 -               result = ps3stor_wait_for_completion(notification_dev_id, tag,
53065 -                                                    timeout);
53066 -               if (result) {
53067 -                       printk(KERN_ERR "%s:%u: read not completed %s\n",
53068 -                              __func__, __LINE__, ps3_result(result));
53069 -                       break;
53070 -               }
53071 -
53072 -               pr_debug("%s:%d: notify event (%u:%u:%u): event_type 0x%lx, "
53073 -                        "port %lu\n", __func__, __LINE__, repo->bus_index,
53074 -                        repo->dev_index, repo->dev_type,
53075 -                        notify_event->event_type, notify_event->dev_port);
53076 -
53077 -               if (notify_event->event_type != notify_region_probe ||
53078 -                   notify_event->bus_id != repo->bus_id) {
53079 -                       pr_debug("%s:%u: bad notify_event: event %lu, "
53080 -                                "dev_id %lu, dev_type %lu\n",
53081 -                                __func__, __LINE__, notify_event->event_type,
53082 -                                notify_event->dev_id, notify_event->dev_type);
53083 -                       break;
53084 -               }
53085 -
53086 -               if (notify_event->dev_id == repo->dev_id &&
53087 -                   notify_event->dev_type == repo->dev_type) {
53088 -                       pr_debug("%s:%u: device ready (%u:%u:%u)\n", __func__,
53089 -                                __LINE__, repo->bus_index, repo->dev_index,
53090 -                                repo->dev_type);
53091 -                       error = 0;
53092 -                       break;
53093 -               }
53094 -
53095 -               if (notify_event->dev_id == repo->dev_id &&
53096 -                   notify_event->dev_type == PS3_DEV_TYPE_NOACCESS) {
53097 -                       pr_debug("%s:%u: no access: dev_id %u\n", __func__,
53098 -                                __LINE__, repo->dev_id);
53099 -                       break;
53100 -               }
53101 -       }
53102 -
53103 -fail_close:
53104 -       lv1_close_device(repo->bus_id, notification_dev_id);
53105 -fail_free:
53106 -       kfree(buf);
53107 -       pr_debug(" <- %s:%u\n", __func__, __LINE__);
53108 -       return error;
53109 -}
53110 -
53111  static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
53112                                  enum ps3_match_id match_id)
53113  {
53114 @@ -449,16 +373,6 @@
53115                 goto fail_find_interrupt;
53116         }
53117  
53118 -       /* FIXME: Arrange to only do this on a 'cold' boot */
53119 -
53120 -       result = ps3_storage_wait_for_device(repo);
53121 -       if (result) {
53122 -               printk(KERN_ERR "%s:%u: storage_notification failed %d\n",
53123 -                      __func__, __LINE__, result);
53124 -               result = -ENODEV;
53125 -               goto fail_probe_notification;
53126 -       }
53127 -
53128         for (i = 0; i < num_regions; i++) {
53129                 unsigned int id;
53130                 u64 start, size;
53131 @@ -494,7 +408,6 @@
53132  
53133  fail_device_register:
53134  fail_read_region:
53135 -fail_probe_notification:
53136  fail_find_interrupt:
53137         kfree(p);
53138  fail_malloc:
53139 @@ -659,62 +572,268 @@
53140         return result;
53141  }
53142  
53143 +static void ps3_find_and_add_device(u64 bus_id, u64 dev_id)
53144 +{
53145 +       struct ps3_repository_device repo;
53146 +       int res;
53147 +       unsigned int retries;
53148 +       unsigned long rem;
53149 +
53150 +       /*
53151 +        * On some firmware versions (e.g. 1.90), the device may not show up
53152 +        * in the repository immediately
53153 +        */
53154 +       for (retries = 0; retries < 10; retries++) {
53155 +               res = ps3_repository_find_device_by_id(&repo, bus_id, dev_id);
53156 +               if (!res)
53157 +                       goto found;
53158 +
53159 +               rem = msleep_interruptible(100);
53160 +               if (rem)
53161 +                       break;
53162 +       }
53163 +       pr_warning("%s:%u: device %lu:%lu not found\n", __func__, __LINE__,
53164 +                  bus_id, dev_id);
53165 +       return;
53166 +
53167 +found:
53168 +       if (retries)
53169 +               pr_debug("%s:%u: device %lu:%lu found after %u retries\n",
53170 +                        __func__, __LINE__, bus_id, dev_id, retries);
53171 +
53172 +       ps3_register_repository_device(&repo);
53173 +       return;
53174 +}
53175 +
53176 +#define PS3_NOTIFICATION_DEV_ID                ULONG_MAX
53177 +#define PS3_NOTIFICATION_INTERRUPT_ID  0
53178 +
53179 +struct ps3_notification_device {
53180 +       struct ps3_system_bus_device sbd;
53181 +       spinlock_t lock;
53182 +       u64 tag;
53183 +       u64 lv1_status;
53184 +       struct completion done;
53185 +};
53186 +
53187 +enum ps3_notify_type {
53188 +       notify_device_ready = 0,
53189 +       notify_region_probe = 1,
53190 +       notify_region_update = 2,
53191 +};
53192 +
53193 +struct ps3_notify_cmd {
53194 +       u64 operation_code;             /* must be zero */
53195 +       u64 event_mask;                 /* OR of 1UL << enum ps3_notify_type */
53196 +};
53197 +
53198 +struct ps3_notify_event {
53199 +       u64 event_type;                 /* enum ps3_notify_type */
53200 +       u64 bus_id;
53201 +       u64 dev_id;
53202 +       u64 dev_type;
53203 +       u64 dev_port;
53204 +};
53205 +
53206 +static irqreturn_t ps3_notification_interrupt(int irq, void *data)
53207 +{
53208 +       struct ps3_notification_device *dev = data;
53209 +       int res;
53210 +       u64 tag, status;
53211 +
53212 +       spin_lock(&dev->lock);
53213 +       res = lv1_storage_get_async_status(PS3_NOTIFICATION_DEV_ID, &tag,
53214 +                                          &status);
53215 +       if (tag != dev->tag)
53216 +               pr_err("%s:%u: tag mismatch, got %lx, expected %lx\n",
53217 +                      __func__, __LINE__, tag, dev->tag);
53218 +
53219 +       if (res) {
53220 +               pr_err("%s:%u: res %d status 0x%lx\n", __func__, __LINE__, res,
53221 +                      status);
53222 +       } else {
53223 +               pr_debug("%s:%u: completed, status 0x%lx\n", __func__,
53224 +                        __LINE__, status);
53225 +               dev->lv1_status = status;
53226 +               complete(&dev->done);
53227 +       }
53228 +       spin_unlock(&dev->lock);
53229 +       return IRQ_HANDLED;
53230 +}
53231 +
53232 +static int ps3_notification_read_write(struct ps3_notification_device *dev,
53233 +                                      u64 lpar, int write)
53234 +{
53235 +       const char *op = write ? "write" : "read";
53236 +       unsigned long flags;
53237 +       int res;
53238 +
53239 +       init_completion(&dev->done);
53240 +       spin_lock_irqsave(&dev->lock, flags);
53241 +       res = write ? lv1_storage_write(dev->sbd.dev_id, 0, 0, 1, 0, lpar,
53242 +                                       &dev->tag)
53243 +                   : lv1_storage_read(dev->sbd.dev_id, 0, 0, 1, 0, lpar,
53244 +                                      &dev->tag);
53245 +       spin_unlock_irqrestore(&dev->lock, flags);
53246 +       if (res) {
53247 +               pr_err("%s:%u: %s failed %d\n", __func__, __LINE__, op, res);
53248 +               return -EPERM;
53249 +       }
53250 +       pr_debug("%s:%u: notification %s issued\n", __func__, __LINE__, op);
53251 +
53252 +       res = wait_event_interruptible(dev->done.wait,
53253 +                                      dev->done.done || kthread_should_stop());
53254 +       if (kthread_should_stop())
53255 +               res = -EINTR;
53256 +       if (res) {
53257 +               pr_debug("%s:%u: interrupted %s\n", __func__, __LINE__, op);
53258 +               return res;
53259 +       }
53260 +
53261 +       if (dev->lv1_status) {
53262 +               pr_err("%s:%u: %s not completed, status 0x%lx\n", __func__,
53263 +                      __LINE__, op, dev->lv1_status);
53264 +               return -EIO;
53265 +       }
53266 +       pr_debug("%s:%u: notification %s completed\n", __func__, __LINE__, op);
53267 +
53268 +       return 0;
53269 +}
53270 +
53271 +static struct task_struct *probe_task;
53272 +
53273  /**
53274   * ps3_probe_thread - Background repository probing at system startup.
53275   *
53276   * This implementation only supports background probing on a single bus.
53277 + * It uses the hypervisor's storage device notification mechanism to wait until
53278 + * a storage device is ready.  The device notification mechanism uses a
53279 + * pseudo device to asynchronously notify the guest when storage devices become
53280 + * ready.  The notification device has a block size of 512 bytes.
53281   */
53282  
53283  static int ps3_probe_thread(void *data)
53284  {
53285 -       struct ps3_repository_device *repo = data;
53286 -       int result;
53287 -       unsigned int ms = 250;
53288 +       struct ps3_notification_device dev;
53289 +       int res;
53290 +       unsigned int irq;
53291 +       u64 lpar;
53292 +       void *buf;
53293 +       struct ps3_notify_cmd *notify_cmd;
53294 +       struct ps3_notify_event *notify_event;
53295  
53296         pr_debug(" -> %s:%u: kthread started\n", __func__, __LINE__);
53297  
53298 -       do {
53299 -               try_to_freeze();
53300 +       buf = kzalloc(512, GFP_KERNEL);
53301 +       if (!buf)
53302 +               return -ENOMEM;
53303  
53304 -               pr_debug("%s:%u: probing...\n", __func__, __LINE__);
53305 +       lpar = ps3_mm_phys_to_lpar(__pa(buf));
53306 +       notify_cmd = buf;
53307 +       notify_event = buf;
53308 +
53309 +       /* dummy system bus device */
53310 +       dev.sbd.bus_id = (u64)data;
53311 +       dev.sbd.dev_id = PS3_NOTIFICATION_DEV_ID;
53312 +       dev.sbd.interrupt_id = PS3_NOTIFICATION_INTERRUPT_ID;
53313 +
53314 +       res = lv1_open_device(dev.sbd.bus_id, dev.sbd.dev_id, 0);
53315 +       if (res) {
53316 +               pr_err("%s:%u: lv1_open_device failed %s\n", __func__,
53317 +                      __LINE__, ps3_result(res));
53318 +               goto fail_free;
53319 +       }
53320 +
53321 +       res = ps3_sb_event_receive_port_setup(&dev.sbd, PS3_BINDING_CPU_ANY,
53322 +                                             &irq);
53323 +       if (res) {
53324 +               pr_err("%s:%u: ps3_sb_event_receive_port_setup failed %d\n",
53325 +                      __func__, __LINE__, res);
53326 +              goto fail_close_device;
53327 +       }
53328 +
53329 +       spin_lock_init(&dev.lock);
53330 +
53331 +       res = request_irq(irq, ps3_notification_interrupt, IRQF_DISABLED,
53332 +                         "ps3_notification", &dev);
53333 +       if (res) {
53334 +               pr_err("%s:%u: request_irq failed %d\n", __func__, __LINE__,
53335 +                      res);
53336 +               goto fail_sb_event_receive_port_destroy;
53337 +       }
53338 +
53339 +       /* Setup and write the request for device notification. */
53340 +       notify_cmd->operation_code = 0; /* must be zero */
53341 +       notify_cmd->event_mask = 1UL << notify_region_probe;
53342  
53343 -               do {
53344 -                       result = ps3_repository_find_device(repo);
53345 +       res = ps3_notification_read_write(&dev, lpar, 1);
53346 +       if (res)
53347 +               goto fail_free_irq;
53348  
53349 -                       if (result == -ENODEV)
53350 -                               pr_debug("%s:%u: nothing new\n", __func__,
53351 -                                       __LINE__);
53352 -                       else if (result)
53353 -                               pr_debug("%s:%u: find device error.\n",
53354 -                                       __func__, __LINE__);
53355 -                       else {
53356 -                               pr_debug("%s:%u: found device (%u:%u:%u)\n",
53357 -                                        __func__, __LINE__, repo->bus_index,
53358 -                                        repo->dev_index, repo->dev_type);
53359 -                               ps3_register_repository_device(repo);
53360 -                               ps3_repository_bump_device(repo);
53361 -                               ms = 250;
53362 -                       }
53363 -               } while (!result);
53364 +       /* Loop here processing the requested notification events. */
53365 +       do {
53366 +               try_to_freeze();
53367  
53368 -               pr_debug("%s:%u: ms %u\n", __func__, __LINE__, ms);
53369 +               memset(notify_event, 0, sizeof(*notify_event));
53370  
53371 -               if ( ms > 60000)
53372 +               res = ps3_notification_read_write(&dev, lpar, 0);
53373 +               if (res)
53374                         break;
53375  
53376 -               msleep_interruptible(ms);
53377 +               pr_debug("%s:%u: notify event type 0x%lx bus id %lu dev id %lu"
53378 +                        " type %lu port %lu\n", __func__, __LINE__,
53379 +                        notify_event->event_type, notify_event->bus_id,
53380 +                        notify_event->dev_id, notify_event->dev_type,
53381 +                        notify_event->dev_port);
53382 +
53383 +               if (notify_event->event_type != notify_region_probe ||
53384 +                   notify_event->bus_id != dev.sbd.bus_id) {
53385 +                       pr_warning("%s:%u: bad notify_event: event %lu, "
53386 +                                  "dev_id %lu, dev_type %lu\n",
53387 +                                  __func__, __LINE__, notify_event->event_type,
53388 +                                  notify_event->dev_id,
53389 +                                  notify_event->dev_type);
53390 +                       continue;
53391 +               }
53392  
53393 -               /* An exponential backoff. */
53394 -               ms <<= 1;
53395 +               ps3_find_and_add_device(dev.sbd.bus_id, notify_event->dev_id);
53396  
53397         } while (!kthread_should_stop());
53398  
53399 +fail_free_irq:
53400 +       free_irq(irq, &dev);
53401 +fail_sb_event_receive_port_destroy:
53402 +       ps3_sb_event_receive_port_destroy(&dev.sbd, irq);
53403 +fail_close_device:
53404 +       lv1_close_device(dev.sbd.bus_id, dev.sbd.dev_id);
53405 +fail_free:
53406 +       kfree(buf);
53407 +
53408 +       probe_task = NULL;
53409 +
53410         pr_debug(" <- %s:%u: kthread finished\n", __func__, __LINE__);
53411  
53412         return 0;
53413  }
53414  
53415  /**
53416 + * ps3_stop_probe_thread - Stops the background probe thread.
53417 + *
53418 + */
53419 +
53420 +static int ps3_stop_probe_thread(struct notifier_block *nb, unsigned long code,
53421 +                                void *data)
53422 +{
53423 +       if (probe_task)
53424 +               kthread_stop(probe_task);
53425 +       return 0;
53426 +}
53427 +
53428 +static struct notifier_block nb = {
53429 +       .notifier_call = ps3_stop_probe_thread
53430 +};
53431 +
53432 +/**
53433   * ps3_start_probe_thread - Starts the background probe thread.
53434   *
53435   */
53436 @@ -723,7 +842,7 @@
53437  {
53438         int result;
53439         struct task_struct *task;
53440 -       static struct ps3_repository_device repo; /* must be static */
53441 +       struct ps3_repository_device repo;
53442  
53443         pr_debug(" -> %s:%d\n", __func__, __LINE__);
53444  
53445 @@ -746,7 +865,8 @@
53446                 return -ENODEV;
53447         }
53448  
53449 -       task = kthread_run(ps3_probe_thread, &repo, "ps3-probe-%u", bus_type);
53450 +       task = kthread_run(ps3_probe_thread, (void *)repo.bus_id,
53451 +                          "ps3-probe-%u", bus_type);
53452  
53453         if (IS_ERR(task)) {
53454                 result = PTR_ERR(task);
53455 @@ -755,6 +875,9 @@
53456                 return result;
53457         }
53458  
53459 +       probe_task = task;
53460 +       register_reboot_notifier(&nb);
53461 +
53462         pr_debug(" <- %s:%d\n", __func__, __LINE__);
53463         return 0;
53464  }
53465 @@ -787,6 +910,8 @@
53466  
53467         ps3_register_sound_devices();
53468  
53469 +       ps3_register_lpm_devices();
53470 +
53471         pr_debug(" <- %s:%d\n", __func__, __LINE__);
53472         return 0;
53473  }
53474 --- a/arch/powerpc/platforms/ps3/mm.c
53475 +++ b/arch/powerpc/platforms/ps3/mm.c
53476 @@ -36,11 +36,6 @@
53477  #endif
53478  
53479  enum {
53480 -#if defined(CONFIG_PS3_USE_LPAR_ADDR)
53481 -       USE_LPAR_ADDR = 1,
53482 -#else
53483 -       USE_LPAR_ADDR = 0,
53484 -#endif
53485  #if defined(CONFIG_PS3_DYNAMIC_DMA)
53486         USE_DYNAMIC_DMA = 1,
53487  #else
53488 @@ -137,11 +132,8 @@
53489  unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr)
53490  {
53491         BUG_ON(is_kernel_addr(phys_addr));
53492 -       if (USE_LPAR_ADDR)
53493 -               return phys_addr;
53494 -       else
53495 -               return (phys_addr < map.rm.size || phys_addr >= map.total)
53496 -                       ? phys_addr : phys_addr + map.r1.offset;
53497 +       return (phys_addr < map.rm.size || phys_addr >= map.total)
53498 +               ? phys_addr : phys_addr + map.r1.offset;
53499  }
53500  
53501  EXPORT_SYMBOL(ps3_mm_phys_to_lpar);
53502 @@ -309,7 +301,7 @@
53503  
53504         BUG_ON(!mem_init_done);
53505  
53506 -       start_addr = USE_LPAR_ADDR ? map.r1.base : map.rm.size;
53507 +       start_addr = map.rm.size;
53508         start_pfn = start_addr >> PAGE_SHIFT;
53509         nr_pages = (map.r1.size + PAGE_SIZE - 1) >> PAGE_SHIFT;
53510  
53511 @@ -359,7 +351,7 @@
53512  static void  __maybe_unused _dma_dump_region(const struct ps3_dma_region *r,
53513         const char *func, int line)
53514  {
53515 -       DBG("%s:%d: dev        %u:%u\n", func, line, r->dev->bus_id,
53516 +       DBG("%s:%d: dev        %lu:%lu\n", func, line, r->dev->bus_id,
53517                 r->dev->dev_id);
53518         DBG("%s:%d: page_size  %u\n", func, line, r->page_size);
53519         DBG("%s:%d: bus_addr   %lxh\n", func, line, r->bus_addr);
53520 @@ -394,7 +386,7 @@
53521  static void _dma_dump_chunk (const struct dma_chunk* c, const char* func,
53522         int line)
53523  {
53524 -       DBG("%s:%d: r.dev        %u:%u\n", func, line,
53525 +       DBG("%s:%d: r.dev        %lu:%lu\n", func, line,
53526                 c->region->dev->bus_id, c->region->dev->dev_id);
53527         DBG("%s:%d: r.bus_addr   %lxh\n", func, line, c->region->bus_addr);
53528         DBG("%s:%d: r.page_size  %u\n", func, line, c->region->page_size);
53529 @@ -658,7 +650,7 @@
53530         BUG_ON(!r);
53531  
53532         if (!r->dev->bus_id) {
53533 -               pr_info("%s:%d: %u:%u no dma\n", __func__, __LINE__,
53534 +               pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__,
53535                         r->dev->bus_id, r->dev->dev_id);
53536                 return 0;
53537         }
53538 @@ -724,7 +716,7 @@
53539         BUG_ON(!r);
53540  
53541         if (!r->dev->bus_id) {
53542 -               pr_info("%s:%d: %u:%u no dma\n", __func__, __LINE__,
53543 +               pr_info("%s:%d: %lu:%lu no dma\n", __func__, __LINE__,
53544                         r->dev->bus_id, r->dev->dev_id);
53545                 return 0;
53546         }
53547 @@ -1007,7 +999,7 @@
53548  
53549         if (r->offset + r->len > map.rm.size) {
53550                 /* Map (part of) 2nd RAM chunk */
53551 -               virt_addr = USE_LPAR_ADDR ? map.r1.base : map.rm.size;
53552 +               virt_addr = map.rm.size;
53553                 len = r->len;
53554                 if (r->offset >= map.rm.size)
53555                         virt_addr += r->offset - map.rm.size;
53556 --- a/arch/powerpc/platforms/ps3/platform.h
53557 +++ b/arch/powerpc/platforms/ps3/platform.h
53558 @@ -89,13 +89,11 @@
53559         PS3_DEV_TYPE_STOR_ROM = TYPE_ROM,       /* 5 */
53560         PS3_DEV_TYPE_SB_GPIO = 6,
53561         PS3_DEV_TYPE_STOR_FLASH = TYPE_RBC,     /* 14 */
53562 -       PS3_DEV_TYPE_STOR_DUMMY = 32,
53563 -       PS3_DEV_TYPE_NOACCESS = 255,
53564  };
53565  
53566  int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str,
53567         u64 *value);
53568 -int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id);
53569 +int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id);
53570  int ps3_repository_read_bus_type(unsigned int bus_index,
53571         enum ps3_bus_type *bus_type);
53572  int ps3_repository_read_bus_num_dev(unsigned int bus_index,
53573 @@ -119,7 +117,7 @@
53574  int ps3_repository_read_dev_str(unsigned int bus_index,
53575         unsigned int dev_index, const char *dev_str, u64 *value);
53576  int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index,
53577 -       unsigned int *dev_id);
53578 +       u64 *dev_id);
53579  int ps3_repository_read_dev_type(unsigned int bus_index,
53580         unsigned int dev_index, enum ps3_dev_type *dev_type);
53581  int ps3_repository_read_dev_intr(unsigned int bus_index,
53582 @@ -138,21 +136,17 @@
53583  /* repository bus enumerators */
53584  
53585  struct ps3_repository_device {
53586 -       enum ps3_bus_type bus_type;
53587         unsigned int bus_index;
53588 -       unsigned int bus_id;
53589 -       enum ps3_dev_type dev_type;
53590         unsigned int dev_index;
53591 -       unsigned int dev_id;
53592 +       enum ps3_bus_type bus_type;
53593 +       enum ps3_dev_type dev_type;
53594 +       u64 bus_id;
53595 +       u64 dev_id;
53596  };
53597  
53598 -static inline struct ps3_repository_device *ps3_repository_bump_device(
53599 -       struct ps3_repository_device *repo)
53600 -{
53601 -       repo->dev_index++;
53602 -       return repo;
53603 -}
53604  int ps3_repository_find_device(struct ps3_repository_device *repo);
53605 +int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
53606 +                                    u64 bus_id, u64 dev_id);
53607  int ps3_repository_find_devices(enum ps3_bus_type bus_type,
53608         int (*callback)(const struct ps3_repository_device *repo));
53609  int ps3_repository_find_bus(enum ps3_bus_type bus_type, unsigned int from,
53610 @@ -186,10 +180,10 @@
53611         unsigned int dev_index, unsigned int region_index,
53612         unsigned int *region_id, u64 *region_start, u64 *region_size);
53613  
53614 -/* repository pu and memory info */
53615 +/* repository logical pu and memory info */
53616  
53617 -int ps3_repository_read_num_pu(unsigned int *num_pu);
53618 -int ps3_repository_read_ppe_id(unsigned int *pu_index, unsigned int *ppe_id);
53619 +int ps3_repository_read_num_pu(u64 *num_pu);
53620 +int ps3_repository_read_pu_id(unsigned int pu_index, u64 *pu_id);
53621  int ps3_repository_read_rm_base(unsigned int ppe_id, u64 *rm_base);
53622  int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size);
53623  int ps3_repository_read_region_total(u64 *region_total);
53624 @@ -200,9 +194,15 @@
53625  
53626  int ps3_repository_read_num_be(unsigned int *num_be);
53627  int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id);
53628 +int ps3_repository_read_be_id(u64 node_id, u64 *be_id);
53629  int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq);
53630  int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq);
53631  
53632 +/* repository performance monitor info */
53633 +
53634 +int ps3_repository_read_lpm_privileges(unsigned int be_index, u64 *lpar,
53635 +       u64 *rights);
53636 +
53637  /* repository 'Other OS' area */
53638  
53639  int ps3_repository_read_boot_dat_addr(u64 *lpar_addr);
53640 --- a/arch/powerpc/platforms/ps3/repository.c
53641 +++ b/arch/powerpc/platforms/ps3/repository.c
53642 @@ -33,7 +33,7 @@
53643  };
53644  
53645  #define dump_field(_a, _b) _dump_field(_a, _b, __func__, __LINE__)
53646 -static void _dump_field(const char *hdr, u64 n, const char* func, int line)
53647 +static void _dump_field(const char *hdr, u64 n, const char *func, int line)
53648  {
53649  #if defined(DEBUG)
53650         char s[16];
53651 @@ -50,8 +50,8 @@
53652  
53653  #define dump_node_name(_a, _b, _c, _d, _e) \
53654         _dump_node_name(_a, _b, _c, _d, _e, __func__, __LINE__)
53655 -static void _dump_node_name (unsigned int lpar_id, u64 n1, u64 n2, u64 n3,
53656 -       u64 n4, const char* func, int line)
53657 +static void _dump_node_name(unsigned int lpar_id, u64 n1, u64 n2, u64 n3,
53658 +       u64 n4, const char *func, int line)
53659  {
53660         pr_debug("%s:%d: lpar: %u\n", func, line, lpar_id);
53661         _dump_field("n1: ", n1, func, line);
53662 @@ -63,7 +63,7 @@
53663  #define dump_node(_a, _b, _c, _d, _e, _f, _g) \
53664         _dump_node(_a, _b, _c, _d, _e, _f, _g, __func__, __LINE__)
53665  static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
53666 -       u64 v1, u64 v2, const char* func, int line)
53667 +       u64 v1, u64 v2, const char *func, int line)
53668  {
53669         pr_debug("%s:%d: lpar: %u\n", func, line, lpar_id);
53670         _dump_field("n1: ", n1, func, line);
53671 @@ -165,21 +165,18 @@
53672                 make_first_field("bus", bus_index),
53673                 make_field(bus_str, 0),
53674                 0, 0,
53675 -               value, 0);
53676 +               value, NULL);
53677  }
53678  
53679 -int ps3_repository_read_bus_id(unsigned int bus_index, unsigned int *bus_id)
53680 +int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id)
53681  {
53682         int result;
53683 -       u64 v1;
53684 -       u64 v2; /* unused */
53685  
53686         result = read_node(PS3_LPAR_ID_PME,
53687                 make_first_field("bus", bus_index),
53688                 make_field("id", 0),
53689                 0, 0,
53690 -               &v1, &v2);
53691 -       *bus_id = v1;
53692 +               bus_id, NULL);
53693         return result;
53694  }
53695  
53696 @@ -193,7 +190,7 @@
53697                 make_first_field("bus", bus_index),
53698                 make_field("type", 0),
53699                 0, 0,
53700 -               &v1, 0);
53701 +               &v1, NULL);
53702         *bus_type = v1;
53703         return result;
53704  }
53705 @@ -208,7 +205,7 @@
53706                 make_first_field("bus", bus_index),
53707                 make_field("num_dev", 0),
53708                 0, 0,
53709 -               &v1, 0);
53710 +               &v1, NULL);
53711         *num_dev = v1;
53712         return result;
53713  }
53714 @@ -221,22 +218,20 @@
53715                 make_field("dev", dev_index),
53716                 make_field(dev_str, 0),
53717                 0,
53718 -               value, 0);
53719 +               value, NULL);
53720  }
53721  
53722  int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index,
53723 -       unsigned int *dev_id)
53724 +       u64 *dev_id)
53725  {
53726         int result;
53727 -       u64 v1;
53728  
53729         result = read_node(PS3_LPAR_ID_PME,
53730                 make_first_field("bus", bus_index),
53731                 make_field("dev", dev_index),
53732                 make_field("id", 0),
53733                 0,
53734 -               &v1, 0);
53735 -       *dev_id = v1;
53736 +               dev_id, NULL);
53737         return result;
53738  }
53739  
53740 @@ -251,14 +246,14 @@
53741                 make_field("dev", dev_index),
53742                 make_field("type", 0),
53743                 0,
53744 -               &v1, 0);
53745 +               &v1, NULL);
53746         *dev_type = v1;
53747         return result;
53748  }
53749  
53750  int ps3_repository_read_dev_intr(unsigned int bus_index,
53751         unsigned int dev_index, unsigned int intr_index,
53752 -       enum ps3_interrupt_type *intr_type, unsigned int* interrupt_id)
53753 +       enum ps3_interrupt_type *intr_type, unsigned int *interrupt_id)
53754  {
53755         int result;
53756         u64 v1;
53757 @@ -287,7 +282,7 @@
53758                 make_field("dev", dev_index),
53759                 make_field("reg", reg_index),
53760                 make_field("type", 0),
53761 -               &v1, 0);
53762 +               &v1, NULL);
53763         *reg_type = v1;
53764         return result;
53765  }
53766 @@ -332,7 +327,7 @@
53767                 return result;
53768         }
53769  
53770 -       pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %u, num_dev %u\n",
53771 +       pr_debug("%s:%d: bus_type %u, bus_index %u, bus_id %lu, num_dev %u\n",
53772                 __func__, __LINE__, tmp.bus_type, tmp.bus_index, tmp.bus_id,
53773                 num_dev);
53774  
53775 @@ -349,47 +344,95 @@
53776                 return result;
53777         }
53778  
53779 -       if (tmp.bus_type == PS3_BUS_TYPE_STORAGE) {
53780 -               /*
53781 -                * A storage device may show up in the repository before the
53782 -                * hypervisor has finished probing its type and regions
53783 -                */
53784 -               unsigned int num_regions;
53785 -
53786 -               if (tmp.dev_type == PS3_DEV_TYPE_STOR_DUMMY) {
53787 -                       pr_debug("%s:%u storage device not ready\n", __func__,
53788 -                                __LINE__);
53789 -                       return -ENODEV;
53790 -               }
53791 +       result = ps3_repository_read_dev_id(tmp.bus_index, tmp.dev_index,
53792 +               &tmp.dev_id);
53793  
53794 -               result = ps3_repository_read_stor_dev_num_regions(tmp.bus_index,
53795 -                                                                 tmp.dev_index,
53796 -                                                                 &num_regions);
53797 +       if (result) {
53798 +               pr_debug("%s:%d ps3_repository_read_dev_id failed\n", __func__,
53799 +               __LINE__);
53800 +               return result;
53801 +       }
53802 +
53803 +       pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %lu\n",
53804 +               __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id);
53805 +
53806 +       *repo = tmp;
53807 +       return 0;
53808 +}
53809 +
53810 +int ps3_repository_find_device_by_id(struct ps3_repository_device *repo,
53811 +                                    u64 bus_id, u64 dev_id)
53812 +{
53813 +       int result = -ENODEV;
53814 +       struct ps3_repository_device tmp;
53815 +       unsigned int num_dev;
53816 +
53817 +       pr_debug(" -> %s:%u: find device by id %lu:%lu\n", __func__, __LINE__,
53818 +                bus_id, dev_id);
53819 +
53820 +       for (tmp.bus_index = 0; tmp.bus_index < 10; tmp.bus_index++) {
53821 +               result = ps3_repository_read_bus_id(tmp.bus_index,
53822 +                                                   &tmp.bus_id);
53823                 if (result) {
53824 -                       pr_debug("%s:%d read_stor_dev_num_regions failed\n",
53825 -                                __func__, __LINE__);
53826 +                       pr_debug("%s:%u read_bus_id(%u) failed\n", __func__,
53827 +                                __LINE__, tmp.bus_index);
53828                         return result;
53829                 }
53830  
53831 -               if (!num_regions) {
53832 -                       pr_debug("%s:%u storage device has no regions yet\n",
53833 -                                __func__, __LINE__);
53834 -                       return -ENODEV;
53835 -               }
53836 +               if (tmp.bus_id == bus_id)
53837 +                       goto found_bus;
53838 +
53839 +               pr_debug("%s:%u: skip, bus_id %lu\n", __func__, __LINE__,
53840 +                        tmp.bus_id);
53841         }
53842 +       pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__);
53843 +       return result;
53844  
53845 -       result = ps3_repository_read_dev_id(tmp.bus_index, tmp.dev_index,
53846 -               &tmp.dev_id);
53847 +found_bus:
53848 +       result = ps3_repository_read_bus_type(tmp.bus_index, &tmp.bus_type);
53849 +       if (result) {
53850 +               pr_debug("%s:%u read_bus_type(%u) failed\n", __func__,
53851 +                        __LINE__, tmp.bus_index);
53852 +               return result;
53853 +       }
53854  
53855 +       result = ps3_repository_read_bus_num_dev(tmp.bus_index, &num_dev);
53856         if (result) {
53857 -               pr_debug("%s:%d ps3_repository_read_dev_id failed\n", __func__,
53858 -               __LINE__);
53859 +               pr_debug("%s:%u read_bus_num_dev failed\n", __func__,
53860 +                        __LINE__);
53861                 return result;
53862         }
53863  
53864 -       pr_debug("%s:%d: found: dev_type %u, dev_index %u, dev_id %u\n",
53865 -               __func__, __LINE__, tmp.dev_type, tmp.dev_index, tmp.dev_id);
53866 +       for (tmp.dev_index = 0; tmp.dev_index < num_dev; tmp.dev_index++) {
53867 +               result = ps3_repository_read_dev_id(tmp.bus_index,
53868 +                                                   tmp.dev_index,
53869 +                                                   &tmp.dev_id);
53870 +               if (result) {
53871 +                       pr_debug("%s:%u read_dev_id(%u:%u) failed\n", __func__,
53872 +                                __LINE__, tmp.bus_index, tmp.dev_index);
53873 +                       return result;
53874 +               }
53875 +
53876 +               if (tmp.dev_id == dev_id)
53877 +                       goto found_dev;
53878 +
53879 +               pr_debug("%s:%u: skip, dev_id %lu\n", __func__, __LINE__,
53880 +                        tmp.dev_id);
53881 +       }
53882 +       pr_debug(" <- %s:%u: dev not found\n", __func__, __LINE__);
53883 +       return result;
53884 +
53885 +found_dev:
53886 +       result = ps3_repository_read_dev_type(tmp.bus_index, tmp.dev_index,
53887 +                                             &tmp.dev_type);
53888 +       if (result) {
53889 +               pr_debug("%s:%u read_dev_type failed\n", __func__, __LINE__);
53890 +               return result;
53891 +       }
53892  
53893 +       pr_debug(" <- %s:%u: found: type (%u:%u) index (%u:%u) id (%lu:%lu)\n",
53894 +                __func__, __LINE__, tmp.bus_type, tmp.dev_type, tmp.bus_index,
53895 +                tmp.dev_index, tmp.bus_id, tmp.dev_id);
53896         *repo = tmp;
53897         return 0;
53898  }
53899 @@ -402,50 +445,34 @@
53900  
53901         pr_debug(" -> %s:%d: find bus_type %u\n", __func__, __LINE__, bus_type);
53902  
53903 -       for (repo.bus_index = 0; repo.bus_index < 10; repo.bus_index++) {
53904 +       repo.bus_type = bus_type;
53905 +       result = ps3_repository_find_bus(repo.bus_type, 0, &repo.bus_index);
53906 +       if (result) {
53907 +               pr_debug(" <- %s:%u: bus not found\n", __func__, __LINE__);
53908 +               return result;
53909 +       }
53910  
53911 -               result = ps3_repository_read_bus_type(repo.bus_index,
53912 -                       &repo.bus_type);
53913 +       result = ps3_repository_read_bus_id(repo.bus_index, &repo.bus_id);
53914 +       if (result) {
53915 +               pr_debug("%s:%d read_bus_id(%u) failed\n", __func__, __LINE__,
53916 +                        repo.bus_index);
53917 +               return result;
53918 +       }
53919  
53920 -               if (result) {
53921 -                       pr_debug("%s:%d read_bus_type(%u) failed\n",
53922 -                               __func__, __LINE__, repo.bus_index);
53923 +       for (repo.dev_index = 0; ; repo.dev_index++) {
53924 +               result = ps3_repository_find_device(&repo);
53925 +               if (result == -ENODEV) {
53926 +                       result = 0;
53927 +                       break;
53928 +               } else if (result)
53929                         break;
53930 -               }
53931 -
53932 -               if (repo.bus_type != bus_type) {
53933 -                       pr_debug("%s:%d: skip, bus_type %u\n", __func__,
53934 -                               __LINE__, repo.bus_type);
53935 -                       continue;
53936 -               }
53937 -
53938 -               result = ps3_repository_read_bus_id(repo.bus_index,
53939 -                       &repo.bus_id);
53940  
53941 +               result = callback(&repo);
53942                 if (result) {
53943 -                       pr_debug("%s:%d read_bus_id(%u) failed\n",
53944 -                               __func__, __LINE__, repo.bus_index);
53945 -                       continue;
53946 -               }
53947 -
53948 -               for (repo.dev_index = 0; ; repo.dev_index++) {
53949 -                       result = ps3_repository_find_device(&repo);
53950 -
53951 -                       if (result == -ENODEV) {
53952 -                               result = 0;
53953 -                               break;
53954 -                       } else if (result)
53955 -                               break;
53956 -
53957 -                       result = callback(&repo);
53958 -
53959 -                       if (result) {
53960 -                               pr_debug("%s:%d: abort at callback\n", __func__,
53961 -                                       __LINE__);
53962 -                               break;
53963 -                       }
53964 +                       pr_debug("%s:%d: abort at callback\n", __func__,
53965 +                               __LINE__);
53966 +                       break;
53967                 }
53968 -               break;
53969         }
53970  
53971         pr_debug(" <- %s:%d\n", __func__, __LINE__);
53972 @@ -561,7 +588,7 @@
53973                 make_first_field("bus", bus_index),
53974                 make_field("dev", dev_index),
53975                 make_field("port", 0),
53976 -               0, port, 0);
53977 +               0, port, NULL);
53978  }
53979  
53980  int ps3_repository_read_stor_dev_blk_size(unsigned int bus_index,
53981 @@ -571,7 +598,7 @@
53982                 make_first_field("bus", bus_index),
53983                 make_field("dev", dev_index),
53984                 make_field("blk_size", 0),
53985 -               0, blk_size, 0);
53986 +               0, blk_size, NULL);
53987  }
53988  
53989  int ps3_repository_read_stor_dev_num_blocks(unsigned int bus_index,
53990 @@ -581,7 +608,7 @@
53991                 make_first_field("bus", bus_index),
53992                 make_field("dev", dev_index),
53993                 make_field("n_blocks", 0),
53994 -               0, num_blocks, 0);
53995 +               0, num_blocks, NULL);
53996  }
53997  
53998  int ps3_repository_read_stor_dev_num_regions(unsigned int bus_index,
53999 @@ -594,7 +621,7 @@
54000                 make_first_field("bus", bus_index),
54001                 make_field("dev", dev_index),
54002                 make_field("n_regs", 0),
54003 -               0, &v1, 0);
54004 +               0, &v1, NULL);
54005         *num_regions = v1;
54006         return result;
54007  }
54008 @@ -611,7 +638,7 @@
54009             make_field("dev", dev_index),
54010             make_field("region", region_index),
54011             make_field("id", 0),
54012 -           &v1, 0);
54013 +           &v1, NULL);
54014         *region_id = v1;
54015         return result;
54016  }
54017 @@ -624,7 +651,7 @@
54018             make_field("dev", dev_index),
54019             make_field("region", region_index),
54020             make_field("size", 0),
54021 -           region_size, 0);
54022 +           region_size, NULL);
54023  }
54024  
54025  int ps3_repository_read_stor_dev_region_start(unsigned int bus_index,
54026 @@ -635,7 +662,7 @@
54027             make_field("dev", dev_index),
54028             make_field("region", region_index),
54029             make_field("start", 0),
54030 -           region_start, 0);
54031 +           region_start, NULL);
54032  }
54033  
54034  int ps3_repository_read_stor_dev_info(unsigned int bus_index,
54035 @@ -684,6 +711,35 @@
54036         return result;
54037  }
54038  
54039 +/**
54040 + * ps3_repository_read_num_pu - Number of logical PU processors for this lpar.
54041 + */
54042 +
54043 +int ps3_repository_read_num_pu(u64 *num_pu)
54044 +{
54045 +       *num_pu = 0;
54046 +       return read_node(PS3_LPAR_ID_CURRENT,
54047 +                          make_first_field("bi", 0),
54048 +                          make_field("pun", 0),
54049 +                          0, 0,
54050 +                          num_pu, NULL);
54051 +}
54052 +
54053 +/**
54054 + * ps3_repository_read_pu_id - Read the logical PU id.
54055 + * @pu_index: Zero based index.
54056 + * @pu_id: The logical PU id.
54057 + */
54058 +
54059 +int ps3_repository_read_pu_id(unsigned int pu_index, u64 *pu_id)
54060 +{
54061 +       return read_node(PS3_LPAR_ID_CURRENT,
54062 +               make_first_field("bi", 0),
54063 +               make_field("pu", pu_index),
54064 +               0, 0,
54065 +               pu_id, NULL);
54066 +}
54067 +
54068  int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size)
54069  {
54070         return read_node(PS3_LPAR_ID_CURRENT,
54071 @@ -691,7 +747,7 @@
54072                 make_field("pu", 0),
54073                 ppe_id,
54074                 make_field("rm_size", 0),
54075 -               rm_size, 0);
54076 +               rm_size, NULL);
54077  }
54078  
54079  int ps3_repository_read_region_total(u64 *region_total)
54080 @@ -700,7 +756,7 @@
54081                 make_first_field("bi", 0),
54082                 make_field("rgntotal", 0),
54083                 0, 0,
54084 -               region_total, 0);
54085 +               region_total, NULL);
54086  }
54087  
54088  /**
54089 @@ -736,7 +792,7 @@
54090                 make_first_field("bi", 0),
54091                 make_field("spun", 0),
54092                 0, 0,
54093 -               &v1, 0);
54094 +               &v1, NULL);
54095         *num_spu_reserved = v1;
54096         return result;
54097  }
54098 @@ -755,7 +811,7 @@
54099                 make_first_field("bi", 0),
54100                 make_field("spursvn", 0),
54101                 0, 0,
54102 -               &v1, 0);
54103 +               &v1, NULL);
54104         *num_resource_id = v1;
54105         return result;
54106  }
54107 @@ -768,7 +824,7 @@
54108   */
54109  
54110  int ps3_repository_read_spu_resource_id(unsigned int res_index,
54111 -       enum ps3_spu_resource_type* resource_type, unsigned int *resource_id)
54112 +       enum ps3_spu_resource_type *resource_type, unsigned int *resource_id)
54113  {
54114         int result;
54115         u64 v1;
54116 @@ -785,14 +841,14 @@
54117         return result;
54118  }
54119  
54120 -int ps3_repository_read_boot_dat_address(u64 *address)
54121 +static int ps3_repository_read_boot_dat_address(u64 *address)
54122  {
54123         return read_node(PS3_LPAR_ID_CURRENT,
54124                 make_first_field("bi", 0),
54125                 make_field("boot_dat", 0),
54126                 make_field("address", 0),
54127                 0,
54128 -               address, 0);
54129 +               address, NULL);
54130  }
54131  
54132  int ps3_repository_read_boot_dat_size(unsigned int *size)
54133 @@ -805,7 +861,7 @@
54134                 make_field("boot_dat", 0),
54135                 make_field("size", 0),
54136                 0,
54137 -               &v1, 0);
54138 +               &v1, NULL);
54139         *size = v1;
54140         return result;
54141  }
54142 @@ -820,7 +876,7 @@
54143                 make_field("vir_uart", 0),
54144                 make_field("port", 0),
54145                 make_field("avset", 0),
54146 -               &v1, 0);
54147 +               &v1, NULL);
54148         *port = v1;
54149         return result;
54150  }
54151 @@ -835,7 +891,7 @@
54152                 make_field("vir_uart", 0),
54153                 make_field("port", 0),
54154                 make_field("sysmgr", 0),
54155 -               &v1, 0);
54156 +               &v1, NULL);
54157         *port = v1;
54158         return result;
54159  }
54160 @@ -856,6 +912,10 @@
54161                 : ps3_repository_read_boot_dat_size(size);
54162  }
54163  
54164 +/**
54165 + * ps3_repository_read_num_be - Number of physical BE processors in the system.
54166 + */
54167 +
54168  int ps3_repository_read_num_be(unsigned int *num_be)
54169  {
54170         int result;
54171 @@ -866,11 +926,17 @@
54172                 0,
54173                 0,
54174                 0,
54175 -               &v1, 0);
54176 +               &v1, NULL);
54177         *num_be = v1;
54178         return result;
54179  }
54180  
54181 +/**
54182 + * ps3_repository_read_be_node_id - Read the physical BE processor node id.
54183 + * @be_index: Zero based index.
54184 + * @node_id: The BE processor node id.
54185 + */
54186 +
54187  int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id)
54188  {
54189         return read_node(PS3_LPAR_ID_PME,
54190 @@ -878,7 +944,23 @@
54191                 0,
54192                 0,
54193                 0,
54194 -               node_id, 0);
54195 +               node_id, NULL);
54196 +}
54197 +
54198 +/**
54199 + * ps3_repository_read_be_id - Read the physical BE processor id.
54200 + * @node_id: The BE processor node id.
54201 + * @be_id: The BE processor id.
54202 + */
54203 +
54204 +int ps3_repository_read_be_id(u64 node_id, u64 *be_id)
54205 +{
54206 +       return read_node(PS3_LPAR_ID_PME,
54207 +               make_first_field("be", 0),
54208 +               node_id,
54209 +               0,
54210 +               0,
54211 +               be_id, NULL);
54212  }
54213  
54214  int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq)
54215 @@ -888,7 +970,7 @@
54216                 node_id,
54217                 make_field("clock", 0),
54218                 0,
54219 -               tb_freq, 0);
54220 +               tb_freq, NULL);
54221  }
54222  
54223  int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq)
54224 @@ -897,11 +979,29 @@
54225         u64 node_id;
54226  
54227         *tb_freq = 0;
54228 -       result = ps3_repository_read_be_node_id(0, &node_id);
54229 +       result = ps3_repository_read_be_node_id(be_index, &node_id);
54230         return result ? result
54231                 : ps3_repository_read_tb_freq(node_id, tb_freq);
54232  }
54233  
54234 +int ps3_repository_read_lpm_privileges(unsigned int be_index, u64 *lpar,
54235 +       u64 *rights)
54236 +{
54237 +       int result;
54238 +       u64 node_id;
54239 +
54240 +       *lpar = 0;
54241 +       *rights = 0;
54242 +       result = ps3_repository_read_be_node_id(be_index, &node_id);
54243 +       return result ? result
54244 +               : read_node(PS3_LPAR_ID_PME,
54245 +                           make_first_field("be", 0),
54246 +                           node_id,
54247 +                           make_field("lpm", 0),
54248 +                           make_field("priv", 0),
54249 +                           lpar, rights);
54250 +}
54251 +
54252  #if defined(DEBUG)
54253  
54254  int ps3_repository_dump_resource_info(const struct ps3_repository_device *repo)
54255 @@ -1034,7 +1134,7 @@
54256                         continue;
54257                 }
54258  
54259 -               pr_debug("%s:%d  (%u:%u): dev_type %u, dev_id %u\n", __func__,
54260 +               pr_debug("%s:%d  (%u:%u): dev_type %u, dev_id %lu\n", __func__,
54261                         __LINE__, repo->bus_index, repo->dev_index,
54262                         repo->dev_type, repo->dev_id);
54263  
54264 @@ -1091,7 +1191,7 @@
54265                         continue;
54266                 }
54267  
54268 -               pr_debug("%s:%d bus_%u: bus_type %u, bus_id %u, num_dev %u\n",
54269 +               pr_debug("%s:%d bus_%u: bus_type %u, bus_id %lu, num_dev %u\n",
54270                         __func__, __LINE__, repo.bus_index, repo.bus_type,
54271                         repo.bus_id, num_dev);
54272  
54273 --- a/arch/powerpc/platforms/ps3/spu.c
54274 +++ b/arch/powerpc/platforms/ps3/spu.c
54275 @@ -28,6 +28,7 @@
54276  #include <asm/spu_priv1.h>
54277  #include <asm/lv1call.h>
54278  
54279 +#include "../cell/spufs/spufs.h"
54280  #include "platform.h"
54281  
54282  /* spu_management_ops */
54283 @@ -419,10 +420,34 @@
54284         return 0;
54285  }
54286  
54287 +/**
54288 + * ps3_enable_spu - Enable SPU run control.
54289 + *
54290 + * An outstanding enhancement for the PS3 would be to add a guard to check
54291 + * for incorrect access to the spu problem state when the spu context is
54292 + * disabled.  This check could be implemented with a flag added to the spu
54293 + * context that would inhibit mapping problem state pages, and a routine
54294 + * to unmap spu problem state pages.  When the spu is enabled with
54295 + * ps3_enable_spu() the flag would be set allowing pages to be mapped,
54296 + * and when the spu is disabled with ps3_disable_spu() the flag would be
54297 + * cleared and the mapped problem state pages would be unmapped.
54298 + */
54299 +
54300 +static void ps3_enable_spu(struct spu_context *ctx)
54301 +{
54302 +}
54303 +
54304 +static void ps3_disable_spu(struct spu_context *ctx)
54305 +{
54306 +       ctx->ops->runcntl_stop(ctx);
54307 +}
54308 +
54309  const struct spu_management_ops spu_management_ps3_ops = {
54310         .enumerate_spus = ps3_enumerate_spus,
54311         .create_spu = ps3_create_spu,
54312         .destroy_spu = ps3_destroy_spu,
54313 +       .enable_spu = ps3_enable_spu,
54314 +       .disable_spu = ps3_disable_spu,
54315         .init_affinity = ps3_init_affinity,
54316  };
54317  
54318 @@ -505,8 +530,6 @@
54319         static const u64 allowed = ~(MFC_STATE1_LOCAL_STORAGE_DECODE_MASK
54320                 | MFC_STATE1_PROBLEM_STATE_MASK);
54321  
54322 -       sr1 |= MFC_STATE1_MASTER_RUN_CONTROL_MASK;
54323 -
54324         BUG_ON((sr1 & allowed) != (spu_pdata(spu)->cache.sr1 & allowed));
54325  
54326         spu_pdata(spu)->cache.sr1 = sr1;
54327 --- a/arch/powerpc/platforms/ps3/system-bus.c
54328 +++ b/arch/powerpc/platforms/ps3/system-bus.c
54329 @@ -42,8 +42,8 @@
54330         int gpu;
54331  } static usage_hack;
54332  
54333 -static int ps3_is_device(struct ps3_system_bus_device *dev,
54334 -                        unsigned int bus_id, unsigned int dev_id)
54335 +static int ps3_is_device(struct ps3_system_bus_device *dev, u64 bus_id,
54336 +                        u64 dev_id)
54337  {
54338         return dev->bus_id == bus_id && dev->dev_id == dev_id;
54339  }
54340 @@ -182,8 +182,8 @@
54341         case PS3_MATCH_ID_SYSTEM_MANAGER:
54342                 pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
54343                         __LINE__, dev->match_id);
54344 -               pr_debug("%s:%d: bus_id: %u\n", __func__,
54345 -                       __LINE__, dev->bus_id);
54346 +               pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
54347 +                       dev->bus_id);
54348                 BUG();
54349                 return -EINVAL;
54350  
54351 @@ -220,8 +220,8 @@
54352         case PS3_MATCH_ID_SYSTEM_MANAGER:
54353                 pr_debug("%s:%d: unsupported match_id: %u\n", __func__,
54354                         __LINE__, dev->match_id);
54355 -               pr_debug("%s:%d: bus_id: %u\n", __func__,
54356 -                       __LINE__, dev->bus_id);
54357 +               pr_debug("%s:%d: bus_id: %lu\n", __func__, __LINE__,
54358 +                       dev->bus_id);
54359                 BUG();
54360                 return -EINVAL;
54361  
54362 @@ -240,7 +240,7 @@
54363  static void _dump_mmio_region(const struct ps3_mmio_region* r,
54364         const char* func, int line)
54365  {
54366 -       pr_debug("%s:%d: dev       %u:%u\n", func, line, r->dev->bus_id,
54367 +       pr_debug("%s:%d: dev       %lu:%lu\n", func, line, r->dev->bus_id,
54368                 r->dev->dev_id);
54369         pr_debug("%s:%d: bus_addr  %lxh\n", func, line, r->bus_addr);
54370         pr_debug("%s:%d: len       %lxh\n", func, line, r->len);
54371 @@ -715,6 +715,7 @@
54372         static unsigned int dev_ioc0_count;
54373         static unsigned int dev_sb_count;
54374         static unsigned int dev_vuart_count;
54375 +       static unsigned int dev_lpm_count;
54376  
54377         if (!dev->core.parent)
54378                 dev->core.parent = &ps3_system_bus;
54379 @@ -737,6 +738,10 @@
54380                 snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
54381                         "vuart_%02x", ++dev_vuart_count);
54382                 break;
54383 +       case PS3_DEVICE_TYPE_LPM:
54384 +               snprintf(dev->core.bus_id, sizeof(dev->core.bus_id),
54385 +                       "lpm_%02x", ++dev_lpm_count);
54386 +               break;
54387         default:
54388                 BUG();
54389         };
54390 --- a/arch/powerpc/platforms/pseries/eeh.c
54391 +++ b/arch/powerpc/platforms/pseries/eeh.c
54392 @@ -29,6 +29,8 @@
54393  #include <linux/rbtree.h>
54394  #include <linux/seq_file.h>
54395  #include <linux/spinlock.h>
54396 +#include <linux/of.h>
54397 +
54398  #include <asm/atomic.h>
54399  #include <asm/eeh.h>
54400  #include <asm/eeh_event.h>
54401 @@ -169,7 +171,6 @@
54402   */
54403  static size_t gather_pci_data(struct pci_dn *pdn, char * buf, size_t len)
54404  {
54405 -       struct device_node *dn;
54406         struct pci_dev *dev = pdn->pcidev;
54407         u32 cfg;
54408         int cap, i;
54409 @@ -243,12 +244,12 @@
54410  
54411         /* Gather status on devices under the bridge */
54412         if (dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) {
54413 -               dn = pdn->node->child;
54414 -               while (dn) {
54415 +               struct device_node *dn;
54416 +
54417 +               for_each_child_of_node(pdn->node, dn) {
54418                         pdn = PCI_DN(dn);
54419                         if (pdn)
54420                                 n += gather_pci_data(pdn, buf+n, len-n);
54421 -                       dn = dn->sibling;
54422                 }
54423         }
54424  
54425 @@ -372,7 +373,7 @@
54426         return dn;
54427  }
54428  
54429 -/** Mark all devices that are peers of this device as failed.
54430 +/** Mark all devices that are children of this device as failed.
54431   *  Mark the device driver too, so that it can see the failure
54432   *  immediately; this is critical, since some drivers poll
54433   *  status registers in interrupts ... If a driver is polling,
54434 @@ -380,9 +381,11 @@
54435   *  an interrupt context, which is bad.
54436   */
54437  
54438 -static void __eeh_mark_slot (struct device_node *dn, int mode_flag)
54439 +static void __eeh_mark_slot(struct device_node *parent, int mode_flag)
54440  {
54441 -       while (dn) {
54442 +       struct device_node *dn;
54443 +
54444 +       for_each_child_of_node(parent, dn) {
54445                 if (PCI_DN(dn)) {
54446                         /* Mark the pci device driver too */
54447                         struct pci_dev *dev = PCI_DN(dn)->pcidev;
54448 @@ -392,10 +395,8 @@
54449                         if (dev && dev->driver)
54450                                 dev->error_state = pci_channel_io_frozen;
54451  
54452 -                       if (dn->child)
54453 -                               __eeh_mark_slot (dn->child, mode_flag);
54454 +                       __eeh_mark_slot(dn, mode_flag);
54455                 }
54456 -               dn = dn->sibling;
54457         }
54458  }
54459  
54460 @@ -415,19 +416,19 @@
54461         if (dev)
54462                 dev->error_state = pci_channel_io_frozen;
54463  
54464 -       __eeh_mark_slot (dn->child, mode_flag);
54465 +       __eeh_mark_slot(dn, mode_flag);
54466  }
54467  
54468 -static void __eeh_clear_slot (struct device_node *dn, int mode_flag)
54469 +static void __eeh_clear_slot(struct device_node *parent, int mode_flag)
54470  {
54471 -       while (dn) {
54472 +       struct device_node *dn;
54473 +
54474 +       for_each_child_of_node(parent, dn) {
54475                 if (PCI_DN(dn)) {
54476                         PCI_DN(dn)->eeh_mode &= ~mode_flag;
54477                         PCI_DN(dn)->eeh_check_count = 0;
54478 -                       if (dn->child)
54479 -                               __eeh_clear_slot (dn->child, mode_flag);
54480 +                       __eeh_clear_slot(dn, mode_flag);
54481                 }
54482 -               dn = dn->sibling;
54483         }
54484  }
54485  
54486 @@ -444,7 +445,7 @@
54487  
54488         PCI_DN(dn)->eeh_mode &= ~mode_flag;
54489         PCI_DN(dn)->eeh_check_count = 0;
54490 -       __eeh_clear_slot (dn->child, mode_flag);
54491 +       __eeh_clear_slot(dn, mode_flag);
54492         spin_unlock_irqrestore(&confirm_error_lock, flags);
54493  }
54494  
54495 @@ -480,6 +481,7 @@
54496                 no_dn++;
54497                 return 0;
54498         }
54499 +       dn = find_device_pe(dn);
54500         pdn = PCI_DN(dn);
54501  
54502         /* Access to IO BARs might get this far and still not want checking. */
54503 @@ -545,7 +547,7 @@
54504  
54505         /* Note that config-io to empty slots may fail;
54506          * they are empty when they don't have children. */
54507 -       if ((rets[0] == 5) && (dn->child == NULL)) {
54508 +       if ((rets[0] == 5) && (rets[2] == 0) && (dn->child == NULL)) {
54509                 false_positives++;
54510                 pdn->eeh_false_positives ++;
54511                 rc = 0;
54512 @@ -848,11 +850,8 @@
54513         if ((pdn->eeh_mode & EEH_MODE_SUPPORTED) && !IS_BRIDGE(pdn->class_code))
54514                 __restore_bars (pdn);
54515  
54516 -       dn = pdn->node->child;
54517 -       while (dn) {
54518 +       for_each_child_of_node(pdn->node, dn)
54519                 eeh_restore_bars (PCI_DN(dn));
54520 -               dn = dn->sibling;
54521 -       }
54522  }
54523  
54524  /**
54525 @@ -1130,7 +1129,8 @@
54526  void eeh_add_device_tree_early(struct device_node *dn)
54527  {
54528         struct device_node *sib;
54529 -       for (sib = dn->child; sib; sib = sib->sibling)
54530 +
54531 +       for_each_child_of_node(dn, sib)
54532                 eeh_add_device_tree_early(sib);
54533         eeh_add_device_early(dn);
54534  }
54535 --- a/arch/powerpc/platforms/pseries/eeh_driver.c
54536 +++ b/arch/powerpc/platforms/pseries/eeh_driver.c
54537 @@ -310,8 +310,6 @@
54538         const char *location, *pci_str, *drv_str;
54539  
54540         frozen_dn = find_device_pe(event->dn);
54541 -       frozen_bus = pcibios_find_pci_bus(frozen_dn);
54542 -
54543         if (!frozen_dn) {
54544  
54545                 location = of_get_property(event->dn, "ibm,loc-code", NULL);
54546 @@ -321,6 +319,8 @@
54547                         location, pci_name(event->dev));
54548                 return NULL;
54549         }
54550 +
54551 +       frozen_bus = pcibios_find_pci_bus(frozen_dn);
54552         location = of_get_property(frozen_dn, "ibm,loc-code", NULL);
54553         location = location ? location : "unknown";
54554  
54555 @@ -354,13 +354,6 @@
54556         if (frozen_pdn->eeh_freeze_count > EEH_MAX_ALLOWED_FREEZES)
54557                 goto excess_failures;
54558  
54559 -       /* Get the current PCI slot state. */
54560 -       rc = eeh_wait_for_slot_status (frozen_pdn, MAX_WAIT_FOR_RECOVERY*1000);
54561 -       if (rc < 0) {
54562 -               printk(KERN_WARNING "EEH: Permanent failure\n");
54563 -               goto hard_fail;
54564 -       }
54565 -
54566         printk(KERN_WARNING
54567            "EEH: This PCI device has failed %d times in the last hour:\n",
54568                 frozen_pdn->eeh_freeze_count);
54569 @@ -376,6 +369,14 @@
54570          */
54571         pci_walk_bus(frozen_bus, eeh_report_error, &result);
54572  
54573 +       /* Get the current PCI slot state. This can take a long time,
54574 +        * sometimes over 3 seconds for certain systems. */
54575 +       rc = eeh_wait_for_slot_status (frozen_pdn, MAX_WAIT_FOR_RECOVERY*1000);
54576 +       if (rc < 0) {
54577 +               printk(KERN_WARNING "EEH: Permanent failure\n");
54578 +               goto hard_fail;
54579 +       }
54580 +
54581         /* Since rtas may enable MMIO when posting the error log,
54582          * don't post the error log until after all dev drivers
54583          * have been informed.
54584 --- a/arch/powerpc/platforms/pseries/iommu.c
54585 +++ b/arch/powerpc/platforms/pseries/iommu.c
54586 @@ -251,7 +251,7 @@
54587         const unsigned long *basep;
54588         const u32 *sizep;
54589  
54590 -       node = (struct device_node *)phb->arch_data;
54591 +       node = phb->dn;
54592  
54593         basep = of_get_property(node, "linux,tce-base", NULL);
54594         sizep = of_get_property(node, "linux,tce-size", NULL);
54595 @@ -296,11 +296,12 @@
54596  static void iommu_table_setparms_lpar(struct pci_controller *phb,
54597                                       struct device_node *dn,
54598                                       struct iommu_table *tbl,
54599 -                                     const void *dma_window)
54600 +                                     const void *dma_window,
54601 +                                     int bussubno)
54602  {
54603         unsigned long offset, size;
54604  
54605 -       tbl->it_busno  = PCI_DN(dn)->bussubno;
54606 +       tbl->it_busno  = bussubno;
54607         of_parse_dma_window(dn, dma_window, &tbl->it_index, &offset, &size);
54608  
54609         tbl->it_base   = 0;
54610 @@ -420,17 +421,10 @@
54611             pdn->full_name, ppci->iommu_table);
54612  
54613         if (!ppci->iommu_table) {
54614 -               /* Bussubno hasn't been copied yet.
54615 -                * Do it now because iommu_table_setparms_lpar needs it.
54616 -                */
54617 -
54618 -               ppci->bussubno = bus->number;
54619 -
54620                 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
54621                                    ppci->phb->node);
54622 -
54623 -               iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window);
54624 -
54625 +               iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window,
54626 +                       bus->number);
54627                 ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node);
54628                 DBG("  created table: %p\n", ppci->iommu_table);
54629         }
54630 @@ -523,14 +517,10 @@
54631  
54632         pci = PCI_DN(pdn);
54633         if (!pci->iommu_table) {
54634 -               /* iommu_table_setparms_lpar needs bussubno. */
54635 -               pci->bussubno = pci->phb->bus->number;
54636 -
54637                 tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
54638                                    pci->phb->node);
54639 -
54640 -               iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window);
54641 -
54642 +               iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window,
54643 +                       pci->phb->bus->number);
54644                 pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
54645                 DBG("  created table: %p\n", pci->iommu_table);
54646         } else {
54647 @@ -556,7 +546,7 @@
54648         case PSERIES_RECONFIG_REMOVE:
54649                 if (pci && pci->iommu_table &&
54650                     of_get_property(np, "ibm,dma-window", NULL))
54651 -                       iommu_free_table(np);
54652 +                       iommu_free_table(pci->iommu_table, np->full_name);
54653                 break;
54654         default:
54655                 err = NOTIFY_DONE;
54656 --- a/arch/powerpc/platforms/pseries/pci_dlpar.c
54657 +++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
54658 @@ -83,7 +83,7 @@
54659  
54660  /* Must be called before pci_bus_add_devices */
54661  void
54662 -pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus)
54663 +pcibios_fixup_new_pci_devices(struct pci_bus *bus)
54664  {
54665         struct pci_dev *dev;
54666  
54667 @@ -98,8 +98,6 @@
54668                         /* Fill device archdata and setup iommu table */
54669                         pcibios_setup_new_device(dev);
54670  
54671 -                       if(fix_bus)
54672 -                               pcibios_fixup_device_resources(dev, bus);
54673                         pci_read_irq_line(dev);
54674                         for (i = 0; i < PCI_NUM_RESOURCES; i++) {
54675                                 struct resource *r = &dev->resource[i];
54676 @@ -132,8 +130,8 @@
54677  
54678         pci_scan_child_bus(child_bus);
54679  
54680 -       /* Fixup new pci devices without touching bus struct */
54681 -       pcibios_fixup_new_pci_devices(child_bus, 0);
54682 +       /* Fixup new pci devices */
54683 +       pcibios_fixup_new_pci_devices(child_bus);
54684  
54685         /* Make the discovered devices available */
54686         pci_bus_add_devices(child_bus);
54687 @@ -169,7 +167,7 @@
54688                 /* use ofdt-based probe */
54689                 of_scan_bus(dn, bus);
54690                 if (!list_empty(&bus->devices)) {
54691 -                       pcibios_fixup_new_pci_devices(bus, 0);
54692 +                       pcibios_fixup_new_pci_devices(bus);
54693                         pci_bus_add_devices(bus);
54694                         eeh_add_device_tree_late(bus);
54695                 }
54696 @@ -178,7 +176,7 @@
54697                 slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
54698                 num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
54699                 if (num) {
54700 -                       pcibios_fixup_new_pci_devices(bus, 1);
54701 +                       pcibios_fixup_new_pci_devices(bus);
54702                         pci_bus_add_devices(bus);
54703                         eeh_add_device_tree_late(bus);
54704                 }
54705 @@ -208,7 +206,7 @@
54706                 eeh_add_device_tree_early(dn);
54707  
54708         scan_phb(phb);
54709 -       pcibios_fixup_new_pci_devices(phb->bus, 0);
54710 +       pcibios_fixup_new_pci_devices(phb->bus);
54711         pci_bus_add_devices(phb->bus);
54712         eeh_add_device_tree_late(phb->bus);
54713  
54714 --- a/arch/powerpc/platforms/pseries/plpar_wrappers.h
54715 +++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h
54716 @@ -8,11 +8,6 @@
54717         return plpar_hcall_norets(H_POLL_PENDING);
54718  }
54719  
54720 -static inline long prod_processor(void)
54721 -{
54722 -       return plpar_hcall_norets(H_PROD);
54723 -}
54724 -
54725  static inline long cede_processor(void)
54726  {
54727         return plpar_hcall_norets(H_CEDE);
54728 --- a/arch/powerpc/platforms/pseries/smp.c
54729 +++ b/arch/powerpc/platforms/pseries/smp.c
54730 @@ -46,6 +46,7 @@
54731  #include <asm/pSeries_reconfig.h>
54732  #include <asm/mpic.h>
54733  #include <asm/vdso_datapage.h>
54734 +#include <asm/cputhreads.h>
54735  
54736  #include "plpar_wrappers.h"
54737  #include "pseries.h"
54738 @@ -202,7 +203,7 @@
54739          */
54740         if (system_state < SYSTEM_RUNNING &&
54741             cpu_has_feature(CPU_FTR_SMT) &&
54742 -           !smt_enabled_at_boot && nr % 2 != 0)
54743 +           !smt_enabled_at_boot && cpu_thread_in_core(nr) != 0)
54744                 return 0;
54745  
54746         return 1;
54747 --- a/arch/powerpc/platforms/pseries/xics.c
54748 +++ b/arch/powerpc/platforms/pseries/xics.c
54749 @@ -87,19 +87,25 @@
54750  /* Direct HW low level accessors */
54751  
54752  
54753 -static inline unsigned int direct_xirr_info_get(int n_cpu)
54754 +static inline unsigned int direct_xirr_info_get(void)
54755  {
54756 -       return in_be32(&xics_per_cpu[n_cpu]->xirr.word);
54757 +       int cpu = smp_processor_id();
54758 +
54759 +       return in_be32(&xics_per_cpu[cpu]->xirr.word);
54760  }
54761  
54762 -static inline void direct_xirr_info_set(int n_cpu, int value)
54763 +static inline void direct_xirr_info_set(int value)
54764  {
54765 -       out_be32(&xics_per_cpu[n_cpu]->xirr.word, value);
54766 +       int cpu = smp_processor_id();
54767 +
54768 +       out_be32(&xics_per_cpu[cpu]->xirr.word, value);
54769  }
54770  
54771 -static inline void direct_cppr_info(int n_cpu, u8 value)
54772 +static inline void direct_cppr_info(u8 value)
54773  {
54774 -       out_8(&xics_per_cpu[n_cpu]->xirr.bytes[0], value);
54775 +       int cpu = smp_processor_id();
54776 +
54777 +       out_8(&xics_per_cpu[cpu]->xirr.bytes[0], value);
54778  }
54779  
54780  static inline void direct_qirr_info(int n_cpu, u8 value)
54781 @@ -111,7 +117,7 @@
54782  /* LPAR low level accessors */
54783  
54784  
54785 -static inline unsigned int lpar_xirr_info_get(int n_cpu)
54786 +static inline unsigned int lpar_xirr_info_get(void)
54787  {
54788         unsigned long lpar_rc;
54789         unsigned long return_value;
54790 @@ -122,7 +128,7 @@
54791         return (unsigned int)return_value;
54792  }
54793  
54794 -static inline void lpar_xirr_info_set(int n_cpu, int value)
54795 +static inline void lpar_xirr_info_set(int value)
54796  {
54797         unsigned long lpar_rc;
54798         unsigned long val64 = value & 0xffffffff;
54799 @@ -133,7 +139,7 @@
54800                       val64);
54801  }
54802  
54803 -static inline void lpar_cppr_info(int n_cpu, u8 value)
54804 +static inline void lpar_cppr_info(u8 value)
54805  {
54806         unsigned long lpar_rc;
54807  
54808 @@ -275,21 +281,19 @@
54809  
54810  static void xics_eoi_direct(unsigned int virq)
54811  {
54812 -       int cpu = smp_processor_id();
54813         unsigned int irq = (unsigned int)irq_map[virq].hwirq;
54814  
54815         iosync();
54816 -       direct_xirr_info_set(cpu, (0xff << 24) | irq);
54817 +       direct_xirr_info_set((0xff << 24) | irq);
54818  }
54819  
54820  
54821  static void xics_eoi_lpar(unsigned int virq)
54822  {
54823 -       int cpu = smp_processor_id();
54824         unsigned int irq = (unsigned int)irq_map[virq].hwirq;
54825  
54826         iosync();
54827 -       lpar_xirr_info_set(cpu, (0xff << 24) | irq);
54828 +       lpar_xirr_info_set((0xff << 24) | irq);
54829  }
54830  
54831  static inline unsigned int xics_remap_irq(unsigned int vec)
54832 @@ -312,16 +316,12 @@
54833  
54834  static unsigned int xics_get_irq_direct(void)
54835  {
54836 -       unsigned int cpu = smp_processor_id();
54837 -
54838 -       return xics_remap_irq(direct_xirr_info_get(cpu));
54839 +       return xics_remap_irq(direct_xirr_info_get());
54840  }
54841  
54842  static unsigned int xics_get_irq_lpar(void)
54843  {
54844 -       unsigned int cpu = smp_processor_id();
54845 -
54846 -       return xics_remap_irq(lpar_xirr_info_get(cpu));
54847 +       return xics_remap_irq(lpar_xirr_info_get());
54848  }
54849  
54850  #ifdef CONFIG_SMP
54851 @@ -387,12 +387,12 @@
54852  
54853  #endif /* CONFIG_SMP */
54854  
54855 -static void xics_set_cpu_priority(int cpu, unsigned char cppr)
54856 +static void xics_set_cpu_priority(unsigned char cppr)
54857  {
54858         if (firmware_has_feature(FW_FEATURE_LPAR))
54859 -               lpar_cppr_info(cpu, cppr);
54860 +               lpar_cppr_info(cppr);
54861         else
54862 -               direct_cppr_info(cpu, cppr);
54863 +               direct_cppr_info(cppr);
54864         iosync();
54865  }
54866  
54867 @@ -440,9 +440,7 @@
54868  
54869  void xics_setup_cpu(void)
54870  {
54871 -       int cpu = smp_processor_id();
54872 -
54873 -       xics_set_cpu_priority(cpu, 0xff);
54874 +       xics_set_cpu_priority(0xff);
54875  
54876         /*
54877          * Put the calling processor into the GIQ.  This is really only
54878 @@ -783,7 +781,7 @@
54879         unsigned int ipi;
54880         struct irq_desc *desc;
54881  
54882 -       xics_set_cpu_priority(cpu, 0);
54883 +       xics_set_cpu_priority(0);
54884  
54885         /*
54886          * Clear IPI
54887 @@ -824,10 +822,11 @@
54888  void xics_migrate_irqs_away(void)
54889  {
54890         int status;
54891 -       unsigned int irq, virq, cpu = smp_processor_id();
54892 +       int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id();
54893 +       unsigned int irq, virq;
54894  
54895         /* Reject any interrupt that was queued to us... */
54896 -       xics_set_cpu_priority(cpu, 0);
54897 +       xics_set_cpu_priority(0);
54898  
54899         /* remove ourselves from the global interrupt queue */
54900         status = rtas_set_indicator_fast(GLOBAL_INTERRUPT_QUEUE,
54901 @@ -835,7 +834,7 @@
54902         WARN_ON(status < 0);
54903  
54904         /* Allow IPIs again... */
54905 -       xics_set_cpu_priority(cpu, DEFAULT_PRIORITY);
54906 +       xics_set_cpu_priority(DEFAULT_PRIORITY);
54907  
54908         for_each_irq(virq) {
54909                 struct irq_desc *desc;
54910 @@ -874,7 +873,7 @@
54911                  * The irq has to be migrated only in the single cpu
54912                  * case.
54913                  */
54914 -               if (xics_status[0] != get_hard_smp_processor_id(cpu))
54915 +               if (xics_status[0] != hw_cpu)
54916                         goto unlock;
54917  
54918                 printk(KERN_WARNING "IRQ %u affinity broken off cpu %u\n",
54919 --- a/arch/powerpc/platforms/pseries/xics.h
54920 +++ b/arch/powerpc/platforms/pseries/xics.h
54921 @@ -21,9 +21,6 @@
54922  extern  void xics_request_IPIs(void);
54923  extern void xics_migrate_irqs_away(void);
54924  
54925 -/* first argument is ignored for now*/
54926 -void pSeriesLP_cppr_info(int n_cpu, u8 value);
54927 -
54928  struct xics_ipi_struct {
54929         volatile unsigned long value;
54930  } ____cacheline_aligned;
54931 --- /dev/null
54932 +++ b/arch/powerpc/sysdev/Kconfig
54933 @@ -0,0 +1,8 @@
54934 +# For a description of the syntax of this configuration file,
54935 +# see Documentation/kbuild/kconfig-language.txt.
54936 +#
54937 +
54938 +config PPC4xx_PCI_EXPRESS
54939 +       bool
54940 +       depends on PCI && 4xx
54941 +       default n
54942 --- a/arch/powerpc/sysdev/Makefile
54943 +++ b/arch/powerpc/sysdev/Makefile
54944 @@ -2,7 +2,7 @@
54945  EXTRA_CFLAGS                   += -mno-minimal-toc
54946  endif
54947  
54948 -mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o
54949 +mpic-msi-obj-$(CONFIG_PCI_MSI) += mpic_msi.o mpic_u3msi.o mpic_pasemi_msi.o
54950  obj-$(CONFIG_MPIC)             += mpic.o $(mpic-msi-obj-y)
54951  
54952  obj-$(CONFIG_PPC_MPC106)       += grackle.o
54953 @@ -12,6 +12,7 @@
54954  obj-$(CONFIG_MMIO_NVRAM)       += mmio_nvram.o
54955  obj-$(CONFIG_FSL_SOC)          += fsl_soc.o
54956  obj-$(CONFIG_FSL_PCI)          += fsl_pci.o
54957 +obj-$(CONFIG_RAPIDIO)          += fsl_rio.o
54958  obj-$(CONFIG_TSI108_BRIDGE)    += tsi108_pci.o tsi108_dev.o
54959  obj-$(CONFIG_QUICC_ENGINE)     += qe_lib/
54960  obj-$(CONFIG_PPC_BESTCOMM)     += bestcomm/
54961 @@ -24,9 +25,13 @@
54962  ifeq ($(CONFIG_PPC_MERGE),y)
54963  obj-$(CONFIG_PPC_INDIRECT_PCI) += indirect_pci.o
54964  obj-$(CONFIG_PPC_I8259)                += i8259.o
54965 -obj-$(CONFIG_PPC_83xx)         += ipic.o
54966 +obj-$(CONFIG_IPIC)             += ipic.o
54967  obj-$(CONFIG_4xx)              += uic.o
54968  obj-$(CONFIG_XILINX_VIRTEX)    += xilinx_intc.o
54969 +obj-$(CONFIG_OF_RTC)           += of_rtc.o
54970 +ifeq ($(CONFIG_PCI),y)
54971 +obj-$(CONFIG_4xx)              += ppc4xx_pci.o
54972 +endif
54973  endif
54974  
54975  # Temporary hack until we have migrated to asm-powerpc
54976 --- a/arch/powerpc/sysdev/axonram.c
54977 +++ b/arch/powerpc/sysdev/axonram.c
54978 @@ -42,8 +42,9 @@
54979  #include <linux/slab.h>
54980  #include <linux/string.h>
54981  #include <linux/types.h>
54982 -#include <asm/of_device.h>
54983 -#include <asm/of_platform.h>
54984 +#include <linux/of_device.h>
54985 +#include <linux/of_platform.h>
54986 +
54987  #include <asm/page.h>
54988  #include <asm/prom.h>
54989  
54990 --- a/arch/powerpc/sysdev/bestcomm/bestcomm.h
54991 +++ b/arch/powerpc/sysdev/bestcomm/bestcomm.h
54992 @@ -20,7 +20,7 @@
54993  
54994  
54995  /* ======================================================================== */
54996 -/* Generic task managment                                                   */
54997 +/* Generic task management                                                   */
54998  /* ======================================================================== */
54999  
55000  /**
55001 --- a/arch/powerpc/sysdev/commproc.c
55002 +++ b/arch/powerpc/sysdev/commproc.c
55003 @@ -240,6 +240,34 @@
55004  #endif
55005  }
55006  
55007 +static DEFINE_SPINLOCK(cmd_lock);
55008 +
55009 +#define MAX_CR_CMD_LOOPS        10000
55010 +
55011 +int cpm_command(u32 command, u8 opcode)
55012 +{
55013 +       int i, ret;
55014 +       unsigned long flags;
55015 +
55016 +       if (command & 0xffffff0f)
55017 +               return -EINVAL;
55018 +
55019 +       spin_lock_irqsave(&cmd_lock, flags);
55020 +
55021 +       ret = 0;
55022 +       out_be16(&cpmp->cp_cpcr, command | CPM_CR_FLG | (opcode << 8));
55023 +       for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
55024 +               if ((in_be16(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0)
55025 +                       goto out;
55026 +
55027 +       printk(KERN_ERR "%s(): Not able to issue CPM command\n", __FUNCTION__);
55028 +       ret = -EIO;
55029 +out:
55030 +       spin_unlock_irqrestore(&cmd_lock, flags);
55031 +       return ret;
55032 +}
55033 +EXPORT_SYMBOL(cpm_command);
55034 +
55035  /* We used to do this earlier, but have to postpone as long as possible
55036   * to ensure the kernel VM is now running.
55037   */
55038 @@ -408,7 +436,7 @@
55039  #endif /* !CONFIG_PPC_CPM_NEW_BINDING */
55040  
55041  struct cpm_ioport16 {
55042 -       __be16 dir, par, sor, dat, intr;
55043 +       __be16 dir, par, odr_sor, dat, intr;
55044         __be16 res[3];
55045  };
55046  
55047 @@ -438,6 +466,13 @@
55048         else
55049                 clrbits32(&iop->par, pin);
55050  
55051 +       if (port == CPM_PORTB) {
55052 +               if (flags & CPM_PIN_OPENDRAIN)
55053 +                       setbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin);
55054 +               else
55055 +                       clrbits16(&mpc8xx_immr->im_cpm.cp_pbodr, pin);
55056 +       }
55057 +
55058         if (port == CPM_PORTE) {
55059                 if (flags & CPM_PIN_SECONDARY)
55060                         setbits32(&iop->sor, pin);
55061 @@ -471,11 +506,17 @@
55062         else
55063                 clrbits16(&iop->par, pin);
55064  
55065 +       if (port == CPM_PORTA) {
55066 +               if (flags & CPM_PIN_OPENDRAIN)
55067 +                       setbits16(&iop->odr_sor, pin);
55068 +               else
55069 +                       clrbits16(&iop->odr_sor, pin);
55070 +       }
55071         if (port == CPM_PORTC) {
55072                 if (flags & CPM_PIN_SECONDARY)
55073 -                       setbits16(&iop->sor, pin);
55074 +                       setbits16(&iop->odr_sor, pin);
55075                 else
55076 -                       clrbits16(&iop->sor, pin);
55077 +                       clrbits16(&iop->odr_sor, pin);
55078         }
55079  }
55080  
55081 --- a/arch/powerpc/sysdev/cpm2_common.c
55082 +++ b/arch/powerpc/sysdev/cpm2_common.c
55083 @@ -82,6 +82,31 @@
55084         cpmp = &cpm2_immr->im_cpm;
55085  }
55086  
55087 +static DEFINE_SPINLOCK(cmd_lock);
55088 +
55089 +#define MAX_CR_CMD_LOOPS        10000
55090 +
55091 +int cpm_command(u32 command, u8 opcode)
55092 +{
55093 +       int i, ret;
55094 +       unsigned long flags;
55095 +
55096 +       spin_lock_irqsave(&cmd_lock, flags);
55097 +
55098 +       ret = 0;
55099 +       out_be32(&cpmp->cp_cpcr, command | opcode | CPM_CR_FLG);
55100 +       for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
55101 +               if ((in_be32(&cpmp->cp_cpcr) & CPM_CR_FLG) == 0)
55102 +                       goto out;
55103 +
55104 +       printk(KERN_ERR "%s(): Not able to issue CPM command\n", __FUNCTION__);
55105 +       ret = -EIO;
55106 +out:
55107 +       spin_unlock_irqrestore(&cmd_lock, flags);
55108 +       return ret;
55109 +}
55110 +EXPORT_SYMBOL(cpm_command);
55111 +
55112  /* Set a baud rate generator.  This needs lots of work.  There are
55113   * eight BRGs, which can be connected to the CPM channels or output
55114   * as clocks.  The BRGs are in two different block of internal
55115 --- a/arch/powerpc/sysdev/fsl_pci.c
55116 +++ b/arch/powerpc/sysdev/fsl_pci.c
55117 @@ -33,8 +33,8 @@
55118         struct ccsr_pci __iomem *pci;
55119         int i;
55120  
55121 -       pr_debug("PCI memory map start 0x%x, size 0x%x\n", rsrc->start,
55122 -                       rsrc->end - rsrc->start + 1);
55123 +       pr_debug("PCI memory map start 0x%016llx, size 0x%016llx\n",
55124 +                   (u64)rsrc->start, (u64)rsrc->end - (u64)rsrc->start + 1);
55125         pci = ioremap(rsrc->start, rsrc->end - rsrc->start + 1);
55126  
55127         /* Disable all windows (except powar0 since its ignored) */
55128 @@ -46,17 +46,17 @@
55129         /* Setup outbound MEM window */
55130         for(i = 0; i < 3; i++)
55131                 if (hose->mem_resources[i].flags & IORESOURCE_MEM){
55132 -                       pr_debug("PCI MEM resource start 0x%08x, size 0x%08x.\n",
55133 -                               hose->mem_resources[i].start,
55134 -                               hose->mem_resources[i].end
55135 -                                 - hose->mem_resources[i].start + 1);
55136 -                       out_be32(&pci->pow[i+1].potar,
55137 -                               (hose->mem_resources[i].start >> 12)
55138 -                               & 0x000fffff);
55139 +                       resource_size_t pci_addr_start =
55140 +                                hose->mem_resources[i].start -
55141 +                                hose->pci_mem_offset;
55142 +                       pr_debug("PCI MEM resource start 0x%016llx, size 0x%016llx.\n",
55143 +                               (u64)hose->mem_resources[i].start,
55144 +                               (u64)hose->mem_resources[i].end
55145 +                                 - (u64)hose->mem_resources[i].start + 1);
55146 +                       out_be32(&pci->pow[i+1].potar, (pci_addr_start >> 12));
55147                         out_be32(&pci->pow[i+1].potear, 0);
55148                         out_be32(&pci->pow[i+1].powbar,
55149 -                               (hose->mem_resources[i].start >> 12)
55150 -                               & 0x000fffff);
55151 +                               (hose->mem_resources[i].start >> 12));
55152                         /* Enable, Mem R/W */
55153                         out_be32(&pci->pow[i+1].powar, 0x80044000
55154                                 | (__ilog2(hose->mem_resources[i].end
55155 @@ -65,15 +65,14 @@
55156  
55157         /* Setup outbound IO window */
55158         if (hose->io_resource.flags & IORESOURCE_IO){
55159 -               pr_debug("PCI IO resource start 0x%08x, size 0x%08x, phy base 0x%08x.\n",
55160 -                       hose->io_resource.start,
55161 -                       hose->io_resource.end - hose->io_resource.start + 1,
55162 -                       hose->io_base_phys);
55163 -               out_be32(&pci->pow[i+1].potar, (hose->io_resource.start >> 12)
55164 -                               & 0x000fffff);
55165 +               pr_debug("PCI IO resource start 0x%016llx, size 0x%016llx, "
55166 +                        "phy base 0x%016llx.\n",
55167 +                       (u64)hose->io_resource.start,
55168 +                       (u64)hose->io_resource.end - (u64)hose->io_resource.start + 1,
55169 +                       (u64)hose->io_base_phys);
55170 +               out_be32(&pci->pow[i+1].potar, (hose->io_resource.start >> 12));
55171                 out_be32(&pci->pow[i+1].potear, 0);
55172 -               out_be32(&pci->pow[i+1].powbar, (hose->io_base_phys >> 12)
55173 -                               & 0x000fffff);
55174 +               out_be32(&pci->pow[i+1].powbar, (hose->io_base_phys >> 12));
55175                 /* Enable, IO R/W */
55176                 out_be32(&pci->pow[i+1].powar, 0x80088000
55177                         | (__ilog2(hose->io_resource.end
55178 @@ -107,55 +106,17 @@
55179         }
55180  }
55181  
55182 -static void __init quirk_fsl_pcie_transparent(struct pci_dev *dev)
55183 -{
55184 -       struct resource *res;
55185 -       int i, res_idx = PCI_BRIDGE_RESOURCES;
55186 -       struct pci_controller *hose;
55187 +static int fsl_pcie_bus_fixup;
55188  
55189 +static void __init quirk_fsl_pcie_header(struct pci_dev *dev)
55190 +{
55191         /* if we aren't a PCIe don't bother */
55192         if (!pci_find_capability(dev, PCI_CAP_ID_EXP))
55193                 return ;
55194  
55195 -       /*
55196 -        * Make the bridge be transparent.
55197 -        */
55198 -       dev->transparent = 1;
55199 -
55200 -       hose = pci_bus_to_host(dev->bus);
55201 -       if (!hose) {
55202 -               printk(KERN_ERR "Can't find hose for bus %d\n",
55203 -                      dev->bus->number);
55204 -               return;
55205 -       }
55206 -
55207 -       /* Clear out any of the virtual P2P bridge registers */
55208 -       pci_write_config_word(dev, PCI_IO_BASE_UPPER16, 0);
55209 -       pci_write_config_word(dev, PCI_IO_LIMIT_UPPER16, 0);
55210 -       pci_write_config_byte(dev, PCI_IO_BASE, 0x10);
55211 -       pci_write_config_byte(dev, PCI_IO_LIMIT, 0);
55212 -       pci_write_config_word(dev, PCI_MEMORY_BASE, 0x10);
55213 -       pci_write_config_word(dev, PCI_MEMORY_LIMIT, 0);
55214 -       pci_write_config_word(dev, PCI_PREF_BASE_UPPER32, 0x0);
55215 -       pci_write_config_word(dev, PCI_PREF_LIMIT_UPPER32, 0x0);
55216 -       pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, 0x10);
55217 -       pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, 0);
55218 -
55219 -       if (hose->io_resource.flags) {
55220 -               res = &dev->resource[res_idx++];
55221 -               res->start = hose->io_resource.start;
55222 -               res->end = hose->io_resource.end;
55223 -               res->flags = hose->io_resource.flags;
55224 -               update_bridge_resource(dev, res);
55225 -       }
55226 -
55227 -       for (i = 0; i < 3; i++) {
55228 -               res = &dev->resource[res_idx + i];
55229 -               res->start = hose->mem_resources[i].start;
55230 -               res->end = hose->mem_resources[i].end;
55231 -               res->flags = hose->mem_resources[i].flags;
55232 -               update_bridge_resource(dev, res);
55233 -       }
55234 +       dev->class = PCI_CLASS_BRIDGE_PCI << 8;
55235 +       fsl_pcie_bus_fixup = 1;
55236 +       return ;
55237  }
55238  
55239  int __init fsl_pcie_check_link(struct pci_controller *hose)
55240 @@ -172,11 +133,24 @@
55241         struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
55242         int i;
55243  
55244 -       /* deal with bogus pci_bus when we don't have anything connected on PCIe */
55245 -       if (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK) {
55246 -               if (bus->parent) {
55247 -                       for (i = 0; i < 4; ++i)
55248 -                               bus->resource[i] = bus->parent->resource[i];
55249 +       if ((bus->parent == hose->bus) &&
55250 +           ((fsl_pcie_bus_fixup &&
55251 +             early_find_capability(hose, 0, 0, PCI_CAP_ID_EXP)) ||
55252 +            (hose->indirect_type & PPC_INDIRECT_TYPE_NO_PCIE_LINK)))
55253 +       {
55254 +               for (i = 0; i < 4; ++i) {
55255 +                       struct resource *res = bus->resource[i];
55256 +                       struct resource *par = bus->parent->resource[i];
55257 +                       if (res) {
55258 +                               res->start = 0;
55259 +                               res->end   = 0;
55260 +                               res->flags = 0;
55261 +                       }
55262 +                       if (res && par) {
55263 +                               res->start = par->start;
55264 +                               res->end   = par->end;
55265 +                               res->flags = par->flags;
55266 +                       }
55267                 }
55268         }
55269  }
55270 @@ -202,7 +176,7 @@
55271                 printk(KERN_WARNING "Can't get bus-range for %s, assume"
55272                         " bus 0\n", dev->full_name);
55273  
55274 -       pci_assign_all_buses = 1;
55275 +       ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
55276         hose = pcibios_alloc_controller(dev);
55277         if (!hose)
55278                 return -ENOMEM;
55279 @@ -222,7 +196,7 @@
55280                         hose->indirect_type |= PPC_INDIRECT_TYPE_NO_PCIE_LINK;
55281         }
55282  
55283 -       printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx."
55284 +       printk(KERN_INFO "Found FSL PCI host bridge at 0x%016llx. "
55285                 "Firmware bus number: %d->%d\n",
55286                 (unsigned long long)rsrc.start, hose->first_busno,
55287                 hose->last_busno);
55288 @@ -240,23 +214,23 @@
55289         return 0;
55290  }
55291  
55292 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8548E, quirk_fsl_pcie_transparent);
55293 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8548, quirk_fsl_pcie_transparent);
55294 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8543E, quirk_fsl_pcie_transparent);
55295 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8543, quirk_fsl_pcie_transparent);
55296 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8547E, quirk_fsl_pcie_transparent);
55297 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8545E, quirk_fsl_pcie_transparent);
55298 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8545, quirk_fsl_pcie_transparent);
55299 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8568E, quirk_fsl_pcie_transparent);
55300 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8568, quirk_fsl_pcie_transparent);
55301 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8567E, quirk_fsl_pcie_transparent);
55302 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8567, quirk_fsl_pcie_transparent);
55303 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8533E, quirk_fsl_pcie_transparent);
55304 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8533, quirk_fsl_pcie_transparent);
55305 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544E, quirk_fsl_pcie_transparent);
55306 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8544, quirk_fsl_pcie_transparent);
55307 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8572E, quirk_fsl_pcie_transparent);
55308 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8572, quirk_fsl_pcie_transparent);
55309 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_transparent);
55310 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_transparent);
55311 -DECLARE_PCI_FIXUP_EARLY(0x1957, PCI_DEVICE_ID_MPC8610, quirk_fsl_pcie_transparent);
55312 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8548E, quirk_fsl_pcie_header);
55313 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8548, quirk_fsl_pcie_header);
55314 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8543E, quirk_fsl_pcie_header);
55315 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8543, quirk_fsl_pcie_header);
55316 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8547E, quirk_fsl_pcie_header);
55317 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8545E, quirk_fsl_pcie_header);
55318 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8545, quirk_fsl_pcie_header);
55319 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8568E, quirk_fsl_pcie_header);
55320 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8568, quirk_fsl_pcie_header);
55321 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8567E, quirk_fsl_pcie_header);
55322 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8567, quirk_fsl_pcie_header);
55323 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8533E, quirk_fsl_pcie_header);
55324 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8533, quirk_fsl_pcie_header);
55325 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8544E, quirk_fsl_pcie_header);
55326 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8544, quirk_fsl_pcie_header);
55327 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8572E, quirk_fsl_pcie_header);
55328 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8572, quirk_fsl_pcie_header);
55329 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8641, quirk_fsl_pcie_header);
55330 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8641D, quirk_fsl_pcie_header);
55331 +DECLARE_PCI_FIXUP_HEADER(0x1957, PCI_DEVICE_ID_MPC8610, quirk_fsl_pcie_header);
55332 --- /dev/null
55333 +++ b/arch/powerpc/sysdev/fsl_rio.c
55334 @@ -0,0 +1,932 @@
55335 +/*
55336 + * MPC85xx RapidIO support
55337 + *
55338 + * Copyright 2005 MontaVista Software, Inc.
55339 + * Matt Porter <mporter@kernel.crashing.org>
55340 + *
55341 + * This program is free software; you can redistribute  it and/or modify it
55342 + * under  the terms of  the GNU General  Public License as published by the
55343 + * Free Software Foundation;  either version 2 of the  License, or (at your
55344 + * option) any later version.
55345 + */
55346 +
55347 +#include <linux/init.h>
55348 +#include <linux/module.h>
55349 +#include <linux/types.h>
55350 +#include <linux/dma-mapping.h>
55351 +#include <linux/interrupt.h>
55352 +#include <linux/rio.h>
55353 +#include <linux/rio_drv.h>
55354 +
55355 +#include <asm/io.h>
55356 +
55357 +#define RIO_REGS_BASE          (CCSRBAR + 0xc0000)
55358 +#define RIO_ATMU_REGS_OFFSET   0x10c00
55359 +#define RIO_MSG_REGS_OFFSET    0x11000
55360 +#define RIO_MAINT_WIN_SIZE     0x400000
55361 +#define RIO_DBELL_WIN_SIZE     0x1000
55362 +
55363 +#define RIO_MSG_OMR_MUI                0x00000002
55364 +#define RIO_MSG_OSR_TE         0x00000080
55365 +#define RIO_MSG_OSR_QOI                0x00000020
55366 +#define RIO_MSG_OSR_QFI                0x00000010
55367 +#define RIO_MSG_OSR_MUB                0x00000004
55368 +#define RIO_MSG_OSR_EOMI       0x00000002
55369 +#define RIO_MSG_OSR_QEI                0x00000001
55370 +
55371 +#define RIO_MSG_IMR_MI         0x00000002
55372 +#define RIO_MSG_ISR_TE         0x00000080
55373 +#define RIO_MSG_ISR_QFI                0x00000010
55374 +#define RIO_MSG_ISR_DIQI       0x00000001
55375 +
55376 +#define RIO_MSG_DESC_SIZE      32
55377 +#define RIO_MSG_BUFFER_SIZE    4096
55378 +#define RIO_MIN_TX_RING_SIZE   2
55379 +#define RIO_MAX_TX_RING_SIZE   2048
55380 +#define RIO_MIN_RX_RING_SIZE   2
55381 +#define RIO_MAX_RX_RING_SIZE   2048
55382 +
55383 +#define DOORBELL_DMR_DI                0x00000002
55384 +#define DOORBELL_DSR_TE                0x00000080
55385 +#define DOORBELL_DSR_QFI       0x00000010
55386 +#define DOORBELL_DSR_DIQI      0x00000001
55387 +#define DOORBELL_TID_OFFSET    0x03
55388 +#define DOORBELL_SID_OFFSET    0x05
55389 +#define DOORBELL_INFO_OFFSET   0x06
55390 +
55391 +#define DOORBELL_MESSAGE_SIZE  0x08
55392 +#define DBELL_SID(x)           (*(u8 *)(x + DOORBELL_SID_OFFSET))
55393 +#define DBELL_TID(x)           (*(u8 *)(x + DOORBELL_TID_OFFSET))
55394 +#define DBELL_INF(x)           (*(u16 *)(x + DOORBELL_INFO_OFFSET))
55395 +
55396 +struct rio_atmu_regs {
55397 +       u32 rowtar;
55398 +       u32 pad1;
55399 +       u32 rowbar;
55400 +       u32 pad2;
55401 +       u32 rowar;
55402 +       u32 pad3[3];
55403 +};
55404 +
55405 +struct rio_msg_regs {
55406 +       u32 omr;
55407 +       u32 osr;
55408 +       u32 pad1;
55409 +       u32 odqdpar;
55410 +       u32 pad2;
55411 +       u32 osar;
55412 +       u32 odpr;
55413 +       u32 odatr;
55414 +       u32 odcr;
55415 +       u32 pad3;
55416 +       u32 odqepar;
55417 +       u32 pad4[13];
55418 +       u32 imr;
55419 +       u32 isr;
55420 +       u32 pad5;
55421 +       u32 ifqdpar;
55422 +       u32 pad6;
55423 +       u32 ifqepar;
55424 +       u32 pad7[250];
55425 +       u32 dmr;
55426 +       u32 dsr;
55427 +       u32 pad8;
55428 +       u32 dqdpar;
55429 +       u32 pad9;
55430 +       u32 dqepar;
55431 +       u32 pad10[26];
55432 +       u32 pwmr;
55433 +       u32 pwsr;
55434 +       u32 pad11;
55435 +       u32 pwqbar;
55436 +};
55437 +
55438 +struct rio_tx_desc {
55439 +       u32 res1;
55440 +       u32 saddr;
55441 +       u32 dport;
55442 +       u32 dattr;
55443 +       u32 res2;
55444 +       u32 res3;
55445 +       u32 dwcnt;
55446 +       u32 res4;
55447 +};
55448 +
55449 +static u32 regs_win;
55450 +static struct rio_atmu_regs *atmu_regs;
55451 +static struct rio_atmu_regs *maint_atmu_regs;
55452 +static struct rio_atmu_regs *dbell_atmu_regs;
55453 +static u32 dbell_win;
55454 +static u32 maint_win;
55455 +static struct rio_msg_regs *msg_regs;
55456 +
55457 +static struct rio_dbell_ring {
55458 +       void *virt;
55459 +       dma_addr_t phys;
55460 +} dbell_ring;
55461 +
55462 +static struct rio_msg_tx_ring {
55463 +       void *virt;
55464 +       dma_addr_t phys;
55465 +       void *virt_buffer[RIO_MAX_TX_RING_SIZE];
55466 +       dma_addr_t phys_buffer[RIO_MAX_TX_RING_SIZE];
55467 +       int tx_slot;
55468 +       int size;
55469 +       void *dev_id;
55470 +} msg_tx_ring;
55471 +
55472 +static struct rio_msg_rx_ring {
55473 +       void *virt;
55474 +       dma_addr_t phys;
55475 +       void *virt_buffer[RIO_MAX_RX_RING_SIZE];
55476 +       int rx_slot;
55477 +       int size;
55478 +       void *dev_id;
55479 +} msg_rx_ring;
55480 +
55481 +/**
55482 + * mpc85xx_rio_doorbell_send - Send a MPC85xx doorbell message
55483 + * @index: ID of RapidIO interface
55484 + * @destid: Destination ID of target device
55485 + * @data: 16-bit info field of RapidIO doorbell message
55486 + *
55487 + * Sends a MPC85xx doorbell message. Returns %0 on success or
55488 + * %-EINVAL on failure.
55489 + */
55490 +static int mpc85xx_rio_doorbell_send(int index, u16 destid, u16 data)
55491 +{
55492 +       pr_debug("mpc85xx_doorbell_send: index %d destid %4.4x data %4.4x\n",
55493 +                index, destid, data);
55494 +       out_be32((void *)&dbell_atmu_regs->rowtar, destid << 22);
55495 +       out_be16((void *)(dbell_win), data);
55496 +
55497 +       return 0;
55498 +}
55499 +
55500 +/**
55501 + * mpc85xx_local_config_read - Generate a MPC85xx local config space read
55502 + * @index: ID of RapdiIO interface
55503 + * @offset: Offset into configuration space
55504 + * @len: Length (in bytes) of the maintenance transaction
55505 + * @data: Value to be read into
55506 + *
55507 + * Generates a MPC85xx local configuration space read. Returns %0 on
55508 + * success or %-EINVAL on failure.
55509 + */
55510 +static int mpc85xx_local_config_read(int index, u32 offset, int len, u32 * data)
55511 +{
55512 +       pr_debug("mpc85xx_local_config_read: index %d offset %8.8x\n", index,
55513 +                offset);
55514 +       *data = in_be32((void *)(regs_win + offset));
55515 +
55516 +       return 0;
55517 +}
55518 +
55519 +/**
55520 + * mpc85xx_local_config_write - Generate a MPC85xx local config space write
55521 + * @index: ID of RapdiIO interface
55522 + * @offset: Offset into configuration space
55523 + * @len: Length (in bytes) of the maintenance transaction
55524 + * @data: Value to be written
55525 + *
55526 + * Generates a MPC85xx local configuration space write. Returns %0 on
55527 + * success or %-EINVAL on failure.
55528 + */
55529 +static int mpc85xx_local_config_write(int index, u32 offset, int len, u32 data)
55530 +{
55531 +       pr_debug
55532 +           ("mpc85xx_local_config_write: index %d offset %8.8x data %8.8x\n",
55533 +            index, offset, data);
55534 +       out_be32((void *)(regs_win + offset), data);
55535 +
55536 +       return 0;
55537 +}
55538 +
55539 +/**
55540 + * mpc85xx_rio_config_read - Generate a MPC85xx read maintenance transaction
55541 + * @index: ID of RapdiIO interface
55542 + * @destid: Destination ID of transaction
55543 + * @hopcount: Number of hops to target device
55544 + * @offset: Offset into configuration space
55545 + * @len: Length (in bytes) of the maintenance transaction
55546 + * @val: Location to be read into
55547 + *
55548 + * Generates a MPC85xx read maintenance transaction. Returns %0 on
55549 + * success or %-EINVAL on failure.
55550 + */
55551 +static int
55552 +mpc85xx_rio_config_read(int index, u16 destid, u8 hopcount, u32 offset, int len,
55553 +                       u32 * val)
55554 +{
55555 +       u8 *data;
55556 +
55557 +       pr_debug
55558 +           ("mpc85xx_rio_config_read: index %d destid %d hopcount %d offset %8.8x len %d\n",
55559 +            index, destid, hopcount, offset, len);
55560 +       out_be32((void *)&maint_atmu_regs->rowtar,
55561 +                (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
55562 +
55563 +       data = (u8 *) maint_win + offset;
55564 +       switch (len) {
55565 +       case 1:
55566 +               *val = in_8((u8 *) data);
55567 +               break;
55568 +       case 2:
55569 +               *val = in_be16((u16 *) data);
55570 +               break;
55571 +       default:
55572 +               *val = in_be32((u32 *) data);
55573 +               break;
55574 +       }
55575 +
55576 +       return 0;
55577 +}
55578 +
55579 +/**
55580 + * mpc85xx_rio_config_write - Generate a MPC85xx write maintenance transaction
55581 + * @index: ID of RapdiIO interface
55582 + * @destid: Destination ID of transaction
55583 + * @hopcount: Number of hops to target device
55584 + * @offset: Offset into configuration space
55585 + * @len: Length (in bytes) of the maintenance transaction
55586 + * @val: Value to be written
55587 + *
55588 + * Generates an MPC85xx write maintenance transaction. Returns %0 on
55589 + * success or %-EINVAL on failure.
55590 + */
55591 +static int
55592 +mpc85xx_rio_config_write(int index, u16 destid, u8 hopcount, u32 offset,
55593 +                        int len, u32 val)
55594 +{
55595 +       u8 *data;
55596 +       pr_debug
55597 +           ("mpc85xx_rio_config_write: index %d destid %d hopcount %d offset %8.8x len %d val %8.8x\n",
55598 +            index, destid, hopcount, offset, len, val);
55599 +       out_be32((void *)&maint_atmu_regs->rowtar,
55600 +                (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
55601 +
55602 +       data = (u8 *) maint_win + offset;
55603 +       switch (len) {
55604 +       case 1:
55605 +               out_8((u8 *) data, val);
55606 +               break;
55607 +       case 2:
55608 +               out_be16((u16 *) data, val);
55609 +               break;
55610 +       default:
55611 +               out_be32((u32 *) data, val);
55612 +               break;
55613 +       }
55614 +
55615 +       return 0;
55616 +}
55617 +
55618 +/**
55619 + * rio_hw_add_outb_message - Add message to the MPC85xx outbound message queue
55620 + * @mport: Master port with outbound message queue
55621 + * @rdev: Target of outbound message
55622 + * @mbox: Outbound mailbox
55623 + * @buffer: Message to add to outbound queue
55624 + * @len: Length of message
55625 + *
55626 + * Adds the @buffer message to the MPC85xx outbound message queue. Returns
55627 + * %0 on success or %-EINVAL on failure.
55628 + */
55629 +int
55630 +rio_hw_add_outb_message(struct rio_mport *mport, struct rio_dev *rdev, int mbox,
55631 +                       void *buffer, size_t len)
55632 +{
55633 +       u32 omr;
55634 +       struct rio_tx_desc *desc =
55635 +           (struct rio_tx_desc *)msg_tx_ring.virt + msg_tx_ring.tx_slot;
55636 +       int ret = 0;
55637 +
55638 +       pr_debug
55639 +           ("RIO: rio_hw_add_outb_message(): destid %4.4x mbox %d buffer %8.8x len %8.8x\n",
55640 +            rdev->destid, mbox, (int)buffer, len);
55641 +
55642 +       if ((len < 8) || (len > RIO_MAX_MSG_SIZE)) {
55643 +               ret = -EINVAL;
55644 +               goto out;
55645 +       }
55646 +
55647 +       /* Copy and clear rest of buffer */
55648 +       memcpy(msg_tx_ring.virt_buffer[msg_tx_ring.tx_slot], buffer, len);
55649 +       if (len < (RIO_MAX_MSG_SIZE - 4))
55650 +               memset((void *)((u32) msg_tx_ring.
55651 +                               virt_buffer[msg_tx_ring.tx_slot] + len), 0,
55652 +                      RIO_MAX_MSG_SIZE - len);
55653 +
55654 +       /* Set mbox field for message */
55655 +       desc->dport = mbox & 0x3;
55656 +
55657 +       /* Enable EOMI interrupt, set priority, and set destid */
55658 +       desc->dattr = 0x28000000 | (rdev->destid << 2);
55659 +
55660 +       /* Set transfer size aligned to next power of 2 (in double words) */
55661 +       desc->dwcnt = is_power_of_2(len) ? len : 1 << get_bitmask_order(len);
55662 +
55663 +       /* Set snooping and source buffer address */
55664 +       desc->saddr = 0x00000004 | msg_tx_ring.phys_buffer[msg_tx_ring.tx_slot];
55665 +
55666 +       /* Increment enqueue pointer */
55667 +       omr = in_be32((void *)&msg_regs->omr);
55668 +       out_be32((void *)&msg_regs->omr, omr | RIO_MSG_OMR_MUI);
55669 +
55670 +       /* Go to next descriptor */
55671 +       if (++msg_tx_ring.tx_slot == msg_tx_ring.size)
55672 +               msg_tx_ring.tx_slot = 0;
55673 +
55674 +      out:
55675 +       return ret;
55676 +}
55677 +
55678 +EXPORT_SYMBOL_GPL(rio_hw_add_outb_message);
55679 +
55680 +/**
55681 + * mpc85xx_rio_tx_handler - MPC85xx outbound message interrupt handler
55682 + * @irq: Linux interrupt number
55683 + * @dev_instance: Pointer to interrupt-specific data
55684 + *
55685 + * Handles outbound message interrupts. Executes a register outbound
55686 + * mailbox event handler and acks the interrupt occurrence.
55687 + */
55688 +static irqreturn_t
55689 +mpc85xx_rio_tx_handler(int irq, void *dev_instance)
55690 +{
55691 +       int osr;
55692 +       struct rio_mport *port = (struct rio_mport *)dev_instance;
55693 +
55694 +       osr = in_be32((void *)&msg_regs->osr);
55695 +
55696 +       if (osr & RIO_MSG_OSR_TE) {
55697 +               pr_info("RIO: outbound message transmission error\n");
55698 +               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_TE);
55699 +               goto out;
55700 +       }
55701 +
55702 +       if (osr & RIO_MSG_OSR_QOI) {
55703 +               pr_info("RIO: outbound message queue overflow\n");
55704 +               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_QOI);
55705 +               goto out;
55706 +       }
55707 +
55708 +       if (osr & RIO_MSG_OSR_EOMI) {
55709 +               u32 dqp = in_be32((void *)&msg_regs->odqdpar);
55710 +               int slot = (dqp - msg_tx_ring.phys) >> 5;
55711 +               port->outb_msg[0].mcback(port, msg_tx_ring.dev_id, -1, slot);
55712 +
55713 +               /* Ack the end-of-message interrupt */
55714 +               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_EOMI);
55715 +       }
55716 +
55717 +      out:
55718 +       return IRQ_HANDLED;
55719 +}
55720 +
55721 +/**
55722 + * rio_open_outb_mbox - Initialize MPC85xx outbound mailbox
55723 + * @mport: Master port implementing the outbound message unit
55724 + * @dev_id: Device specific pointer to pass on event
55725 + * @mbox: Mailbox to open
55726 + * @entries: Number of entries in the outbound mailbox ring
55727 + *
55728 + * Initializes buffer ring, request the outbound message interrupt,
55729 + * and enables the outbound message unit. Returns %0 on success and
55730 + * %-EINVAL or %-ENOMEM on failure.
55731 + */
55732 +int rio_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
55733 +{
55734 +       int i, j, rc = 0;
55735 +
55736 +       if ((entries < RIO_MIN_TX_RING_SIZE) ||
55737 +           (entries > RIO_MAX_TX_RING_SIZE) || (!is_power_of_2(entries))) {
55738 +               rc = -EINVAL;
55739 +               goto out;
55740 +       }
55741 +
55742 +       /* Initialize shadow copy ring */
55743 +       msg_tx_ring.dev_id = dev_id;
55744 +       msg_tx_ring.size = entries;
55745 +
55746 +       for (i = 0; i < msg_tx_ring.size; i++) {
55747 +               if (!
55748 +                   (msg_tx_ring.virt_buffer[i] =
55749 +                    dma_alloc_coherent(NULL, RIO_MSG_BUFFER_SIZE,
55750 +                                       &msg_tx_ring.phys_buffer[i],
55751 +                                       GFP_KERNEL))) {
55752 +                       rc = -ENOMEM;
55753 +                       for (j = 0; j < msg_tx_ring.size; j++)
55754 +                               if (msg_tx_ring.virt_buffer[j])
55755 +                                       dma_free_coherent(NULL,
55756 +                                                         RIO_MSG_BUFFER_SIZE,
55757 +                                                         msg_tx_ring.
55758 +                                                         virt_buffer[j],
55759 +                                                         msg_tx_ring.
55760 +                                                         phys_buffer[j]);
55761 +                       goto out;
55762 +               }
55763 +       }
55764 +
55765 +       /* Initialize outbound message descriptor ring */
55766 +       if (!(msg_tx_ring.virt = dma_alloc_coherent(NULL,
55767 +                                                   msg_tx_ring.size *
55768 +                                                   RIO_MSG_DESC_SIZE,
55769 +                                                   &msg_tx_ring.phys,
55770 +                                                   GFP_KERNEL))) {
55771 +               rc = -ENOMEM;
55772 +               goto out_dma;
55773 +       }
55774 +       memset(msg_tx_ring.virt, 0, msg_tx_ring.size * RIO_MSG_DESC_SIZE);
55775 +       msg_tx_ring.tx_slot = 0;
55776 +
55777 +       /* Point dequeue/enqueue pointers at first entry in ring */
55778 +       out_be32((void *)&msg_regs->odqdpar, msg_tx_ring.phys);
55779 +       out_be32((void *)&msg_regs->odqepar, msg_tx_ring.phys);
55780 +
55781 +       /* Configure for snooping */
55782 +       out_be32((void *)&msg_regs->osar, 0x00000004);
55783 +
55784 +       /* Clear interrupt status */
55785 +       out_be32((void *)&msg_regs->osr, 0x000000b3);
55786 +
55787 +       /* Hook up outbound message handler */
55788 +       if ((rc =
55789 +            request_irq(MPC85xx_IRQ_RIO_TX, mpc85xx_rio_tx_handler, 0,
55790 +                        "msg_tx", (void *)mport)) < 0)
55791 +               goto out_irq;
55792 +
55793 +       /*
55794 +        * Configure outbound message unit
55795 +        *      Snooping
55796 +        *      Interrupts (all enabled, except QEIE)
55797 +        *      Chaining mode
55798 +        *      Disable
55799 +        */
55800 +       out_be32((void *)&msg_regs->omr, 0x00100220);
55801 +
55802 +       /* Set number of entries */
55803 +       out_be32((void *)&msg_regs->omr,
55804 +                in_be32((void *)&msg_regs->omr) |
55805 +                ((get_bitmask_order(entries) - 2) << 12));
55806 +
55807 +       /* Now enable the unit */
55808 +       out_be32((void *)&msg_regs->omr, in_be32((void *)&msg_regs->omr) | 0x1);
55809 +
55810 +      out:
55811 +       return rc;
55812 +
55813 +      out_irq:
55814 +       dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
55815 +                         msg_tx_ring.virt, msg_tx_ring.phys);
55816 +
55817 +      out_dma:
55818 +       for (i = 0; i < msg_tx_ring.size; i++)
55819 +               dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
55820 +                                 msg_tx_ring.virt_buffer[i],
55821 +                                 msg_tx_ring.phys_buffer[i]);
55822 +
55823 +       return rc;
55824 +}
55825 +
55826 +/**
55827 + * rio_close_outb_mbox - Shut down MPC85xx outbound mailbox
55828 + * @mport: Master port implementing the outbound message unit
55829 + * @mbox: Mailbox to close
55830 + *
55831 + * Disables the outbound message unit, free all buffers, and
55832 + * frees the outbound message interrupt.
55833 + */
55834 +void rio_close_outb_mbox(struct rio_mport *mport, int mbox)
55835 +{
55836 +       /* Disable inbound message unit */
55837 +       out_be32((void *)&msg_regs->omr, 0);
55838 +
55839 +       /* Free ring */
55840 +       dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
55841 +                         msg_tx_ring.virt, msg_tx_ring.phys);
55842 +
55843 +       /* Free interrupt */
55844 +       free_irq(MPC85xx_IRQ_RIO_TX, (void *)mport);
55845 +}
55846 +
55847 +/**
55848 + * mpc85xx_rio_rx_handler - MPC85xx inbound message interrupt handler
55849 + * @irq: Linux interrupt number
55850 + * @dev_instance: Pointer to interrupt-specific data
55851 + *
55852 + * Handles inbound message interrupts. Executes a registered inbound
55853 + * mailbox event handler and acks the interrupt occurrence.
55854 + */
55855 +static irqreturn_t
55856 +mpc85xx_rio_rx_handler(int irq, void *dev_instance)
55857 +{
55858 +       int isr;
55859 +       struct rio_mport *port = (struct rio_mport *)dev_instance;
55860 +
55861 +       isr = in_be32((void *)&msg_regs->isr);
55862 +
55863 +       if (isr & RIO_MSG_ISR_TE) {
55864 +               pr_info("RIO: inbound message reception error\n");
55865 +               out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_TE);
55866 +               goto out;
55867 +       }
55868 +
55869 +       /* XXX Need to check/dispatch until queue empty */
55870 +       if (isr & RIO_MSG_ISR_DIQI) {
55871 +               /*
55872 +                * We implement *only* mailbox 0, but can receive messages
55873 +                * for any mailbox/letter to that mailbox destination. So,
55874 +                * make the callback with an unknown/invalid mailbox number
55875 +                * argument.
55876 +                */
55877 +               port->inb_msg[0].mcback(port, msg_rx_ring.dev_id, -1, -1);
55878 +
55879 +               /* Ack the queueing interrupt */
55880 +               out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_DIQI);
55881 +       }
55882 +
55883 +      out:
55884 +       return IRQ_HANDLED;
55885 +}
55886 +
55887 +/**
55888 + * rio_open_inb_mbox - Initialize MPC85xx inbound mailbox
55889 + * @mport: Master port implementing the inbound message unit
55890 + * @dev_id: Device specific pointer to pass on event
55891 + * @mbox: Mailbox to open
55892 + * @entries: Number of entries in the inbound mailbox ring
55893 + *
55894 + * Initializes buffer ring, request the inbound message interrupt,
55895 + * and enables the inbound message unit. Returns %0 on success
55896 + * and %-EINVAL or %-ENOMEM on failure.
55897 + */
55898 +int rio_open_inb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
55899 +{
55900 +       int i, rc = 0;
55901 +
55902 +       if ((entries < RIO_MIN_RX_RING_SIZE) ||
55903 +           (entries > RIO_MAX_RX_RING_SIZE) || (!is_power_of_2(entries))) {
55904 +               rc = -EINVAL;
55905 +               goto out;
55906 +       }
55907 +
55908 +       /* Initialize client buffer ring */
55909 +       msg_rx_ring.dev_id = dev_id;
55910 +       msg_rx_ring.size = entries;
55911 +       msg_rx_ring.rx_slot = 0;
55912 +       for (i = 0; i < msg_rx_ring.size; i++)
55913 +               msg_rx_ring.virt_buffer[i] = NULL;
55914 +
55915 +       /* Initialize inbound message ring */
55916 +       if (!(msg_rx_ring.virt = dma_alloc_coherent(NULL,
55917 +                                                   msg_rx_ring.size *
55918 +                                                   RIO_MAX_MSG_SIZE,
55919 +                                                   &msg_rx_ring.phys,
55920 +                                                   GFP_KERNEL))) {
55921 +               rc = -ENOMEM;
55922 +               goto out;
55923 +       }
55924 +
55925 +       /* Point dequeue/enqueue pointers at first entry in ring */
55926 +       out_be32((void *)&msg_regs->ifqdpar, (u32) msg_rx_ring.phys);
55927 +       out_be32((void *)&msg_regs->ifqepar, (u32) msg_rx_ring.phys);
55928 +
55929 +       /* Clear interrupt status */
55930 +       out_be32((void *)&msg_regs->isr, 0x00000091);
55931 +
55932 +       /* Hook up inbound message handler */
55933 +       if ((rc =
55934 +            request_irq(MPC85xx_IRQ_RIO_RX, mpc85xx_rio_rx_handler, 0,
55935 +                        "msg_rx", (void *)mport)) < 0) {
55936 +               dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
55937 +                                 msg_tx_ring.virt_buffer[i],
55938 +                                 msg_tx_ring.phys_buffer[i]);
55939 +               goto out;
55940 +       }
55941 +
55942 +       /*
55943 +        * Configure inbound message unit:
55944 +        *      Snooping
55945 +        *      4KB max message size
55946 +        *      Unmask all interrupt sources
55947 +        *      Disable
55948 +        */
55949 +       out_be32((void *)&msg_regs->imr, 0x001b0060);
55950 +
55951 +       /* Set number of queue entries */
55952 +       out_be32((void *)&msg_regs->imr,
55953 +                in_be32((void *)&msg_regs->imr) |
55954 +                ((get_bitmask_order(entries) - 2) << 12));
55955 +
55956 +       /* Now enable the unit */
55957 +       out_be32((void *)&msg_regs->imr, in_be32((void *)&msg_regs->imr) | 0x1);
55958 +
55959 +      out:
55960 +       return rc;
55961 +}
55962 +
55963 +/**
55964 + * rio_close_inb_mbox - Shut down MPC85xx inbound mailbox
55965 + * @mport: Master port implementing the inbound message unit
55966 + * @mbox: Mailbox to close
55967 + *
55968 + * Disables the inbound message unit, free all buffers, and
55969 + * frees the inbound message interrupt.
55970 + */
55971 +void rio_close_inb_mbox(struct rio_mport *mport, int mbox)
55972 +{
55973 +       /* Disable inbound message unit */
55974 +       out_be32((void *)&msg_regs->imr, 0);
55975 +
55976 +       /* Free ring */
55977 +       dma_free_coherent(NULL, msg_rx_ring.size * RIO_MAX_MSG_SIZE,
55978 +                         msg_rx_ring.virt, msg_rx_ring.phys);
55979 +
55980 +       /* Free interrupt */
55981 +       free_irq(MPC85xx_IRQ_RIO_RX, (void *)mport);
55982 +}
55983 +
55984 +/**
55985 + * rio_hw_add_inb_buffer - Add buffer to the MPC85xx inbound message queue
55986 + * @mport: Master port implementing the inbound message unit
55987 + * @mbox: Inbound mailbox number
55988 + * @buf: Buffer to add to inbound queue
55989 + *
55990 + * Adds the @buf buffer to the MPC85xx inbound message queue. Returns
55991 + * %0 on success or %-EINVAL on failure.
55992 + */
55993 +int rio_hw_add_inb_buffer(struct rio_mport *mport, int mbox, void *buf)
55994 +{
55995 +       int rc = 0;
55996 +
55997 +       pr_debug("RIO: rio_hw_add_inb_buffer(), msg_rx_ring.rx_slot %d\n",
55998 +                msg_rx_ring.rx_slot);
55999 +
56000 +       if (msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot]) {
56001 +               printk(KERN_ERR
56002 +                      "RIO: error adding inbound buffer %d, buffer exists\n",
56003 +                      msg_rx_ring.rx_slot);
56004 +               rc = -EINVAL;
56005 +               goto out;
56006 +       }
56007 +
56008 +       msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot] = buf;
56009 +       if (++msg_rx_ring.rx_slot == msg_rx_ring.size)
56010 +               msg_rx_ring.rx_slot = 0;
56011 +
56012 +      out:
56013 +       return rc;
56014 +}
56015 +
56016 +EXPORT_SYMBOL_GPL(rio_hw_add_inb_buffer);
56017 +
56018 +/**
56019 + * rio_hw_get_inb_message - Fetch inbound message from the MPC85xx message unit
56020 + * @mport: Master port implementing the inbound message unit
56021 + * @mbox: Inbound mailbox number
56022 + *
56023 + * Gets the next available inbound message from the inbound message queue.
56024 + * A pointer to the message is returned on success or NULL on failure.
56025 + */
56026 +void *rio_hw_get_inb_message(struct rio_mport *mport, int mbox)
56027 +{
56028 +       u32 imr;
56029 +       u32 phys_buf, virt_buf;
56030 +       void *buf = NULL;
56031 +       int buf_idx;
56032 +
56033 +       phys_buf = in_be32((void *)&msg_regs->ifqdpar);
56034 +
56035 +       /* If no more messages, then bail out */
56036 +       if (phys_buf == in_be32((void *)&msg_regs->ifqepar))
56037 +               goto out2;
56038 +
56039 +       virt_buf = (u32) msg_rx_ring.virt + (phys_buf - msg_rx_ring.phys);
56040 +       buf_idx = (phys_buf - msg_rx_ring.phys) / RIO_MAX_MSG_SIZE;
56041 +       buf = msg_rx_ring.virt_buffer[buf_idx];
56042 +
56043 +       if (!buf) {
56044 +               printk(KERN_ERR
56045 +                      "RIO: inbound message copy failed, no buffers\n");
56046 +               goto out1;
56047 +       }
56048 +
56049 +       /* Copy max message size, caller is expected to allocate that big */
56050 +       memcpy(buf, (void *)virt_buf, RIO_MAX_MSG_SIZE);
56051 +
56052 +       /* Clear the available buffer */
56053 +       msg_rx_ring.virt_buffer[buf_idx] = NULL;
56054 +
56055 +      out1:
56056 +       imr = in_be32((void *)&msg_regs->imr);
56057 +       out_be32((void *)&msg_regs->imr, imr | RIO_MSG_IMR_MI);
56058 +
56059 +      out2:
56060 +       return buf;
56061 +}
56062 +
56063 +EXPORT_SYMBOL_GPL(rio_hw_get_inb_message);
56064 +
56065 +/**
56066 + * mpc85xx_rio_dbell_handler - MPC85xx doorbell interrupt handler
56067 + * @irq: Linux interrupt number
56068 + * @dev_instance: Pointer to interrupt-specific data
56069 + *
56070 + * Handles doorbell interrupts. Parses a list of registered
56071 + * doorbell event handlers and executes a matching event handler.
56072 + */
56073 +static irqreturn_t
56074 +mpc85xx_rio_dbell_handler(int irq, void *dev_instance)
56075 +{
56076 +       int dsr;
56077 +       struct rio_mport *port = (struct rio_mport *)dev_instance;
56078 +
56079 +       dsr = in_be32((void *)&msg_regs->dsr);
56080 +
56081 +       if (dsr & DOORBELL_DSR_TE) {
56082 +               pr_info("RIO: doorbell reception error\n");
56083 +               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_TE);
56084 +               goto out;
56085 +       }
56086 +
56087 +       if (dsr & DOORBELL_DSR_QFI) {
56088 +               pr_info("RIO: doorbell queue full\n");
56089 +               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_QFI);
56090 +               goto out;
56091 +       }
56092 +
56093 +       /* XXX Need to check/dispatch until queue empty */
56094 +       if (dsr & DOORBELL_DSR_DIQI) {
56095 +               u32 dmsg =
56096 +                   (u32) dbell_ring.virt +
56097 +                   (in_be32((void *)&msg_regs->dqdpar) & 0xfff);
56098 +               u32 dmr;
56099 +               struct rio_dbell *dbell;
56100 +               int found = 0;
56101 +
56102 +               pr_debug
56103 +                   ("RIO: processing doorbell, sid %2.2x tid %2.2x info %4.4x\n",
56104 +                    DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
56105 +
56106 +               list_for_each_entry(dbell, &port->dbells, node) {
56107 +                       if ((dbell->res->start <= DBELL_INF(dmsg)) &&
56108 +                           (dbell->res->end >= DBELL_INF(dmsg))) {
56109 +                               found = 1;
56110 +                               break;
56111 +                       }
56112 +               }
56113 +               if (found) {
56114 +                       dbell->dinb(port, dbell->dev_id, DBELL_SID(dmsg), DBELL_TID(dmsg),
56115 +                                   DBELL_INF(dmsg));
56116 +               } else {
56117 +                       pr_debug
56118 +                           ("RIO: spurious doorbell, sid %2.2x tid %2.2x info %4.4x\n",
56119 +                            DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
56120 +               }
56121 +               dmr = in_be32((void *)&msg_regs->dmr);
56122 +               out_be32((void *)&msg_regs->dmr, dmr | DOORBELL_DMR_DI);
56123 +               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_DIQI);
56124 +       }
56125 +
56126 +      out:
56127 +       return IRQ_HANDLED;
56128 +}
56129 +
56130 +/**
56131 + * mpc85xx_rio_doorbell_init - MPC85xx doorbell interface init
56132 + * @mport: Master port implementing the inbound doorbell unit
56133 + *
56134 + * Initializes doorbell unit hardware and inbound DMA buffer
56135 + * ring. Called from mpc85xx_rio_setup(). Returns %0 on success
56136 + * or %-ENOMEM on failure.
56137 + */
56138 +static int mpc85xx_rio_doorbell_init(struct rio_mport *mport)
56139 +{
56140 +       int rc = 0;
56141 +
56142 +       /* Map outbound doorbell window immediately after maintenance window */
56143 +       if (!(dbell_win =
56144 +             (u32) ioremap(mport->iores.start + RIO_MAINT_WIN_SIZE,
56145 +                           RIO_DBELL_WIN_SIZE))) {
56146 +               printk(KERN_ERR
56147 +                      "RIO: unable to map outbound doorbell window\n");
56148 +               rc = -ENOMEM;
56149 +               goto out;
56150 +       }
56151 +
56152 +       /* Initialize inbound doorbells */
56153 +       if (!(dbell_ring.virt = dma_alloc_coherent(NULL,
56154 +                                                  512 * DOORBELL_MESSAGE_SIZE,
56155 +                                                  &dbell_ring.phys,
56156 +                                                  GFP_KERNEL))) {
56157 +               printk(KERN_ERR "RIO: unable allocate inbound doorbell ring\n");
56158 +               rc = -ENOMEM;
56159 +               iounmap((void *)dbell_win);
56160 +               goto out;
56161 +       }
56162 +
56163 +       /* Point dequeue/enqueue pointers at first entry in ring */
56164 +       out_be32((void *)&msg_regs->dqdpar, (u32) dbell_ring.phys);
56165 +       out_be32((void *)&msg_regs->dqepar, (u32) dbell_ring.phys);
56166 +
56167 +       /* Clear interrupt status */
56168 +       out_be32((void *)&msg_regs->dsr, 0x00000091);
56169 +
56170 +       /* Hook up doorbell handler */
56171 +       if ((rc =
56172 +            request_irq(MPC85xx_IRQ_RIO_BELL, mpc85xx_rio_dbell_handler, 0,
56173 +                        "dbell_rx", (void *)mport) < 0)) {
56174 +               iounmap((void *)dbell_win);
56175 +               dma_free_coherent(NULL, 512 * DOORBELL_MESSAGE_SIZE,
56176 +                                 dbell_ring.virt, dbell_ring.phys);
56177 +               printk(KERN_ERR
56178 +                      "MPC85xx RIO: unable to request inbound doorbell irq");
56179 +               goto out;
56180 +       }
56181 +
56182 +       /* Configure doorbells for snooping, 512 entries, and enable */
56183 +       out_be32((void *)&msg_regs->dmr, 0x00108161);
56184 +
56185 +      out:
56186 +       return rc;
56187 +}
56188 +
56189 +static char *cmdline = NULL;
56190 +
56191 +static int mpc85xx_rio_get_hdid(int index)
56192 +{
56193 +       /* XXX Need to parse multiple entries in some format */
56194 +       if (!cmdline)
56195 +               return -1;
56196 +
56197 +       return simple_strtol(cmdline, NULL, 0);
56198 +}
56199 +
56200 +static int mpc85xx_rio_get_cmdline(char *s)
56201 +{
56202 +       if (!s)
56203 +               return 0;
56204 +
56205 +       cmdline = s;
56206 +       return 1;
56207 +}
56208 +
56209 +__setup("riohdid=", mpc85xx_rio_get_cmdline);
56210 +
56211 +/**
56212 + * mpc85xx_rio_setup - Setup MPC85xx RapidIO interface
56213 + * @law_start: Starting physical address of RapidIO LAW
56214 + * @law_size: Size of RapidIO LAW
56215 + *
56216 + * Initializes MPC85xx RapidIO hardware interface, configures
56217 + * master port with system-specific info, and registers the
56218 + * master port with the RapidIO subsystem.
56219 + */
56220 +void mpc85xx_rio_setup(int law_start, int law_size)
56221 +{
56222 +       struct rio_ops *ops;
56223 +       struct rio_mport *port;
56224 +
56225 +       ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL);
56226 +       ops->lcread = mpc85xx_local_config_read;
56227 +       ops->lcwrite = mpc85xx_local_config_write;
56228 +       ops->cread = mpc85xx_rio_config_read;
56229 +       ops->cwrite = mpc85xx_rio_config_write;
56230 +       ops->dsend = mpc85xx_rio_doorbell_send;
56231 +
56232 +       port = kmalloc(sizeof(struct rio_mport), GFP_KERNEL);
56233 +       port->id = 0;
56234 +       port->index = 0;
56235 +       INIT_LIST_HEAD(&port->dbells);
56236 +       port->iores.start = law_start;
56237 +       port->iores.end = law_start + law_size;
56238 +       port->iores.flags = IORESOURCE_MEM;
56239 +
56240 +       rio_init_dbell_res(&port->riores[RIO_DOORBELL_RESOURCE], 0, 0xffff);
56241 +       rio_init_mbox_res(&port->riores[RIO_INB_MBOX_RESOURCE], 0, 0);
56242 +       rio_init_mbox_res(&port->riores[RIO_OUTB_MBOX_RESOURCE], 0, 0);
56243 +       strcpy(port->name, "RIO0 mport");
56244 +
56245 +       port->ops = ops;
56246 +       port->host_deviceid = mpc85xx_rio_get_hdid(port->id);
56247 +
56248 +       rio_register_mport(port);
56249 +
56250 +       regs_win = (u32) ioremap(RIO_REGS_BASE, 0x20000);
56251 +       atmu_regs = (struct rio_atmu_regs *)(regs_win + RIO_ATMU_REGS_OFFSET);
56252 +       maint_atmu_regs = atmu_regs + 1;
56253 +       dbell_atmu_regs = atmu_regs + 2;
56254 +       msg_regs = (struct rio_msg_regs *)(regs_win + RIO_MSG_REGS_OFFSET);
56255 +
56256 +       /* Configure maintenance transaction window */
56257 +       out_be32((void *)&maint_atmu_regs->rowbar, 0x000c0000);
56258 +       out_be32((void *)&maint_atmu_regs->rowar, 0x80077015);
56259 +
56260 +       maint_win = (u32) ioremap(law_start, RIO_MAINT_WIN_SIZE);
56261 +
56262 +       /* Configure outbound doorbell window */
56263 +       out_be32((void *)&dbell_atmu_regs->rowbar, 0x000c0400);
56264 +       out_be32((void *)&dbell_atmu_regs->rowar, 0x8004200b);
56265 +       mpc85xx_rio_doorbell_init(port);
56266 +}
56267 --- /dev/null
56268 +++ b/arch/powerpc/sysdev/fsl_rio.h
56269 @@ -0,0 +1,20 @@
56270 +/*
56271 + * MPC85xx RapidIO definitions
56272 + *
56273 + * Copyright 2005 MontaVista Software, Inc.
56274 + * Matt Porter <mporter@kernel.crashing.org>
56275 + *
56276 + * This program is free software; you can redistribute  it and/or modify it
56277 + * under  the terms of  the GNU General  Public License as published by the
56278 + * Free Software Foundation;  either version 2 of the  License, or (at your
56279 + * option) any later version.
56280 + */
56281 +
56282 +#ifndef __PPC_SYSLIB_PPC85XX_RIO_H
56283 +#define __PPC_SYSLIB_PPC85XX_RIO_H
56284 +
56285 +#include <linux/init.h>
56286 +
56287 +extern void mpc85xx_rio_setup(int law_start, int law_size);
56288 +
56289 +#endif                         /* __PPC_SYSLIB_PPC85XX_RIO_H */
56290 --- a/arch/powerpc/sysdev/fsl_soc.c
56291 +++ b/arch/powerpc/sysdev/fsl_soc.c
56292 @@ -24,6 +24,7 @@
56293  #include <linux/platform_device.h>
56294  #include <linux/of_platform.h>
56295  #include <linux/phy.h>
56296 +#include <linux/phy_fixed.h>
56297  #include <linux/spi/spi.h>
56298  #include <linux/fsl_devices.h>
56299  #include <linux/fs_enet_pd.h>
56300 @@ -54,10 +55,18 @@
56301         soc = of_find_node_by_type(NULL, "soc");
56302         if (soc) {
56303                 int size;
56304 -               const void *prop = of_get_property(soc, "reg", &size);
56305 +               u32 naddr;
56306 +               const u32 *prop = of_get_property(soc, "#address-cells", &size);
56307  
56308 +               if (prop && size == 4)
56309 +                       naddr = *prop;
56310 +               else
56311 +                       naddr = 2;
56312 +
56313 +               prop = of_get_property(soc, "ranges", &size);
56314                 if (prop)
56315 -                       immrbase = of_translate_address(soc, prop);
56316 +                       immrbase = of_translate_address(soc, prop + naddr);
56317 +
56318                 of_node_put(soc);
56319         }
56320  
56321 @@ -130,17 +139,51 @@
56322  EXPORT_SYMBOL(get_baudrate);
56323  #endif /* CONFIG_CPM2 */
56324  
56325 -static int __init gfar_mdio_of_init(void)
56326 +#ifdef CONFIG_FIXED_PHY
56327 +static int __init of_add_fixed_phys(void)
56328  {
56329 +       int ret;
56330         struct device_node *np;
56331 -       unsigned int i;
56332 +       u32 *fixed_link;
56333 +       struct fixed_phy_status status = {};
56334 +
56335 +       for_each_node_by_name(np, "ethernet") {
56336 +               fixed_link  = (u32 *)of_get_property(np, "fixed-link", NULL);
56337 +               if (!fixed_link)
56338 +                       continue;
56339 +
56340 +               status.link = 1;
56341 +               status.duplex = fixed_link[1];
56342 +               status.speed = fixed_link[2];
56343 +               status.pause = fixed_link[3];
56344 +               status.asym_pause = fixed_link[4];
56345 +
56346 +               ret = fixed_phy_add(PHY_POLL, fixed_link[0], &status);
56347 +               if (ret) {
56348 +                       of_node_put(np);
56349 +                       return ret;
56350 +               }
56351 +       }
56352 +
56353 +       return 0;
56354 +}
56355 +arch_initcall(of_add_fixed_phys);
56356 +#endif /* CONFIG_FIXED_PHY */
56357 +
56358 +static int __init gfar_mdio_of_init(void)
56359 +{
56360 +       struct device_node *np = NULL;
56361         struct platform_device *mdio_dev;
56362         struct resource res;
56363         int ret;
56364  
56365 -       for (np = NULL, i = 0;
56366 -            (np = of_find_compatible_node(np, "mdio", "gianfar")) != NULL;
56367 -            i++) {
56368 +       np = of_find_compatible_node(np, NULL, "fsl,gianfar-mdio");
56369 +
56370 +       /* try the deprecated version */
56371 +       if (!np)
56372 +               np = of_find_compatible_node(np, "mdio", "gianfar");
56373 +
56374 +       if (np) {
56375                 int k;
56376                 struct device_node *child = NULL;
56377                 struct gianfar_mdio_data mdio_data;
56378 @@ -179,11 +222,13 @@
56379                         goto unreg;
56380         }
56381  
56382 +       of_node_put(np);
56383         return 0;
56384  
56385  unreg:
56386         platform_device_unregister(mdio_dev);
56387  err:
56388 +       of_node_put(np);
56389         return ret;
56390  }
56391  
56392 @@ -193,7 +238,6 @@
56393  static const char *gfar_rx_intr = "rx";
56394  static const char *gfar_err_intr = "error";
56395  
56396 -
56397  static int __init gfar_of_init(void)
56398  {
56399         struct device_node *np;
56400 @@ -277,29 +321,43 @@
56401                         gfar_data.interface = PHY_INTERFACE_MODE_MII;
56402  
56403                 ph = of_get_property(np, "phy-handle", NULL);
56404 -               phy = of_find_node_by_phandle(*ph);
56405 +               if (ph == NULL) {
56406 +                       u32 *fixed_link;
56407  
56408 -               if (phy == NULL) {
56409 -                       ret = -ENODEV;
56410 -                       goto unreg;
56411 -               }
56412 +                       fixed_link = (u32 *)of_get_property(np, "fixed-link",
56413 +                                                          NULL);
56414 +                       if (!fixed_link) {
56415 +                               ret = -ENODEV;
56416 +                               goto unreg;
56417 +                       }
56418  
56419 -               mdio = of_get_parent(phy);
56420 +                       gfar_data.bus_id = 0;
56421 +                       gfar_data.phy_id = fixed_link[0];
56422 +               } else {
56423 +                       phy = of_find_node_by_phandle(*ph);
56424 +
56425 +                       if (phy == NULL) {
56426 +                               ret = -ENODEV;
56427 +                               goto unreg;
56428 +                       }
56429 +
56430 +                       mdio = of_get_parent(phy);
56431 +
56432 +                       id = of_get_property(phy, "reg", NULL);
56433 +                       ret = of_address_to_resource(mdio, 0, &res);
56434 +                       if (ret) {
56435 +                               of_node_put(phy);
56436 +                               of_node_put(mdio);
56437 +                               goto unreg;
56438 +                       }
56439 +
56440 +                       gfar_data.phy_id = *id;
56441 +                       gfar_data.bus_id = res.start;
56442  
56443 -               id = of_get_property(phy, "reg", NULL);
56444 -               ret = of_address_to_resource(mdio, 0, &res);
56445 -               if (ret) {
56446                         of_node_put(phy);
56447                         of_node_put(mdio);
56448 -                       goto unreg;
56449                 }
56450  
56451 -               gfar_data.phy_id = *id;
56452 -               gfar_data.bus_id = res.start;
56453 -
56454 -               of_node_put(phy);
56455 -               of_node_put(mdio);
56456 -
56457                 ret =
56458                     platform_device_add_data(gfar_dev, &gfar_data,
56459                                              sizeof(struct
56460 @@ -390,13 +448,11 @@
56461  static int __init fsl_i2c_of_init(void)
56462  {
56463         struct device_node *np;
56464 -       unsigned int i;
56465 +       unsigned int i = 0;
56466         struct platform_device *i2c_dev;
56467         int ret;
56468  
56469 -       for (np = NULL, i = 0;
56470 -            (np = of_find_compatible_node(np, "i2c", "fsl-i2c")) != NULL;
56471 -            i++) {
56472 +       for_each_compatible_node(np, NULL, "fsl-i2c") {
56473                 struct resource r[2];
56474                 struct fsl_i2c_platform_data i2c_data;
56475                 const unsigned char *flags = NULL;
56476 @@ -432,7 +488,7 @@
56477                 if (ret)
56478                         goto unreg;
56479  
56480 -               of_register_i2c_devices(np, i);
56481 +               of_register_i2c_devices(np, i++);
56482         }
56483  
56484         return 0;
56485 @@ -528,14 +584,12 @@
56486  static int __init fsl_usb_of_init(void)
56487  {
56488         struct device_node *np;
56489 -       unsigned int i;
56490 +       unsigned int i = 0;
56491         struct platform_device *usb_dev_mph = NULL, *usb_dev_dr_host = NULL,
56492                 *usb_dev_dr_client = NULL;
56493         int ret;
56494  
56495 -       for (np = NULL, i = 0;
56496 -            (np = of_find_compatible_node(np, "usb", "fsl-usb2-mph")) != NULL;
56497 -            i++) {
56498 +       for_each_compatible_node(np, NULL, "fsl-usb2-mph") {
56499                 struct resource r[2];
56500                 struct fsl_usb2_platform_data usb_data;
56501                 const unsigned char *prop = NULL;
56502 @@ -578,11 +632,10 @@
56503                                                     fsl_usb2_platform_data));
56504                 if (ret)
56505                         goto unreg_mph;
56506 +               i++;
56507         }
56508  
56509 -       for (np = NULL;
56510 -            (np = of_find_compatible_node(np, "usb", "fsl-usb2-dr")) != NULL;
56511 -            i++) {
56512 +       for_each_compatible_node(np, NULL, "fsl-usb2-dr") {
56513                 struct resource r[2];
56514                 struct fsl_usb2_platform_data usb_data;
56515                 const unsigned char *prop = NULL;
56516 @@ -654,6 +707,7 @@
56517                                                 fsl_usb2_platform_data))))
56518                                 goto unreg_dr;
56519                 }
56520 +               i++;
56521         }
56522         return 0;
56523  
56524 @@ -1125,13 +1179,12 @@
56525  
56526  static int __init fsl_pcmcia_of_init(void)
56527  {
56528 -       struct device_node *np = NULL;
56529 +       struct device_node *np;
56530         /*
56531          * Register all the devices which type is "pcmcia"
56532          */
56533 -       while ((np = of_find_compatible_node(np,
56534 -                       "pcmcia", "fsl,pq-pcmcia")) != NULL)
56535 -                           of_platform_device_create(np, "m8xx-pcmcia", NULL);
56536 +       for_each_compatible_node(np, "pcmcia", "fsl,pq-pcmcia")
56537 +               of_platform_device_create(np, "m8xx-pcmcia", NULL);
56538         return 0;
56539  }
56540  
56541 --- a/arch/powerpc/sysdev/grackle.c
56542 +++ b/arch/powerpc/sysdev/grackle.c
56543 @@ -57,7 +57,7 @@
56544  {
56545         setup_indirect_pci(hose, 0xfec00000, 0xfee00000, 0);
56546         if (machine_is_compatible("PowerMac1,1"))
56547 -               pci_assign_all_buses = 1;
56548 +               ppc_pci_flags |= PPC_PCI_REASSIGN_ALL_BUS;
56549         if (machine_is_compatible("AAPL,PowerBook1998"))
56550                 grackle_set_loop_snoop(hose, 1);
56551  #if 0  /* Disabled for now, HW problems ??? */
56552 --- a/arch/powerpc/sysdev/ipic.c
56553 +++ b/arch/powerpc/sysdev/ipic.c
56554 @@ -30,11 +30,67 @@
56555  #include "ipic.h"
56556  
56557  static struct ipic * primary_ipic;
56558 +static struct irq_chip ipic_level_irq_chip, ipic_edge_irq_chip;
56559  static DEFINE_SPINLOCK(ipic_lock);
56560  
56561  static struct ipic_info ipic_info[] = {
56562 +       [1] = {
56563 +               .mask   = IPIC_SIMSR_H,
56564 +               .prio   = IPIC_SIPRR_C,
56565 +               .force  = IPIC_SIFCR_H,
56566 +               .bit    = 16,
56567 +               .prio_mask = 0,
56568 +       },
56569 +       [2] = {
56570 +               .mask   = IPIC_SIMSR_H,
56571 +               .prio   = IPIC_SIPRR_C,
56572 +               .force  = IPIC_SIFCR_H,
56573 +               .bit    = 17,
56574 +               .prio_mask = 1,
56575 +       },
56576 +       [3] = {
56577 +               .mask   = IPIC_SIMSR_H,
56578 +               .prio   = IPIC_SIPRR_C,
56579 +               .force  = IPIC_SIFCR_H,
56580 +               .bit    = 18,
56581 +               .prio_mask = 2,
56582 +       },
56583 +       [4] = {
56584 +               .mask   = IPIC_SIMSR_H,
56585 +               .prio   = IPIC_SIPRR_C,
56586 +               .force  = IPIC_SIFCR_H,
56587 +               .bit    = 19,
56588 +               .prio_mask = 3,
56589 +       },
56590 +       [5] = {
56591 +               .mask   = IPIC_SIMSR_H,
56592 +               .prio   = IPIC_SIPRR_C,
56593 +               .force  = IPIC_SIFCR_H,
56594 +               .bit    = 20,
56595 +               .prio_mask = 4,
56596 +       },
56597 +       [6] = {
56598 +               .mask   = IPIC_SIMSR_H,
56599 +               .prio   = IPIC_SIPRR_C,
56600 +               .force  = IPIC_SIFCR_H,
56601 +               .bit    = 21,
56602 +               .prio_mask = 5,
56603 +       },
56604 +       [7] = {
56605 +               .mask   = IPIC_SIMSR_H,
56606 +               .prio   = IPIC_SIPRR_C,
56607 +               .force  = IPIC_SIFCR_H,
56608 +               .bit    = 22,
56609 +               .prio_mask = 6,
56610 +       },
56611 +       [8] = {
56612 +               .mask   = IPIC_SIMSR_H,
56613 +               .prio   = IPIC_SIPRR_C,
56614 +               .force  = IPIC_SIFCR_H,
56615 +               .bit    = 23,
56616 +               .prio_mask = 7,
56617 +       },
56618         [9] = {
56619 -               .pend   = IPIC_SIPNR_H,
56620                 .mask   = IPIC_SIMSR_H,
56621                 .prio   = IPIC_SIPRR_D,
56622                 .force  = IPIC_SIFCR_H,
56623 @@ -42,7 +98,6 @@
56624                 .prio_mask = 0,
56625         },
56626         [10] = {
56627 -               .pend   = IPIC_SIPNR_H,
56628                 .mask   = IPIC_SIMSR_H,
56629                 .prio   = IPIC_SIPRR_D,
56630                 .force  = IPIC_SIFCR_H,
56631 @@ -50,15 +105,27 @@
56632                 .prio_mask = 1,
56633         },
56634         [11] = {
56635 -               .pend   = IPIC_SIPNR_H,
56636                 .mask   = IPIC_SIMSR_H,
56637                 .prio   = IPIC_SIPRR_D,
56638                 .force  = IPIC_SIFCR_H,
56639                 .bit    = 26,
56640                 .prio_mask = 2,
56641         },
56642 +       [12] = {
56643 +               .mask   = IPIC_SIMSR_H,
56644 +               .prio   = IPIC_SIPRR_D,
56645 +               .force  = IPIC_SIFCR_H,
56646 +               .bit    = 27,
56647 +               .prio_mask = 3,
56648 +       },
56649 +       [13] = {
56650 +               .mask   = IPIC_SIMSR_H,
56651 +               .prio   = IPIC_SIPRR_D,
56652 +               .force  = IPIC_SIFCR_H,
56653 +               .bit    = 28,
56654 +               .prio_mask = 4,
56655 +       },
56656         [14] = {
56657 -               .pend   = IPIC_SIPNR_H,
56658                 .mask   = IPIC_SIMSR_H,
56659                 .prio   = IPIC_SIPRR_D,
56660                 .force  = IPIC_SIFCR_H,
56661 @@ -66,7 +133,6 @@
56662                 .prio_mask = 5,
56663         },
56664         [15] = {
56665 -               .pend   = IPIC_SIPNR_H,
56666                 .mask   = IPIC_SIMSR_H,
56667                 .prio   = IPIC_SIPRR_D,
56668                 .force  = IPIC_SIFCR_H,
56669 @@ -74,7 +140,6 @@
56670                 .prio_mask = 6,
56671         },
56672         [16] = {
56673 -               .pend   = IPIC_SIPNR_H,
56674                 .mask   = IPIC_SIMSR_H,
56675                 .prio   = IPIC_SIPRR_D,
56676                 .force  = IPIC_SIFCR_H,
56677 @@ -82,7 +147,7 @@
56678                 .prio_mask = 7,
56679         },
56680         [17] = {
56681 -               .pend   = IPIC_SEPNR,
56682 +               .ack    = IPIC_SEPNR,
56683                 .mask   = IPIC_SEMSR,
56684                 .prio   = IPIC_SMPRR_A,
56685                 .force  = IPIC_SEFCR,
56686 @@ -90,7 +155,7 @@
56687                 .prio_mask = 5,
56688         },
56689         [18] = {
56690 -               .pend   = IPIC_SEPNR,
56691 +               .ack    = IPIC_SEPNR,
56692                 .mask   = IPIC_SEMSR,
56693                 .prio   = IPIC_SMPRR_A,
56694                 .force  = IPIC_SEFCR,
56695 @@ -98,7 +163,7 @@
56696                 .prio_mask = 6,
56697         },
56698         [19] = {
56699 -               .pend   = IPIC_SEPNR,
56700 +               .ack    = IPIC_SEPNR,
56701                 .mask   = IPIC_SEMSR,
56702                 .prio   = IPIC_SMPRR_A,
56703                 .force  = IPIC_SEFCR,
56704 @@ -106,7 +171,7 @@
56705                 .prio_mask = 7,
56706         },
56707         [20] = {
56708 -               .pend   = IPIC_SEPNR,
56709 +               .ack    = IPIC_SEPNR,
56710                 .mask   = IPIC_SEMSR,
56711                 .prio   = IPIC_SMPRR_B,
56712                 .force  = IPIC_SEFCR,
56713 @@ -114,7 +179,7 @@
56714                 .prio_mask = 4,
56715         },
56716         [21] = {
56717 -               .pend   = IPIC_SEPNR,
56718 +               .ack    = IPIC_SEPNR,
56719                 .mask   = IPIC_SEMSR,
56720                 .prio   = IPIC_SMPRR_B,
56721                 .force  = IPIC_SEFCR,
56722 @@ -122,7 +187,7 @@
56723                 .prio_mask = 5,
56724         },
56725         [22] = {
56726 -               .pend   = IPIC_SEPNR,
56727 +               .ack    = IPIC_SEPNR,
56728                 .mask   = IPIC_SEMSR,
56729                 .prio   = IPIC_SMPRR_B,
56730                 .force  = IPIC_SEFCR,
56731 @@ -130,7 +195,7 @@
56732                 .prio_mask = 6,
56733         },
56734         [23] = {
56735 -               .pend   = IPIC_SEPNR,
56736 +               .ack    = IPIC_SEPNR,
56737                 .mask   = IPIC_SEMSR,
56738                 .prio   = IPIC_SMPRR_B,
56739                 .force  = IPIC_SEFCR,
56740 @@ -138,7 +203,6 @@
56741                 .prio_mask = 7,
56742         },
56743         [32] = {
56744 -               .pend   = IPIC_SIPNR_H,
56745                 .mask   = IPIC_SIMSR_H,
56746                 .prio   = IPIC_SIPRR_A,
56747                 .force  = IPIC_SIFCR_H,
56748 @@ -146,7 +210,6 @@
56749                 .prio_mask = 0,
56750         },
56751         [33] = {
56752 -               .pend   = IPIC_SIPNR_H,
56753                 .mask   = IPIC_SIMSR_H,
56754                 .prio   = IPIC_SIPRR_A,
56755                 .force  = IPIC_SIFCR_H,
56756 @@ -154,7 +217,6 @@
56757                 .prio_mask = 1,
56758         },
56759         [34] = {
56760 -               .pend   = IPIC_SIPNR_H,
56761                 .mask   = IPIC_SIMSR_H,
56762                 .prio   = IPIC_SIPRR_A,
56763                 .force  = IPIC_SIFCR_H,
56764 @@ -162,7 +224,6 @@
56765                 .prio_mask = 2,
56766         },
56767         [35] = {
56768 -               .pend   = IPIC_SIPNR_H,
56769                 .mask   = IPIC_SIMSR_H,
56770                 .prio   = IPIC_SIPRR_A,
56771                 .force  = IPIC_SIFCR_H,
56772 @@ -170,7 +231,6 @@
56773                 .prio_mask = 3,
56774         },
56775         [36] = {
56776 -               .pend   = IPIC_SIPNR_H,
56777                 .mask   = IPIC_SIMSR_H,
56778                 .prio   = IPIC_SIPRR_A,
56779                 .force  = IPIC_SIFCR_H,
56780 @@ -178,7 +238,6 @@
56781                 .prio_mask = 4,
56782         },
56783         [37] = {
56784 -               .pend   = IPIC_SIPNR_H,
56785                 .mask   = IPIC_SIMSR_H,
56786                 .prio   = IPIC_SIPRR_A,
56787                 .force  = IPIC_SIFCR_H,
56788 @@ -186,7 +245,6 @@
56789                 .prio_mask = 5,
56790         },
56791         [38] = {
56792 -               .pend   = IPIC_SIPNR_H,
56793                 .mask   = IPIC_SIMSR_H,
56794                 .prio   = IPIC_SIPRR_A,
56795                 .force  = IPIC_SIFCR_H,
56796 @@ -194,15 +252,69 @@
56797                 .prio_mask = 6,
56798         },
56799         [39] = {
56800 -               .pend   = IPIC_SIPNR_H,
56801                 .mask   = IPIC_SIMSR_H,
56802                 .prio   = IPIC_SIPRR_A,
56803                 .force  = IPIC_SIFCR_H,
56804                 .bit    = 7,
56805                 .prio_mask = 7,
56806         },
56807 +       [40] = {
56808 +               .mask   = IPIC_SIMSR_H,
56809 +               .prio   = IPIC_SIPRR_B,
56810 +               .force  = IPIC_SIFCR_H,
56811 +               .bit    = 8,
56812 +               .prio_mask = 0,
56813 +       },
56814 +       [41] = {
56815 +               .mask   = IPIC_SIMSR_H,
56816 +               .prio   = IPIC_SIPRR_B,
56817 +               .force  = IPIC_SIFCR_H,
56818 +               .bit    = 9,
56819 +               .prio_mask = 1,
56820 +       },
56821 +       [42] = {
56822 +               .mask   = IPIC_SIMSR_H,
56823 +               .prio   = IPIC_SIPRR_B,
56824 +               .force  = IPIC_SIFCR_H,
56825 +               .bit    = 10,
56826 +               .prio_mask = 2,
56827 +       },
56828 +       [43] = {
56829 +               .mask   = IPIC_SIMSR_H,
56830 +               .prio   = IPIC_SIPRR_B,
56831 +               .force  = IPIC_SIFCR_H,
56832 +               .bit    = 11,
56833 +               .prio_mask = 3,
56834 +       },
56835 +       [44] = {
56836 +               .mask   = IPIC_SIMSR_H,
56837 +               .prio   = IPIC_SIPRR_B,
56838 +               .force  = IPIC_SIFCR_H,
56839 +               .bit    = 12,
56840 +               .prio_mask = 4,
56841 +       },
56842 +       [45] = {
56843 +               .mask   = IPIC_SIMSR_H,
56844 +               .prio   = IPIC_SIPRR_B,
56845 +               .force  = IPIC_SIFCR_H,
56846 +               .bit    = 13,
56847 +               .prio_mask = 5,
56848 +       },
56849 +       [46] = {
56850 +               .mask   = IPIC_SIMSR_H,
56851 +               .prio   = IPIC_SIPRR_B,
56852 +               .force  = IPIC_SIFCR_H,
56853 +               .bit    = 14,
56854 +               .prio_mask = 6,
56855 +       },
56856 +       [47] = {
56857 +               .mask   = IPIC_SIMSR_H,
56858 +               .prio   = IPIC_SIPRR_B,
56859 +               .force  = IPIC_SIFCR_H,
56860 +               .bit    = 15,
56861 +               .prio_mask = 7,
56862 +       },
56863         [48] = {
56864 -               .pend   = IPIC_SEPNR,
56865                 .mask   = IPIC_SEMSR,
56866                 .prio   = IPIC_SMPRR_A,
56867                 .force  = IPIC_SEFCR,
56868 @@ -210,7 +322,6 @@
56869                 .prio_mask = 4,
56870         },
56871         [64] = {
56872 -               .pend   = IPIC_SIPNR_L,
56873                 .mask   = IPIC_SIMSR_L,
56874                 .prio   = IPIC_SMPRR_A,
56875                 .force  = IPIC_SIFCR_L,
56876 @@ -218,7 +329,6 @@
56877                 .prio_mask = 0,
56878         },
56879         [65] = {
56880 -               .pend   = IPIC_SIPNR_L,
56881                 .mask   = IPIC_SIMSR_L,
56882                 .prio   = IPIC_SMPRR_A,
56883                 .force  = IPIC_SIFCR_L,
56884 @@ -226,7 +336,6 @@
56885                 .prio_mask = 1,
56886         },
56887         [66] = {
56888 -               .pend   = IPIC_SIPNR_L,
56889                 .mask   = IPIC_SIMSR_L,
56890                 .prio   = IPIC_SMPRR_A,
56891                 .force  = IPIC_SIFCR_L,
56892 @@ -234,7 +343,6 @@
56893                 .prio_mask = 2,
56894         },
56895         [67] = {
56896 -               .pend   = IPIC_SIPNR_L,
56897                 .mask   = IPIC_SIMSR_L,
56898                 .prio   = IPIC_SMPRR_A,
56899                 .force  = IPIC_SIFCR_L,
56900 @@ -242,7 +350,6 @@
56901                 .prio_mask = 3,
56902         },
56903         [68] = {
56904 -               .pend   = IPIC_SIPNR_L,
56905                 .mask   = IPIC_SIMSR_L,
56906                 .prio   = IPIC_SMPRR_B,
56907                 .force  = IPIC_SIFCR_L,
56908 @@ -250,7 +357,6 @@
56909                 .prio_mask = 0,
56910         },
56911         [69] = {
56912 -               .pend   = IPIC_SIPNR_L,
56913                 .mask   = IPIC_SIMSR_L,
56914                 .prio   = IPIC_SMPRR_B,
56915                 .force  = IPIC_SIFCR_L,
56916 @@ -258,7 +364,6 @@
56917                 .prio_mask = 1,
56918         },
56919         [70] = {
56920 -               .pend   = IPIC_SIPNR_L,
56921                 .mask   = IPIC_SIMSR_L,
56922                 .prio   = IPIC_SMPRR_B,
56923                 .force  = IPIC_SIFCR_L,
56924 @@ -266,7 +371,6 @@
56925                 .prio_mask = 2,
56926         },
56927         [71] = {
56928 -               .pend   = IPIC_SIPNR_L,
56929                 .mask   = IPIC_SIMSR_L,
56930                 .prio   = IPIC_SMPRR_B,
56931                 .force  = IPIC_SIFCR_L,
56932 @@ -274,91 +378,120 @@
56933                 .prio_mask = 3,
56934         },
56935         [72] = {
56936 -               .pend   = IPIC_SIPNR_L,
56937                 .mask   = IPIC_SIMSR_L,
56938                 .prio   = 0,
56939                 .force  = IPIC_SIFCR_L,
56940                 .bit    = 8,
56941         },
56942         [73] = {
56943 -               .pend   = IPIC_SIPNR_L,
56944                 .mask   = IPIC_SIMSR_L,
56945                 .prio   = 0,
56946                 .force  = IPIC_SIFCR_L,
56947                 .bit    = 9,
56948         },
56949         [74] = {
56950 -               .pend   = IPIC_SIPNR_L,
56951                 .mask   = IPIC_SIMSR_L,
56952                 .prio   = 0,
56953                 .force  = IPIC_SIFCR_L,
56954                 .bit    = 10,
56955         },
56956         [75] = {
56957 -               .pend   = IPIC_SIPNR_L,
56958                 .mask   = IPIC_SIMSR_L,
56959                 .prio   = 0,
56960                 .force  = IPIC_SIFCR_L,
56961                 .bit    = 11,
56962         },
56963         [76] = {
56964 -               .pend   = IPIC_SIPNR_L,
56965                 .mask   = IPIC_SIMSR_L,
56966                 .prio   = 0,
56967                 .force  = IPIC_SIFCR_L,
56968                 .bit    = 12,
56969         },
56970         [77] = {
56971 -               .pend   = IPIC_SIPNR_L,
56972                 .mask   = IPIC_SIMSR_L,
56973                 .prio   = 0,
56974                 .force  = IPIC_SIFCR_L,
56975                 .bit    = 13,
56976         },
56977         [78] = {
56978 -               .pend   = IPIC_SIPNR_L,
56979                 .mask   = IPIC_SIMSR_L,
56980                 .prio   = 0,
56981                 .force  = IPIC_SIFCR_L,
56982                 .bit    = 14,
56983         },
56984         [79] = {
56985 -               .pend   = IPIC_SIPNR_L,
56986                 .mask   = IPIC_SIMSR_L,
56987                 .prio   = 0,
56988                 .force  = IPIC_SIFCR_L,
56989                 .bit    = 15,
56990         },
56991         [80] = {
56992 -               .pend   = IPIC_SIPNR_L,
56993                 .mask   = IPIC_SIMSR_L,
56994                 .prio   = 0,
56995                 .force  = IPIC_SIFCR_L,
56996                 .bit    = 16,
56997         },
56998 +       [81] = {
56999 +               .mask   = IPIC_SIMSR_L,
57000 +               .prio   = 0,
57001 +               .force  = IPIC_SIFCR_L,
57002 +               .bit    = 17,
57003 +       },
57004 +       [82] = {
57005 +               .mask   = IPIC_SIMSR_L,
57006 +               .prio   = 0,
57007 +               .force  = IPIC_SIFCR_L,
57008 +               .bit    = 18,
57009 +       },
57010 +       [83] = {
57011 +               .mask   = IPIC_SIMSR_L,
57012 +               .prio   = 0,
57013 +               .force  = IPIC_SIFCR_L,
57014 +               .bit    = 19,
57015 +       },
57016         [84] = {
57017 -               .pend   = IPIC_SIPNR_L,
57018                 .mask   = IPIC_SIMSR_L,
57019                 .prio   = 0,
57020                 .force  = IPIC_SIFCR_L,
57021                 .bit    = 20,
57022         },
57023         [85] = {
57024 -               .pend   = IPIC_SIPNR_L,
57025                 .mask   = IPIC_SIMSR_L,
57026                 .prio   = 0,
57027                 .force  = IPIC_SIFCR_L,
57028                 .bit    = 21,
57029         },
57030 +       [86] = {
57031 +               .mask   = IPIC_SIMSR_L,
57032 +               .prio   = 0,
57033 +               .force  = IPIC_SIFCR_L,
57034 +               .bit    = 22,
57035 +       },
57036 +       [87] = {
57037 +               .mask   = IPIC_SIMSR_L,
57038 +               .prio   = 0,
57039 +               .force  = IPIC_SIFCR_L,
57040 +               .bit    = 23,
57041 +       },
57042 +       [88] = {
57043 +               .mask   = IPIC_SIMSR_L,
57044 +               .prio   = 0,
57045 +               .force  = IPIC_SIFCR_L,
57046 +               .bit    = 24,
57047 +       },
57048 +       [89] = {
57049 +               .mask   = IPIC_SIMSR_L,
57050 +               .prio   = 0,
57051 +               .force  = IPIC_SIFCR_L,
57052 +               .bit    = 25,
57053 +       },
57054         [90] = {
57055 -               .pend   = IPIC_SIPNR_L,
57056                 .mask   = IPIC_SIMSR_L,
57057                 .prio   = 0,
57058                 .force  = IPIC_SIFCR_L,
57059                 .bit    = 26,
57060         },
57061         [91] = {
57062 -               .pend   = IPIC_SIPNR_L,
57063                 .mask   = IPIC_SIMSR_L,
57064                 .prio   = 0,
57065                 .force  = IPIC_SIFCR_L,
57066 @@ -412,6 +545,10 @@
57067         temp &= ~(1 << (31 - ipic_info[src].bit));
57068         ipic_write(ipic->regs, ipic_info[src].mask, temp);
57069  
57070 +       /* mb() can't guarantee that masking is finished.  But it does finish
57071 +        * for nearly all cases. */
57072 +       mb();
57073 +
57074         spin_unlock_irqrestore(&ipic_lock, flags);
57075  }
57076  
57077 @@ -424,9 +561,13 @@
57078  
57079         spin_lock_irqsave(&ipic_lock, flags);
57080  
57081 -       temp = ipic_read(ipic->regs, ipic_info[src].pend);
57082 +       temp = ipic_read(ipic->regs, ipic_info[src].ack);
57083         temp |= (1 << (31 - ipic_info[src].bit));
57084 -       ipic_write(ipic->regs, ipic_info[src].pend, temp);
57085 +       ipic_write(ipic->regs, ipic_info[src].ack, temp);
57086 +
57087 +       /* mb() can't guarantee that ack is finished.  But it does finish
57088 +        * for nearly all cases. */
57089 +       mb();
57090  
57091         spin_unlock_irqrestore(&ipic_lock, flags);
57092  }
57093 @@ -444,9 +585,13 @@
57094         temp &= ~(1 << (31 - ipic_info[src].bit));
57095         ipic_write(ipic->regs, ipic_info[src].mask, temp);
57096  
57097 -       temp = ipic_read(ipic->regs, ipic_info[src].pend);
57098 +       temp = ipic_read(ipic->regs, ipic_info[src].ack);
57099         temp |= (1 << (31 - ipic_info[src].bit));
57100 -       ipic_write(ipic->regs, ipic_info[src].pend, temp);
57101 +       ipic_write(ipic->regs, ipic_info[src].ack, temp);
57102 +
57103 +       /* mb() can't guarantee that ack is finished.  But it does finish
57104 +        * for nearly all cases. */
57105 +       mb();
57106  
57107         spin_unlock_irqrestore(&ipic_lock, flags);
57108  }
57109 @@ -468,14 +613,22 @@
57110                         flow_type);
57111                 return -EINVAL;
57112         }
57113 +       /* ipic supports only edge mode on external interrupts */
57114 +       if ((flow_type & IRQ_TYPE_EDGE_FALLING) && !ipic_info[src].ack) {
57115 +               printk(KERN_ERR "ipic: edge sense not supported on internal "
57116 +                               "interrupts\n");
57117 +               return -EINVAL;
57118 +       }
57119  
57120         desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
57121         desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
57122         if (flow_type & IRQ_TYPE_LEVEL_LOW)  {
57123                 desc->status |= IRQ_LEVEL;
57124                 desc->handle_irq = handle_level_irq;
57125 +               desc->chip = &ipic_level_irq_chip;
57126         } else {
57127                 desc->handle_irq = handle_edge_irq;
57128 +               desc->chip = &ipic_edge_irq_chip;
57129         }
57130  
57131         /* only EXT IRQ senses are programmable on ipic
57132 @@ -500,7 +653,16 @@
57133         return 0;
57134  }
57135  
57136 -static struct irq_chip ipic_irq_chip = {
57137 +/* level interrupts and edge interrupts have different ack operations */
57138 +static struct irq_chip ipic_level_irq_chip = {
57139 +       .typename       = " IPIC  ",
57140 +       .unmask         = ipic_unmask_irq,
57141 +       .mask           = ipic_mask_irq,
57142 +       .mask_ack       = ipic_mask_irq,
57143 +       .set_type       = ipic_set_irq_type,
57144 +};
57145 +
57146 +static struct irq_chip ipic_edge_irq_chip = {
57147         .typename       = " IPIC  ",
57148         .unmask         = ipic_unmask_irq,
57149         .mask           = ipic_mask_irq,
57150 @@ -519,13 +681,9 @@
57151                          irq_hw_number_t hw)
57152  {
57153         struct ipic *ipic = h->host_data;
57154 -       struct irq_chip *chip;
57155 -
57156 -       /* Default chip */
57157 -       chip = &ipic->hc_irq;
57158  
57159         set_irq_chip_data(virq, ipic);
57160 -       set_irq_chip_and_handler(virq, chip, handle_level_irq);
57161 +       set_irq_chip_and_handler(virq, &ipic_level_irq_chip, handle_level_irq);
57162  
57163         /* Set default irq type */
57164         set_irq_type(virq, IRQ_TYPE_NONE);
57165 @@ -584,7 +742,6 @@
57166         ipic->regs = ioremap(res.start, res.end - res.start + 1);
57167  
57168         ipic->irqhost->host_data = ipic;
57169 -       ipic->hc_irq = ipic_irq_chip;
57170  
57171         /* init hw */
57172         ipic_write(ipic->regs, IPIC_SICNR, 0x0);
57173 @@ -593,6 +750,10 @@
57174          * configure SICFR accordingly */
57175         if (flags & IPIC_SPREADMODE_GRP_A)
57176                 temp |= SICFR_IPSA;
57177 +       if (flags & IPIC_SPREADMODE_GRP_B)
57178 +               temp |= SICFR_IPSB;
57179 +       if (flags & IPIC_SPREADMODE_GRP_C)
57180 +               temp |= SICFR_IPSC;
57181         if (flags & IPIC_SPREADMODE_GRP_D)
57182                 temp |= SICFR_IPSD;
57183         if (flags & IPIC_SPREADMODE_MIX_A)
57184 @@ -600,7 +761,7 @@
57185         if (flags & IPIC_SPREADMODE_MIX_B)
57186                 temp |= SICFR_MPSB;
57187  
57188 -       ipic_write(ipic->regs, IPIC_SICNR, temp);
57189 +       ipic_write(ipic->regs, IPIC_SICFR, temp);
57190  
57191         /* handle MCP route */
57192         temp = 0;
57193 @@ -672,10 +833,12 @@
57194  
57195  void ipic_set_default_priority(void)
57196  {
57197 -       ipic_write(primary_ipic->regs, IPIC_SIPRR_A, IPIC_SIPRR_A_DEFAULT);
57198 -       ipic_write(primary_ipic->regs, IPIC_SIPRR_D, IPIC_SIPRR_D_DEFAULT);
57199 -       ipic_write(primary_ipic->regs, IPIC_SMPRR_A, IPIC_SMPRR_A_DEFAULT);
57200 -       ipic_write(primary_ipic->regs, IPIC_SMPRR_B, IPIC_SMPRR_B_DEFAULT);
57201 +       ipic_write(primary_ipic->regs, IPIC_SIPRR_A, IPIC_PRIORITY_DEFAULT);
57202 +       ipic_write(primary_ipic->regs, IPIC_SIPRR_B, IPIC_PRIORITY_DEFAULT);
57203 +       ipic_write(primary_ipic->regs, IPIC_SIPRR_C, IPIC_PRIORITY_DEFAULT);
57204 +       ipic_write(primary_ipic->regs, IPIC_SIPRR_D, IPIC_PRIORITY_DEFAULT);
57205 +       ipic_write(primary_ipic->regs, IPIC_SMPRR_A, IPIC_PRIORITY_DEFAULT);
57206 +       ipic_write(primary_ipic->regs, IPIC_SMPRR_B, IPIC_PRIORITY_DEFAULT);
57207  }
57208  
57209  void ipic_enable_mcp(enum ipic_mcp_irq mcp_irq)
57210 --- a/arch/powerpc/sysdev/ipic.h
57211 +++ b/arch/powerpc/sysdev/ipic.h
57212 @@ -23,13 +23,12 @@
57213  #define IPIC_IRQ_EXT7 23
57214  
57215  /* Default Priority Registers */
57216 -#define IPIC_SIPRR_A_DEFAULT 0x05309770
57217 -#define IPIC_SIPRR_D_DEFAULT 0x05309770
57218 -#define IPIC_SMPRR_A_DEFAULT 0x05309770
57219 -#define IPIC_SMPRR_B_DEFAULT 0x05309770
57220 +#define IPIC_PRIORITY_DEFAULT 0x05309770
57221  
57222  /* System Global Interrupt Configuration Register */
57223  #define        SICFR_IPSA      0x00010000
57224 +#define        SICFR_IPSB      0x00020000
57225 +#define        SICFR_IPSC      0x00040000
57226  #define        SICFR_IPSD      0x00080000
57227  #define        SICFR_MPSA      0x00200000
57228  #define        SICFR_MPSB      0x00400000
57229 @@ -45,13 +44,11 @@
57230  
57231         /* The remapper for this IPIC */
57232         struct irq_host         *irqhost;
57233 -
57234 -       /* The "linux" controller struct */
57235 -       struct irq_chip         hc_irq;
57236  };
57237  
57238  struct ipic_info {
57239 -       u8      pend;           /* pending register offset from base */
57240 +       u8      ack;            /* pending register offset from base if the irq
57241 +                                  supports ack operation */
57242         u8      mask;           /* mask register offset from base */
57243         u8      prio;           /* priority register offset from base */
57244         u8      force;          /* force register offset from base */
57245 --- a/arch/powerpc/sysdev/mmio_nvram.c
57246 +++ b/arch/powerpc/sysdev/mmio_nvram.c
57247 @@ -99,7 +99,7 @@
57248         nvram_addr = r.start;
57249         mmio_nvram_len = r.end - r.start + 1;
57250         if ( (!mmio_nvram_len) || (!nvram_addr) ) {
57251 -               printk(KERN_WARNING "nvram: address or lenght is 0\n");
57252 +               printk(KERN_WARNING "nvram: address or length is 0\n");
57253                 ret = -EIO;
57254                 goto out;
57255         }
57256 --- a/arch/powerpc/sysdev/mpic.c
57257 +++ b/arch/powerpc/sysdev/mpic.c
57258 @@ -83,6 +83,7 @@
57259                 MPIC_CPU_WHOAMI,
57260                 MPIC_CPU_INTACK,
57261                 MPIC_CPU_EOI,
57262 +               MPIC_CPU_MCACK,
57263  
57264                 MPIC_IRQ_BASE,
57265                 MPIC_IRQ_STRIDE,
57266 @@ -121,6 +122,7 @@
57267                 TSI108_CPU_WHOAMI,
57268                 TSI108_CPU_INTACK,
57269                 TSI108_CPU_EOI,
57270 +               TSI108_CPU_MCACK,
57271  
57272                 TSI108_IRQ_BASE,
57273                 TSI108_IRQ_STRIDE,
57274 @@ -265,7 +267,7 @@
57275   */
57276  
57277  
57278 -static void _mpic_map_mmio(struct mpic *mpic, unsigned long phys_addr,
57279 +static void _mpic_map_mmio(struct mpic *mpic, phys_addr_t phys_addr,
57280                            struct mpic_reg_bank *rb, unsigned int offset,
57281                            unsigned int size)
57282  {
57283 @@ -285,7 +287,7 @@
57284         BUG_ON(!DCR_MAP_OK(rb->dhost));
57285  }
57286  
57287 -static inline void mpic_map(struct mpic *mpic, unsigned long phys_addr,
57288 +static inline void mpic_map(struct mpic *mpic, phys_addr_t phys_addr,
57289                             struct mpic_reg_bank *rb, unsigned int offset,
57290                             unsigned int size)
57291  {
57292 @@ -612,12 +614,11 @@
57293  }
57294  
57295  #ifdef CONFIG_SMP
57296 -static irqreturn_t mpic_ipi_action(int irq, void *dev_id)
57297 +static irqreturn_t mpic_ipi_action(int irq, void *data)
57298  {
57299 -       struct mpic *mpic;
57300 +       long ipi = (long)data;
57301  
57302 -       mpic = mpic_find(irq, NULL);
57303 -       smp_message_recv(mpic_irq_to_hw(irq) - mpic->ipi_vecs[0]);
57304 +       smp_message_recv(ipi);
57305  
57306         return IRQ_HANDLED;
57307  }
57308 @@ -842,6 +843,24 @@
57309         return 0;
57310  }
57311  
57312 +void mpic_set_vector(unsigned int virq, unsigned int vector)
57313 +{
57314 +       struct mpic *mpic = mpic_from_irq(virq);
57315 +       unsigned int src = mpic_irq_to_hw(virq);
57316 +       unsigned int vecpri;
57317 +
57318 +       DBG("mpic: set_vector(mpic:@%p,virq:%d,src:%d,vector:0x%x)\n",
57319 +           mpic, virq, src, vector);
57320 +
57321 +       if (src >= mpic->irq_count)
57322 +               return;
57323 +
57324 +       vecpri = mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI));
57325 +       vecpri = vecpri & ~MPIC_INFO(VECPRI_VECTOR_MASK);
57326 +       vecpri |= vector;
57327 +       mpic_irq_write(src, MPIC_INFO(IRQ_VECTOR_PRI), vecpri);
57328 +}
57329 +
57330  static struct irq_chip mpic_irq_chip = {
57331         .mask           = mpic_mask_irq,
57332         .unmask         = mpic_unmask_irq,
57333 @@ -1109,6 +1128,11 @@
57334                         mb();
57335         }
57336  
57337 +       if (flags & MPIC_ENABLE_MCK)
57338 +               mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0),
57339 +                          mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0))
57340 +                          | MPIC_GREG_GCONF_MCK);
57341 +
57342         /* Read feature register, calculate num CPUs and, for non-ISU
57343          * MPICs, num sources as well. On ISU MPICs, sources are counted
57344          * as ISUs are added
57345 @@ -1230,6 +1254,8 @@
57346                 mpic_u3msi_init(mpic);
57347         }
57348  
57349 +       mpic_pasemi_msi_init(mpic);
57350 +
57351         for (i = 0; i < mpic->num_sources; i++) {
57352                 /* start with vector = source number, and masked */
57353                 u32 vecpri = MPIC_VECPRI_MASK | i |
57354 @@ -1253,6 +1279,11 @@
57355                            mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0))
57356                            | MPIC_GREG_GCONF_8259_PTHROU_DIS);
57357  
57358 +       if (mpic->flags & MPIC_NO_BIAS)
57359 +               mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0),
57360 +                       mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0))
57361 +                       | MPIC_GREG_GCONF_NO_BIAS);
57362 +
57363         /* Set current processor priority to 0 */
57364         mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0);
57365  
57366 @@ -1419,13 +1450,13 @@
57367                        mpic_physmask(cpu_mask & cpus_addr(cpu_online_map)[0]));
57368  }
57369  
57370 -unsigned int mpic_get_one_irq(struct mpic *mpic)
57371 +static unsigned int _mpic_get_one_irq(struct mpic *mpic, int reg)
57372  {
57373         u32 src;
57374  
57375 -       src = mpic_cpu_read(MPIC_INFO(CPU_INTACK)) & MPIC_INFO(VECPRI_VECTOR_MASK);
57376 +       src = mpic_cpu_read(reg) & MPIC_INFO(VECPRI_VECTOR_MASK);
57377  #ifdef DEBUG_LOW
57378 -       DBG("%s: get_one_irq(): %d\n", mpic->name, src);
57379 +       DBG("%s: get_one_irq(reg 0x%x): %d\n", mpic->name, reg, src);
57380  #endif
57381         if (unlikely(src == mpic->spurious_vec)) {
57382                 if (mpic->flags & MPIC_SPV_EOI)
57383 @@ -1443,6 +1474,11 @@
57384         return irq_linear_revmap(mpic->irqhost, src);
57385  }
57386  
57387 +unsigned int mpic_get_one_irq(struct mpic *mpic)
57388 +{
57389 +       return _mpic_get_one_irq(mpic, MPIC_INFO(CPU_INTACK));
57390 +}
57391 +
57392  unsigned int mpic_get_irq(void)
57393  {
57394         struct mpic *mpic = mpic_primary;
57395 @@ -1452,12 +1488,20 @@
57396         return mpic_get_one_irq(mpic);
57397  }
57398  
57399 +unsigned int mpic_get_mcirq(void)
57400 +{
57401 +       struct mpic *mpic = mpic_primary;
57402 +
57403 +       BUG_ON(mpic == NULL);
57404 +
57405 +       return _mpic_get_one_irq(mpic, MPIC_INFO(CPU_MCACK));
57406 +}
57407  
57408  #ifdef CONFIG_SMP
57409  void mpic_request_ipis(void)
57410  {
57411         struct mpic *mpic = mpic_primary;
57412 -       int i, err;
57413 +       long i, err;
57414         static char *ipi_names[] = {
57415                 "IPI0 (call function)",
57416                 "IPI1 (reschedule)",
57417 @@ -1472,14 +1516,14 @@
57418                 unsigned int vipi = irq_create_mapping(mpic->irqhost,
57419                                                        mpic->ipi_vecs[0] + i);
57420                 if (vipi == NO_IRQ) {
57421 -                       printk(KERN_ERR "Failed to map IPI %d\n", i);
57422 +                       printk(KERN_ERR "Failed to map IPI %ld\n", i);
57423                         break;
57424                 }
57425                 err = request_irq(vipi, mpic_ipi_action,
57426                                   IRQF_DISABLED|IRQF_PERCPU,
57427 -                                 ipi_names[i], mpic);
57428 +                                 ipi_names[i], (void *)i);
57429                 if (err) {
57430 -                       printk(KERN_ERR "Request of irq %d for IPI %d failed\n",
57431 +                       printk(KERN_ERR "Request of irq %d for IPI %ld failed\n",
57432                                vipi, i);
57433                         break;
57434                 }
57435 --- a/arch/powerpc/sysdev/mpic.h
57436 +++ b/arch/powerpc/sysdev/mpic.h
57437 @@ -17,6 +17,7 @@
57438  extern irq_hw_number_t mpic_msi_alloc_hwirqs(struct mpic *mpic, int num);
57439  extern void mpic_msi_free_hwirqs(struct mpic *mpic, int offset, int num);
57440  extern int mpic_u3msi_init(struct mpic *mpic);
57441 +extern int mpic_pasemi_msi_init(struct mpic *mpic);
57442  #else
57443  static inline void mpic_msi_reserve_hwirq(struct mpic *mpic,
57444                                           irq_hw_number_t hwirq)
57445 @@ -28,12 +29,15 @@
57446  {
57447         return -1;
57448  }
57449 +
57450 +static inline int mpic_pasemi_msi_init(struct mpic *mpic)
57451 +{
57452 +       return -1;
57453 +}
57454  #endif
57455  
57456  extern int mpic_set_irq_type(unsigned int virq, unsigned int flow_type);
57457 -extern void mpic_end_irq(unsigned int irq);
57458 -extern void mpic_mask_irq(unsigned int irq);
57459 -extern void mpic_unmask_irq(unsigned int irq);
57460 +extern void mpic_set_vector(unsigned int virq, unsigned int vector);
57461  extern void mpic_set_affinity(unsigned int irq, cpumask_t cpumask);
57462  
57463  #endif /* _POWERPC_SYSDEV_MPIC_H */
57464 --- /dev/null
57465 +++ b/arch/powerpc/sysdev/mpic_pasemi_msi.c
57466 @@ -0,0 +1,172 @@
57467 +/*
57468 + * Copyright 2007, Olof Johansson, PA Semi
57469 + *
57470 + * Based on arch/powerpc/sysdev/mpic_u3msi.c:
57471 + *
57472 + * Copyright 2006, Segher Boessenkool, IBM Corporation.
57473 + * Copyright 2006-2007, Michael Ellerman, IBM Corporation.
57474 + *
57475 + * This program is free software; you can redistribute it and/or
57476 + * modify it under the terms of the GNU General Public License
57477 + * as published by the Free Software Foundation; version 2 of the
57478 + * License.
57479 + *
57480 + */
57481 +
57482 +#undef DEBUG
57483 +
57484 +#include <linux/irq.h>
57485 +#include <linux/bootmem.h>
57486 +#include <linux/msi.h>
57487 +#include <asm/mpic.h>
57488 +#include <asm/prom.h>
57489 +#include <asm/hw_irq.h>
57490 +#include <asm/ppc-pci.h>
57491 +
57492 +#include "mpic.h"
57493 +
57494 +/* Allocate 16 interrupts per device, to give an alignment of 16,
57495 + * since that's the size of the grouping w.r.t. affinity. If someone
57496 + * needs more than 32 MSI's down the road we'll have to rethink this,
57497 + * but it should be OK for now.
57498 + */
57499 +#define ALLOC_CHUNK 16
57500 +
57501 +#define PASEMI_MSI_ADDR 0xfc080000
57502 +
57503 +/* A bit ugly, can we get this from the pci_dev somehow? */
57504 +static struct mpic *msi_mpic;
57505 +
57506 +
57507 +static void mpic_pasemi_msi_mask_irq(unsigned int irq)
57508 +{
57509 +       pr_debug("mpic_pasemi_msi_mask_irq %d\n", irq);
57510 +       mask_msi_irq(irq);
57511 +       mpic_mask_irq(irq);
57512 +}
57513 +
57514 +static void mpic_pasemi_msi_unmask_irq(unsigned int irq)
57515 +{
57516 +       pr_debug("mpic_pasemi_msi_unmask_irq %d\n", irq);
57517 +       mpic_unmask_irq(irq);
57518 +       unmask_msi_irq(irq);
57519 +}
57520 +
57521 +static struct irq_chip mpic_pasemi_msi_chip = {
57522 +       .shutdown       = mpic_pasemi_msi_mask_irq,
57523 +       .mask           = mpic_pasemi_msi_mask_irq,
57524 +       .unmask         = mpic_pasemi_msi_unmask_irq,
57525 +       .eoi            = mpic_end_irq,
57526 +       .set_type       = mpic_set_irq_type,
57527 +       .set_affinity   = mpic_set_affinity,
57528 +       .typename       = "PASEMI-MSI ",
57529 +};
57530 +
57531 +static int pasemi_msi_check_device(struct pci_dev *pdev, int nvec, int type)
57532 +{
57533 +       if (type == PCI_CAP_ID_MSIX)
57534 +               pr_debug("pasemi_msi: MSI-X untested, trying anyway\n");
57535 +
57536 +       return 0;
57537 +}
57538 +
57539 +static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev)
57540 +{
57541 +       struct msi_desc *entry;
57542 +
57543 +       pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev);
57544 +
57545 +       list_for_each_entry(entry, &pdev->msi_list, list) {
57546 +               if (entry->irq == NO_IRQ)
57547 +                       continue;
57548 +
57549 +               set_irq_msi(entry->irq, NULL);
57550 +               mpic_msi_free_hwirqs(msi_mpic, virq_to_hw(entry->irq),
57551 +                                    ALLOC_CHUNK);
57552 +               irq_dispose_mapping(entry->irq);
57553 +       }
57554 +
57555 +       return;
57556 +}
57557 +
57558 +static int pasemi_msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
57559 +{
57560 +       irq_hw_number_t hwirq;
57561 +       unsigned int virq;
57562 +       struct msi_desc *entry;
57563 +       struct msi_msg msg;
57564 +       u64 addr;
57565 +
57566 +       pr_debug("pasemi_msi_setup_msi_irqs, pdev %p nvec %d type %d\n",
57567 +                pdev, nvec, type);
57568 +
57569 +       msg.address_hi = 0;
57570 +       msg.address_lo = PASEMI_MSI_ADDR;
57571 +
57572 +       list_for_each_entry(entry, &pdev->msi_list, list) {
57573 +               /* Allocate 16 interrupts for now, since that's the grouping for
57574 +                * affinity. This can be changed later if it turns out 32 is too
57575 +                * few MSIs for someone, but restrictions will apply to how the
57576 +                * sources can be changed independently.
57577 +                */
57578 +               hwirq = mpic_msi_alloc_hwirqs(msi_mpic, ALLOC_CHUNK);
57579 +               if (hwirq < 0) {
57580 +                       pr_debug("pasemi_msi: failed allocating hwirq\n");
57581 +                       return hwirq;
57582 +               }
57583 +
57584 +               virq = irq_create_mapping(msi_mpic->irqhost, hwirq);
57585 +               if (virq == NO_IRQ) {
57586 +                       pr_debug("pasemi_msi: failed mapping hwirq 0x%lx\n", hwirq);
57587 +                       mpic_msi_free_hwirqs(msi_mpic, hwirq, ALLOC_CHUNK);
57588 +                       return -ENOSPC;
57589 +               }
57590 +
57591 +               /* Vector on MSI is really an offset, the hardware adds
57592 +                * it to the value written at the magic address. So set
57593 +                * it to 0 to remain sane.
57594 +                */
57595 +               mpic_set_vector(virq, 0);
57596 +
57597 +               set_irq_msi(virq, entry);
57598 +               set_irq_chip(virq, &mpic_pasemi_msi_chip);
57599 +               set_irq_type(virq, IRQ_TYPE_EDGE_RISING);
57600 +
57601 +               pr_debug("pasemi_msi: allocated virq 0x%x (hw 0x%lx) addr 0x%lx\n",
57602 +                         virq, hwirq, addr);
57603 +
57604 +               /* Likewise, the device writes [0...511] into the target
57605 +                * register to generate MSI [512...1023]
57606 +                */
57607 +               msg.data = hwirq-0x200;
57608 +               write_msi_msg(virq, &msg);
57609 +       }
57610 +
57611 +       return 0;
57612 +}
57613 +
57614 +int mpic_pasemi_msi_init(struct mpic *mpic)
57615 +{
57616 +       int rc;
57617 +
57618 +       if (!mpic->irqhost->of_node ||
57619 +           !of_device_is_compatible(mpic->irqhost->of_node,
57620 +                                    "pasemi,pwrficient-openpic"))
57621 +               return -ENODEV;
57622 +
57623 +       rc = mpic_msi_init_allocator(mpic);
57624 +       if (rc) {
57625 +               pr_debug("pasemi_msi: Error allocating bitmap!\n");
57626 +               return rc;
57627 +       }
57628 +
57629 +       pr_debug("pasemi_msi: Registering PA Semi MPIC MSI callbacks\n");
57630 +
57631 +       msi_mpic = mpic;
57632 +       WARN_ON(ppc_md.setup_msi_irqs);
57633 +       ppc_md.setup_msi_irqs = pasemi_msi_setup_msi_irqs;
57634 +       ppc_md.teardown_msi_irqs = pasemi_msi_teardown_msi_irqs;
57635 +       ppc_md.msi_check_device = pasemi_msi_check_device;
57636 +
57637 +       return 0;
57638 +}
57639 --- a/arch/powerpc/sysdev/mv64x60_dev.c
57640 +++ b/arch/powerpc/sysdev/mv64x60_dev.c
57641 @@ -241,7 +241,7 @@
57642  
57643         /* only register the shared platform device the first time through */
57644         if (id == 0 && (err = eth_register_shared_pdev(np)))
57645 -               return err;;
57646 +               return err;
57647  
57648         memset(r, 0, sizeof(r));
57649         of_irq_to_resource(np, 0, &r[0]);
57650 @@ -451,22 +451,19 @@
57651         int id;
57652         int err;
57653  
57654 -       for (id = 0;
57655 -            (np = of_find_compatible_node(np, "serial", "marvell,mpsc")); id++)
57656 -               if ((err = mv64x60_mpsc_device_setup(np, id)))
57657 +       id = 0;
57658 +       for_each_compatible_node(np, "serial", "marvell,mpsc")
57659 +               if ((err = mv64x60_mpsc_device_setup(np, id++)))
57660                         goto error;
57661  
57662 -       for (id = 0;
57663 -            (np = of_find_compatible_node(np, "network",
57664 -                                          "marvell,mv64x60-eth"));
57665 -            id++)
57666 -               if ((err = mv64x60_eth_device_setup(np, id)))
57667 +       id = 0;
57668 +       for_each_compatible_node(np, "network", "marvell,mv64x60-eth")
57669 +               if ((err = mv64x60_eth_device_setup(np, id++)))
57670                         goto error;
57671  
57672 -       for (id = 0;
57673 -            (np = of_find_compatible_node(np, "i2c", "marvell,mv64x60-i2c"));
57674 -            id++)
57675 -               if ((err = mv64x60_i2c_device_setup(np, id)))
57676 +       id = 0;
57677 +       for_each_compatible_node(np, "i2c", "marvell,mv64x60-i2c")
57678 +               if ((err = mv64x60_i2c_device_setup(np, id++)))
57679                         goto error;
57680  
57681         /* support up to one watchdog timer */
57682 @@ -477,7 +474,6 @@
57683                 of_node_put(np);
57684         }
57685  
57686 -
57687         return 0;
57688  
57689  error:
57690 --- a/arch/powerpc/sysdev/mv64x60_pci.c
57691 +++ b/arch/powerpc/sysdev/mv64x60_pci.c
57692 @@ -164,8 +164,8 @@
57693  
57694  void __init mv64x60_pci_init(void)
57695  {
57696 -       struct device_node *np = NULL;
57697 +       struct device_node *np;
57698  
57699 -       while ((np = of_find_compatible_node(np, "pci", "marvell,mv64x60-pci")))
57700 +       for_each_compatible_node(np, "pci", "marvell,mv64x60-pci")
57701                 mv64x60_add_bridge(np);
57702  }
57703 --- a/arch/powerpc/sysdev/mv64x60_udbg.c
57704 +++ b/arch/powerpc/sysdev/mv64x60_udbg.c
57705 @@ -85,10 +85,10 @@
57706         if (!stdout)
57707                 return;
57708  
57709 -       for (np = NULL;
57710 -            (np = of_find_compatible_node(np, "serial", "marvell,mpsc")); )
57711 +       for_each_compatible_node(np, "serial", "marvell,mpsc") {
57712                 if (np == stdout)
57713                         break;
57714 +       }
57715  
57716         of_node_put(stdout);
57717         if (!np)
57718 --- /dev/null
57719 +++ b/arch/powerpc/sysdev/of_rtc.c
57720 @@ -0,0 +1,59 @@
57721 +/*
57722 + * Instantiate mmio-mapped RTC chips based on device tree information
57723 + *
57724 + * Copyright 2007 David Gibson <dwg@au1.ibm.com>, IBM Corporation.
57725 + *
57726 + * This program is free software; you can redistribute  it and/or modify it
57727 + * under  the terms of  the GNU General  Public License as published by the
57728 + * Free Software Foundation;  either version 2 of the  License, or (at your
57729 + * option) any later version.
57730 + */
57731 +#include <linux/kernel.h>
57732 +#include <linux/of.h>
57733 +#include <linux/init.h>
57734 +#include <linux/of_platform.h>
57735 +
57736 +static __initdata struct {
57737 +       const char *compatible;
57738 +       char *plat_name;
57739 +} of_rtc_table[] = {
57740 +       { "ds1743-nvram", "rtc-ds1742" },
57741 +};
57742 +
57743 +void __init of_instantiate_rtc(void)
57744 +{
57745 +       struct device_node *node;
57746 +       int err;
57747 +       int i;
57748 +
57749 +       for (i = 0; i < ARRAY_SIZE(of_rtc_table); i++) {
57750 +               char *plat_name = of_rtc_table[i].plat_name;
57751 +
57752 +               for_each_compatible_node(node, NULL,
57753 +                                        of_rtc_table[i].compatible) {
57754 +                       struct resource *res;
57755 +
57756 +                       res = kmalloc(sizeof(*res), GFP_KERNEL);
57757 +                       if (!res) {
57758 +                               printk(KERN_ERR "OF RTC: Out of memory "
57759 +                                      "allocating resource structure for %s\n",
57760 +                                      node->full_name);
57761 +                               continue;
57762 +                       }
57763 +
57764 +                       err = of_address_to_resource(node, 0, res);
57765 +                       if (err) {
57766 +                               printk(KERN_ERR "OF RTC: Error "
57767 +                                      "translating resources for %s\n",
57768 +                                      node->full_name);
57769 +                               continue;
57770 +                       }
57771 +
57772 +                       printk(KERN_INFO "OF_RTC: %s is a %s @ 0x%llx-0x%llx\n",
57773 +                              node->full_name, plat_name,
57774 +                              (unsigned long long)res->start,
57775 +                              (unsigned long long)res->end);
57776 +                       platform_device_register_simple(plat_name, -1, res, 1);
57777 +               }
57778 +       }
57779 +}
57780 --- a/arch/powerpc/sysdev/pmi.c
57781 +++ b/arch/powerpc/sysdev/pmi.c
57782 @@ -28,9 +28,9 @@
57783  #include <linux/completion.h>
57784  #include <linux/spinlock.h>
57785  #include <linux/workqueue.h>
57786 +#include <linux/of_device.h>
57787 +#include <linux/of_platform.h>
57788  
57789 -#include <asm/of_device.h>
57790 -#include <asm/of_platform.h>
57791  #include <asm/io.h>
57792  #include <asm/pmi.h>
57793  #include <asm/prom.h>
57794 --- /dev/null
57795 +++ b/arch/powerpc/sysdev/ppc4xx_pci.c
57796 @@ -0,0 +1,1528 @@
57797 +/*
57798 + * PCI / PCI-X / PCI-Express support for 4xx parts
57799 + *
57800 + * Copyright 2007 Ben. Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
57801 + *
57802 + * Most PCI Express code is coming from Stefan Roese implementation for
57803 + * arch/ppc in the Denx tree, slightly reworked by me.
57804 + *
57805 + * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
57806 + *
57807 + * Some of that comes itself from a previous implementation for 440SPE only
57808 + * by Roland Dreier:
57809 + *
57810 + * Copyright (c) 2005 Cisco Systems.  All rights reserved.
57811 + * Roland Dreier <rolandd@cisco.com>
57812 + *
57813 + */
57814 +
57815 +#undef DEBUG
57816 +
57817 +#include <linux/kernel.h>
57818 +#include <linux/pci.h>
57819 +#include <linux/init.h>
57820 +#include <linux/of.h>
57821 +#include <linux/bootmem.h>
57822 +#include <linux/delay.h>
57823 +
57824 +#include <asm/io.h>
57825 +#include <asm/pci-bridge.h>
57826 +#include <asm/machdep.h>
57827 +#include <asm/dcr.h>
57828 +#include <asm/dcr-regs.h>
57829 +
57830 +#include "ppc4xx_pci.h"
57831 +
57832 +static int dma_offset_set;
57833 +
57834 +/* Move that to a useable header */
57835 +extern unsigned long total_memory;
57836 +
57837 +#define U64_TO_U32_LOW(val)    ((u32)((val) & 0x00000000ffffffffULL))
57838 +#define U64_TO_U32_HIGH(val)   ((u32)((val) >> 32))
57839 +
57840 +#ifdef CONFIG_RESOURCES_64BIT
57841 +#define RES_TO_U32_LOW(val)    U64_TO_U32_LOW(val)
57842 +#define RES_TO_U32_HIGH(val)   U64_TO_U32_HIGH(val)
57843 +#else
57844 +#define RES_TO_U32_LOW(val)    (val)
57845 +#define RES_TO_U32_HIGH(val)   (0)
57846 +#endif
57847 +
57848 +static inline int ppc440spe_revA(void)
57849 +{
57850 +       /* Catch both 440SPe variants, with and without RAID6 support */
57851 +        if ((mfspr(SPRN_PVR) & 0xffefffff) == 0x53421890)
57852 +                return 1;
57853 +        else
57854 +                return 0;
57855 +}
57856 +
57857 +static void fixup_ppc4xx_pci_bridge(struct pci_dev *dev)
57858 +{
57859 +       struct pci_controller *hose;
57860 +       int i;
57861 +
57862 +       if (dev->devfn != 0 || dev->bus->self != NULL)
57863 +               return;
57864 +
57865 +       hose = pci_bus_to_host(dev->bus);
57866 +       if (hose == NULL)
57867 +               return;
57868 +
57869 +       if (!of_device_is_compatible(hose->dn, "ibm,plb-pciex") &&
57870 +           !of_device_is_compatible(hose->dn, "ibm,plb-pcix") &&
57871 +           !of_device_is_compatible(hose->dn, "ibm,plb-pci"))
57872 +               return;
57873 +
57874 +       /* Hide the PCI host BARs from the kernel as their content doesn't
57875 +        * fit well in the resource management
57876 +        */
57877 +       for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
57878 +               dev->resource[i].start = dev->resource[i].end = 0;
57879 +               dev->resource[i].flags = 0;
57880 +       }
57881 +
57882 +       printk(KERN_INFO "PCI: Hiding 4xx host bridge resources %s\n",
57883 +              pci_name(dev));
57884 +}
57885 +DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, fixup_ppc4xx_pci_bridge);
57886 +
57887 +static int __init ppc4xx_parse_dma_ranges(struct pci_controller *hose,
57888 +                                         void __iomem *reg,
57889 +                                         struct resource *res)
57890 +{
57891 +       u64 size;
57892 +       const u32 *ranges;
57893 +       int rlen;
57894 +       int pna = of_n_addr_cells(hose->dn);
57895 +       int np = pna + 5;
57896 +
57897 +       /* Default */
57898 +       res->start = 0;
57899 +       res->end = size = 0x80000000;
57900 +       res->flags = IORESOURCE_MEM | IORESOURCE_PREFETCH;
57901 +
57902 +       /* Get dma-ranges property */
57903 +       ranges = of_get_property(hose->dn, "dma-ranges", &rlen);
57904 +       if (ranges == NULL)
57905 +               goto out;
57906 +
57907 +       /* Walk it */
57908 +       while ((rlen -= np * 4) >= 0) {
57909 +               u32 pci_space = ranges[0];
57910 +               u64 pci_addr = of_read_number(ranges + 1, 2);
57911 +               u64 cpu_addr = of_translate_dma_address(hose->dn, ranges + 3);
57912 +               size = of_read_number(ranges + pna + 3, 2);
57913 +               ranges += np;
57914 +               if (cpu_addr == OF_BAD_ADDR || size == 0)
57915 +                       continue;
57916 +
57917 +               /* We only care about memory */
57918 +               if ((pci_space & 0x03000000) != 0x02000000)
57919 +                       continue;
57920 +
57921 +               /* We currently only support memory at 0, and pci_addr
57922 +                * within 32 bits space
57923 +                */
57924 +               if (cpu_addr != 0 || pci_addr > 0xffffffff) {
57925 +                       printk(KERN_WARNING "%s: Ignored unsupported dma range"
57926 +                              " 0x%016llx...0x%016llx -> 0x%016llx\n",
57927 +                              hose->dn->full_name,
57928 +                              pci_addr, pci_addr + size - 1, cpu_addr);
57929 +                       continue;
57930 +               }
57931 +
57932 +               /* Check if not prefetchable */
57933 +               if (!(pci_space & 0x40000000))
57934 +                       res->flags &= ~IORESOURCE_PREFETCH;
57935 +
57936 +
57937 +               /* Use that */
57938 +               res->start = pci_addr;
57939 +#ifndef CONFIG_RESOURCES_64BIT
57940 +               /* Beware of 32 bits resources */
57941 +               if ((pci_addr + size) > 0x100000000ull)
57942 +                       res->end = 0xffffffff;
57943 +               else
57944 +#endif
57945 +                       res->end = res->start + size - 1;
57946 +               break;
57947 +       }
57948 +
57949 +       /* We only support one global DMA offset */
57950 +       if (dma_offset_set && pci_dram_offset != res->start) {
57951 +               printk(KERN_ERR "%s: dma-ranges(s) mismatch\n",
57952 +                      hose->dn->full_name);
57953 +               return -ENXIO;
57954 +       }
57955 +
57956 +       /* Check that we can fit all of memory as we don't support
57957 +        * DMA bounce buffers
57958 +        */
57959 +       if (size < total_memory) {
57960 +               printk(KERN_ERR "%s: dma-ranges too small "
57961 +                      "(size=%llx total_memory=%lx)\n",
57962 +                      hose->dn->full_name, size, total_memory);
57963 +               return -ENXIO;
57964 +       }
57965 +
57966 +       /* Check we are a power of 2 size and that base is a multiple of size*/
57967 +       if (!is_power_of_2(size) ||
57968 +           (res->start & (size - 1)) != 0) {
57969 +               printk(KERN_ERR "%s: dma-ranges unaligned\n",
57970 +                      hose->dn->full_name);
57971 +               return -ENXIO;
57972 +       }
57973 +
57974 +       /* Check that we are fully contained within 32 bits space */
57975 +       if (res->end > 0xffffffff) {
57976 +               printk(KERN_ERR "%s: dma-ranges outside of 32 bits space\n",
57977 +                      hose->dn->full_name);
57978 +               return -ENXIO;
57979 +       }
57980 + out:
57981 +       dma_offset_set = 1;
57982 +       pci_dram_offset = res->start;
57983 +
57984 +       printk(KERN_INFO "4xx PCI DMA offset set to 0x%08lx\n",
57985 +              pci_dram_offset);
57986 +       return 0;
57987 +}
57988 +
57989 +/*
57990 + * 4xx PCI 2.x part
57991 + */
57992 +
57993 +static void __init ppc4xx_configure_pci_PMMs(struct pci_controller *hose,
57994 +                                            void __iomem *reg)
57995 +{
57996 +       u32 la, ma, pcila, pciha;
57997 +       int i, j;
57998 +
57999 +       /* Setup outbound memory windows */
58000 +       for (i = j = 0; i < 3; i++) {
58001 +               struct resource *res = &hose->mem_resources[i];
58002 +
58003 +               /* we only care about memory windows */
58004 +               if (!(res->flags & IORESOURCE_MEM))
58005 +                       continue;
58006 +               if (j > 2) {
58007 +                       printk(KERN_WARNING "%s: Too many ranges\n",
58008 +                              hose->dn->full_name);
58009 +                       break;
58010 +               }
58011 +
58012 +               /* Calculate register values */
58013 +               la = res->start;
58014 +               pciha = RES_TO_U32_HIGH(res->start - hose->pci_mem_offset);
58015 +               pcila = RES_TO_U32_LOW(res->start - hose->pci_mem_offset);
58016 +
58017 +               ma = res->end + 1 - res->start;
58018 +               if (!is_power_of_2(ma) || ma < 0x1000 || ma > 0xffffffffu) {
58019 +                       printk(KERN_WARNING "%s: Resource out of range\n",
58020 +                              hose->dn->full_name);
58021 +                       continue;
58022 +               }
58023 +               ma = (0xffffffffu << ilog2(ma)) | 0x1;
58024 +               if (res->flags & IORESOURCE_PREFETCH)
58025 +                       ma |= 0x2;
58026 +
58027 +               /* Program register values */
58028 +               writel(la, reg + PCIL0_PMM0LA + (0x10 * j));
58029 +               writel(pcila, reg + PCIL0_PMM0PCILA + (0x10 * j));
58030 +               writel(pciha, reg + PCIL0_PMM0PCIHA + (0x10 * j));
58031 +               writel(ma, reg + PCIL0_PMM0MA + (0x10 * j));
58032 +               j++;
58033 +       }
58034 +}
58035 +
58036 +static void __init ppc4xx_configure_pci_PTMs(struct pci_controller *hose,
58037 +                                            void __iomem *reg,
58038 +                                            const struct resource *res)
58039 +{
58040 +       resource_size_t size = res->end - res->start + 1;
58041 +       u32 sa;
58042 +
58043 +       /* Calculate window size */
58044 +       sa = (0xffffffffu << ilog2(size)) | 1;
58045 +       sa |= 0x1;
58046 +
58047 +       /* RAM is always at 0 local for now */
58048 +       writel(0, reg + PCIL0_PTM1LA);
58049 +       writel(sa, reg + PCIL0_PTM1MS);
58050 +
58051 +       /* Map on PCI side */
58052 +       early_write_config_dword(hose, hose->first_busno, 0,
58053 +                                PCI_BASE_ADDRESS_1, res->start);
58054 +       early_write_config_dword(hose, hose->first_busno, 0,
58055 +                                PCI_BASE_ADDRESS_2, 0x00000000);
58056 +       early_write_config_word(hose, hose->first_busno, 0,
58057 +                               PCI_COMMAND, 0x0006);
58058 +}
58059 +
58060 +static void __init ppc4xx_probe_pci_bridge(struct device_node *np)
58061 +{
58062 +       /* NYI */
58063 +       struct resource rsrc_cfg;
58064 +       struct resource rsrc_reg;
58065 +       struct resource dma_window;
58066 +       struct pci_controller *hose = NULL;
58067 +       void __iomem *reg = NULL;
58068 +       const int *bus_range;
58069 +       int primary = 0;
58070 +
58071 +       /* Fetch config space registers address */
58072 +       if (of_address_to_resource(np, 0, &rsrc_cfg)) {
58073 +               printk(KERN_ERR "%s:Can't get PCI config register base !",
58074 +                      np->full_name);
58075 +               return;
58076 +       }
58077 +       /* Fetch host bridge internal registers address */
58078 +       if (of_address_to_resource(np, 3, &rsrc_reg)) {
58079 +               printk(KERN_ERR "%s: Can't get PCI internal register base !",
58080 +                      np->full_name);
58081 +               return;
58082 +       }
58083 +
58084 +       /* Check if primary bridge */
58085 +       if (of_get_property(np, "primary", NULL))
58086 +               primary = 1;
58087 +
58088 +       /* Get bus range if any */
58089 +       bus_range = of_get_property(np, "bus-range", NULL);
58090 +
58091 +       /* Map registers */
58092 +       reg = ioremap(rsrc_reg.start, rsrc_reg.end + 1 - rsrc_reg.start);
58093 +       if (reg == NULL) {
58094 +               printk(KERN_ERR "%s: Can't map registers !", np->full_name);
58095 +               goto fail;
58096 +       }
58097 +
58098 +       /* Allocate the host controller data structure */
58099 +       hose = pcibios_alloc_controller(np);
58100 +       if (!hose)
58101 +               goto fail;
58102 +
58103 +       hose->first_busno = bus_range ? bus_range[0] : 0x0;
58104 +       hose->last_busno = bus_range ? bus_range[1] : 0xff;
58105 +
58106 +       /* Setup config space */
58107 +       setup_indirect_pci(hose, rsrc_cfg.start, rsrc_cfg.start + 0x4, 0);
58108 +
58109 +       /* Disable all windows */
58110 +       writel(0, reg + PCIL0_PMM0MA);
58111 +       writel(0, reg + PCIL0_PMM1MA);
58112 +       writel(0, reg + PCIL0_PMM2MA);
58113 +       writel(0, reg + PCIL0_PTM1MS);
58114 +       writel(0, reg + PCIL0_PTM2MS);
58115 +
58116 +       /* Parse outbound mapping resources */
58117 +       pci_process_bridge_OF_ranges(hose, np, primary);
58118 +
58119 +       /* Parse inbound mapping resources */
58120 +       if (ppc4xx_parse_dma_ranges(hose, reg, &dma_window) != 0)
58121 +               goto fail;
58122 +
58123 +       /* Configure outbound ranges POMs */
58124 +       ppc4xx_configure_pci_PMMs(hose, reg);
58125 +
58126 +       /* Configure inbound ranges PIMs */
58127 +       ppc4xx_configure_pci_PTMs(hose, reg, &dma_window);
58128 +
58129 +       /* We don't need the registers anymore */
58130 +       iounmap(reg);
58131 +       return;
58132 +
58133 + fail:
58134 +       if (hose)
58135 +               pcibios_free_controller(hose);
58136 +       if (reg)
58137 +               iounmap(reg);
58138 +}
58139 +
58140 +/*
58141 + * 4xx PCI-X part
58142 + */
58143 +
58144 +static void __init ppc4xx_configure_pcix_POMs(struct pci_controller *hose,
58145 +                                             void __iomem *reg)
58146 +{
58147 +       u32 lah, lal, pciah, pcial, sa;
58148 +       int i, j;
58149 +
58150 +       /* Setup outbound memory windows */
58151 +       for (i = j = 0; i < 3; i++) {
58152 +               struct resource *res = &hose->mem_resources[i];
58153 +
58154 +               /* we only care about memory windows */
58155 +               if (!(res->flags & IORESOURCE_MEM))
58156 +                       continue;
58157 +               if (j > 1) {
58158 +                       printk(KERN_WARNING "%s: Too many ranges\n",
58159 +                              hose->dn->full_name);
58160 +                       break;
58161 +               }
58162 +
58163 +               /* Calculate register values */
58164 +               lah = RES_TO_U32_HIGH(res->start);
58165 +               lal = RES_TO_U32_LOW(res->start);
58166 +               pciah = RES_TO_U32_HIGH(res->start - hose->pci_mem_offset);
58167 +               pcial = RES_TO_U32_LOW(res->start - hose->pci_mem_offset);
58168 +               sa = res->end + 1 - res->start;
58169 +               if (!is_power_of_2(sa) || sa < 0x100000 ||
58170 +                   sa > 0xffffffffu) {
58171 +                       printk(KERN_WARNING "%s: Resource out of range\n",
58172 +                              hose->dn->full_name);
58173 +                       continue;
58174 +               }
58175 +               sa = (0xffffffffu << ilog2(sa)) | 0x1;
58176 +
58177 +               /* Program register values */
58178 +               if (j == 0) {
58179 +                       writel(lah, reg + PCIX0_POM0LAH);
58180 +                       writel(lal, reg + PCIX0_POM0LAL);
58181 +                       writel(pciah, reg + PCIX0_POM0PCIAH);
58182 +                       writel(pcial, reg + PCIX0_POM0PCIAL);
58183 +                       writel(sa, reg + PCIX0_POM0SA);
58184 +               } else {
58185 +                       writel(lah, reg + PCIX0_POM1LAH);
58186 +                       writel(lal, reg + PCIX0_POM1LAL);
58187 +                       writel(pciah, reg + PCIX0_POM1PCIAH);
58188 +                       writel(pcial, reg + PCIX0_POM1PCIAL);
58189 +                       writel(sa, reg + PCIX0_POM1SA);
58190 +               }
58191 +               j++;
58192 +       }
58193 +}
58194 +
58195 +static void __init ppc4xx_configure_pcix_PIMs(struct pci_controller *hose,
58196 +                                             void __iomem *reg,
58197 +                                             const struct resource *res,
58198 +                                             int big_pim,
58199 +                                             int enable_msi_hole)
58200 +{
58201 +       resource_size_t size = res->end - res->start + 1;
58202 +       u32 sa;
58203 +
58204 +       /* RAM is always at 0 */
58205 +       writel(0x00000000, reg + PCIX0_PIM0LAH);
58206 +       writel(0x00000000, reg + PCIX0_PIM0LAL);
58207 +
58208 +       /* Calculate window size */
58209 +       sa = (0xffffffffu << ilog2(size)) | 1;
58210 +       sa |= 0x1;
58211 +       if (res->flags & IORESOURCE_PREFETCH)
58212 +               sa |= 0x2;
58213 +       if (enable_msi_hole)
58214 +               sa |= 0x4;
58215 +       writel(sa, reg + PCIX0_PIM0SA);
58216 +       if (big_pim)
58217 +               writel(0xffffffff, reg + PCIX0_PIM0SAH);
58218 +
58219 +       /* Map on PCI side */
58220 +       writel(0x00000000, reg + PCIX0_BAR0H);
58221 +       writel(res->start, reg + PCIX0_BAR0L);
58222 +       writew(0x0006, reg + PCIX0_COMMAND);
58223 +}
58224 +
58225 +static void __init ppc4xx_probe_pcix_bridge(struct device_node *np)
58226 +{
58227 +       struct resource rsrc_cfg;
58228 +       struct resource rsrc_reg;
58229 +       struct resource dma_window;
58230 +       struct pci_controller *hose = NULL;
58231 +       void __iomem *reg = NULL;
58232 +       const int *bus_range;
58233 +       int big_pim = 0, msi = 0, primary = 0;
58234 +
58235 +       /* Fetch config space registers address */
58236 +       if (of_address_to_resource(np, 0, &rsrc_cfg)) {
58237 +               printk(KERN_ERR "%s:Can't get PCI-X config register base !",
58238 +                      np->full_name);
58239 +               return;
58240 +       }
58241 +       /* Fetch host bridge internal registers address */
58242 +       if (of_address_to_resource(np, 3, &rsrc_reg)) {
58243 +               printk(KERN_ERR "%s: Can't get PCI-X internal register base !",
58244 +                      np->full_name);
58245 +               return;
58246 +       }
58247 +
58248 +       /* Check if it supports large PIMs (440GX) */
58249 +       if (of_get_property(np, "large-inbound-windows", NULL))
58250 +               big_pim = 1;
58251 +
58252 +       /* Check if we should enable MSIs inbound hole */
58253 +       if (of_get_property(np, "enable-msi-hole", NULL))
58254 +               msi = 1;
58255 +
58256 +       /* Check if primary bridge */
58257 +       if (of_get_property(np, "primary", NULL))
58258 +               primary = 1;
58259 +
58260 +       /* Get bus range if any */
58261 +       bus_range = of_get_property(np, "bus-range", NULL);
58262 +
58263 +       /* Map registers */
58264 +       reg = ioremap(rsrc_reg.start, rsrc_reg.end + 1 - rsrc_reg.start);
58265 +       if (reg == NULL) {
58266 +               printk(KERN_ERR "%s: Can't map registers !", np->full_name);
58267 +               goto fail;
58268 +       }
58269 +
58270 +       /* Allocate the host controller data structure */
58271 +       hose = pcibios_alloc_controller(np);
58272 +       if (!hose)
58273 +               goto fail;
58274 +
58275 +       hose->first_busno = bus_range ? bus_range[0] : 0x0;
58276 +       hose->last_busno = bus_range ? bus_range[1] : 0xff;
58277 +
58278 +       /* Setup config space */
58279 +       setup_indirect_pci(hose, rsrc_cfg.start, rsrc_cfg.start + 0x4, 0);
58280 +
58281 +       /* Disable all windows */
58282 +       writel(0, reg + PCIX0_POM0SA);
58283 +       writel(0, reg + PCIX0_POM1SA);
58284 +       writel(0, reg + PCIX0_POM2SA);
58285 +       writel(0, reg + PCIX0_PIM0SA);
58286 +       writel(0, reg + PCIX0_PIM1SA);
58287 +       writel(0, reg + PCIX0_PIM2SA);
58288 +       if (big_pim) {
58289 +               writel(0, reg + PCIX0_PIM0SAH);
58290 +               writel(0, reg + PCIX0_PIM2SAH);
58291 +       }
58292 +
58293 +       /* Parse outbound mapping resources */
58294 +       pci_process_bridge_OF_ranges(hose, np, primary);
58295 +
58296 +       /* Parse inbound mapping resources */
58297 +       if (ppc4xx_parse_dma_ranges(hose, reg, &dma_window) != 0)
58298 +               goto fail;
58299 +
58300 +       /* Configure outbound ranges POMs */
58301 +       ppc4xx_configure_pcix_POMs(hose, reg);
58302 +
58303 +       /* Configure inbound ranges PIMs */
58304 +       ppc4xx_configure_pcix_PIMs(hose, reg, &dma_window, big_pim, msi);
58305 +
58306 +       /* We don't need the registers anymore */
58307 +       iounmap(reg);
58308 +       return;
58309 +
58310 + fail:
58311 +       if (hose)
58312 +               pcibios_free_controller(hose);
58313 +       if (reg)
58314 +               iounmap(reg);
58315 +}
58316 +
58317 +#ifdef CONFIG_PPC4xx_PCI_EXPRESS
58318 +
58319 +/*
58320 + * 4xx PCI-Express part
58321 + *
58322 + * We support 3 parts currently based on the compatible property:
58323 + *
58324 + * ibm,plb-pciex-440spe
58325 + * ibm,plb-pciex-405ex
58326 + *
58327 + * Anything else will be rejected for now as they are all subtly
58328 + * different unfortunately.
58329 + *
58330 + */
58331 +
58332 +#define MAX_PCIE_BUS_MAPPED    0x40
58333 +
58334 +struct ppc4xx_pciex_port
58335 +{
58336 +       struct pci_controller   *hose;
58337 +       struct device_node      *node;
58338 +       unsigned int            index;
58339 +       int                     endpoint;
58340 +       int                     link;
58341 +       int                     has_ibpre;
58342 +       unsigned int            sdr_base;
58343 +       dcr_host_t              dcrs;
58344 +       struct resource         cfg_space;
58345 +       struct resource         utl_regs;
58346 +       void __iomem            *utl_base;
58347 +};
58348 +
58349 +static struct ppc4xx_pciex_port *ppc4xx_pciex_ports;
58350 +static unsigned int ppc4xx_pciex_port_count;
58351 +
58352 +struct ppc4xx_pciex_hwops
58353 +{
58354 +       int (*core_init)(struct device_node *np);
58355 +       int (*port_init_hw)(struct ppc4xx_pciex_port *port);
58356 +       int (*setup_utl)(struct ppc4xx_pciex_port *port);
58357 +};
58358 +
58359 +static struct ppc4xx_pciex_hwops *ppc4xx_pciex_hwops;
58360 +
58361 +#ifdef CONFIG_44x
58362 +
58363 +/* Check various reset bits of the 440SPe PCIe core */
58364 +static int __init ppc440spe_pciex_check_reset(struct device_node *np)
58365 +{
58366 +       u32 valPE0, valPE1, valPE2;
58367 +       int err = 0;
58368 +
58369 +       /* SDR0_PEGPLLLCT1 reset */
58370 +       if (!(mfdcri(SDR0, PESDR0_PLLLCT1) & 0x01000000)) {
58371 +               /*
58372 +                * the PCIe core was probably already initialised
58373 +                * by firmware - let's re-reset RCSSET regs
58374 +                *
58375 +                * -- Shouldn't we also re-reset the whole thing ? -- BenH
58376 +                */
58377 +               pr_debug("PCIE: SDR0_PLLLCT1 already reset.\n");
58378 +               mtdcri(SDR0, PESDR0_440SPE_RCSSET, 0x01010000);
58379 +               mtdcri(SDR0, PESDR1_440SPE_RCSSET, 0x01010000);
58380 +               mtdcri(SDR0, PESDR2_440SPE_RCSSET, 0x01010000);
58381 +       }
58382 +
58383 +       valPE0 = mfdcri(SDR0, PESDR0_440SPE_RCSSET);
58384 +       valPE1 = mfdcri(SDR0, PESDR1_440SPE_RCSSET);
58385 +       valPE2 = mfdcri(SDR0, PESDR2_440SPE_RCSSET);
58386 +
58387 +       /* SDR0_PExRCSSET rstgu */
58388 +       if (!(valPE0 & 0x01000000) ||
58389 +           !(valPE1 & 0x01000000) ||
58390 +           !(valPE2 & 0x01000000)) {
58391 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstgu error\n");
58392 +               err = -1;
58393 +       }
58394 +
58395 +       /* SDR0_PExRCSSET rstdl */
58396 +       if (!(valPE0 & 0x00010000) ||
58397 +           !(valPE1 & 0x00010000) ||
58398 +           !(valPE2 & 0x00010000)) {
58399 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstdl error\n");
58400 +               err = -1;
58401 +       }
58402 +
58403 +       /* SDR0_PExRCSSET rstpyn */
58404 +       if ((valPE0 & 0x00001000) ||
58405 +           (valPE1 & 0x00001000) ||
58406 +           (valPE2 & 0x00001000)) {
58407 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET rstpyn error\n");
58408 +               err = -1;
58409 +       }
58410 +
58411 +       /* SDR0_PExRCSSET hldplb */
58412 +       if ((valPE0 & 0x10000000) ||
58413 +           (valPE1 & 0x10000000) ||
58414 +           (valPE2 & 0x10000000)) {
58415 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET hldplb error\n");
58416 +               err = -1;
58417 +       }
58418 +
58419 +       /* SDR0_PExRCSSET rdy */
58420 +       if ((valPE0 & 0x00100000) ||
58421 +           (valPE1 & 0x00100000) ||
58422 +           (valPE2 & 0x00100000)) {
58423 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET rdy error\n");
58424 +               err = -1;
58425 +       }
58426 +
58427 +       /* SDR0_PExRCSSET shutdown */
58428 +       if ((valPE0 & 0x00000100) ||
58429 +           (valPE1 & 0x00000100) ||
58430 +           (valPE2 & 0x00000100)) {
58431 +               printk(KERN_INFO "PCIE: SDR0_PExRCSSET shutdown error\n");
58432 +               err = -1;
58433 +       }
58434 +
58435 +       return err;
58436 +}
58437 +
58438 +/* Global PCIe core initializations for 440SPe core */
58439 +static int __init ppc440spe_pciex_core_init(struct device_node *np)
58440 +{
58441 +       int time_out = 20;
58442 +
58443 +       /* Set PLL clock receiver to LVPECL */
58444 +       mtdcri(SDR0, PESDR0_PLLLCT1, mfdcri(SDR0, PESDR0_PLLLCT1) | 1 << 28);
58445 +
58446 +       /* Shouldn't we do all the calibration stuff etc... here ? */
58447 +       if (ppc440spe_pciex_check_reset(np))
58448 +               return -ENXIO;
58449 +
58450 +       if (!(mfdcri(SDR0, PESDR0_PLLLCT2) & 0x10000)) {
58451 +               printk(KERN_INFO "PCIE: PESDR_PLLCT2 resistance calibration "
58452 +                      "failed (0x%08x)\n",
58453 +                      mfdcri(SDR0, PESDR0_PLLLCT2));
58454 +               return -1;
58455 +       }
58456 +
58457 +       /* De-assert reset of PCIe PLL, wait for lock */
58458 +       mtdcri(SDR0, PESDR0_PLLLCT1,
58459 +              mfdcri(SDR0, PESDR0_PLLLCT1) & ~(1 << 24));
58460 +       udelay(3);
58461 +
58462 +       while (time_out) {
58463 +               if (!(mfdcri(SDR0, PESDR0_PLLLCT3) & 0x10000000)) {
58464 +                       time_out--;
58465 +                       udelay(1);
58466 +               } else
58467 +                       break;
58468 +       }
58469 +       if (!time_out) {
58470 +               printk(KERN_INFO "PCIE: VCO output not locked\n");
58471 +               return -1;
58472 +       }
58473 +
58474 +       pr_debug("PCIE initialization OK\n");
58475 +
58476 +       return 3;
58477 +}
58478 +
58479 +static int ppc440spe_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
58480 +{
58481 +       u32 val = 1 << 24;
58482 +
58483 +       if (port->endpoint)
58484 +               val = PTYPE_LEGACY_ENDPOINT << 20;
58485 +       else
58486 +               val = PTYPE_ROOT_PORT << 20;
58487 +
58488 +       if (port->index == 0)
58489 +               val |= LNKW_X8 << 12;
58490 +       else
58491 +               val |= LNKW_X4 << 12;
58492 +
58493 +       mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET, val);
58494 +       mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, 0x20222222);
58495 +       if (ppc440spe_revA())
58496 +               mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x11000000);
58497 +       mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL0SET1, 0x35000000);
58498 +       mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL1SET1, 0x35000000);
58499 +       mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL2SET1, 0x35000000);
58500 +       mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL3SET1, 0x35000000);
58501 +       if (port->index == 0) {
58502 +               mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL4SET1,
58503 +                      0x35000000);
58504 +               mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL5SET1,
58505 +                      0x35000000);
58506 +               mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL6SET1,
58507 +                      0x35000000);
58508 +               mtdcri(SDR0, port->sdr_base + PESDRn_440SPE_HSSL7SET1,
58509 +                      0x35000000);
58510 +       }
58511 +       val = mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET);
58512 +       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
58513 +              (val & ~(1 << 24 | 1 << 16)) | 1 << 12);
58514 +
58515 +       return 0;
58516 +}
58517 +
58518 +static int ppc440speA_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
58519 +{
58520 +       return ppc440spe_pciex_init_port_hw(port);
58521 +}
58522 +
58523 +static int ppc440speB_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
58524 +{
58525 +       int rc = ppc440spe_pciex_init_port_hw(port);
58526 +
58527 +       port->has_ibpre = 1;
58528 +
58529 +       return rc;
58530 +}
58531 +
58532 +static int ppc440speA_pciex_init_utl(struct ppc4xx_pciex_port *port)
58533 +{
58534 +       /* XXX Check what that value means... I hate magic */
58535 +       dcr_write(port->dcrs, DCRO_PEGPL_SPECIAL, 0x68782800);
58536 +
58537 +       /*
58538 +        * Set buffer allocations and then assert VRB and TXE.
58539 +        */
58540 +       out_be32(port->utl_base + PEUTL_OUTTR,   0x08000000);
58541 +       out_be32(port->utl_base + PEUTL_INTR,    0x02000000);
58542 +       out_be32(port->utl_base + PEUTL_OPDBSZ,  0x10000000);
58543 +       out_be32(port->utl_base + PEUTL_PBBSZ,   0x53000000);
58544 +       out_be32(port->utl_base + PEUTL_IPHBSZ,  0x08000000);
58545 +       out_be32(port->utl_base + PEUTL_IPDBSZ,  0x10000000);
58546 +       out_be32(port->utl_base + PEUTL_RCIRQEN, 0x00f00000);
58547 +       out_be32(port->utl_base + PEUTL_PCTL,    0x80800066);
58548 +
58549 +       return 0;
58550 +}
58551 +
58552 +static int ppc440speB_pciex_init_utl(struct ppc4xx_pciex_port *port)
58553 +{
58554 +       /* Report CRS to the operating system */
58555 +       out_be32(port->utl_base + PEUTL_PBCTL,    0x08000000);
58556 +
58557 +       return 0;
58558 +}
58559 +
58560 +static struct ppc4xx_pciex_hwops ppc440speA_pcie_hwops __initdata =
58561 +{
58562 +       .core_init      = ppc440spe_pciex_core_init,
58563 +       .port_init_hw   = ppc440speA_pciex_init_port_hw,
58564 +       .setup_utl      = ppc440speA_pciex_init_utl,
58565 +};
58566 +
58567 +static struct ppc4xx_pciex_hwops ppc440speB_pcie_hwops __initdata =
58568 +{
58569 +       .core_init      = ppc440spe_pciex_core_init,
58570 +       .port_init_hw   = ppc440speB_pciex_init_port_hw,
58571 +       .setup_utl      = ppc440speB_pciex_init_utl,
58572 +};
58573 +
58574 +#endif /* CONFIG_44x */
58575 +
58576 +#ifdef CONFIG_40x
58577 +
58578 +static int __init ppc405ex_pciex_core_init(struct device_node *np)
58579 +{
58580 +       /* Nothing to do, return 2 ports */
58581 +       return 2;
58582 +}
58583 +
58584 +static void ppc405ex_pcie_phy_reset(struct ppc4xx_pciex_port *port)
58585 +{
58586 +       /* Assert the PE0_PHY reset */
58587 +       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01010000);
58588 +       msleep(1);
58589 +
58590 +       /* deassert the PE0_hotreset */
58591 +       if (port->endpoint)
58592 +               mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01111000);
58593 +       else
58594 +               mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01101000);
58595 +
58596 +       /* poll for phy !reset */
58597 +       /* XXX FIXME add timeout */
58598 +       while (!(mfdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSTA) & 0x00001000))
58599 +               ;
58600 +
58601 +       /* deassert the PE0_gpl_utl_reset */
58602 +       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x00101000);
58603 +}
58604 +
58605 +static int ppc405ex_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
58606 +{
58607 +       u32 val;
58608 +
58609 +       if (port->endpoint)
58610 +               val = PTYPE_LEGACY_ENDPOINT;
58611 +       else
58612 +               val = PTYPE_ROOT_PORT;
58613 +
58614 +       mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET,
58615 +              1 << 24 | val << 20 | LNKW_X1 << 12);
58616 +
58617 +       mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, 0x00000000);
58618 +       mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x01010000);
58619 +       mtdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSET1, 0x720F0000);
58620 +       mtdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSET2, 0x70600003);
58621 +
58622 +       /*
58623 +        * Only reset the PHY when no link is currently established.
58624 +        * This is for the Atheros PCIe board which has problems to establish
58625 +        * the link (again) after this PHY reset. All other currently tested
58626 +        * PCIe boards don't show this problem.
58627 +        * This has to be re-tested and fixed in a later release!
58628 +        */
58629 +#if 0 /* XXX FIXME: Not resetting the PHY will leave all resources
58630 +       * configured as done previously by U-Boot. Then Linux will currently
58631 +       * not reassign them. So the PHY reset is now done always. This will
58632 +       * lead to problems with the Atheros PCIe board again.
58633 +       */
58634 +       val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP);
58635 +       if (!(val & 0x00001000))
58636 +               ppc405ex_pcie_phy_reset(port);
58637 +#else
58638 +       ppc405ex_pcie_phy_reset(port);
58639 +#endif
58640 +
58641 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, 0x10000000);  /* guarded on */
58642 +
58643 +       port->has_ibpre = 1;
58644 +
58645 +       return 0;
58646 +}
58647 +
58648 +static int ppc405ex_pciex_init_utl(struct ppc4xx_pciex_port *port)
58649 +{
58650 +       dcr_write(port->dcrs, DCRO_PEGPL_SPECIAL, 0x0);
58651 +
58652 +       /*
58653 +        * Set buffer allocations and then assert VRB and TXE.
58654 +        */
58655 +       out_be32(port->utl_base + PEUTL_OUTTR,   0x02000000);
58656 +       out_be32(port->utl_base + PEUTL_INTR,    0x02000000);
58657 +       out_be32(port->utl_base + PEUTL_OPDBSZ,  0x04000000);
58658 +       out_be32(port->utl_base + PEUTL_PBBSZ,   0x21000000);
58659 +       out_be32(port->utl_base + PEUTL_IPHBSZ,  0x02000000);
58660 +       out_be32(port->utl_base + PEUTL_IPDBSZ,  0x04000000);
58661 +       out_be32(port->utl_base + PEUTL_RCIRQEN, 0x00f00000);
58662 +       out_be32(port->utl_base + PEUTL_PCTL,    0x80800066);
58663 +
58664 +       out_be32(port->utl_base + PEUTL_PBCTL,   0x08000000);
58665 +
58666 +       return 0;
58667 +}
58668 +
58669 +static struct ppc4xx_pciex_hwops ppc405ex_pcie_hwops __initdata =
58670 +{
58671 +       .core_init      = ppc405ex_pciex_core_init,
58672 +       .port_init_hw   = ppc405ex_pciex_init_port_hw,
58673 +       .setup_utl      = ppc405ex_pciex_init_utl,
58674 +};
58675 +
58676 +#endif /* CONFIG_40x */
58677 +
58678 +
58679 +/* Check that the core has been initied and if not, do it */
58680 +static int __init ppc4xx_pciex_check_core_init(struct device_node *np)
58681 +{
58682 +       static int core_init;
58683 +       int count = -ENODEV;
58684 +
58685 +       if (core_init++)
58686 +               return 0;
58687 +
58688 +#ifdef CONFIG_44x
58689 +       if (of_device_is_compatible(np, "ibm,plb-pciex-440spe")) {
58690 +               if (ppc440spe_revA())
58691 +                       ppc4xx_pciex_hwops = &ppc440speA_pcie_hwops;
58692 +               else
58693 +                       ppc4xx_pciex_hwops = &ppc440speB_pcie_hwops;
58694 +       }
58695 +#endif /* CONFIG_44x    */
58696 +#ifdef CONFIG_40x
58697 +       if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))
58698 +               ppc4xx_pciex_hwops = &ppc405ex_pcie_hwops;
58699 +#endif
58700 +       if (ppc4xx_pciex_hwops == NULL) {
58701 +               printk(KERN_WARNING "PCIE: unknown host type %s\n",
58702 +                      np->full_name);
58703 +               return -ENODEV;
58704 +       }
58705 +
58706 +       count = ppc4xx_pciex_hwops->core_init(np);
58707 +       if (count > 0) {
58708 +               ppc4xx_pciex_ports =
58709 +                      kzalloc(count * sizeof(struct ppc4xx_pciex_port),
58710 +                              GFP_KERNEL);
58711 +               if (ppc4xx_pciex_ports) {
58712 +                       ppc4xx_pciex_port_count = count;
58713 +                       return 0;
58714 +               }
58715 +               printk(KERN_WARNING "PCIE: failed to allocate ports array\n");
58716 +               return -ENOMEM;
58717 +       }
58718 +       return -ENODEV;
58719 +}
58720 +
58721 +static void __init ppc4xx_pciex_port_init_mapping(struct ppc4xx_pciex_port *port)
58722 +{
58723 +       /* We map PCI Express configuration based on the reg property */
58724 +       dcr_write(port->dcrs, DCRO_PEGPL_CFGBAH,
58725 +                 RES_TO_U32_HIGH(port->cfg_space.start));
58726 +       dcr_write(port->dcrs, DCRO_PEGPL_CFGBAL,
58727 +                 RES_TO_U32_LOW(port->cfg_space.start));
58728 +
58729 +       /* XXX FIXME: Use size from reg property. For now, map 512M */
58730 +       dcr_write(port->dcrs, DCRO_PEGPL_CFGMSK, 0xe0000001);
58731 +
58732 +       /* We map UTL registers based on the reg property */
58733 +       dcr_write(port->dcrs, DCRO_PEGPL_REGBAH,
58734 +                 RES_TO_U32_HIGH(port->utl_regs.start));
58735 +       dcr_write(port->dcrs, DCRO_PEGPL_REGBAL,
58736 +                 RES_TO_U32_LOW(port->utl_regs.start));
58737 +
58738 +       /* XXX FIXME: Use size from reg property */
58739 +       dcr_write(port->dcrs, DCRO_PEGPL_REGMSK, 0x00007001);
58740 +
58741 +       /* Disable all other outbound windows */
58742 +       dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL, 0);
58743 +       dcr_write(port->dcrs, DCRO_PEGPL_OMR2MSKL, 0);
58744 +       dcr_write(port->dcrs, DCRO_PEGPL_OMR3MSKL, 0);
58745 +       dcr_write(port->dcrs, DCRO_PEGPL_MSGMSK, 0);
58746 +}
58747 +
58748 +static int __init ppc4xx_pciex_wait_on_sdr(struct ppc4xx_pciex_port *port,
58749 +                                          unsigned int sdr_offset,
58750 +                                          unsigned int mask,
58751 +                                          unsigned int value,
58752 +                                          int timeout_ms)
58753 +{
58754 +       u32 val;
58755 +
58756 +       while(timeout_ms--) {
58757 +               val = mfdcri(SDR0, port->sdr_base + sdr_offset);
58758 +               if ((val & mask) == value) {
58759 +                       pr_debug("PCIE%d: Wait on SDR %x success with tm %d (%08x)\n",
58760 +                                port->index, sdr_offset, timeout_ms, val);
58761 +                       return 0;
58762 +               }
58763 +               msleep(1);
58764 +       }
58765 +       return -1;
58766 +}
58767 +
58768 +static int __init ppc4xx_pciex_port_init(struct ppc4xx_pciex_port *port)
58769 +{
58770 +       int rc = 0;
58771 +
58772 +       /* Init HW */
58773 +       if (ppc4xx_pciex_hwops->port_init_hw)
58774 +               rc = ppc4xx_pciex_hwops->port_init_hw(port);
58775 +       if (rc != 0)
58776 +               return rc;
58777 +
58778 +       printk(KERN_INFO "PCIE%d: Checking link...\n",
58779 +              port->index);
58780 +
58781 +       /* Wait for reset to complete */
58782 +       if (ppc4xx_pciex_wait_on_sdr(port, PESDRn_RCSSTS, 1 << 20, 0, 10)) {
58783 +               printk(KERN_WARNING "PCIE%d: PGRST failed\n",
58784 +                      port->index);
58785 +               return -1;
58786 +       }
58787 +
58788 +       /* Check for card presence detect if supported, if not, just wait for
58789 +        * link unconditionally.
58790 +        *
58791 +        * note that we don't fail if there is no link, we just filter out
58792 +        * config space accesses. That way, it will be easier to implement
58793 +        * hotplug later on.
58794 +        */
58795 +       if (!port->has_ibpre ||
58796 +           !ppc4xx_pciex_wait_on_sdr(port, PESDRn_LOOP,
58797 +                                     1 << 28, 1 << 28, 100)) {
58798 +               printk(KERN_INFO
58799 +                      "PCIE%d: Device detected, waiting for link...\n",
58800 +                      port->index);
58801 +               if (ppc4xx_pciex_wait_on_sdr(port, PESDRn_LOOP,
58802 +                                            0x1000, 0x1000, 2000))
58803 +                       printk(KERN_WARNING
58804 +                              "PCIE%d: Link up failed\n", port->index);
58805 +               else {
58806 +                       printk(KERN_INFO
58807 +                              "PCIE%d: link is up !\n", port->index);
58808 +                       port->link = 1;
58809 +               }
58810 +       } else
58811 +               printk(KERN_INFO "PCIE%d: No device detected.\n", port->index);
58812 +
58813 +       /*
58814 +        * Initialize mapping: disable all regions and configure
58815 +        * CFG and REG regions based on resources in the device tree
58816 +        */
58817 +       ppc4xx_pciex_port_init_mapping(port);
58818 +
58819 +       /*
58820 +        * Map UTL
58821 +        */
58822 +       port->utl_base = ioremap(port->utl_regs.start, 0x100);
58823 +       BUG_ON(port->utl_base == NULL);
58824 +
58825 +       /*
58826 +        * Setup UTL registers --BenH.
58827 +        */
58828 +       if (ppc4xx_pciex_hwops->setup_utl)
58829 +               ppc4xx_pciex_hwops->setup_utl(port);
58830 +
58831 +       /*
58832 +        * Check for VC0 active and assert RDY.
58833 +        */
58834 +       if (port->link &&
58835 +           ppc4xx_pciex_wait_on_sdr(port, PESDRn_RCSSTS,
58836 +                                    1 << 16, 1 << 16, 5000)) {
58837 +               printk(KERN_INFO "PCIE%d: VC0 not active\n", port->index);
58838 +               port->link = 0;
58839 +       }
58840 +
58841 +       mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
58842 +              mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET) | 1 << 20);
58843 +       msleep(100);
58844 +
58845 +       return 0;
58846 +}
58847 +
58848 +static int ppc4xx_pciex_validate_bdf(struct ppc4xx_pciex_port *port,
58849 +                                    struct pci_bus *bus,
58850 +                                    unsigned int devfn)
58851 +{
58852 +       static int message;
58853 +
58854 +       /* Endpoint can not generate upstream(remote) config cycles */
58855 +       if (port->endpoint && bus->number != port->hose->first_busno)
58856 +               return PCIBIOS_DEVICE_NOT_FOUND;
58857 +
58858 +       /* Check we are within the mapped range */
58859 +       if (bus->number > port->hose->last_busno) {
58860 +               if (!message) {
58861 +                       printk(KERN_WARNING "Warning! Probing bus %u"
58862 +                              " out of range !\n", bus->number);
58863 +                       message++;
58864 +               }
58865 +               return PCIBIOS_DEVICE_NOT_FOUND;
58866 +       }
58867 +
58868 +       /* The root complex has only one device / function */
58869 +       if (bus->number == port->hose->first_busno && devfn != 0)
58870 +               return PCIBIOS_DEVICE_NOT_FOUND;
58871 +
58872 +       /* The other side of the RC has only one device as well */
58873 +       if (bus->number == (port->hose->first_busno + 1) &&
58874 +           PCI_SLOT(devfn) != 0)
58875 +               return PCIBIOS_DEVICE_NOT_FOUND;
58876 +
58877 +       /* Check if we have a link */
58878 +       if ((bus->number != port->hose->first_busno) && !port->link)
58879 +               return PCIBIOS_DEVICE_NOT_FOUND;
58880 +
58881 +       return 0;
58882 +}
58883 +
58884 +static void __iomem *ppc4xx_pciex_get_config_base(struct ppc4xx_pciex_port *port,
58885 +                                                 struct pci_bus *bus,
58886 +                                                 unsigned int devfn)
58887 +{
58888 +       int relbus;
58889 +
58890 +       /* Remove the casts when we finally remove the stupid volatile
58891 +        * in struct pci_controller
58892 +        */
58893 +       if (bus->number == port->hose->first_busno)
58894 +               return (void __iomem *)port->hose->cfg_addr;
58895 +
58896 +       relbus = bus->number - (port->hose->first_busno + 1);
58897 +       return (void __iomem *)port->hose->cfg_data +
58898 +               ((relbus  << 20) | (devfn << 12));
58899 +}
58900 +
58901 +static int ppc4xx_pciex_read_config(struct pci_bus *bus, unsigned int devfn,
58902 +                                   int offset, int len, u32 *val)
58903 +{
58904 +       struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
58905 +       struct ppc4xx_pciex_port *port =
58906 +               &ppc4xx_pciex_ports[hose->indirect_type];
58907 +       void __iomem *addr;
58908 +       u32 gpl_cfg;
58909 +
58910 +       BUG_ON(hose != port->hose);
58911 +
58912 +       if (ppc4xx_pciex_validate_bdf(port, bus, devfn) != 0)
58913 +               return PCIBIOS_DEVICE_NOT_FOUND;
58914 +
58915 +       addr = ppc4xx_pciex_get_config_base(port, bus, devfn);
58916 +
58917 +       /*
58918 +        * Reading from configuration space of non-existing device can
58919 +        * generate transaction errors. For the read duration we suppress
58920 +        * assertion of machine check exceptions to avoid those.
58921 +        */
58922 +       gpl_cfg = dcr_read(port->dcrs, DCRO_PEGPL_CFG);
58923 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg | GPL_DMER_MASK_DISA);
58924 +
58925 +       /* Make sure no CRS is recorded */
58926 +       out_be32(port->utl_base + PEUTL_RCSTA, 0x00040000);
58927 +
58928 +       switch (len) {
58929 +       case 1:
58930 +               *val = in_8((u8 *)(addr + offset));
58931 +               break;
58932 +       case 2:
58933 +               *val = in_le16((u16 *)(addr + offset));
58934 +               break;
58935 +       default:
58936 +               *val = in_le32((u32 *)(addr + offset));
58937 +               break;
58938 +       }
58939 +
58940 +       pr_debug("pcie-config-read: bus=%3d [%3d..%3d] devfn=0x%04x"
58941 +                " offset=0x%04x len=%d, addr=0x%p val=0x%08x\n",
58942 +                bus->number, hose->first_busno, hose->last_busno,
58943 +                devfn, offset, len, addr + offset, *val);
58944 +
58945 +       /* Check for CRS (440SPe rev B does that for us but heh ..) */
58946 +       if (in_be32(port->utl_base + PEUTL_RCSTA) & 0x00040000) {
58947 +               pr_debug("Got CRS !\n");
58948 +               if (len != 4 || offset != 0)
58949 +                       return PCIBIOS_DEVICE_NOT_FOUND;
58950 +               *val = 0xffff0001;
58951 +       }
58952 +
58953 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg);
58954 +
58955 +       return PCIBIOS_SUCCESSFUL;
58956 +}
58957 +
58958 +static int ppc4xx_pciex_write_config(struct pci_bus *bus, unsigned int devfn,
58959 +                                    int offset, int len, u32 val)
58960 +{
58961 +       struct pci_controller *hose = (struct pci_controller *) bus->sysdata;
58962 +       struct ppc4xx_pciex_port *port =
58963 +               &ppc4xx_pciex_ports[hose->indirect_type];
58964 +       void __iomem *addr;
58965 +       u32 gpl_cfg;
58966 +
58967 +       if (ppc4xx_pciex_validate_bdf(port, bus, devfn) != 0)
58968 +               return PCIBIOS_DEVICE_NOT_FOUND;
58969 +
58970 +       addr = ppc4xx_pciex_get_config_base(port, bus, devfn);
58971 +
58972 +       /*
58973 +        * Reading from configuration space of non-existing device can
58974 +        * generate transaction errors. For the read duration we suppress
58975 +        * assertion of machine check exceptions to avoid those.
58976 +        */
58977 +       gpl_cfg = dcr_read(port->dcrs, DCRO_PEGPL_CFG);
58978 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg | GPL_DMER_MASK_DISA);
58979 +
58980 +       pr_debug("pcie-config-write: bus=%3d [%3d..%3d] devfn=0x%04x"
58981 +                " offset=0x%04x len=%d, addr=0x%p val=0x%08x\n",
58982 +                bus->number, hose->first_busno, hose->last_busno,
58983 +                devfn, offset, len, addr + offset, val);
58984 +
58985 +       switch (len) {
58986 +       case 1:
58987 +               out_8((u8 *)(addr + offset), val);
58988 +               break;
58989 +       case 2:
58990 +               out_le16((u16 *)(addr + offset), val);
58991 +               break;
58992 +       default:
58993 +               out_le32((u32 *)(addr + offset), val);
58994 +               break;
58995 +       }
58996 +
58997 +       dcr_write(port->dcrs, DCRO_PEGPL_CFG, gpl_cfg);
58998 +
58999 +       return PCIBIOS_SUCCESSFUL;
59000 +}
59001 +
59002 +static struct pci_ops ppc4xx_pciex_pci_ops =
59003 +{
59004 +       .read  = ppc4xx_pciex_read_config,
59005 +       .write = ppc4xx_pciex_write_config,
59006 +};
59007 +
59008 +static void __init ppc4xx_configure_pciex_POMs(struct ppc4xx_pciex_port *port,
59009 +                                              struct pci_controller *hose,
59010 +                                              void __iomem *mbase)
59011 +{
59012 +       u32 lah, lal, pciah, pcial, sa;
59013 +       int i, j;
59014 +
59015 +       /* Setup outbound memory windows */
59016 +       for (i = j = 0; i < 3; i++) {
59017 +               struct resource *res = &hose->mem_resources[i];
59018 +
59019 +               /* we only care about memory windows */
59020 +               if (!(res->flags & IORESOURCE_MEM))
59021 +                       continue;
59022 +               if (j > 1) {
59023 +                       printk(KERN_WARNING "%s: Too many ranges\n",
59024 +                              port->node->full_name);
59025 +                       break;
59026 +               }
59027 +
59028 +               /* Calculate register values */
59029 +               lah = RES_TO_U32_HIGH(res->start);
59030 +               lal = RES_TO_U32_LOW(res->start);
59031 +               pciah = RES_TO_U32_HIGH(res->start - hose->pci_mem_offset);
59032 +               pcial = RES_TO_U32_LOW(res->start - hose->pci_mem_offset);
59033 +               sa = res->end + 1 - res->start;
59034 +               if (!is_power_of_2(sa) || sa < 0x100000 ||
59035 +                   sa > 0xffffffffu) {
59036 +                       printk(KERN_WARNING "%s: Resource out of range\n",
59037 +                              port->node->full_name);
59038 +                       continue;
59039 +               }
59040 +               sa = (0xffffffffu << ilog2(sa)) | 0x1;
59041 +
59042 +               /* Program register values */
59043 +               switch (j) {
59044 +               case 0:
59045 +                       out_le32(mbase + PECFG_POM0LAH, pciah);
59046 +                       out_le32(mbase + PECFG_POM0LAL, pcial);
59047 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR1BAH, lah);
59048 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR1BAL, lal);
59049 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKH, 0x7fffffff);
59050 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR1MSKL, sa | 3);
59051 +                       break;
59052 +               case 1:
59053 +                       out_le32(mbase + PECFG_POM1LAH, pciah);
59054 +                       out_le32(mbase + PECFG_POM1LAL, pcial);
59055 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR2BAH, lah);
59056 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR2BAL, lal);
59057 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR2MSKH, 0x7fffffff);
59058 +                       dcr_write(port->dcrs, DCRO_PEGPL_OMR2MSKL, sa | 3);
59059 +                       break;
59060 +               }
59061 +               j++;
59062 +       }
59063 +
59064 +       /* Configure IO, always 64K starting at 0 */
59065 +       if (hose->io_resource.flags & IORESOURCE_IO) {
59066 +               lah = RES_TO_U32_HIGH(hose->io_base_phys);
59067 +               lal = RES_TO_U32_LOW(hose->io_base_phys);
59068 +               out_le32(mbase + PECFG_POM2LAH, 0);
59069 +               out_le32(mbase + PECFG_POM2LAL, 0);
59070 +               dcr_write(port->dcrs, DCRO_PEGPL_OMR3BAH, lah);
59071 +               dcr_write(port->dcrs, DCRO_PEGPL_OMR3BAL, lal);
59072 +               dcr_write(port->dcrs, DCRO_PEGPL_OMR3MSKH, 0x7fffffff);
59073 +               dcr_write(port->dcrs, DCRO_PEGPL_OMR3MSKL, 0xffff0000 | 3);
59074 +       }
59075 +}
59076 +
59077 +static void __init ppc4xx_configure_pciex_PIMs(struct ppc4xx_pciex_port *port,
59078 +                                              struct pci_controller *hose,
59079 +                                              void __iomem *mbase,
59080 +                                              struct resource *res)
59081 +{
59082 +       resource_size_t size = res->end - res->start + 1;
59083 +       u64 sa;
59084 +
59085 +       /* Calculate window size */
59086 +       sa = (0xffffffffffffffffull << ilog2(size));;
59087 +       if (res->flags & IORESOURCE_PREFETCH)
59088 +               sa |= 0x8;
59089 +
59090 +       out_le32(mbase + PECFG_BAR0HMPA, RES_TO_U32_HIGH(sa));
59091 +       out_le32(mbase + PECFG_BAR0LMPA, RES_TO_U32_LOW(sa));
59092 +
59093 +       /* The setup of the split looks weird to me ... let's see if it works */
59094 +       out_le32(mbase + PECFG_PIM0LAL, 0x00000000);
59095 +       out_le32(mbase + PECFG_PIM0LAH, 0x00000000);
59096 +       out_le32(mbase + PECFG_PIM1LAL, 0x00000000);
59097 +       out_le32(mbase + PECFG_PIM1LAH, 0x00000000);
59098 +       out_le32(mbase + PECFG_PIM01SAH, 0xffff0000);
59099 +       out_le32(mbase + PECFG_PIM01SAL, 0x00000000);
59100 +
59101 +       /* Enable inbound mapping */
59102 +       out_le32(mbase + PECFG_PIMEN, 0x1);
59103 +
59104 +       out_le32(mbase + PCI_BASE_ADDRESS_0, RES_TO_U32_LOW(res->start));
59105 +       out_le32(mbase + PCI_BASE_ADDRESS_1, RES_TO_U32_HIGH(res->start));
59106 +
59107 +       /* Enable I/O, Mem, and Busmaster cycles */
59108 +       out_le16(mbase + PCI_COMMAND,
59109 +                in_le16(mbase + PCI_COMMAND) |
59110 +                PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
59111 +}
59112 +
59113 +static void __init ppc4xx_pciex_port_setup_hose(struct ppc4xx_pciex_port *port)
59114 +{
59115 +       struct resource dma_window;
59116 +       struct pci_controller *hose = NULL;
59117 +       const int *bus_range;
59118 +       int primary = 0, busses;
59119 +       void __iomem *mbase = NULL, *cfg_data = NULL;
59120 +
59121 +       /* XXX FIXME: Handle endpoint mode properly */
59122 +       if (port->endpoint) {
59123 +               printk(KERN_WARNING "PCIE%d: Port in endpoint mode !\n",
59124 +                      port->index);
59125 +               return;
59126 +       }
59127 +
59128 +       /* Check if primary bridge */
59129 +       if (of_get_property(port->node, "primary", NULL))
59130 +               primary = 1;
59131 +
59132 +       /* Get bus range if any */
59133 +       bus_range = of_get_property(port->node, "bus-range", NULL);
59134 +
59135 +       /* Allocate the host controller data structure */
59136 +       hose = pcibios_alloc_controller(port->node);
59137 +       if (!hose)
59138 +               goto fail;
59139 +
59140 +       /* We stick the port number in "indirect_type" so the config space
59141 +        * ops can retrieve the port data structure easily
59142 +        */
59143 +       hose->indirect_type = port->index;
59144 +
59145 +       /* Get bus range */
59146 +       hose->first_busno = bus_range ? bus_range[0] : 0x0;
59147 +       hose->last_busno = bus_range ? bus_range[1] : 0xff;
59148 +
59149 +       /* Because of how big mapping the config space is (1M per bus), we
59150 +        * limit how many busses we support. In the long run, we could replace
59151 +        * that with something akin to kmap_atomic instead. We set aside 1 bus
59152 +        * for the host itself too.
59153 +        */
59154 +       busses = hose->last_busno - hose->first_busno; /* This is off by 1 */
59155 +       if (busses > MAX_PCIE_BUS_MAPPED) {
59156 +               busses = MAX_PCIE_BUS_MAPPED;
59157 +               hose->last_busno = hose->first_busno + busses;
59158 +       }
59159 +
59160 +       /* We map the external config space in cfg_data and the host config
59161 +        * space in cfg_addr. External space is 1M per bus, internal space
59162 +        * is 4K
59163 +        */
59164 +       cfg_data = ioremap(port->cfg_space.start +
59165 +                                (hose->first_busno + 1) * 0x100000,
59166 +                                busses * 0x100000);
59167 +       mbase = ioremap(port->cfg_space.start + 0x10000000, 0x1000);
59168 +       if (cfg_data == NULL || mbase == NULL) {
59169 +               printk(KERN_ERR "%s: Can't map config space !",
59170 +                      port->node->full_name);
59171 +               goto fail;
59172 +       }
59173 +
59174 +       hose->cfg_data = cfg_data;
59175 +       hose->cfg_addr = mbase;
59176 +
59177 +       pr_debug("PCIE %s, bus %d..%d\n", port->node->full_name,
59178 +                hose->first_busno, hose->last_busno);
59179 +       pr_debug("     config space mapped at: root @0x%p, other @0x%p\n",
59180 +                hose->cfg_addr, hose->cfg_data);
59181 +
59182 +       /* Setup config space */
59183 +       hose->ops = &ppc4xx_pciex_pci_ops;
59184 +       port->hose = hose;
59185 +       mbase = (void __iomem *)hose->cfg_addr;
59186 +
59187 +       /*
59188 +        * Set bus numbers on our root port
59189 +        */
59190 +       out_8(mbase + PCI_PRIMARY_BUS, hose->first_busno);
59191 +       out_8(mbase + PCI_SECONDARY_BUS, hose->first_busno + 1);
59192 +       out_8(mbase + PCI_SUBORDINATE_BUS, hose->last_busno);
59193 +
59194 +       /*
59195 +        * OMRs are already reset, also disable PIMs
59196 +        */
59197 +       out_le32(mbase + PECFG_PIMEN, 0);
59198 +
59199 +       /* Parse outbound mapping resources */
59200 +       pci_process_bridge_OF_ranges(hose, port->node, primary);
59201 +
59202 +       /* Parse inbound mapping resources */
59203 +       if (ppc4xx_parse_dma_ranges(hose, mbase, &dma_window) != 0)
59204 +               goto fail;
59205 +
59206 +       /* Configure outbound ranges POMs */
59207 +       ppc4xx_configure_pciex_POMs(port, hose, mbase);
59208 +
59209 +       /* Configure inbound ranges PIMs */
59210 +       ppc4xx_configure_pciex_PIMs(port, hose, mbase, &dma_window);
59211 +
59212 +       /* The root complex doesn't show up if we don't set some vendor
59213 +        * and device IDs into it. Those are the same bogus one that the
59214 +        * initial code in arch/ppc add. We might want to change that.
59215 +        */
59216 +       out_le16(mbase + 0x200, 0xaaa0 + port->index);
59217 +       out_le16(mbase + 0x202, 0xbed0 + port->index);
59218 +
59219 +       /* Set Class Code to PCI-PCI bridge and Revision Id to 1 */
59220 +       out_le32(mbase + 0x208, 0x06040001);
59221 +
59222 +       printk(KERN_INFO "PCIE%d: successfully set as root-complex\n",
59223 +              port->index);
59224 +       return;
59225 + fail:
59226 +       if (hose)
59227 +               pcibios_free_controller(hose);
59228 +       if (cfg_data)
59229 +               iounmap(cfg_data);
59230 +       if (mbase)
59231 +               iounmap(mbase);
59232 +}
59233 +
59234 +static void __init ppc4xx_probe_pciex_bridge(struct device_node *np)
59235 +{
59236 +       struct ppc4xx_pciex_port *port;
59237 +       const u32 *pval;
59238 +       int portno;
59239 +       unsigned int dcrs;
59240 +
59241 +       /* First, proceed to core initialization as we assume there's
59242 +        * only one PCIe core in the system
59243 +        */
59244 +       if (ppc4xx_pciex_check_core_init(np))
59245 +               return;
59246 +
59247 +       /* Get the port number from the device-tree */
59248 +       pval = of_get_property(np, "port", NULL);
59249 +       if (pval == NULL) {
59250 +               printk(KERN_ERR "PCIE: Can't find port number for %s\n",
59251 +                      np->full_name);
59252 +               return;
59253 +       }
59254 +       portno = *pval;
59255 +       if (portno >= ppc4xx_pciex_port_count) {
59256 +               printk(KERN_ERR "PCIE: port number out of range for %s\n",
59257 +                      np->full_name);
59258 +               return;
59259 +       }
59260 +       port = &ppc4xx_pciex_ports[portno];
59261 +       port->index = portno;
59262 +       port->node = of_node_get(np);
59263 +       pval = of_get_property(np, "sdr-base", NULL);
59264 +       if (pval == NULL) {
59265 +               printk(KERN_ERR "PCIE: missing sdr-base for %s\n",
59266 +                      np->full_name);
59267 +               return;
59268 +       }
59269 +       port->sdr_base = *pval;
59270 +
59271 +       /* XXX Currently, we only support root complex mode */
59272 +       port->endpoint = 0;
59273 +
59274 +       /* Fetch config space registers address */
59275 +       if (of_address_to_resource(np, 0, &port->cfg_space)) {
59276 +               printk(KERN_ERR "%s: Can't get PCI-E config space !",
59277 +                      np->full_name);
59278 +               return;
59279 +       }
59280 +       /* Fetch host bridge internal registers address */
59281 +       if (of_address_to_resource(np, 1, &port->utl_regs)) {
59282 +               printk(KERN_ERR "%s: Can't get UTL register base !",
59283 +                      np->full_name);
59284 +               return;
59285 +       }
59286 +
59287 +       /* Map DCRs */
59288 +       dcrs = dcr_resource_start(np, 0);
59289 +       if (dcrs == 0) {
59290 +               printk(KERN_ERR "%s: Can't get DCR register base !",
59291 +                      np->full_name);
59292 +               return;
59293 +       }
59294 +       port->dcrs = dcr_map(np, dcrs, dcr_resource_len(np, 0));
59295 +
59296 +       /* Initialize the port specific registers */
59297 +       if (ppc4xx_pciex_port_init(port)) {
59298 +               printk(KERN_WARNING "PCIE%d: Port init failed\n", port->index);
59299 +               return;
59300 +       }
59301 +
59302 +       /* Setup the linux hose data structure */
59303 +       ppc4xx_pciex_port_setup_hose(port);
59304 +}
59305 +
59306 +#endif /* CONFIG_PPC4xx_PCI_EXPRESS */
59307 +
59308 +static int __init ppc4xx_pci_find_bridges(void)
59309 +{
59310 +       struct device_node *np;
59311 +
59312 +#ifdef CONFIG_PPC4xx_PCI_EXPRESS
59313 +       for_each_compatible_node(np, NULL, "ibm,plb-pciex")
59314 +               ppc4xx_probe_pciex_bridge(np);
59315 +#endif
59316 +       for_each_compatible_node(np, NULL, "ibm,plb-pcix")
59317 +               ppc4xx_probe_pcix_bridge(np);
59318 +       for_each_compatible_node(np, NULL, "ibm,plb-pci")
59319 +               ppc4xx_probe_pci_bridge(np);
59320 +
59321 +       return 0;
59322 +}
59323 +arch_initcall(ppc4xx_pci_find_bridges);
59324 +
59325 --- /dev/null
59326 +++ b/arch/powerpc/sysdev/ppc4xx_pci.h
59327 @@ -0,0 +1,369 @@
59328 +/*
59329 + * PCI / PCI-X / PCI-Express support for 4xx parts
59330 + *
59331 + * Copyright 2007 Ben. Herrenschmidt <benh@kernel.crashing.org>, IBM Corp.
59332 + *
59333 + * Bits and pieces extracted from arch/ppc support by
59334 + *
59335 + * Matt Porter <mporter@kernel.crashing.org>
59336 + *
59337 + * Copyright 2002-2005 MontaVista Software Inc.
59338 + */
59339 +#ifndef __PPC4XX_PCI_H__
59340 +#define __PPC4XX_PCI_H__
59341 +
59342 +/*
59343 + * 4xx PCI-X bridge register definitions
59344 + */
59345 +#define PCIX0_VENDID           0x000
59346 +#define PCIX0_DEVID            0x002
59347 +#define PCIX0_COMMAND          0x004
59348 +#define PCIX0_STATUS           0x006
59349 +#define PCIX0_REVID            0x008
59350 +#define PCIX0_CLS              0x009
59351 +#define PCIX0_CACHELS          0x00c
59352 +#define PCIX0_LATTIM           0x00d
59353 +#define PCIX0_HDTYPE           0x00e
59354 +#define PCIX0_BIST             0x00f
59355 +#define PCIX0_BAR0L            0x010
59356 +#define PCIX0_BAR0H            0x014
59357 +#define PCIX0_BAR1             0x018
59358 +#define PCIX0_BAR2L            0x01c
59359 +#define PCIX0_BAR2H            0x020
59360 +#define PCIX0_BAR3             0x024
59361 +#define PCIX0_CISPTR           0x028
59362 +#define PCIX0_SBSYSVID         0x02c
59363 +#define PCIX0_SBSYSID          0x02e
59364 +#define PCIX0_EROMBA           0x030
59365 +#define PCIX0_CAP              0x034
59366 +#define PCIX0_RES0             0x035
59367 +#define PCIX0_RES1             0x036
59368 +#define PCIX0_RES2             0x038
59369 +#define PCIX0_INTLN            0x03c
59370 +#define PCIX0_INTPN            0x03d
59371 +#define PCIX0_MINGNT           0x03e
59372 +#define PCIX0_MAXLTNCY         0x03f
59373 +#define PCIX0_BRDGOPT1         0x040
59374 +#define PCIX0_BRDGOPT2         0x044
59375 +#define PCIX0_ERREN            0x050
59376 +#define PCIX0_ERRSTS           0x054
59377 +#define PCIX0_PLBBESR          0x058
59378 +#define PCIX0_PLBBEARL         0x05c
59379 +#define PCIX0_PLBBEARH         0x060
59380 +#define PCIX0_POM0LAL          0x068
59381 +#define PCIX0_POM0LAH          0x06c
59382 +#define PCIX0_POM0SA           0x070
59383 +#define PCIX0_POM0PCIAL                0x074
59384 +#define PCIX0_POM0PCIAH                0x078
59385 +#define PCIX0_POM1LAL          0x07c
59386 +#define PCIX0_POM1LAH          0x080
59387 +#define PCIX0_POM1SA           0x084
59388 +#define PCIX0_POM1PCIAL                0x088
59389 +#define PCIX0_POM1PCIAH                0x08c
59390 +#define PCIX0_POM2SA           0x090
59391 +#define PCIX0_PIM0SAL          0x098
59392 +#define PCIX0_PIM0SA           PCIX0_PIM0SAL
59393 +#define PCIX0_PIM0LAL          0x09c
59394 +#define PCIX0_PIM0LAH          0x0a0
59395 +#define PCIX0_PIM1SA           0x0a4
59396 +#define PCIX0_PIM1LAL          0x0a8
59397 +#define PCIX0_PIM1LAH          0x0ac
59398 +#define PCIX0_PIM2SAL          0x0b0
59399 +#define PCIX0_PIM2SA           PCIX0_PIM2SAL
59400 +#define PCIX0_PIM2LAL          0x0b4
59401 +#define PCIX0_PIM2LAH          0x0b8
59402 +#define PCIX0_OMCAPID          0x0c0
59403 +#define PCIX0_OMNIPTR          0x0c1
59404 +#define PCIX0_OMMC             0x0c2
59405 +#define PCIX0_OMMA             0x0c4
59406 +#define PCIX0_OMMUA            0x0c8
59407 +#define PCIX0_OMMDATA          0x0cc
59408 +#define PCIX0_OMMEOI           0x0ce
59409 +#define PCIX0_PMCAPID          0x0d0
59410 +#define PCIX0_PMNIPTR          0x0d1
59411 +#define PCIX0_PMC              0x0d2
59412 +#define PCIX0_PMCSR            0x0d4
59413 +#define PCIX0_PMCSRBSE         0x0d6
59414 +#define PCIX0_PMDATA           0x0d7
59415 +#define PCIX0_PMSCRR           0x0d8
59416 +#define PCIX0_CAPID            0x0dc
59417 +#define PCIX0_NIPTR            0x0dd
59418 +#define PCIX0_CMD              0x0de
59419 +#define PCIX0_STS              0x0e0
59420 +#define PCIX0_IDR              0x0e4
59421 +#define PCIX0_CID              0x0e8
59422 +#define PCIX0_RID              0x0ec
59423 +#define PCIX0_PIM0SAH          0x0f8
59424 +#define PCIX0_PIM2SAH          0x0fc
59425 +#define PCIX0_MSGIL            0x100
59426 +#define PCIX0_MSGIH            0x104
59427 +#define PCIX0_MSGOL            0x108
59428 +#define PCIX0_MSGOH            0x10c
59429 +#define PCIX0_IM               0x1f8
59430 +
59431 +/*
59432 + * 4xx PCI bridge register definitions
59433 + */
59434 +#define PCIL0_PMM0LA           0x00
59435 +#define PCIL0_PMM0MA           0x04
59436 +#define PCIL0_PMM0PCILA                0x08
59437 +#define PCIL0_PMM0PCIHA                0x0c
59438 +#define PCIL0_PMM1LA           0x10
59439 +#define PCIL0_PMM1MA           0x14
59440 +#define PCIL0_PMM1PCILA                0x18
59441 +#define PCIL0_PMM1PCIHA                0x1c
59442 +#define PCIL0_PMM2LA           0x20
59443 +#define PCIL0_PMM2MA           0x24
59444 +#define PCIL0_PMM2PCILA                0x28
59445 +#define PCIL0_PMM2PCIHA                0x2c
59446 +#define PCIL0_PTM1MS           0x30
59447 +#define PCIL0_PTM1LA           0x34
59448 +#define PCIL0_PTM2MS           0x38
59449 +#define PCIL0_PTM2LA           0x3c
59450 +
59451 +/*
59452 + * 4xx PCIe bridge register definitions
59453 + */
59454 +
59455 +/* DCR offsets */
59456 +#define DCRO_PEGPL_CFGBAH              0x00
59457 +#define DCRO_PEGPL_CFGBAL              0x01
59458 +#define DCRO_PEGPL_CFGMSK              0x02
59459 +#define DCRO_PEGPL_MSGBAH              0x03
59460 +#define DCRO_PEGPL_MSGBAL              0x04
59461 +#define DCRO_PEGPL_MSGMSK              0x05
59462 +#define DCRO_PEGPL_OMR1BAH             0x06
59463 +#define DCRO_PEGPL_OMR1BAL             0x07
59464 +#define DCRO_PEGPL_OMR1MSKH            0x08
59465 +#define DCRO_PEGPL_OMR1MSKL            0x09
59466 +#define DCRO_PEGPL_OMR2BAH             0x0a
59467 +#define DCRO_PEGPL_OMR2BAL             0x0b
59468 +#define DCRO_PEGPL_OMR2MSKH            0x0c
59469 +#define DCRO_PEGPL_OMR2MSKL            0x0d
59470 +#define DCRO_PEGPL_OMR3BAH             0x0e
59471 +#define DCRO_PEGPL_OMR3BAL             0x0f
59472 +#define DCRO_PEGPL_OMR3MSKH            0x10
59473 +#define DCRO_PEGPL_OMR3MSKL            0x11
59474 +#define DCRO_PEGPL_REGBAH              0x12
59475 +#define DCRO_PEGPL_REGBAL              0x13
59476 +#define DCRO_PEGPL_REGMSK              0x14
59477 +#define DCRO_PEGPL_SPECIAL             0x15
59478 +#define DCRO_PEGPL_CFG                 0x16
59479 +#define DCRO_PEGPL_ESR                 0x17
59480 +#define DCRO_PEGPL_EARH                        0x18
59481 +#define DCRO_PEGPL_EARL                        0x19
59482 +#define DCRO_PEGPL_EATR                        0x1a
59483 +
59484 +/* DMER mask */
59485 +#define GPL_DMER_MASK_DISA     0x02000000
59486 +
59487 +/*
59488 + * System DCRs (SDRs)
59489 + */
59490 +#define PESDR0_PLLLCT1                 0x03a0
59491 +#define PESDR0_PLLLCT2                 0x03a1
59492 +#define PESDR0_PLLLCT3                 0x03a2
59493 +
59494 +/*
59495 + * 440SPe additional DCRs
59496 + */
59497 +#define PESDR0_440SPE_UTLSET1          0x0300
59498 +#define PESDR0_440SPE_UTLSET2          0x0301
59499 +#define PESDR0_440SPE_DLPSET           0x0302
59500 +#define PESDR0_440SPE_LOOP             0x0303
59501 +#define PESDR0_440SPE_RCSSET           0x0304
59502 +#define PESDR0_440SPE_RCSSTS           0x0305
59503 +#define PESDR0_440SPE_HSSL0SET1                0x0306
59504 +#define PESDR0_440SPE_HSSL0SET2                0x0307
59505 +#define PESDR0_440SPE_HSSL0STS         0x0308
59506 +#define PESDR0_440SPE_HSSL1SET1                0x0309
59507 +#define PESDR0_440SPE_HSSL1SET2                0x030a
59508 +#define PESDR0_440SPE_HSSL1STS         0x030b
59509 +#define PESDR0_440SPE_HSSL2SET1                0x030c
59510 +#define PESDR0_440SPE_HSSL2SET2                0x030d
59511 +#define PESDR0_440SPE_HSSL2STS         0x030e
59512 +#define PESDR0_440SPE_HSSL3SET1                0x030f
59513 +#define PESDR0_440SPE_HSSL3SET2                0x0310
59514 +#define PESDR0_440SPE_HSSL3STS         0x0311
59515 +#define PESDR0_440SPE_HSSL4SET1                0x0312
59516 +#define PESDR0_440SPE_HSSL4SET2                0x0313
59517 +#define PESDR0_440SPE_HSSL4STS         0x0314
59518 +#define PESDR0_440SPE_HSSL5SET1                0x0315
59519 +#define PESDR0_440SPE_HSSL5SET2                0x0316
59520 +#define PESDR0_440SPE_HSSL5STS         0x0317
59521 +#define PESDR0_440SPE_HSSL6SET1                0x0318
59522 +#define PESDR0_440SPE_HSSL6SET2                0x0319
59523 +#define PESDR0_440SPE_HSSL6STS         0x031a
59524 +#define PESDR0_440SPE_HSSL7SET1                0x031b
59525 +#define PESDR0_440SPE_HSSL7SET2                0x031c
59526 +#define PESDR0_440SPE_HSSL7STS         0x031d
59527 +#define PESDR0_440SPE_HSSCTLSET                0x031e
59528 +#define PESDR0_440SPE_LANE_ABCD                0x031f
59529 +#define PESDR0_440SPE_LANE_EFGH                0x0320
59530 +
59531 +#define PESDR1_440SPE_UTLSET1          0x0340
59532 +#define PESDR1_440SPE_UTLSET2          0x0341
59533 +#define PESDR1_440SPE_DLPSET           0x0342
59534 +#define PESDR1_440SPE_LOOP             0x0343
59535 +#define PESDR1_440SPE_RCSSET           0x0344
59536 +#define PESDR1_440SPE_RCSSTS           0x0345
59537 +#define PESDR1_440SPE_HSSL0SET1                0x0346
59538 +#define PESDR1_440SPE_HSSL0SET2                0x0347
59539 +#define PESDR1_440SPE_HSSL0STS         0x0348
59540 +#define PESDR1_440SPE_HSSL1SET1                0x0349
59541 +#define PESDR1_440SPE_HSSL1SET2                0x034a
59542 +#define PESDR1_440SPE_HSSL1STS         0x034b
59543 +#define PESDR1_440SPE_HSSL2SET1                0x034c
59544 +#define PESDR1_440SPE_HSSL2SET2                0x034d
59545 +#define PESDR1_440SPE_HSSL2STS         0x034e
59546 +#define PESDR1_440SPE_HSSL3SET1                0x034f
59547 +#define PESDR1_440SPE_HSSL3SET2                0x0350
59548 +#define PESDR1_440SPE_HSSL3STS         0x0351
59549 +#define PESDR1_440SPE_HSSCTLSET                0x0352
59550 +#define PESDR1_440SPE_LANE_ABCD                0x0353
59551 +
59552 +#define PESDR2_440SPE_UTLSET1          0x0370
59553 +#define PESDR2_440SPE_UTLSET2          0x0371
59554 +#define PESDR2_440SPE_DLPSET           0x0372
59555 +#define PESDR2_440SPE_LOOP             0x0373
59556 +#define PESDR2_440SPE_RCSSET           0x0374
59557 +#define PESDR2_440SPE_RCSSTS           0x0375
59558 +#define PESDR2_440SPE_HSSL0SET1                0x0376
59559 +#define PESDR2_440SPE_HSSL0SET2                0x0377
59560 +#define PESDR2_440SPE_HSSL0STS         0x0378
59561 +#define PESDR2_440SPE_HSSL1SET1                0x0379
59562 +#define PESDR2_440SPE_HSSL1SET2                0x037a
59563 +#define PESDR2_440SPE_HSSL1STS         0x037b
59564 +#define PESDR2_440SPE_HSSL2SET1                0x037c
59565 +#define PESDR2_440SPE_HSSL2SET2                0x037d
59566 +#define PESDR2_440SPE_HSSL2STS         0x037e
59567 +#define PESDR2_440SPE_HSSL3SET1                0x037f
59568 +#define PESDR2_440SPE_HSSL3SET2                0x0380
59569 +#define PESDR2_440SPE_HSSL3STS         0x0381
59570 +#define PESDR2_440SPE_HSSCTLSET                0x0382
59571 +#define PESDR2_440SPE_LANE_ABCD                0x0383
59572 +
59573 +/*
59574 + * 405EX additional DCRs
59575 + */
59576 +#define PESDR0_405EX_UTLSET1           0x0400
59577 +#define PESDR0_405EX_UTLSET2           0x0401
59578 +#define PESDR0_405EX_DLPSET            0x0402
59579 +#define PESDR0_405EX_LOOP              0x0403
59580 +#define PESDR0_405EX_RCSSET            0x0404
59581 +#define PESDR0_405EX_RCSSTS            0x0405
59582 +#define PESDR0_405EX_PHYSET1           0x0406
59583 +#define PESDR0_405EX_PHYSET2           0x0407
59584 +#define PESDR0_405EX_BIST              0x0408
59585 +#define PESDR0_405EX_LPB               0x040B
59586 +#define PESDR0_405EX_PHYSTA            0x040C
59587 +
59588 +#define PESDR1_405EX_UTLSET1           0x0440
59589 +#define PESDR1_405EX_UTLSET2           0x0441
59590 +#define PESDR1_405EX_DLPSET            0x0442
59591 +#define PESDR1_405EX_LOOP              0x0443
59592 +#define PESDR1_405EX_RCSSET            0x0444
59593 +#define PESDR1_405EX_RCSSTS            0x0445
59594 +#define PESDR1_405EX_PHYSET1           0x0446
59595 +#define PESDR1_405EX_PHYSET2           0x0447
59596 +#define PESDR1_405EX_BIST              0x0448
59597 +#define PESDR1_405EX_LPB               0x044B
59598 +#define PESDR1_405EX_PHYSTA            0x044C
59599 +
59600 +/*
59601 + * Of the above, some are common offsets from the base
59602 + */
59603 +#define PESDRn_UTLSET1                 0x00
59604 +#define PESDRn_UTLSET2                 0x01
59605 +#define PESDRn_DLPSET                  0x02
59606 +#define PESDRn_LOOP                    0x03
59607 +#define PESDRn_RCSSET                  0x04
59608 +#define PESDRn_RCSSTS                  0x05
59609 +
59610 +/* 440spe only */
59611 +#define PESDRn_440SPE_HSSL0SET1                0x06
59612 +#define PESDRn_440SPE_HSSL0SET2                0x07
59613 +#define PESDRn_440SPE_HSSL0STS         0x08
59614 +#define PESDRn_440SPE_HSSL1SET1                0x09
59615 +#define PESDRn_440SPE_HSSL1SET2                0x0a
59616 +#define PESDRn_440SPE_HSSL1STS         0x0b
59617 +#define PESDRn_440SPE_HSSL2SET1                0x0c
59618 +#define PESDRn_440SPE_HSSL2SET2                0x0d
59619 +#define PESDRn_440SPE_HSSL2STS         0x0e
59620 +#define PESDRn_440SPE_HSSL3SET1                0x0f
59621 +#define PESDRn_440SPE_HSSL3SET2                0x10
59622 +#define PESDRn_440SPE_HSSL3STS         0x11
59623 +
59624 +/* 440spe port 0 only */
59625 +#define PESDRn_440SPE_HSSL4SET1                0x12
59626 +#define PESDRn_440SPE_HSSL4SET2                0x13
59627 +#define PESDRn_440SPE_HSSL4STS         0x14
59628 +#define PESDRn_440SPE_HSSL5SET1                0x15
59629 +#define PESDRn_440SPE_HSSL5SET2                0x16
59630 +#define PESDRn_440SPE_HSSL5STS         0x17
59631 +#define PESDRn_440SPE_HSSL6SET1                0x18
59632 +#define PESDRn_440SPE_HSSL6SET2                0x19
59633 +#define PESDRn_440SPE_HSSL6STS         0x1a
59634 +#define PESDRn_440SPE_HSSL7SET1                0x1b
59635 +#define PESDRn_440SPE_HSSL7SET2                0x1c
59636 +#define PESDRn_440SPE_HSSL7STS         0x1d
59637 +
59638 +/* 405ex only */
59639 +#define PESDRn_405EX_PHYSET1           0x06
59640 +#define PESDRn_405EX_PHYSET2           0x07
59641 +#define PESDRn_405EX_PHYSTA            0x0c
59642 +
59643 +/*
59644 + * UTL register offsets
59645 + */
59646 +#define PEUTL_PBCTL            0x00
59647 +#define PEUTL_PBBSZ            0x20
59648 +#define PEUTL_OPDBSZ           0x68
59649 +#define PEUTL_IPHBSZ           0x70
59650 +#define PEUTL_IPDBSZ           0x78
59651 +#define PEUTL_OUTTR            0x90
59652 +#define PEUTL_INTR             0x98
59653 +#define PEUTL_PCTL             0xa0
59654 +#define PEUTL_RCSTA            0xB0
59655 +#define PEUTL_RCIRQEN          0xb8
59656 +
59657 +/*
59658 + * Config space register offsets
59659 + */
59660 +#define PECFG_ECRTCTL          0x074
59661 +
59662 +#define PECFG_BAR0LMPA         0x210
59663 +#define PECFG_BAR0HMPA         0x214
59664 +#define PECFG_BAR1MPA          0x218
59665 +#define PECFG_BAR2LMPA         0x220
59666 +#define PECFG_BAR2HMPA         0x224
59667 +
59668 +#define PECFG_PIMEN            0x33c
59669 +#define PECFG_PIM0LAL          0x340
59670 +#define PECFG_PIM0LAH          0x344
59671 +#define PECFG_PIM1LAL          0x348
59672 +#define PECFG_PIM1LAH          0x34c
59673 +#define PECFG_PIM01SAL         0x350
59674 +#define PECFG_PIM01SAH         0x354
59675 +
59676 +#define PECFG_POM0LAL          0x380
59677 +#define PECFG_POM0LAH          0x384
59678 +#define PECFG_POM1LAL          0x388
59679 +#define PECFG_POM1LAH          0x38c
59680 +#define PECFG_POM2LAL          0x390
59681 +#define PECFG_POM2LAH          0x394
59682 +
59683 +
59684 +enum
59685 +{
59686 +       PTYPE_ENDPOINT          = 0x0,
59687 +       PTYPE_LEGACY_ENDPOINT   = 0x1,
59688 +       PTYPE_ROOT_PORT         = 0x4,
59689 +
59690 +       LNKW_X1                 = 0x1,
59691 +       LNKW_X4                 = 0x4,
59692 +       LNKW_X8                 = 0x8
59693 +};
59694 +
59695 +
59696 +#endif /* __PPC4XX_PCI_H__ */
59697 --- a/arch/powerpc/sysdev/qe_lib/Kconfig
59698 +++ b/arch/powerpc/sysdev/qe_lib/Kconfig
59699 @@ -4,7 +4,7 @@
59700  
59701  config UCC_SLOW
59702         bool
59703 -       default n
59704 +       default y if SERIAL_QE
59705         help
59706           This option provides qe_lib support to UCC slow
59707           protocols: UART, BISYNC, QMC
59708 --- a/arch/powerpc/sysdev/qe_lib/qe.c
59709 +++ b/arch/powerpc/sysdev/qe_lib/qe.c
59710 @@ -25,6 +25,7 @@
59711  #include <linux/module.h>
59712  #include <linux/delay.h>
59713  #include <linux/ioport.h>
59714 +#include <linux/crc32.h>
59715  #include <asm/irq.h>
59716  #include <asm/page.h>
59717  #include <asm/pgtable.h>
59718 @@ -167,19 +168,20 @@
59719  
59720  /* Program the BRG to the given sampling rate and multiplier
59721   *
59722 - * @brg: the BRG, 1-16
59723 + * @brg: the BRG, QE_BRG1 - QE_BRG16
59724   * @rate: the desired sampling rate
59725   * @multiplier: corresponds to the value programmed in GUMR_L[RDCR] or
59726   * GUMR_L[TDCR].  E.g., if this BRG is the RX clock, and GUMR_L[RDCR]=01,
59727   * then 'multiplier' should be 8.
59728 - *
59729 - * Also note that the value programmed into the BRGC register must be even.
59730   */
59731 -void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier)
59732 +int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
59733  {
59734         u32 divisor, tempval;
59735         u32 div16 = 0;
59736  
59737 +       if ((brg < QE_BRG1) || (brg > QE_BRG16))
59738 +               return -EINVAL;
59739 +
59740         divisor = get_brg_clk() / (rate * multiplier);
59741  
59742         if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
59743 @@ -196,8 +198,43 @@
59744         tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |
59745                 QE_BRGC_ENABLE | div16;
59746  
59747 -       out_be32(&qe_immr->brg.brgc[brg - 1], tempval);
59748 +       out_be32(&qe_immr->brg.brgc[brg - QE_BRG1], tempval);
59749 +
59750 +       return 0;
59751 +}
59752 +EXPORT_SYMBOL(qe_setbrg);
59753 +
59754 +/* Convert a string to a QE clock source enum
59755 + *
59756 + * This function takes a string, typically from a property in the device
59757 + * tree, and returns the corresponding "enum qe_clock" value.
59758 +*/
59759 +enum qe_clock qe_clock_source(const char *source)
59760 +{
59761 +       unsigned int i;
59762 +
59763 +       if (strcasecmp(source, "none") == 0)
59764 +               return QE_CLK_NONE;
59765 +
59766 +       if (strncasecmp(source, "brg", 3) == 0) {
59767 +               i = simple_strtoul(source + 3, NULL, 10);
59768 +               if ((i >= 1) && (i <= 16))
59769 +                       return (QE_BRG1 - 1) + i;
59770 +               else
59771 +                       return QE_CLK_DUMMY;
59772 +       }
59773 +
59774 +       if (strncasecmp(source, "clk", 3) == 0) {
59775 +               i = simple_strtoul(source + 3, NULL, 10);
59776 +               if ((i >= 1) && (i <= 24))
59777 +                       return (QE_CLK1 - 1) + i;
59778 +               else
59779 +                       return QE_CLK_DUMMY;
59780 +       }
59781 +
59782 +       return QE_CLK_DUMMY;
59783  }
59784 +EXPORT_SYMBOL(qe_clock_source);
59785  
59786  /* Initialize SNUMs (thread serial numbers) according to
59787   * QE Module Control chapter, SNUM table
59788 @@ -358,3 +395,249 @@
59789         return (void *)&qe_immr->muram[offset];
59790  }
59791  EXPORT_SYMBOL(qe_muram_addr);
59792 +
59793 +/* The maximum number of RISCs we support */
59794 +#define MAX_QE_RISC     2
59795 +
59796 +/* Firmware information stored here for qe_get_firmware_info() */
59797 +static struct qe_firmware_info qe_firmware_info;
59798 +
59799 +/*
59800 + * Set to 1 if QE firmware has been uploaded, and therefore
59801 + * qe_firmware_info contains valid data.
59802 + */
59803 +static int qe_firmware_uploaded;
59804 +
59805 +/*
59806 + * Upload a QE microcode
59807 + *
59808 + * This function is a worker function for qe_upload_firmware().  It does
59809 + * the actual uploading of the microcode.
59810 + */
59811 +static void qe_upload_microcode(const void *base,
59812 +       const struct qe_microcode *ucode)
59813 +{
59814 +       const __be32 *code = base + be32_to_cpu(ucode->code_offset);
59815 +       unsigned int i;
59816 +
59817 +       if (ucode->major || ucode->minor || ucode->revision)
59818 +               printk(KERN_INFO "qe-firmware: "
59819 +                       "uploading microcode '%s' version %u.%u.%u\n",
59820 +                       ucode->id, ucode->major, ucode->minor, ucode->revision);
59821 +       else
59822 +               printk(KERN_INFO "qe-firmware: "
59823 +                       "uploading microcode '%s'\n", ucode->id);
59824 +
59825 +       /* Use auto-increment */
59826 +       out_be32(&qe_immr->iram.iadd, be32_to_cpu(ucode->iram_offset) |
59827 +               QE_IRAM_IADD_AIE | QE_IRAM_IADD_BADDR);
59828 +
59829 +       for (i = 0; i < be32_to_cpu(ucode->count); i++)
59830 +               out_be32(&qe_immr->iram.idata, be32_to_cpu(code[i]));
59831 +}
59832 +
59833 +/*
59834 + * Upload a microcode to the I-RAM at a specific address.
59835 + *
59836 + * See Documentation/powerpc/qe-firmware.txt for information on QE microcode
59837 + * uploading.
59838 + *
59839 + * Currently, only version 1 is supported, so the 'version' field must be
59840 + * set to 1.
59841 + *
59842 + * The SOC model and revision are not validated, they are only displayed for
59843 + * informational purposes.
59844 + *
59845 + * 'calc_size' is the calculated size, in bytes, of the firmware structure and
59846 + * all of the microcode structures, minus the CRC.
59847 + *
59848 + * 'length' is the size that the structure says it is, including the CRC.
59849 + */
59850 +int qe_upload_firmware(const struct qe_firmware *firmware)
59851 +{
59852 +       unsigned int i;
59853 +       unsigned int j;
59854 +       u32 crc;
59855 +       size_t calc_size = sizeof(struct qe_firmware);
59856 +       size_t length;
59857 +       const struct qe_header *hdr;
59858 +
59859 +       if (!firmware) {
59860 +               printk(KERN_ERR "qe-firmware: invalid pointer\n");
59861 +               return -EINVAL;
59862 +       }
59863 +
59864 +       hdr = &firmware->header;
59865 +       length = be32_to_cpu(hdr->length);
59866 +
59867 +       /* Check the magic */
59868 +       if ((hdr->magic[0] != 'Q') || (hdr->magic[1] != 'E') ||
59869 +           (hdr->magic[2] != 'F')) {
59870 +               printk(KERN_ERR "qe-firmware: not a microcode\n");
59871 +               return -EPERM;
59872 +       }
59873 +
59874 +       /* Check the version */
59875 +       if (hdr->version != 1) {
59876 +               printk(KERN_ERR "qe-firmware: unsupported version\n");
59877 +               return -EPERM;
59878 +       }
59879 +
59880 +       /* Validate some of the fields */
59881 +       if ((firmware->count < 1) || (firmware->count >= MAX_QE_RISC)) {
59882 +               printk(KERN_ERR "qe-firmware: invalid data\n");
59883 +               return -EINVAL;
59884 +       }
59885 +
59886 +       /* Validate the length and check if there's a CRC */
59887 +       calc_size += (firmware->count - 1) * sizeof(struct qe_microcode);
59888 +
59889 +       for (i = 0; i < firmware->count; i++)
59890 +               /*
59891 +                * For situations where the second RISC uses the same microcode
59892 +                * as the first, the 'code_offset' and 'count' fields will be
59893 +                * zero, so it's okay to add those.
59894 +                */
59895 +               calc_size += sizeof(__be32) *
59896 +                       be32_to_cpu(firmware->microcode[i].count);
59897 +
59898 +       /* Validate the length */
59899 +       if (length != calc_size + sizeof(__be32)) {
59900 +               printk(KERN_ERR "qe-firmware: invalid length\n");
59901 +               return -EPERM;
59902 +       }
59903 +
59904 +       /* Validate the CRC */
59905 +       crc = be32_to_cpu(*(__be32 *)((void *)firmware + calc_size));
59906 +       if (crc != crc32(0, firmware, calc_size)) {
59907 +               printk(KERN_ERR "qe-firmware: firmware CRC is invalid\n");
59908 +               return -EIO;
59909 +       }
59910 +
59911 +       /*
59912 +        * If the microcode calls for it, split the I-RAM.
59913 +        */
59914 +       if (!firmware->split)
59915 +               setbits16(&qe_immr->cp.cercr, QE_CP_CERCR_CIR);
59916 +
59917 +       if (firmware->soc.model)
59918 +               printk(KERN_INFO
59919 +                       "qe-firmware: firmware '%s' for %u V%u.%u\n",
59920 +                       firmware->id, be16_to_cpu(firmware->soc.model),
59921 +                       firmware->soc.major, firmware->soc.minor);
59922 +       else
59923 +               printk(KERN_INFO "qe-firmware: firmware '%s'\n",
59924 +                       firmware->id);
59925 +
59926 +       /*
59927 +        * The QE only supports one microcode per RISC, so clear out all the
59928 +        * saved microcode information and put in the new.
59929 +        */
59930 +       memset(&qe_firmware_info, 0, sizeof(qe_firmware_info));
59931 +       strcpy(qe_firmware_info.id, firmware->id);
59932 +       qe_firmware_info.extended_modes = firmware->extended_modes;
59933 +       memcpy(qe_firmware_info.vtraps, firmware->vtraps,
59934 +               sizeof(firmware->vtraps));
59935 +
59936 +       /* Loop through each microcode. */
59937 +       for (i = 0; i < firmware->count; i++) {
59938 +               const struct qe_microcode *ucode = &firmware->microcode[i];
59939 +
59940 +               /* Upload a microcode if it's present */
59941 +               if (ucode->code_offset)
59942 +                       qe_upload_microcode(firmware, ucode);
59943 +
59944 +               /* Program the traps for this processor */
59945 +               for (j = 0; j < 16; j++) {
59946 +                       u32 trap = be32_to_cpu(ucode->traps[j]);
59947 +
59948 +                       if (trap)
59949 +                               out_be32(&qe_immr->rsp[i].tibcr[j], trap);
59950 +               }
59951 +
59952 +               /* Enable traps */
59953 +               out_be32(&qe_immr->rsp[i].eccr, be32_to_cpu(ucode->eccr));
59954 +       }
59955 +
59956 +       qe_firmware_uploaded = 1;
59957 +
59958 +       return 0;
59959 +}
59960 +EXPORT_SYMBOL(qe_upload_firmware);
59961 +
59962 +/*
59963 + * Get info on the currently-loaded firmware
59964 + *
59965 + * This function also checks the device tree to see if the boot loader has
59966 + * uploaded a firmware already.
59967 + */
59968 +struct qe_firmware_info *qe_get_firmware_info(void)
59969 +{
59970 +       static int initialized;
59971 +       struct property *prop;
59972 +       struct device_node *qe;
59973 +       struct device_node *fw = NULL;
59974 +       const char *sprop;
59975 +       unsigned int i;
59976 +
59977 +       /*
59978 +        * If we haven't checked yet, and a driver hasn't uploaded a firmware
59979 +        * yet, then check the device tree for information.
59980 +        */
59981 +       if (initialized || qe_firmware_uploaded)
59982 +               return NULL;
59983 +
59984 +       initialized = 1;
59985 +
59986 +       /*
59987 +        * Newer device trees have an "fsl,qe" compatible property for the QE
59988 +        * node, but we still need to support older device trees.
59989 +       */
59990 +       qe = of_find_compatible_node(NULL, NULL, "fsl,qe");
59991 +       if (!qe) {
59992 +               qe = of_find_node_by_type(NULL, "qe");
59993 +               if (!qe)
59994 +                       return NULL;
59995 +       }
59996 +
59997 +       /* Find the 'firmware' child node */
59998 +       for_each_child_of_node(qe, fw) {
59999 +               if (strcmp(fw->name, "firmware") == 0)
60000 +                       break;
60001 +       }
60002 +
60003 +       of_node_put(qe);
60004 +
60005 +       /* Did we find the 'firmware' node? */
60006 +       if (!fw)
60007 +               return NULL;
60008 +
60009 +       qe_firmware_uploaded = 1;
60010 +
60011 +       /* Copy the data into qe_firmware_info*/
60012 +       sprop = of_get_property(fw, "id", NULL);
60013 +       if (sprop)
60014 +               strncpy(qe_firmware_info.id, sprop,
60015 +                       sizeof(qe_firmware_info.id) - 1);
60016 +
60017 +       prop = of_find_property(fw, "extended-modes", NULL);
60018 +       if (prop && (prop->length == sizeof(u64))) {
60019 +               const u64 *iprop = prop->value;
60020 +
60021 +               qe_firmware_info.extended_modes = *iprop;
60022 +       }
60023 +
60024 +       prop = of_find_property(fw, "virtual-traps", NULL);
60025 +       if (prop && (prop->length == 32)) {
60026 +               const u32 *iprop = prop->value;
60027 +
60028 +               for (i = 0; i < ARRAY_SIZE(qe_firmware_info.vtraps); i++)
60029 +                       qe_firmware_info.vtraps[i] = iprop[i];
60030 +       }
60031 +
60032 +       of_node_put(fw);
60033 +
60034 +       return &qe_firmware_info;
60035 +}
60036 +EXPORT_SYMBOL(qe_get_firmware_info);
60037 +
60038 --- a/arch/powerpc/sysdev/qe_lib/ucc_slow.c
60039 +++ b/arch/powerpc/sysdev/qe_lib/ucc_slow.c
60040 @@ -19,6 +19,7 @@
60041  #include <linux/stddef.h>
60042  #include <linux/interrupt.h>
60043  #include <linux/err.h>
60044 +#include <linux/module.h>
60045  
60046  #include <asm/io.h>
60047  #include <asm/immap_qe.h>
60048 @@ -41,6 +42,7 @@
60049         default: return QE_CR_SUBBLOCK_INVALID;
60050         }
60051  }
60052 +EXPORT_SYMBOL(ucc_slow_get_qe_cr_subblock);
60053  
60054  void ucc_slow_poll_transmitter_now(struct ucc_slow_private * uccs)
60055  {
60056 @@ -56,6 +58,7 @@
60057         qe_issue_cmd(QE_GRACEFUL_STOP_TX, id,
60058                          QE_CR_PROTOCOL_UNSPECIFIED, 0);
60059  }
60060 +EXPORT_SYMBOL(ucc_slow_graceful_stop_tx);
60061  
60062  void ucc_slow_stop_tx(struct ucc_slow_private * uccs)
60063  {
60064 @@ -65,6 +68,7 @@
60065         id = ucc_slow_get_qe_cr_subblock(us_info->ucc_num);
60066         qe_issue_cmd(QE_STOP_TX, id, QE_CR_PROTOCOL_UNSPECIFIED, 0);
60067  }
60068 +EXPORT_SYMBOL(ucc_slow_stop_tx);
60069  
60070  void ucc_slow_restart_tx(struct ucc_slow_private * uccs)
60071  {
60072 @@ -74,6 +78,7 @@
60073         id = ucc_slow_get_qe_cr_subblock(us_info->ucc_num);
60074         qe_issue_cmd(QE_RESTART_TX, id, QE_CR_PROTOCOL_UNSPECIFIED, 0);
60075  }
60076 +EXPORT_SYMBOL(ucc_slow_restart_tx);
60077  
60078  void ucc_slow_enable(struct ucc_slow_private * uccs, enum comm_dir mode)
60079  {
60080 @@ -94,6 +99,7 @@
60081         }
60082         out_be32(&us_regs->gumr_l, gumr_l);
60083  }
60084 +EXPORT_SYMBOL(ucc_slow_enable);
60085  
60086  void ucc_slow_disable(struct ucc_slow_private * uccs, enum comm_dir mode)
60087  {
60088 @@ -114,6 +120,7 @@
60089         }
60090         out_be32(&us_regs->gumr_l, gumr_l);
60091  }
60092 +EXPORT_SYMBOL(ucc_slow_disable);
60093  
60094  /* Initialize the UCC for Slow operations
60095   *
60096 @@ -347,6 +354,7 @@
60097         *uccs_ret = uccs;
60098         return 0;
60099  }
60100 +EXPORT_SYMBOL(ucc_slow_init);
60101  
60102  void ucc_slow_free(struct ucc_slow_private * uccs)
60103  {
60104 @@ -366,5 +374,5 @@
60105  
60106         kfree(uccs);
60107  }
60108 -
60109 +EXPORT_SYMBOL(ucc_slow_free);
60110  
60111 --- a/arch/powerpc/sysdev/tsi108_dev.c
60112 +++ b/arch/powerpc/sysdev/tsi108_dev.c
60113 @@ -66,14 +66,12 @@
60114  static int __init tsi108_eth_of_init(void)
60115  {
60116         struct device_node *np;
60117 -       unsigned int i;
60118 +       unsigned int i = 0;
60119         struct platform_device *tsi_eth_dev;
60120         struct resource res;
60121         int ret;
60122  
60123 -       for (np = NULL, i = 0;
60124 -            (np = of_find_compatible_node(np, "network", "tsi108-ethernet")) != NULL;
60125 -            i++) {
60126 +       for_each_compatible_node(np, "network", "tsi108-ethernet") {
60127                 struct resource r[2];
60128                 struct device_node *phy, *mdio;
60129                 hw_info tsi_eth_data;
60130 @@ -98,7 +96,7 @@
60131                         __FUNCTION__,r[1].name, r[1].start, r[1].end);
60132  
60133                 tsi_eth_dev =
60134 -                   platform_device_register_simple("tsi-ethernet", i, &r[0],
60135 +                   platform_device_register_simple("tsi-ethernet", i++, &r[0],
60136                                                     1);
60137  
60138                 if (IS_ERR(tsi_eth_dev)) {
60139 @@ -154,6 +152,7 @@
60140  unreg:
60141         platform_device_unregister(tsi_eth_dev);
60142  err:
60143 +       of_node_put(np);
60144         return ret;
60145  }
60146  
60147 --- a/arch/powerpc/sysdev/uic.c
60148 +++ b/arch/powerpc/sysdev/uic.c
60149 @@ -53,21 +53,23 @@
60150  
60151         /* The remapper for this UIC */
60152         struct irq_host *irqhost;
60153 -
60154 -       /* For secondary UICs, the cascade interrupt's irqaction */
60155 -       struct irqaction cascade;
60156  };
60157  
60158  static void uic_unmask_irq(unsigned int virq)
60159  {
60160 +       struct irq_desc *desc = get_irq_desc(virq);
60161         struct uic *uic = get_irq_chip_data(virq);
60162         unsigned int src = uic_irq_to_hw(virq);
60163         unsigned long flags;
60164 -       u32 er;
60165 +       u32 er, sr;
60166  
60167 +       sr = 1 << (31-src);
60168         spin_lock_irqsave(&uic->lock, flags);
60169 +       /* ack level-triggered interrupts here */
60170 +       if (desc->status & IRQ_LEVEL)
60171 +               mtdcr(uic->dcrbase + UIC_SR, sr);
60172         er = mfdcr(uic->dcrbase + UIC_ER);
60173 -       er |= 1 << (31 - src);
60174 +       er |= sr;
60175         mtdcr(uic->dcrbase + UIC_ER, er);
60176         spin_unlock_irqrestore(&uic->lock, flags);
60177  }
60178 @@ -99,6 +101,7 @@
60179  
60180  static void uic_mask_ack_irq(unsigned int virq)
60181  {
60182 +       struct irq_desc *desc = get_irq_desc(virq);
60183         struct uic *uic = get_irq_chip_data(virq);
60184         unsigned int src = uic_irq_to_hw(virq);
60185         unsigned long flags;
60186 @@ -109,7 +112,16 @@
60187         er = mfdcr(uic->dcrbase + UIC_ER);
60188         er &= ~sr;
60189         mtdcr(uic->dcrbase + UIC_ER, er);
60190 -       mtdcr(uic->dcrbase + UIC_SR, sr);
60191 +       /* On the UIC, acking (i.e. clearing the SR bit)
60192 +        * a level irq will have no effect if the interrupt
60193 +        * is still asserted by the device, even if
60194 +        * the interrupt is already masked. Therefore
60195 +        * we only ack the egde interrupts here, while
60196 +        * level interrupts are ack'ed after the actual
60197 +        * isr call in the uic_unmask_irq()
60198 +        */
60199 +       if (!(desc->status & IRQ_LEVEL))
60200 +               mtdcr(uic->dcrbase + UIC_SR, sr);
60201         spin_unlock_irqrestore(&uic->lock, flags);
60202  }
60203  
60204 @@ -173,64 +185,6 @@
60205         .set_type       = uic_set_irq_type,
60206  };
60207  
60208 -/**
60209 - *     handle_uic_irq - irq flow handler for UIC
60210 - *     @irq:   the interrupt number
60211 - *     @desc:  the interrupt description structure for this irq
60212 - *
60213 - * This is modified version of the generic handle_level_irq() suitable
60214 - * for the UIC.  On the UIC, acking (i.e. clearing the SR bit) a level
60215 - * irq will have no effect if the interrupt is still asserted by the
60216 - * device, even if the interrupt is already masked.  Therefore, unlike
60217 - * the standard handle_level_irq(), we must ack the interrupt *after*
60218 - * invoking the ISR (which should have de-asserted the interrupt in
60219 - * the external source).  For edge interrupts we ack at the beginning
60220 - * instead of the end, to keep the window in which we can miss an
60221 - * interrupt as small as possible.
60222 - */
60223 -void fastcall handle_uic_irq(unsigned int irq, struct irq_desc *desc)
60224 -{
60225 -       unsigned int cpu = smp_processor_id();
60226 -       struct irqaction *action;
60227 -       irqreturn_t action_ret;
60228 -
60229 -       spin_lock(&desc->lock);
60230 -       if (desc->status & IRQ_LEVEL)
60231 -               desc->chip->mask(irq);
60232 -       else
60233 -               desc->chip->mask_ack(irq);
60234 -
60235 -       if (unlikely(desc->status & IRQ_INPROGRESS))
60236 -               goto out_unlock;
60237 -       desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
60238 -       kstat_cpu(cpu).irqs[irq]++;
60239 -
60240 -       /*
60241 -        * If its disabled or no action available
60242 -        * keep it masked and get out of here
60243 -        */
60244 -       action = desc->action;
60245 -       if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
60246 -               desc->status |= IRQ_PENDING;
60247 -               goto out_unlock;
60248 -       }
60249 -
60250 -       desc->status |= IRQ_INPROGRESS;
60251 -       desc->status &= ~IRQ_PENDING;
60252 -       spin_unlock(&desc->lock);
60253 -
60254 -       action_ret = handle_IRQ_event(irq, action);
60255 -
60256 -       spin_lock(&desc->lock);
60257 -       desc->status &= ~IRQ_INPROGRESS;
60258 -       if (desc->status & IRQ_LEVEL)
60259 -               desc->chip->ack(irq);
60260 -       if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask)
60261 -               desc->chip->unmask(irq);
60262 -out_unlock:
60263 -       spin_unlock(&desc->lock);
60264 -}
60265 -
60266  static int uic_host_map(struct irq_host *h, unsigned int virq,
60267                         irq_hw_number_t hw)
60268  {
60269 @@ -239,7 +193,7 @@
60270         set_irq_chip_data(virq, uic);
60271         /* Despite the name, handle_level_irq() works for both level
60272          * and edge irqs on UIC.  FIXME: check this is correct */
60273 -       set_irq_chip_and_handler(virq, &uic_irq_chip, handle_uic_irq);
60274 +       set_irq_chip_and_handler(virq, &uic_irq_chip, handle_level_irq);
60275  
60276         /* Set default irq type */
60277         set_irq_type(virq, IRQ_TYPE_NONE);
60278 @@ -264,23 +218,36 @@
60279         .xlate  = uic_host_xlate,
60280  };
60281  
60282 -irqreturn_t uic_cascade(int virq, void *data)
60283 +void uic_irq_cascade(unsigned int virq, struct irq_desc *desc)
60284  {
60285 -       struct uic *uic = data;
60286 +       struct uic *uic = get_irq_data(virq);
60287         u32 msr;
60288         int src;
60289         int subvirq;
60290  
60291 +       spin_lock(&desc->lock);
60292 +       if (desc->status & IRQ_LEVEL)
60293 +               desc->chip->mask(virq);
60294 +       else
60295 +               desc->chip->mask_ack(virq);
60296 +       spin_unlock(&desc->lock);
60297 +
60298         msr = mfdcr(uic->dcrbase + UIC_MSR);
60299         if (!msr) /* spurious interrupt */
60300 -               return IRQ_HANDLED;
60301 +               goto uic_irq_ret;
60302  
60303         src = 32 - ffs(msr);
60304  
60305         subvirq = irq_linear_revmap(uic->irqhost, src);
60306         generic_handle_irq(subvirq);
60307  
60308 -       return IRQ_HANDLED;
60309 +uic_irq_ret:
60310 +       spin_lock(&desc->lock);
60311 +       if (desc->status & IRQ_LEVEL)
60312 +               desc->chip->ack(virq);
60313 +       if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask)
60314 +               desc->chip->unmask(virq);
60315 +       spin_unlock(&desc->lock);
60316  }
60317  
60318  static struct uic * __init uic_init_one(struct device_node *node)
60319 @@ -342,33 +309,27 @@
60320         const u32 *interrupts;
60321  
60322         /* First locate and initialize the top-level UIC */
60323 -
60324 -       np = of_find_compatible_node(NULL, NULL, "ibm,uic");
60325 -       while (np) {
60326 +       for_each_compatible_node(np, NULL, "ibm,uic") {
60327                 interrupts = of_get_property(np, "interrupts", NULL);
60328 -               if (! interrupts)
60329 +               if (!interrupts)
60330                         break;
60331 -
60332 -               np = of_find_compatible_node(np, NULL, "ibm,uic");
60333         }
60334  
60335         BUG_ON(!np); /* uic_init_tree() assumes there's a UIC as the
60336                       * top-level interrupt controller */
60337         primary_uic = uic_init_one(np);
60338 -       if (! primary_uic)
60339 +       if (!primary_uic)
60340                 panic("Unable to initialize primary UIC %s\n", np->full_name);
60341  
60342         irq_set_default_host(primary_uic->irqhost);
60343         of_node_put(np);
60344  
60345         /* The scan again for cascaded UICs */
60346 -       np = of_find_compatible_node(NULL, NULL, "ibm,uic");
60347 -       while (np) {
60348 +       for_each_compatible_node(np, NULL, "ibm,uic") {
60349                 interrupts = of_get_property(np, "interrupts", NULL);
60350                 if (interrupts) {
60351                         /* Secondary UIC */
60352                         int cascade_virq;
60353 -                       int ret;
60354  
60355                         uic = uic_init_one(np);
60356                         if (! uic)
60357 @@ -377,20 +338,11 @@
60358  
60359                         cascade_virq = irq_of_parse_and_map(np, 0);
60360  
60361 -                       uic->cascade.handler = uic_cascade;
60362 -                       uic->cascade.name = "UIC cascade";
60363 -                       uic->cascade.dev_id = uic;
60364 -
60365 -                       ret = setup_irq(cascade_virq, &uic->cascade);
60366 -                       if (ret)
60367 -                               printk(KERN_ERR "Failed to setup_irq(%d) for "
60368 -                                      "UIC%d cascade\n", cascade_virq,
60369 -                                      uic->index);
60370 +                       set_irq_data(cascade_virq, uic);
60371 +                       set_irq_chained_handler(cascade_virq, uic_irq_cascade);
60372  
60373                         /* FIXME: setup critical cascade?? */
60374                 }
60375 -
60376 -               np = of_find_compatible_node(np, NULL, "ibm,uic");
60377         }
60378  }
60379  
60380 --- a/arch/powerpc/sysdev/xilinx_intc.c
60381 +++ b/arch/powerpc/sysdev/xilinx_intc.c
60382 @@ -135,10 +135,16 @@
60383         struct device_node *np;
60384  
60385         /* find top level interrupt controller */
60386 -       for_each_compatible_node(np, NULL, "xilinx,intc") {
60387 +       for_each_compatible_node(np, NULL, "xlnx,opb-intc-1.00.c") {
60388                 if (!of_get_property(np, "interrupts", NULL))
60389                         break;
60390         }
60391 +       if (!np) {
60392 +               for_each_compatible_node(np, NULL, "xlnx,xps-intc-1.00.a") {
60393 +                       if (!of_get_property(np, "interrupts", NULL))
60394 +                               break;
60395 +               }
60396 +       }
60397  
60398         /* xilinx interrupt controller needs to be top level */
60399         BUG_ON(!np);
60400 --- a/arch/powerpc/xmon/setjmp.S
60401 +++ b/arch/powerpc/xmon/setjmp.S
60402 @@ -12,67 +12,6 @@
60403  #include <asm/ppc_asm.h>
60404  #include <asm/asm-offsets.h>
60405  
60406 -_GLOBAL(xmon_setjmp)
60407 -       mflr    r0
60408 -       PPC_STL r0,0(r3)
60409 -       PPC_STL r1,SZL(r3)
60410 -       PPC_STL r2,2*SZL(r3)
60411 -       mfcr    r0
60412 -       PPC_STL r0,3*SZL(r3)
60413 -       PPC_STL r13,4*SZL(r3)
60414 -       PPC_STL r14,5*SZL(r3)
60415 -       PPC_STL r15,6*SZL(r3)
60416 -       PPC_STL r16,7*SZL(r3)
60417 -       PPC_STL r17,8*SZL(r3)
60418 -       PPC_STL r18,9*SZL(r3)
60419 -       PPC_STL r19,10*SZL(r3)
60420 -       PPC_STL r20,11*SZL(r3)
60421 -       PPC_STL r21,12*SZL(r3)
60422 -       PPC_STL r22,13*SZL(r3)
60423 -       PPC_STL r23,14*SZL(r3)
60424 -       PPC_STL r24,15*SZL(r3)
60425 -       PPC_STL r25,16*SZL(r3)
60426 -       PPC_STL r26,17*SZL(r3)
60427 -       PPC_STL r27,18*SZL(r3)
60428 -       PPC_STL r28,19*SZL(r3)
60429 -       PPC_STL r29,20*SZL(r3)
60430 -       PPC_STL r30,21*SZL(r3)
60431 -       PPC_STL r31,22*SZL(r3)
60432 -       li      r3,0
60433 -       blr
60434 -
60435 -_GLOBAL(xmon_longjmp)
60436 -       PPC_LCMPI r4,0
60437 -       bne     1f
60438 -       li      r4,1
60439 -1:     PPC_LL  r13,4*SZL(r3)
60440 -       PPC_LL  r14,5*SZL(r3)
60441 -       PPC_LL  r15,6*SZL(r3)
60442 -       PPC_LL  r16,7*SZL(r3)
60443 -       PPC_LL  r17,8*SZL(r3)
60444 -       PPC_LL  r18,9*SZL(r3)
60445 -       PPC_LL  r19,10*SZL(r3)
60446 -       PPC_LL  r20,11*SZL(r3)
60447 -       PPC_LL  r21,12*SZL(r3)
60448 -       PPC_LL  r22,13*SZL(r3)
60449 -       PPC_LL  r23,14*SZL(r3)
60450 -       PPC_LL  r24,15*SZL(r3)
60451 -       PPC_LL  r25,16*SZL(r3)
60452 -       PPC_LL  r26,17*SZL(r3)
60453 -       PPC_LL  r27,18*SZL(r3)
60454 -       PPC_LL  r28,19*SZL(r3)
60455 -       PPC_LL  r29,20*SZL(r3)
60456 -       PPC_LL  r30,21*SZL(r3)
60457 -       PPC_LL  r31,22*SZL(r3)
60458 -       PPC_LL  r0,3*SZL(r3)
60459 -       mtcrf   0x38,r0
60460 -       PPC_LL  r0,0(r3)
60461 -       PPC_LL  r1,SZL(r3)
60462 -       PPC_LL  r2,2*SZL(r3)
60463 -       mtlr    r0
60464 -       mr      r3,r4
60465 -       blr
60466 -
60467  /*
60468   * Grab the register values as they are now.
60469   * This won't do a particularily good job because we really
60470 --- a/arch/powerpc/xmon/xmon.c
60471 +++ b/arch/powerpc/xmon/xmon.c
60472 @@ -40,6 +40,7 @@
60473  #include <asm/spu.h>
60474  #include <asm/spu_priv1.h>
60475  #include <asm/firmware.h>
60476 +#include <asm/setjmp.h>
60477  
60478  #ifdef CONFIG_PPC64
60479  #include <asm/hvcall.h>
60480 @@ -71,12 +72,9 @@
60481  static int termch;
60482  static char tmpstr[128];
60483  
60484 -#define JMP_BUF_LEN    23
60485  static long bus_error_jmp[JMP_BUF_LEN];
60486  static int catch_memory_errors;
60487  static long *xmon_fault_jmp[NR_CPUS];
60488 -#define setjmp xmon_setjmp
60489 -#define longjmp xmon_longjmp
60490  
60491  /* Breakpoint stuff */
60492  struct bpt {
60493 @@ -153,13 +151,15 @@
60494  
60495  static int do_spu_cmd(void);
60496  
60497 +#ifdef CONFIG_44x
60498 +static void dump_tlb_44x(void);
60499 +#endif
60500 +
60501  int xmon_no_auto_backtrace;
60502  
60503  extern void xmon_enter(void);
60504  extern void xmon_leave(void);
60505  
60506 -extern long setjmp(long *);
60507 -extern void longjmp(long *, long);
60508  extern void xmon_save_regs(struct pt_regs *);
60509  
60510  #ifdef CONFIG_PPC64
60511 @@ -231,6 +231,9 @@
60512  #ifdef CONFIG_PPC_STD_MMU_32
60513  "  u   dump segment registers\n"
60514  #endif
60515 +#ifdef CONFIG_44x
60516 +"  u   dump TLB\n"
60517 +#endif
60518  "  ?   help\n"
60519  "  zr  reboot\n\
60520    zh   halt\n"
60521 @@ -856,6 +859,11 @@
60522                         dump_segments();
60523                         break;
60524  #endif
60525 +#ifdef CONFIG_4xx
60526 +               case 'u':
60527 +                       dump_tlb_44x();
60528 +                       break;
60529 +#endif
60530                 default:
60531                         printf("Unrecognized command: ");
60532                         do {
60533 @@ -2527,16 +2535,33 @@
60534  static void dump_slb(void)
60535  {
60536         int i;
60537 -       unsigned long tmp;
60538 +       unsigned long esid,vsid,valid;
60539 +       unsigned long llp;
60540  
60541         printf("SLB contents of cpu %x\n", smp_processor_id());
60542  
60543 -       for (i = 0; i < SLB_NUM_ENTRIES; i++) {
60544 -               asm volatile("slbmfee  %0,%1" : "=r" (tmp) : "r" (i));
60545 -               printf("%02d %016lx ", i, tmp);
60546 -
60547 -               asm volatile("slbmfev  %0,%1" : "=r" (tmp) : "r" (i));
60548 -               printf("%016lx\n", tmp);
60549 +       for (i = 0; i < mmu_slb_size; i++) {
60550 +               asm volatile("slbmfee  %0,%1" : "=r" (esid) : "r" (i));
60551 +               asm volatile("slbmfev  %0,%1" : "=r" (vsid) : "r" (i));
60552 +               valid = (esid & SLB_ESID_V);
60553 +               if (valid | esid | vsid) {
60554 +                       printf("%02d %016lx %016lx", i, esid, vsid);
60555 +                       if (valid) {
60556 +                               llp = vsid & SLB_VSID_LLP;
60557 +                               if (vsid & SLB_VSID_B_1T) {
60558 +                                       printf("  1T  ESID=%9lx  VSID=%13lx LLP:%3lx \n",
60559 +                                               GET_ESID_1T(esid),
60560 +                                               (vsid & ~SLB_VSID_B) >> SLB_VSID_SHIFT_1T,
60561 +                                               llp);
60562 +                               } else {
60563 +                                       printf(" 256M ESID=%9lx  VSID=%13lx LLP:%3lx \n",
60564 +                                               GET_ESID(esid),
60565 +                                               (vsid & ~SLB_VSID_B) >> SLB_VSID_SHIFT,
60566 +                                               llp);
60567 +                               }
60568 +                       } else
60569 +                               printf("\n");
60570 +               }
60571         }
60572  }
60573  
60574 @@ -2581,6 +2606,32 @@
60575  }
60576  #endif
60577  
60578 +#ifdef CONFIG_44x
60579 +static void dump_tlb_44x(void)
60580 +{
60581 +       int i;
60582 +
60583 +       for (i = 0; i < PPC44x_TLB_SIZE; i++) {
60584 +               unsigned long w0,w1,w2;
60585 +               asm volatile("tlbre  %0,%1,0" : "=r" (w0) : "r" (i));
60586 +               asm volatile("tlbre  %0,%1,1" : "=r" (w1) : "r" (i));
60587 +               asm volatile("tlbre  %0,%1,2" : "=r" (w2) : "r" (i));
60588 +               printf("[%02x] %08x %08x %08x ", i, w0, w1, w2);
60589 +               if (w0 & PPC44x_TLB_VALID) {
60590 +                       printf("V %08x -> %01x%08x %c%c%c%c%c",
60591 +                              w0 & PPC44x_TLB_EPN_MASK,
60592 +                              w1 & PPC44x_TLB_ERPN_MASK,
60593 +                              w1 & PPC44x_TLB_RPN_MASK,
60594 +                              (w2 & PPC44x_TLB_W) ? 'W' : 'w',
60595 +                              (w2 & PPC44x_TLB_I) ? 'I' : 'i',
60596 +                              (w2 & PPC44x_TLB_M) ? 'M' : 'm',
60597 +                              (w2 & PPC44x_TLB_G) ? 'G' : 'g',
60598 +                              (w2 & PPC44x_TLB_E) ? 'E' : 'e');
60599 +               }
60600 +               printf("\n");
60601 +       }
60602 +}
60603 +#endif /* CONFIG_44x */
60604  void xmon_init(int enable)
60605  {
60606  #ifdef CONFIG_PPC_ISERIES
60607 --- a/arch/ppc/kernel/Makefile
60608 +++ b/arch/ppc/kernel/Makefile
60609 @@ -13,7 +13,6 @@
60610                                         ppc_htab.o
60611  obj-$(CONFIG_MODULES)          += ppc_ksyms.o
60612  obj-$(CONFIG_PCI)              += pci.o
60613 -obj-$(CONFIG_RAPIDIO)          += rio.o
60614  obj-$(CONFIG_KGDB)             += ppc-stub.o
60615  obj-$(CONFIG_SMP)              += smp.o smp-tbsync.o
60616  obj-$(CONFIG_KEXEC)            += machine_kexec.o relocate_kernel.o
60617 --- a/arch/ppc/kernel/head_44x.S
60618 +++ b/arch/ppc/kernel/head_44x.S
60619 @@ -195,7 +195,7 @@
60620         li      r5,0
60621         ori     r5,r5,(PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_I | PPC44x_TLB_G)
60622  
60623 -        li      r0,0                    /* TLB slot 0 */
60624 +       li      r0,62                   /* TLB slot 62 */
60625  
60626         tlbwe   r3,r0,PPC44x_TLB_PAGEID /* Load the pageid fields */
60627         tlbwe   r4,r0,PPC44x_TLB_XLAT   /* Load the translation fields */
60628 --- a/arch/ppc/kernel/rio.c
60629 +++ /dev/null
60630 @@ -1,52 +0,0 @@
60631 -/*
60632 - * RapidIO PPC32 support
60633 - *
60634 - * Copyright 2005 MontaVista Software, Inc.
60635 - * Matt Porter <mporter@kernel.crashing.org>
60636 - *
60637 - * This program is free software; you can redistribute  it and/or modify it
60638 - * under  the terms of  the GNU General  Public License as published by the
60639 - * Free Software Foundation;  either version 2 of the  License, or (at your
60640 - * option) any later version.
60641 - */
60642 -
60643 -#include <linux/init.h>
60644 -#include <linux/kernel.h>
60645 -#include <linux/rio.h>
60646 -
60647 -#include <asm/rio.h>
60648 -
60649 -/**
60650 - * platform_rio_init - Do platform specific RIO init
60651 - *
60652 - * Any platform specific initialization of RapdIO
60653 - * hardware is done here as well as registration
60654 - * of any active master ports in the system.
60655 - */
60656 -void __attribute__ ((weak))
60657 -    platform_rio_init(void)
60658 -{
60659 -       printk(KERN_WARNING "RIO: No platform_rio_init() present\n");
60660 -}
60661 -
60662 -/**
60663 - * ppc_rio_init - Do PPC32 RIO init
60664 - *
60665 - * Calls platform-specific RIO init code and then calls
60666 - * rio_init_mports() to initialize any master ports that
60667 - * have been registered with the RIO subsystem.
60668 - */
60669 -static int __init ppc_rio_init(void)
60670 -{
60671 -       printk(KERN_INFO "RIO: RapidIO init\n");
60672 -
60673 -       /* Platform specific initialization */
60674 -       platform_rio_init();
60675 -
60676 -       /* Enumerate all registered ports */
60677 -       rio_init_mports();
60678 -
60679 -       return 0;
60680 -}
60681 -
60682 -subsys_initcall(ppc_rio_init);
60683 --- a/arch/ppc/kernel/setup.c
60684 +++ b/arch/ppc/kernel/setup.c
60685 @@ -37,7 +37,6 @@
60686  #include <asm/nvram.h>
60687  #include <asm/xmon.h>
60688  #include <asm/ocp.h>
60689 -#include <asm/prom.h>
60690  
60691  #define USES_PPC_SYS (defined(CONFIG_85xx) || defined(CONFIG_83xx) || \
60692                       defined(CONFIG_MPC10X_BRIDGE) || defined(CONFIG_8260) || \
60693 --- a/arch/ppc/kernel/traps.c
60694 +++ b/arch/ppc/kernel/traps.c
60695 @@ -231,39 +231,25 @@
60696  {
60697  }
60698  
60699 -void machine_check_exception(struct pt_regs *regs)
60700 +#if defined(CONFIG_4xx)
60701 +int machine_check_4xx(struct pt_regs *regs)
60702  {
60703         unsigned long reason = get_mc_reason(regs);
60704  
60705 -       if (user_mode(regs)) {
60706 -               regs->msr |= MSR_RI;
60707 -               _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
60708 -               return;
60709 -       }
60710 -
60711 -#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
60712 -       /* the qspan pci read routines can cause machine checks -- Cort */
60713 -       bad_page_fault(regs, regs->dar, SIGBUS);
60714 -       return;
60715 -#endif
60716 -
60717 -       if (debugger_fault_handler) {
60718 -               debugger_fault_handler(regs);
60719 -               regs->msr |= MSR_RI;
60720 -               return;
60721 -       }
60722 -
60723 -       if (check_io_access(regs))
60724 -               return;
60725 -
60726 -#if defined(CONFIG_4xx) && !defined(CONFIG_440A)
60727         if (reason & ESR_IMCP) {
60728                 printk("Instruction");
60729                 mtspr(SPRN_ESR, reason & ~ESR_IMCP);
60730         } else
60731                 printk("Data");
60732         printk(" machine check in kernel mode.\n");
60733 -#elif defined(CONFIG_440A)
60734 +
60735 +       return 0;
60736 +}
60737 +
60738 +int machine_check_440A(struct pt_regs *regs)
60739 +{
60740 +       unsigned long reason = get_mc_reason(regs);
60741 +
60742         printk("Machine check in kernel mode.\n");
60743         if (reason & ESR_IMCP){
60744                 printk("Instruction Synchronous Machine Check exception\n");
60745 @@ -293,7 +279,13 @@
60746                 /* Clear MCSR */
60747                 mtspr(SPRN_MCSR, mcsr);
60748         }
60749 -#elif defined (CONFIG_E500)
60750 +       return 0;
60751 +}
60752 +#elif defined(CONFIG_E500)
60753 +int machine_check_e500(struct pt_regs *regs)
60754 +{
60755 +       unsigned long reason = get_mc_reason(regs);
60756 +
60757         printk("Machine check in kernel mode.\n");
60758         printk("Caused by (from MCSR=%lx): ", reason);
60759  
60760 @@ -305,8 +297,6 @@
60761                 printk("Data Cache Push Parity Error\n");
60762         if (reason & MCSR_DCPERR)
60763                 printk("Data Cache Parity Error\n");
60764 -       if (reason & MCSR_GL_CI)
60765 -               printk("Guarded Load or Cache-Inhibited stwcx.\n");
60766         if (reason & MCSR_BUS_IAERR)
60767                 printk("Bus - Instruction Address Error\n");
60768         if (reason & MCSR_BUS_RAERR)
60769 @@ -318,12 +308,19 @@
60770         if (reason & MCSR_BUS_RBERR)
60771                 printk("Bus - Read Data Bus Error\n");
60772         if (reason & MCSR_BUS_WBERR)
60773 -               printk("Bus - Write Data Bus Error\n");
60774 +               printk("Bus - Read Data Bus Error\n");
60775         if (reason & MCSR_BUS_IPERR)
60776                 printk("Bus - Instruction Parity Error\n");
60777         if (reason & MCSR_BUS_RPERR)
60778                 printk("Bus - Read Parity Error\n");
60779 -#elif defined (CONFIG_E200)
60780 +
60781 +       return 0;
60782 +}
60783 +#elif defined(CONFIG_E200)
60784 +int machine_check_e200(struct pt_regs *regs)
60785 +{
60786 +       unsigned long reason = get_mc_reason(regs);
60787 +
60788         printk("Machine check in kernel mode.\n");
60789         printk("Caused by (from MCSR=%lx): ", reason);
60790  
60791 @@ -341,7 +338,14 @@
60792                 printk("Bus - Read Bus Error on data load\n");
60793         if (reason & MCSR_BUS_WRERR)
60794                 printk("Bus - Write Bus Error on buffered store or cache line push\n");
60795 -#else /* !CONFIG_4xx && !CONFIG_E500 && !CONFIG_E200 */
60796 +
60797 +       return 0;
60798 +}
60799 +#else
60800 +int machine_check_generic(struct pt_regs *regs)
60801 +{
60802 +       unsigned long reason = get_mc_reason(regs);
60803 +
60804         printk("Machine check in kernel mode.\n");
60805         printk("Caused by (from SRR1=%lx): ", reason);
60806         switch (reason & 0x601F0000) {
60807 @@ -371,7 +375,39 @@
60808         default:
60809                 printk("Unknown values in msr\n");
60810         }
60811 -#endif /* CONFIG_4xx */
60812 +       return 0;
60813 +}
60814 +#endif /* everything else */
60815 +
60816 +void machine_check_exception(struct pt_regs *regs)
60817 +{
60818 +       int recover = 0;
60819 +
60820 +       if (cur_cpu_spec->machine_check)
60821 +               recover = cur_cpu_spec->machine_check(regs);
60822 +       if (recover > 0)
60823 +               return;
60824 +
60825 +       if (user_mode(regs)) {
60826 +               regs->msr |= MSR_RI;
60827 +               _exception(SIGBUS, regs, BUS_ADRERR, regs->nip);
60828 +               return;
60829 +       }
60830 +
60831 +#if defined(CONFIG_8xx) && defined(CONFIG_PCI)
60832 +       /* the qspan pci read routines can cause machine checks -- Cort */
60833 +       bad_page_fault(regs, regs->dar, SIGBUS);
60834 +       return;
60835 +#endif
60836 +
60837 +       if (debugger_fault_handler) {
60838 +               debugger_fault_handler(regs);
60839 +               regs->msr |= MSR_RI;
60840 +               return;
60841 +       }
60842 +
60843 +       if (check_io_access(regs))
60844 +               return;
60845  
60846         /*
60847          * Optional platform-provided routine to print out
60848 --- a/arch/ppc/mm/44x_mmu.c
60849 +++ b/arch/ppc/mm/44x_mmu.c
60850 @@ -60,38 +60,28 @@
60851   * Just needed it declared someplace.
60852   */
60853  unsigned int tlb_44x_index = 0;
60854 -unsigned int tlb_44x_hwater = 62;
60855 +unsigned int tlb_44x_hwater = PPC4XX_TLB_SIZE - 1 - PPC44x_EARLY_TLBS;
60856  int icache_44x_need_flush;
60857  
60858  /*
60859   * "Pins" a 256MB TLB entry in AS0 for kernel lowmem
60860   */
60861 -static void __init
60862 -ppc44x_pin_tlb(int slot, unsigned int virt, unsigned int phys)
60863 +static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys)
60864  {
60865 -       unsigned long attrib = 0;
60866 -
60867 -       __asm__ __volatile__("\
60868 -       clrrwi  %2,%2,10\n\
60869 -       ori     %2,%2,%4\n\
60870 -       clrrwi  %1,%1,10\n\
60871 -       li      %0,0\n\
60872 -       ori     %0,%0,%5\n\
60873 -       tlbwe   %2,%3,%6\n\
60874 -       tlbwe   %1,%3,%7\n\
60875 -       tlbwe   %0,%3,%8"
60876 +       __asm__ __volatile__(
60877 +               "tlbwe  %2,%3,%4\n"
60878 +               "tlbwe  %1,%3,%5\n"
60879 +               "tlbwe  %0,%3,%6\n"
60880         :
60881 -       : "r" (attrib), "r" (phys), "r" (virt), "r" (slot),
60882 -         "i" (PPC44x_TLB_VALID | PPC44x_TLB_256M),
60883 -         "i" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
60884 +       : "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
60885 +         "r" (phys),
60886 +         "r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M),
60887 +         "r" (tlb_44x_hwater--), /* slot for this TLB entry */
60888           "i" (PPC44x_TLB_PAGEID),
60889           "i" (PPC44x_TLB_XLAT),
60890           "i" (PPC44x_TLB_ATTRIB));
60891  }
60892  
60893 -/*
60894 - * MMU_init_hw does the chip-specific initialization of the MMU hardware.
60895 - */
60896  void __init MMU_init_hw(void)
60897  {
60898         flush_instruction_cache();
60899 @@ -99,22 +89,13 @@
60900  
60901  unsigned long __init mmu_mapin_ram(void)
60902  {
60903 -       unsigned int pinned_tlbs = 1;
60904 -       int i;
60905 -
60906 -       /* Determine number of entries necessary to cover lowmem */
60907 -       pinned_tlbs = (unsigned int)
60908 -               (_ALIGN(total_lowmem, PPC_PIN_SIZE) >> PPC44x_PIN_SHIFT);
60909 -
60910 -       /* Write upper watermark to save location */
60911 -       tlb_44x_hwater = PPC44x_LOW_SLOT - pinned_tlbs;
60912 +       unsigned long addr;
60913  
60914 -       /* If necessary, set additional pinned TLBs */
60915 -       if (pinned_tlbs > 1)
60916 -               for (i = (PPC44x_LOW_SLOT-(pinned_tlbs-1)); i < PPC44x_LOW_SLOT; i++) {
60917 -                       unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC_PIN_SIZE;
60918 -                       ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr);
60919 -               }
60920 +       /* Pin in enough TLBs to cover any lowmem not covered by the
60921 +        * initial 256M mapping established in head_44x.S */
60922 +       for (addr = PPC_PIN_SIZE; addr < total_lowmem;
60923 +            addr += PPC_PIN_SIZE)
60924 +               ppc44x_pin_tlb(addr + PAGE_OFFSET, addr);
60925  
60926         return total_lowmem;
60927  }
60928 --- a/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
60929 +++ b/arch/ppc/platforms/85xx/mpc85xx_ads_common.c
60930 @@ -42,8 +42,6 @@
60931  
60932  #include <mm/mmu_decl.h>
60933  
60934 -#include <syslib/ppc85xx_rio.h>
60935 -
60936  #include <platforms/85xx/mpc85xx_ads_common.h>
60937  
60938  #ifndef CONFIG_PCI
60939 @@ -190,6 +188,7 @@
60940  #endif /* CONFIG_PCI */
60941  
60942  #ifdef CONFIG_RAPIDIO
60943 +extern void mpc85xx_rio_setup(int law_start, int law_size);
60944  void platform_rio_init(void)
60945  {
60946         /* 512MB RIO LAW at 0xc0000000 */
60947 --- a/arch/ppc/platforms/85xx/stx_gp3.c
60948 +++ b/arch/ppc/platforms/85xx/stx_gp3.c
60949 @@ -50,12 +50,10 @@
60950  #include <asm/irq.h>
60951  #include <asm/immap_85xx.h>
60952  #include <asm/cpm2.h>
60953 -#include <asm/mpc85xx.h>
60954  #include <asm/ppc_sys.h>
60955  
60956  #include <syslib/cpm2_pic.h>
60957  #include <syslib/ppc85xx_common.h>
60958 -#include <syslib/ppc85xx_rio.h>
60959  
60960  
60961  unsigned char __res[sizeof(bd_t)];
60962 @@ -271,6 +269,7 @@
60963  #endif /* CONFIG_PCI */
60964  
60965  #ifdef CONFIG_RAPIDIO
60966 +extern void mpc85xx_rio_setup(int law_start, int law_size);
60967  void
60968  platform_rio_init(void)
60969  {
60970 --- a/arch/ppc/platforms/85xx/tqm85xx.c
60971 +++ b/arch/ppc/platforms/85xx/tqm85xx.c
60972 @@ -54,7 +54,6 @@
60973  #include <syslib/ppc85xx_setup.h>
60974  #include <syslib/cpm2_pic.h>
60975  #include <syslib/ppc85xx_common.h>
60976 -#include <syslib/ppc85xx_rio.h>
60977  
60978  #ifndef CONFIG_PCI
60979  unsigned long isa_io_base = 0;
60980 @@ -309,6 +308,7 @@
60981  #endif /* CONFIG_PCI */
60982  
60983  #ifdef CONFIG_RAPIDIO
60984 +extern void mpc85xx_rio_setup(int law_start, int law_size);
60985  void platform_rio_init(void)
60986  {
60987         /* 512MB RIO LAW at 0xc0000000 */
60988 --- a/arch/ppc/platforms/ev64260.c
60989 +++ b/arch/ppc/platforms/ev64260.c
60990 @@ -336,7 +336,7 @@
60991  #endif
60992  
60993                 if (early_serial_setup(&port) != 0)
60994 -                       printk(KERN_WARNING "Early serial init of port 0"
60995 +                       printk(KERN_WARNING "Early serial init of port 0 "
60996                                 "failed\n");
60997  
60998                 first_time = 0;
60999 @@ -388,7 +388,7 @@
61000         ev64260_early_serial_map();
61001  #endif
61002  
61003 -       printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc."
61004 +       printk(KERN_INFO "%s %s port (C) 2001 MontaVista Software, Inc. "
61005                 "(source@mvista.com)\n", BOARD_VENDOR, BOARD_MACHINE);
61006  
61007         if (ppc_md.progress)
61008 --- a/arch/ppc/platforms/prep_pci.c
61009 +++ b/arch/ppc/platforms/prep_pci.c
61010 @@ -1099,7 +1099,6 @@
61011                                 pci_write_config_byte(dev, 0x43, reg);
61012                         }
61013                 }
61014 -               pci_dev_put(dev);
61015         }
61016  
61017         if ((dev = pci_get_device(PCI_VENDOR_ID_WINBOND,
61018 --- a/arch/ppc/syslib/Makefile
61019 +++ b/arch/ppc/syslib/Makefile
61020 @@ -93,7 +93,6 @@
61021  ifeq ($(CONFIG_85xx),y)
61022  obj-$(CONFIG_PCI)              += pci_auto.o
61023  endif
61024 -obj-$(CONFIG_RAPIDIO)          += ppc85xx_rio.o
61025  obj-$(CONFIG_83xx)             += ppc83xx_setup.o ppc_sys.o \
61026                                         mpc83xx_sys.o mpc83xx_devices.o ipic.o
61027  ifeq ($(CONFIG_83xx),y)
61028 --- a/arch/ppc/syslib/gt64260_pic.c
61029 +++ b/arch/ppc/syslib/gt64260_pic.c
61030 @@ -35,7 +35,6 @@
61031  #include <linux/interrupt.h>
61032  #include <linux/sched.h>
61033  #include <linux/signal.h>
61034 -#include <linux/stddef.h>
61035  #include <linux/delay.h>
61036  #include <linux/irq.h>
61037  
61038 --- a/arch/ppc/syslib/mpc52xx_pic.c
61039 +++ b/arch/ppc/syslib/mpc52xx_pic.c
61040 @@ -20,7 +20,6 @@
61041  #include <linux/init.h>
61042  #include <linux/sched.h>
61043  #include <linux/signal.h>
61044 -#include <linux/stddef.h>
61045  #include <linux/delay.h>
61046  #include <linux/irq.h>
61047  
61048 --- a/arch/ppc/syslib/mv64360_pic.c
61049 +++ b/arch/ppc/syslib/mv64360_pic.c
61050 @@ -36,7 +36,6 @@
61051  #include <linux/init.h>
61052  #include <linux/sched.h>
61053  #include <linux/signal.h>
61054 -#include <linux/stddef.h>
61055  #include <linux/delay.h>
61056  #include <linux/irq.h>
61057  #include <linux/interrupt.h>
61058 --- a/arch/ppc/syslib/ocp.c
61059 +++ b/arch/ppc/syslib/ocp.c
61060 @@ -376,7 +376,7 @@
61061  
61062         down_write(&ocp_devices_sem);
61063         dev = __ocp_find_device(vendor, function, index);
61064 -       list_del((struct list_head *)dev);
61065 +       list_del(&dev->link);
61066         up_write(&ocp_devices_sem);
61067  
61068         DBG(("ocp: ocp_remove_one_device(vendor: %x, function: %x, index: %d)... done.\n", vendor, function, index));
61069 --- a/arch/ppc/syslib/ppc83xx_setup.c
61070 +++ b/arch/ppc/syslib/ppc83xx_setup.c
61071 @@ -41,7 +41,6 @@
61072  
61073  #include <syslib/ppc83xx_setup.h>
61074  #if defined(CONFIG_PCI)
61075 -#include <asm/delay.h>
61076  #include <syslib/ppc83xx_pci.h>
61077  #endif
61078  
61079 --- a/arch/ppc/syslib/ppc85xx_rio.c
61080 +++ /dev/null
61081 @@ -1,932 +0,0 @@
61082 -/*
61083 - * MPC85xx RapidIO support
61084 - *
61085 - * Copyright 2005 MontaVista Software, Inc.
61086 - * Matt Porter <mporter@kernel.crashing.org>
61087 - *
61088 - * This program is free software; you can redistribute  it and/or modify it
61089 - * under  the terms of  the GNU General  Public License as published by the
61090 - * Free Software Foundation;  either version 2 of the  License, or (at your
61091 - * option) any later version.
61092 - */
61093 -
61094 -#include <linux/init.h>
61095 -#include <linux/module.h>
61096 -#include <linux/types.h>
61097 -#include <linux/dma-mapping.h>
61098 -#include <linux/interrupt.h>
61099 -#include <linux/rio.h>
61100 -#include <linux/rio_drv.h>
61101 -
61102 -#include <asm/io.h>
61103 -
61104 -#define RIO_REGS_BASE          (CCSRBAR + 0xc0000)
61105 -#define RIO_ATMU_REGS_OFFSET   0x10c00
61106 -#define RIO_MSG_REGS_OFFSET    0x11000
61107 -#define RIO_MAINT_WIN_SIZE     0x400000
61108 -#define RIO_DBELL_WIN_SIZE     0x1000
61109 -
61110 -#define RIO_MSG_OMR_MUI                0x00000002
61111 -#define RIO_MSG_OSR_TE         0x00000080
61112 -#define RIO_MSG_OSR_QOI                0x00000020
61113 -#define RIO_MSG_OSR_QFI                0x00000010
61114 -#define RIO_MSG_OSR_MUB                0x00000004
61115 -#define RIO_MSG_OSR_EOMI       0x00000002
61116 -#define RIO_MSG_OSR_QEI                0x00000001
61117 -
61118 -#define RIO_MSG_IMR_MI         0x00000002
61119 -#define RIO_MSG_ISR_TE         0x00000080
61120 -#define RIO_MSG_ISR_QFI                0x00000010
61121 -#define RIO_MSG_ISR_DIQI       0x00000001
61122 -
61123 -#define RIO_MSG_DESC_SIZE      32
61124 -#define RIO_MSG_BUFFER_SIZE    4096
61125 -#define RIO_MIN_TX_RING_SIZE   2
61126 -#define RIO_MAX_TX_RING_SIZE   2048
61127 -#define RIO_MIN_RX_RING_SIZE   2
61128 -#define RIO_MAX_RX_RING_SIZE   2048
61129 -
61130 -#define DOORBELL_DMR_DI                0x00000002
61131 -#define DOORBELL_DSR_TE                0x00000080
61132 -#define DOORBELL_DSR_QFI       0x00000010
61133 -#define DOORBELL_DSR_DIQI      0x00000001
61134 -#define DOORBELL_TID_OFFSET    0x03
61135 -#define DOORBELL_SID_OFFSET    0x05
61136 -#define DOORBELL_INFO_OFFSET   0x06
61137 -
61138 -#define DOORBELL_MESSAGE_SIZE  0x08
61139 -#define DBELL_SID(x)           (*(u8 *)(x + DOORBELL_SID_OFFSET))
61140 -#define DBELL_TID(x)           (*(u8 *)(x + DOORBELL_TID_OFFSET))
61141 -#define DBELL_INF(x)           (*(u16 *)(x + DOORBELL_INFO_OFFSET))
61142 -
61143 -struct rio_atmu_regs {
61144 -       u32 rowtar;
61145 -       u32 pad1;
61146 -       u32 rowbar;
61147 -       u32 pad2;
61148 -       u32 rowar;
61149 -       u32 pad3[3];
61150 -};
61151 -
61152 -struct rio_msg_regs {
61153 -       u32 omr;
61154 -       u32 osr;
61155 -       u32 pad1;
61156 -       u32 odqdpar;
61157 -       u32 pad2;
61158 -       u32 osar;
61159 -       u32 odpr;
61160 -       u32 odatr;
61161 -       u32 odcr;
61162 -       u32 pad3;
61163 -       u32 odqepar;
61164 -       u32 pad4[13];
61165 -       u32 imr;
61166 -       u32 isr;
61167 -       u32 pad5;
61168 -       u32 ifqdpar;
61169 -       u32 pad6;
61170 -       u32 ifqepar;
61171 -       u32 pad7[250];
61172 -       u32 dmr;
61173 -       u32 dsr;
61174 -       u32 pad8;
61175 -       u32 dqdpar;
61176 -       u32 pad9;
61177 -       u32 dqepar;
61178 -       u32 pad10[26];
61179 -       u32 pwmr;
61180 -       u32 pwsr;
61181 -       u32 pad11;
61182 -       u32 pwqbar;
61183 -};
61184 -
61185 -struct rio_tx_desc {
61186 -       u32 res1;
61187 -       u32 saddr;
61188 -       u32 dport;
61189 -       u32 dattr;
61190 -       u32 res2;
61191 -       u32 res3;
61192 -       u32 dwcnt;
61193 -       u32 res4;
61194 -};
61195 -
61196 -static u32 regs_win;
61197 -static struct rio_atmu_regs *atmu_regs;
61198 -static struct rio_atmu_regs *maint_atmu_regs;
61199 -static struct rio_atmu_regs *dbell_atmu_regs;
61200 -static u32 dbell_win;
61201 -static u32 maint_win;
61202 -static struct rio_msg_regs *msg_regs;
61203 -
61204 -static struct rio_dbell_ring {
61205 -       void *virt;
61206 -       dma_addr_t phys;
61207 -} dbell_ring;
61208 -
61209 -static struct rio_msg_tx_ring {
61210 -       void *virt;
61211 -       dma_addr_t phys;
61212 -       void *virt_buffer[RIO_MAX_TX_RING_SIZE];
61213 -       dma_addr_t phys_buffer[RIO_MAX_TX_RING_SIZE];
61214 -       int tx_slot;
61215 -       int size;
61216 -       void *dev_id;
61217 -} msg_tx_ring;
61218 -
61219 -static struct rio_msg_rx_ring {
61220 -       void *virt;
61221 -       dma_addr_t phys;
61222 -       void *virt_buffer[RIO_MAX_RX_RING_SIZE];
61223 -       int rx_slot;
61224 -       int size;
61225 -       void *dev_id;
61226 -} msg_rx_ring;
61227 -
61228 -/**
61229 - * mpc85xx_rio_doorbell_send - Send a MPC85xx doorbell message
61230 - * @index: ID of RapidIO interface
61231 - * @destid: Destination ID of target device
61232 - * @data: 16-bit info field of RapidIO doorbell message
61233 - *
61234 - * Sends a MPC85xx doorbell message. Returns %0 on success or
61235 - * %-EINVAL on failure.
61236 - */
61237 -static int mpc85xx_rio_doorbell_send(int index, u16 destid, u16 data)
61238 -{
61239 -       pr_debug("mpc85xx_doorbell_send: index %d destid %4.4x data %4.4x\n",
61240 -                index, destid, data);
61241 -       out_be32((void *)&dbell_atmu_regs->rowtar, destid << 22);
61242 -       out_be16((void *)(dbell_win), data);
61243 -
61244 -       return 0;
61245 -}
61246 -
61247 -/**
61248 - * mpc85xx_local_config_read - Generate a MPC85xx local config space read
61249 - * @index: ID of RapdiIO interface
61250 - * @offset: Offset into configuration space
61251 - * @len: Length (in bytes) of the maintenance transaction
61252 - * @data: Value to be read into
61253 - *
61254 - * Generates a MPC85xx local configuration space read. Returns %0 on
61255 - * success or %-EINVAL on failure.
61256 - */
61257 -static int mpc85xx_local_config_read(int index, u32 offset, int len, u32 * data)
61258 -{
61259 -       pr_debug("mpc85xx_local_config_read: index %d offset %8.8x\n", index,
61260 -                offset);
61261 -       *data = in_be32((void *)(regs_win + offset));
61262 -
61263 -       return 0;
61264 -}
61265 -
61266 -/**
61267 - * mpc85xx_local_config_write - Generate a MPC85xx local config space write
61268 - * @index: ID of RapdiIO interface
61269 - * @offset: Offset into configuration space
61270 - * @len: Length (in bytes) of the maintenance transaction
61271 - * @data: Value to be written
61272 - *
61273 - * Generates a MPC85xx local configuration space write. Returns %0 on
61274 - * success or %-EINVAL on failure.
61275 - */
61276 -static int mpc85xx_local_config_write(int index, u32 offset, int len, u32 data)
61277 -{
61278 -       pr_debug
61279 -           ("mpc85xx_local_config_write: index %d offset %8.8x data %8.8x\n",
61280 -            index, offset, data);
61281 -       out_be32((void *)(regs_win + offset), data);
61282 -
61283 -       return 0;
61284 -}
61285 -
61286 -/**
61287 - * mpc85xx_rio_config_read - Generate a MPC85xx read maintenance transaction
61288 - * @index: ID of RapdiIO interface
61289 - * @destid: Destination ID of transaction
61290 - * @hopcount: Number of hops to target device
61291 - * @offset: Offset into configuration space
61292 - * @len: Length (in bytes) of the maintenance transaction
61293 - * @val: Location to be read into
61294 - *
61295 - * Generates a MPC85xx read maintenance transaction. Returns %0 on
61296 - * success or %-EINVAL on failure.
61297 - */
61298 -static int
61299 -mpc85xx_rio_config_read(int index, u16 destid, u8 hopcount, u32 offset, int len,
61300 -                       u32 * val)
61301 -{
61302 -       u8 *data;
61303 -
61304 -       pr_debug
61305 -           ("mpc85xx_rio_config_read: index %d destid %d hopcount %d offset %8.8x len %d\n",
61306 -            index, destid, hopcount, offset, len);
61307 -       out_be32((void *)&maint_atmu_regs->rowtar,
61308 -                (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
61309 -
61310 -       data = (u8 *) maint_win + offset;
61311 -       switch (len) {
61312 -       case 1:
61313 -               *val = in_8((u8 *) data);
61314 -               break;
61315 -       case 2:
61316 -               *val = in_be16((u16 *) data);
61317 -               break;
61318 -       default:
61319 -               *val = in_be32((u32 *) data);
61320 -               break;
61321 -       }
61322 -
61323 -       return 0;
61324 -}
61325 -
61326 -/**
61327 - * mpc85xx_rio_config_write - Generate a MPC85xx write maintenance transaction
61328 - * @index: ID of RapdiIO interface
61329 - * @destid: Destination ID of transaction
61330 - * @hopcount: Number of hops to target device
61331 - * @offset: Offset into configuration space
61332 - * @len: Length (in bytes) of the maintenance transaction
61333 - * @val: Value to be written
61334 - *
61335 - * Generates an MPC85xx write maintenance transaction. Returns %0 on
61336 - * success or %-EINVAL on failure.
61337 - */
61338 -static int
61339 -mpc85xx_rio_config_write(int index, u16 destid, u8 hopcount, u32 offset,
61340 -                        int len, u32 val)
61341 -{
61342 -       u8 *data;
61343 -       pr_debug
61344 -           ("mpc85xx_rio_config_write: index %d destid %d hopcount %d offset %8.8x len %d val %8.8x\n",
61345 -            index, destid, hopcount, offset, len, val);
61346 -       out_be32((void *)&maint_atmu_regs->rowtar,
61347 -                (destid << 22) | (hopcount << 12) | ((offset & ~0x3) >> 9));
61348 -
61349 -       data = (u8 *) maint_win + offset;
61350 -       switch (len) {
61351 -       case 1:
61352 -               out_8((u8 *) data, val);
61353 -               break;
61354 -       case 2:
61355 -               out_be16((u16 *) data, val);
61356 -               break;
61357 -       default:
61358 -               out_be32((u32 *) data, val);
61359 -               break;
61360 -       }
61361 -
61362 -       return 0;
61363 -}
61364 -
61365 -/**
61366 - * rio_hw_add_outb_message - Add message to the MPC85xx outbound message queue
61367 - * @mport: Master port with outbound message queue
61368 - * @rdev: Target of outbound message
61369 - * @mbox: Outbound mailbox
61370 - * @buffer: Message to add to outbound queue
61371 - * @len: Length of message
61372 - *
61373 - * Adds the @buffer message to the MPC85xx outbound message queue. Returns
61374 - * %0 on success or %-EINVAL on failure.
61375 - */
61376 -int
61377 -rio_hw_add_outb_message(struct rio_mport *mport, struct rio_dev *rdev, int mbox,
61378 -                       void *buffer, size_t len)
61379 -{
61380 -       u32 omr;
61381 -       struct rio_tx_desc *desc =
61382 -           (struct rio_tx_desc *)msg_tx_ring.virt + msg_tx_ring.tx_slot;
61383 -       int ret = 0;
61384 -
61385 -       pr_debug
61386 -           ("RIO: rio_hw_add_outb_message(): destid %4.4x mbox %d buffer %8.8x len %8.8x\n",
61387 -            rdev->destid, mbox, (int)buffer, len);
61388 -
61389 -       if ((len < 8) || (len > RIO_MAX_MSG_SIZE)) {
61390 -               ret = -EINVAL;
61391 -               goto out;
61392 -       }
61393 -
61394 -       /* Copy and clear rest of buffer */
61395 -       memcpy(msg_tx_ring.virt_buffer[msg_tx_ring.tx_slot], buffer, len);
61396 -       if (len < (RIO_MAX_MSG_SIZE - 4))
61397 -               memset((void *)((u32) msg_tx_ring.
61398 -                               virt_buffer[msg_tx_ring.tx_slot] + len), 0,
61399 -                      RIO_MAX_MSG_SIZE - len);
61400 -
61401 -       /* Set mbox field for message */
61402 -       desc->dport = mbox & 0x3;
61403 -
61404 -       /* Enable EOMI interrupt, set priority, and set destid */
61405 -       desc->dattr = 0x28000000 | (rdev->destid << 2);
61406 -
61407 -       /* Set transfer size aligned to next power of 2 (in double words) */
61408 -       desc->dwcnt = is_power_of_2(len) ? len : 1 << get_bitmask_order(len);
61409 -
61410 -       /* Set snooping and source buffer address */
61411 -       desc->saddr = 0x00000004 | msg_tx_ring.phys_buffer[msg_tx_ring.tx_slot];
61412 -
61413 -       /* Increment enqueue pointer */
61414 -       omr = in_be32((void *)&msg_regs->omr);
61415 -       out_be32((void *)&msg_regs->omr, omr | RIO_MSG_OMR_MUI);
61416 -
61417 -       /* Go to next descriptor */
61418 -       if (++msg_tx_ring.tx_slot == msg_tx_ring.size)
61419 -               msg_tx_ring.tx_slot = 0;
61420 -
61421 -      out:
61422 -       return ret;
61423 -}
61424 -
61425 -EXPORT_SYMBOL_GPL(rio_hw_add_outb_message);
61426 -
61427 -/**
61428 - * mpc85xx_rio_tx_handler - MPC85xx outbound message interrupt handler
61429 - * @irq: Linux interrupt number
61430 - * @dev_instance: Pointer to interrupt-specific data
61431 - *
61432 - * Handles outbound message interrupts. Executes a register outbound
61433 - * mailbox event handler and acks the interrupt occurrence.
61434 - */
61435 -static irqreturn_t
61436 -mpc85xx_rio_tx_handler(int irq, void *dev_instance)
61437 -{
61438 -       int osr;
61439 -       struct rio_mport *port = (struct rio_mport *)dev_instance;
61440 -
61441 -       osr = in_be32((void *)&msg_regs->osr);
61442 -
61443 -       if (osr & RIO_MSG_OSR_TE) {
61444 -               pr_info("RIO: outbound message transmission error\n");
61445 -               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_TE);
61446 -               goto out;
61447 -       }
61448 -
61449 -       if (osr & RIO_MSG_OSR_QOI) {
61450 -               pr_info("RIO: outbound message queue overflow\n");
61451 -               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_QOI);
61452 -               goto out;
61453 -       }
61454 -
61455 -       if (osr & RIO_MSG_OSR_EOMI) {
61456 -               u32 dqp = in_be32((void *)&msg_regs->odqdpar);
61457 -               int slot = (dqp - msg_tx_ring.phys) >> 5;
61458 -               port->outb_msg[0].mcback(port, msg_tx_ring.dev_id, -1, slot);
61459 -
61460 -               /* Ack the end-of-message interrupt */
61461 -               out_be32((void *)&msg_regs->osr, RIO_MSG_OSR_EOMI);
61462 -       }
61463 -
61464 -      out:
61465 -       return IRQ_HANDLED;
61466 -}
61467 -
61468 -/**
61469 - * rio_open_outb_mbox - Initialize MPC85xx outbound mailbox
61470 - * @mport: Master port implementing the outbound message unit
61471 - * @dev_id: Device specific pointer to pass on event
61472 - * @mbox: Mailbox to open
61473 - * @entries: Number of entries in the outbound mailbox ring
61474 - *
61475 - * Initializes buffer ring, request the outbound message interrupt,
61476 - * and enables the outbound message unit. Returns %0 on success and
61477 - * %-EINVAL or %-ENOMEM on failure.
61478 - */
61479 -int rio_open_outb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
61480 -{
61481 -       int i, j, rc = 0;
61482 -
61483 -       if ((entries < RIO_MIN_TX_RING_SIZE) ||
61484 -           (entries > RIO_MAX_TX_RING_SIZE) || (!is_power_of_2(entries))) {
61485 -               rc = -EINVAL;
61486 -               goto out;
61487 -       }
61488 -
61489 -       /* Initialize shadow copy ring */
61490 -       msg_tx_ring.dev_id = dev_id;
61491 -       msg_tx_ring.size = entries;
61492 -
61493 -       for (i = 0; i < msg_tx_ring.size; i++) {
61494 -               if (!
61495 -                   (msg_tx_ring.virt_buffer[i] =
61496 -                    dma_alloc_coherent(NULL, RIO_MSG_BUFFER_SIZE,
61497 -                                       &msg_tx_ring.phys_buffer[i],
61498 -                                       GFP_KERNEL))) {
61499 -                       rc = -ENOMEM;
61500 -                       for (j = 0; j < msg_tx_ring.size; j++)
61501 -                               if (msg_tx_ring.virt_buffer[j])
61502 -                                       dma_free_coherent(NULL,
61503 -                                                         RIO_MSG_BUFFER_SIZE,
61504 -                                                         msg_tx_ring.
61505 -                                                         virt_buffer[j],
61506 -                                                         msg_tx_ring.
61507 -                                                         phys_buffer[j]);
61508 -                       goto out;
61509 -               }
61510 -       }
61511 -
61512 -       /* Initialize outbound message descriptor ring */
61513 -       if (!(msg_tx_ring.virt = dma_alloc_coherent(NULL,
61514 -                                                   msg_tx_ring.size *
61515 -                                                   RIO_MSG_DESC_SIZE,
61516 -                                                   &msg_tx_ring.phys,
61517 -                                                   GFP_KERNEL))) {
61518 -               rc = -ENOMEM;
61519 -               goto out_dma;
61520 -       }
61521 -       memset(msg_tx_ring.virt, 0, msg_tx_ring.size * RIO_MSG_DESC_SIZE);
61522 -       msg_tx_ring.tx_slot = 0;
61523 -
61524 -       /* Point dequeue/enqueue pointers at first entry in ring */
61525 -       out_be32((void *)&msg_regs->odqdpar, msg_tx_ring.phys);
61526 -       out_be32((void *)&msg_regs->odqepar, msg_tx_ring.phys);
61527 -
61528 -       /* Configure for snooping */
61529 -       out_be32((void *)&msg_regs->osar, 0x00000004);
61530 -
61531 -       /* Clear interrupt status */
61532 -       out_be32((void *)&msg_regs->osr, 0x000000b3);
61533 -
61534 -       /* Hook up outbound message handler */
61535 -       if ((rc =
61536 -            request_irq(MPC85xx_IRQ_RIO_TX, mpc85xx_rio_tx_handler, 0,
61537 -                        "msg_tx", (void *)mport)) < 0)
61538 -               goto out_irq;
61539 -
61540 -       /*
61541 -        * Configure outbound message unit
61542 -        *      Snooping
61543 -        *      Interrupts (all enabled, except QEIE)
61544 -        *      Chaining mode
61545 -        *      Disable
61546 -        */
61547 -       out_be32((void *)&msg_regs->omr, 0x00100220);
61548 -
61549 -       /* Set number of entries */
61550 -       out_be32((void *)&msg_regs->omr,
61551 -                in_be32((void *)&msg_regs->omr) |
61552 -                ((get_bitmask_order(entries) - 2) << 12));
61553 -
61554 -       /* Now enable the unit */
61555 -       out_be32((void *)&msg_regs->omr, in_be32((void *)&msg_regs->omr) | 0x1);
61556 -
61557 -      out:
61558 -       return rc;
61559 -
61560 -      out_irq:
61561 -       dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
61562 -                         msg_tx_ring.virt, msg_tx_ring.phys);
61563 -
61564 -      out_dma:
61565 -       for (i = 0; i < msg_tx_ring.size; i++)
61566 -               dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
61567 -                                 msg_tx_ring.virt_buffer[i],
61568 -                                 msg_tx_ring.phys_buffer[i]);
61569 -
61570 -       return rc;
61571 -}
61572 -
61573 -/**
61574 - * rio_close_outb_mbox - Shut down MPC85xx outbound mailbox
61575 - * @mport: Master port implementing the outbound message unit
61576 - * @mbox: Mailbox to close
61577 - *
61578 - * Disables the outbound message unit, free all buffers, and
61579 - * frees the outbound message interrupt.
61580 - */
61581 -void rio_close_outb_mbox(struct rio_mport *mport, int mbox)
61582 -{
61583 -       /* Disable inbound message unit */
61584 -       out_be32((void *)&msg_regs->omr, 0);
61585 -
61586 -       /* Free ring */
61587 -       dma_free_coherent(NULL, msg_tx_ring.size * RIO_MSG_DESC_SIZE,
61588 -                         msg_tx_ring.virt, msg_tx_ring.phys);
61589 -
61590 -       /* Free interrupt */
61591 -       free_irq(MPC85xx_IRQ_RIO_TX, (void *)mport);
61592 -}
61593 -
61594 -/**
61595 - * mpc85xx_rio_rx_handler - MPC85xx inbound message interrupt handler
61596 - * @irq: Linux interrupt number
61597 - * @dev_instance: Pointer to interrupt-specific data
61598 - *
61599 - * Handles inbound message interrupts. Executes a registered inbound
61600 - * mailbox event handler and acks the interrupt occurrence.
61601 - */
61602 -static irqreturn_t
61603 -mpc85xx_rio_rx_handler(int irq, void *dev_instance)
61604 -{
61605 -       int isr;
61606 -       struct rio_mport *port = (struct rio_mport *)dev_instance;
61607 -
61608 -       isr = in_be32((void *)&msg_regs->isr);
61609 -
61610 -       if (isr & RIO_MSG_ISR_TE) {
61611 -               pr_info("RIO: inbound message reception error\n");
61612 -               out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_TE);
61613 -               goto out;
61614 -       }
61615 -
61616 -       /* XXX Need to check/dispatch until queue empty */
61617 -       if (isr & RIO_MSG_ISR_DIQI) {
61618 -               /*
61619 -                * We implement *only* mailbox 0, but can receive messages
61620 -                * for any mailbox/letter to that mailbox destination. So,
61621 -                * make the callback with an unknown/invalid mailbox number
61622 -                * argument.
61623 -                */
61624 -               port->inb_msg[0].mcback(port, msg_rx_ring.dev_id, -1, -1);
61625 -
61626 -               /* Ack the queueing interrupt */
61627 -               out_be32((void *)&msg_regs->isr, RIO_MSG_ISR_DIQI);
61628 -       }
61629 -
61630 -      out:
61631 -       return IRQ_HANDLED;
61632 -}
61633 -
61634 -/**
61635 - * rio_open_inb_mbox - Initialize MPC85xx inbound mailbox
61636 - * @mport: Master port implementing the inbound message unit
61637 - * @dev_id: Device specific pointer to pass on event
61638 - * @mbox: Mailbox to open
61639 - * @entries: Number of entries in the inbound mailbox ring
61640 - *
61641 - * Initializes buffer ring, request the inbound message interrupt,
61642 - * and enables the inbound message unit. Returns %0 on success
61643 - * and %-EINVAL or %-ENOMEM on failure.
61644 - */
61645 -int rio_open_inb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
61646 -{
61647 -       int i, rc = 0;
61648 -
61649 -       if ((entries < RIO_MIN_RX_RING_SIZE) ||
61650 -           (entries > RIO_MAX_RX_RING_SIZE) || (!is_power_of_2(entries))) {
61651 -               rc = -EINVAL;
61652 -               goto out;
61653 -       }
61654 -
61655 -       /* Initialize client buffer ring */
61656 -       msg_rx_ring.dev_id = dev_id;
61657 -       msg_rx_ring.size = entries;
61658 -       msg_rx_ring.rx_slot = 0;
61659 -       for (i = 0; i < msg_rx_ring.size; i++)
61660 -               msg_rx_ring.virt_buffer[i] = NULL;
61661 -
61662 -       /* Initialize inbound message ring */
61663 -       if (!(msg_rx_ring.virt = dma_alloc_coherent(NULL,
61664 -                                                   msg_rx_ring.size *
61665 -                                                   RIO_MAX_MSG_SIZE,
61666 -                                                   &msg_rx_ring.phys,
61667 -                                                   GFP_KERNEL))) {
61668 -               rc = -ENOMEM;
61669 -               goto out;
61670 -       }
61671 -
61672 -       /* Point dequeue/enqueue pointers at first entry in ring */
61673 -       out_be32((void *)&msg_regs->ifqdpar, (u32) msg_rx_ring.phys);
61674 -       out_be32((void *)&msg_regs->ifqepar, (u32) msg_rx_ring.phys);
61675 -
61676 -       /* Clear interrupt status */
61677 -       out_be32((void *)&msg_regs->isr, 0x00000091);
61678 -
61679 -       /* Hook up inbound message handler */
61680 -       if ((rc =
61681 -            request_irq(MPC85xx_IRQ_RIO_RX, mpc85xx_rio_rx_handler, 0,
61682 -                        "msg_rx", (void *)mport)) < 0) {
61683 -               dma_free_coherent(NULL, RIO_MSG_BUFFER_SIZE,
61684 -                                 msg_tx_ring.virt_buffer[i],
61685 -                                 msg_tx_ring.phys_buffer[i]);
61686 -               goto out;
61687 -       }
61688 -
61689 -       /*
61690 -        * Configure inbound message unit:
61691 -        *      Snooping
61692 -        *      4KB max message size
61693 -        *      Unmask all interrupt sources
61694 -        *      Disable
61695 -        */
61696 -       out_be32((void *)&msg_regs->imr, 0x001b0060);
61697 -
61698 -       /* Set number of queue entries */
61699 -       out_be32((void *)&msg_regs->imr,
61700 -                in_be32((void *)&msg_regs->imr) |
61701 -                ((get_bitmask_order(entries) - 2) << 12));
61702 -
61703 -       /* Now enable the unit */
61704 -       out_be32((void *)&msg_regs->imr, in_be32((void *)&msg_regs->imr) | 0x1);
61705 -
61706 -      out:
61707 -       return rc;
61708 -}
61709 -
61710 -/**
61711 - * rio_close_inb_mbox - Shut down MPC85xx inbound mailbox
61712 - * @mport: Master port implementing the inbound message unit
61713 - * @mbox: Mailbox to close
61714 - *
61715 - * Disables the inbound message unit, free all buffers, and
61716 - * frees the inbound message interrupt.
61717 - */
61718 -void rio_close_inb_mbox(struct rio_mport *mport, int mbox)
61719 -{
61720 -       /* Disable inbound message unit */
61721 -       out_be32((void *)&msg_regs->imr, 0);
61722 -
61723 -       /* Free ring */
61724 -       dma_free_coherent(NULL, msg_rx_ring.size * RIO_MAX_MSG_SIZE,
61725 -                         msg_rx_ring.virt, msg_rx_ring.phys);
61726 -
61727 -       /* Free interrupt */
61728 -       free_irq(MPC85xx_IRQ_RIO_RX, (void *)mport);
61729 -}
61730 -
61731 -/**
61732 - * rio_hw_add_inb_buffer - Add buffer to the MPC85xx inbound message queue
61733 - * @mport: Master port implementing the inbound message unit
61734 - * @mbox: Inbound mailbox number
61735 - * @buf: Buffer to add to inbound queue
61736 - *
61737 - * Adds the @buf buffer to the MPC85xx inbound message queue. Returns
61738 - * %0 on success or %-EINVAL on failure.
61739 - */
61740 -int rio_hw_add_inb_buffer(struct rio_mport *mport, int mbox, void *buf)
61741 -{
61742 -       int rc = 0;
61743 -
61744 -       pr_debug("RIO: rio_hw_add_inb_buffer(), msg_rx_ring.rx_slot %d\n",
61745 -                msg_rx_ring.rx_slot);
61746 -
61747 -       if (msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot]) {
61748 -               printk(KERN_ERR
61749 -                      "RIO: error adding inbound buffer %d, buffer exists\n",
61750 -                      msg_rx_ring.rx_slot);
61751 -               rc = -EINVAL;
61752 -               goto out;
61753 -       }
61754 -
61755 -       msg_rx_ring.virt_buffer[msg_rx_ring.rx_slot] = buf;
61756 -       if (++msg_rx_ring.rx_slot == msg_rx_ring.size)
61757 -               msg_rx_ring.rx_slot = 0;
61758 -
61759 -      out:
61760 -       return rc;
61761 -}
61762 -
61763 -EXPORT_SYMBOL_GPL(rio_hw_add_inb_buffer);
61764 -
61765 -/**
61766 - * rio_hw_get_inb_message - Fetch inbound message from the MPC85xx message unit
61767 - * @mport: Master port implementing the inbound message unit
61768 - * @mbox: Inbound mailbox number
61769 - *
61770 - * Gets the next available inbound message from the inbound message queue.
61771 - * A pointer to the message is returned on success or NULL on failure.
61772 - */
61773 -void *rio_hw_get_inb_message(struct rio_mport *mport, int mbox)
61774 -{
61775 -       u32 imr;
61776 -       u32 phys_buf, virt_buf;
61777 -       void *buf = NULL;
61778 -       int buf_idx;
61779 -
61780 -       phys_buf = in_be32((void *)&msg_regs->ifqdpar);
61781 -
61782 -       /* If no more messages, then bail out */
61783 -       if (phys_buf == in_be32((void *)&msg_regs->ifqepar))
61784 -               goto out2;
61785 -
61786 -       virt_buf = (u32) msg_rx_ring.virt + (phys_buf - msg_rx_ring.phys);
61787 -       buf_idx = (phys_buf - msg_rx_ring.phys) / RIO_MAX_MSG_SIZE;
61788 -       buf = msg_rx_ring.virt_buffer[buf_idx];
61789 -
61790 -       if (!buf) {
61791 -               printk(KERN_ERR
61792 -                      "RIO: inbound message copy failed, no buffers\n");
61793 -               goto out1;
61794 -       }
61795 -
61796 -       /* Copy max message size, caller is expected to allocate that big */
61797 -       memcpy(buf, (void *)virt_buf, RIO_MAX_MSG_SIZE);
61798 -
61799 -       /* Clear the available buffer */
61800 -       msg_rx_ring.virt_buffer[buf_idx] = NULL;
61801 -
61802 -      out1:
61803 -       imr = in_be32((void *)&msg_regs->imr);
61804 -       out_be32((void *)&msg_regs->imr, imr | RIO_MSG_IMR_MI);
61805 -
61806 -      out2:
61807 -       return buf;
61808 -}
61809 -
61810 -EXPORT_SYMBOL_GPL(rio_hw_get_inb_message);
61811 -
61812 -/**
61813 - * mpc85xx_rio_dbell_handler - MPC85xx doorbell interrupt handler
61814 - * @irq: Linux interrupt number
61815 - * @dev_instance: Pointer to interrupt-specific data
61816 - *
61817 - * Handles doorbell interrupts. Parses a list of registered
61818 - * doorbell event handlers and executes a matching event handler.
61819 - */
61820 -static irqreturn_t
61821 -mpc85xx_rio_dbell_handler(int irq, void *dev_instance)
61822 -{
61823 -       int dsr;
61824 -       struct rio_mport *port = (struct rio_mport *)dev_instance;
61825 -
61826 -       dsr = in_be32((void *)&msg_regs->dsr);
61827 -
61828 -       if (dsr & DOORBELL_DSR_TE) {
61829 -               pr_info("RIO: doorbell reception error\n");
61830 -               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_TE);
61831 -               goto out;
61832 -       }
61833 -
61834 -       if (dsr & DOORBELL_DSR_QFI) {
61835 -               pr_info("RIO: doorbell queue full\n");
61836 -               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_QFI);
61837 -               goto out;
61838 -       }
61839 -
61840 -       /* XXX Need to check/dispatch until queue empty */
61841 -       if (dsr & DOORBELL_DSR_DIQI) {
61842 -               u32 dmsg =
61843 -                   (u32) dbell_ring.virt +
61844 -                   (in_be32((void *)&msg_regs->dqdpar) & 0xfff);
61845 -               u32 dmr;
61846 -               struct rio_dbell *dbell;
61847 -               int found = 0;
61848 -
61849 -               pr_debug
61850 -                   ("RIO: processing doorbell, sid %2.2x tid %2.2x info %4.4x\n",
61851 -                    DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
61852 -
61853 -               list_for_each_entry(dbell, &port->dbells, node) {
61854 -                       if ((dbell->res->start <= DBELL_INF(dmsg)) &&
61855 -                           (dbell->res->end >= DBELL_INF(dmsg))) {
61856 -                               found = 1;
61857 -                               break;
61858 -                       }
61859 -               }
61860 -               if (found) {
61861 -                       dbell->dinb(port, dbell->dev_id, DBELL_SID(dmsg), DBELL_TID(dmsg),
61862 -                                   DBELL_INF(dmsg));
61863 -               } else {
61864 -                       pr_debug
61865 -                           ("RIO: spurious doorbell, sid %2.2x tid %2.2x info %4.4x\n",
61866 -                            DBELL_SID(dmsg), DBELL_TID(dmsg), DBELL_INF(dmsg));
61867 -               }
61868 -               dmr = in_be32((void *)&msg_regs->dmr);
61869 -               out_be32((void *)&msg_regs->dmr, dmr | DOORBELL_DMR_DI);
61870 -               out_be32((void *)&msg_regs->dsr, DOORBELL_DSR_DIQI);
61871 -       }
61872 -
61873 -      out:
61874 -       return IRQ_HANDLED;
61875 -}
61876 -
61877 -/**
61878 - * mpc85xx_rio_doorbell_init - MPC85xx doorbell interface init
61879 - * @mport: Master port implementing the inbound doorbell unit
61880 - *
61881 - * Initializes doorbell unit hardware and inbound DMA buffer
61882 - * ring. Called from mpc85xx_rio_setup(). Returns %0 on success
61883 - * or %-ENOMEM on failure.
61884 - */
61885 -static int mpc85xx_rio_doorbell_init(struct rio_mport *mport)
61886 -{
61887 -       int rc = 0;
61888 -
61889 -       /* Map outbound doorbell window immediately after maintenance window */
61890 -       if (!(dbell_win =
61891 -             (u32) ioremap(mport->iores.start + RIO_MAINT_WIN_SIZE,
61892 -                           RIO_DBELL_WIN_SIZE))) {
61893 -               printk(KERN_ERR
61894 -                      "RIO: unable to map outbound doorbell window\n");
61895 -               rc = -ENOMEM;
61896 -               goto out;
61897 -       }
61898 -
61899 -       /* Initialize inbound doorbells */
61900 -       if (!(dbell_ring.virt = dma_alloc_coherent(NULL,
61901 -                                                  512 * DOORBELL_MESSAGE_SIZE,
61902 -                                                  &dbell_ring.phys,
61903 -                                                  GFP_KERNEL))) {
61904 -               printk(KERN_ERR "RIO: unable allocate inbound doorbell ring\n");
61905 -               rc = -ENOMEM;
61906 -               iounmap((void *)dbell_win);
61907 -               goto out;
61908 -       }
61909 -
61910 -       /* Point dequeue/enqueue pointers at first entry in ring */
61911 -       out_be32((void *)&msg_regs->dqdpar, (u32) dbell_ring.phys);
61912 -       out_be32((void *)&msg_regs->dqepar, (u32) dbell_ring.phys);
61913 -
61914 -       /* Clear interrupt status */
61915 -       out_be32((void *)&msg_regs->dsr, 0x00000091);
61916 -
61917 -       /* Hook up doorbell handler */
61918 -       if ((rc =
61919 -            request_irq(MPC85xx_IRQ_RIO_BELL, mpc85xx_rio_dbell_handler, 0,
61920 -                        "dbell_rx", (void *)mport) < 0)) {
61921 -               iounmap((void *)dbell_win);
61922 -               dma_free_coherent(NULL, 512 * DOORBELL_MESSAGE_SIZE,
61923 -                                 dbell_ring.virt, dbell_ring.phys);
61924 -               printk(KERN_ERR
61925 -                      "MPC85xx RIO: unable to request inbound doorbell irq");
61926 -               goto out;
61927 -       }
61928 -
61929 -       /* Configure doorbells for snooping, 512 entries, and enable */
61930 -       out_be32((void *)&msg_regs->dmr, 0x00108161);
61931 -
61932 -      out:
61933 -       return rc;
61934 -}
61935 -
61936 -static char *cmdline = NULL;
61937 -
61938 -static int mpc85xx_rio_get_hdid(int index)
61939 -{
61940 -       /* XXX Need to parse multiple entries in some format */
61941 -       if (!cmdline)
61942 -               return -1;
61943 -
61944 -       return simple_strtol(cmdline, NULL, 0);
61945 -}
61946 -
61947 -static int mpc85xx_rio_get_cmdline(char *s)
61948 -{
61949 -       if (!s)
61950 -               return 0;
61951 -
61952 -       cmdline = s;
61953 -       return 1;
61954 -}
61955 -
61956 -__setup("riohdid=", mpc85xx_rio_get_cmdline);
61957 -
61958 -/**
61959 - * mpc85xx_rio_setup - Setup MPC85xx RapidIO interface
61960 - * @law_start: Starting physical address of RapidIO LAW
61961 - * @law_size: Size of RapidIO LAW
61962 - *
61963 - * Initializes MPC85xx RapidIO hardware interface, configures
61964 - * master port with system-specific info, and registers the
61965 - * master port with the RapidIO subsystem.
61966 - */
61967 -void mpc85xx_rio_setup(int law_start, int law_size)
61968 -{
61969 -       struct rio_ops *ops;
61970 -       struct rio_mport *port;
61971 -
61972 -       ops = kmalloc(sizeof(struct rio_ops), GFP_KERNEL);
61973 -       ops->lcread = mpc85xx_local_config_read;
61974 -       ops->lcwrite = mpc85xx_local_config_write;
61975 -       ops->cread = mpc85xx_rio_config_read;
61976 -       ops->cwrite = mpc85xx_rio_config_write;
61977 -       ops->dsend = mpc85xx_rio_doorbell_send;
61978 -
61979 -       port = kmalloc(sizeof(struct rio_mport), GFP_KERNEL);
61980 -       port->id = 0;
61981 -       port->index = 0;
61982 -       INIT_LIST_HEAD(&port->dbells);
61983 -       port->iores.start = law_start;
61984 -       port->iores.end = law_start + law_size;
61985 -       port->iores.flags = IORESOURCE_MEM;
61986 -
61987 -       rio_init_dbell_res(&port->riores[RIO_DOORBELL_RESOURCE], 0, 0xffff);
61988 -       rio_init_mbox_res(&port->riores[RIO_INB_MBOX_RESOURCE], 0, 0);
61989 -       rio_init_mbox_res(&port->riores[RIO_OUTB_MBOX_RESOURCE], 0, 0);
61990 -       strcpy(port->name, "RIO0 mport");
61991 -
61992 -       port->ops = ops;
61993 -       port->host_deviceid = mpc85xx_rio_get_hdid(port->id);
61994 -
61995 -       rio_register_mport(port);
61996 -
61997 -       regs_win = (u32) ioremap(RIO_REGS_BASE, 0x20000);
61998 -       atmu_regs = (struct rio_atmu_regs *)(regs_win + RIO_ATMU_REGS_OFFSET);
61999 -       maint_atmu_regs = atmu_regs + 1;
62000 -       dbell_atmu_regs = atmu_regs + 2;
62001 -       msg_regs = (struct rio_msg_regs *)(regs_win + RIO_MSG_REGS_OFFSET);
62002 -
62003 -       /* Configure maintenance transaction window */
62004 -       out_be32((void *)&maint_atmu_regs->rowbar, 0x000c0000);
62005 -       out_be32((void *)&maint_atmu_regs->rowar, 0x80077015);
62006 -
62007 -       maint_win = (u32) ioremap(law_start, RIO_MAINT_WIN_SIZE);
62008 -
62009 -       /* Configure outbound doorbell window */
62010 -       out_be32((void *)&dbell_atmu_regs->rowbar, 0x000c0400);
62011 -       out_be32((void *)&dbell_atmu_regs->rowar, 0x8004200b);
62012 -       mpc85xx_rio_doorbell_init(port);
62013 -}
62014 --- a/arch/ppc/syslib/ppc85xx_rio.h
62015 +++ /dev/null
62016 @@ -1,20 +0,0 @@
62017 -/*
62018 - * MPC85xx RapidIO definitions
62019 - *
62020 - * Copyright 2005 MontaVista Software, Inc.
62021 - * Matt Porter <mporter@kernel.crashing.org>
62022 - *
62023 - * This program is free software; you can redistribute  it and/or modify it
62024 - * under  the terms of  the GNU General  Public License as published by the
62025 - * Free Software Foundation;  either version 2 of the  License, or (at your
62026 - * option) any later version.
62027 - */
62028 -
62029 -#ifndef __PPC_SYSLIB_PPC85XX_RIO_H
62030 -#define __PPC_SYSLIB_PPC85XX_RIO_H
62031 -
62032 -#include <linux/init.h>
62033 -
62034 -extern void mpc85xx_rio_setup(int law_start, int law_size);
62035 -
62036 -#endif                         /* __PPC_SYSLIB_PPC85XX_RIO_H */
62037 --- a/arch/ppc/syslib/ppc8xx_pic.c
62038 +++ b/arch/ppc/syslib/ppc8xx_pic.c
62039 @@ -16,7 +16,7 @@
62040   * the only interrupt controller.  Some boards, like the MBX and
62041   * Sandpoint have the 8259 as a secondary controller.  Depending
62042   * upon the processor type, the internal controller can have as
62043 - * few as 16 interrups or as many as 64.  We could use  the
62044 + * few as 16 interrupts or as many as 64.  We could use  the
62045   * "clear_bit()" and "set_bit()" functions like other platforms,
62046   * but they are overkill for us.
62047   */
62048 --- a/arch/ppc/syslib/ppc_sys.c
62049 +++ b/arch/ppc/syslib/ppc_sys.c
62050 @@ -185,7 +185,7 @@
62051   */
62052  
62053  /*
62054 -   Here we'll replace .name pointers with fixed-lenght strings
62055 +   Here we'll replace .name pointers with fixed-length strings
62056     Hereby, this should be called *before* any func stuff triggeded.
62057   */
62058  void ppc_sys_device_initfunc(void)
62059 --- a/arch/ppc/xmon/start.c
62060 +++ b/arch/ppc/xmon/start.c
62061 @@ -10,7 +10,6 @@
62062  #include <linux/sysrq.h>
62063  #include <linux/bitops.h>
62064  #include <asm/xmon.h>
62065 -#include <asm/machdep.h>
62066  #include <asm/errno.h>
62067  #include <asm/processor.h>
62068  #include <asm/delay.h>
62069 --- a/drivers/ata/Kconfig
62070 +++ b/drivers/ata/Kconfig
62071 @@ -607,13 +607,23 @@
62072  
62073  config PATA_PLATFORM
62074         tristate "Generic platform device PATA support"
62075 -       depends on EMBEDDED || ARCH_RPC
62076 +       depends on EMBEDDED || ARCH_RPC || PPC
62077         help
62078           This option enables support for generic directly connected ATA
62079           devices commonly found on embedded systems.
62080  
62081           If unsure, say N.
62082  
62083 +config PATA_OF_PLATFORM
62084 +       tristate "OpenFirmware platform device PATA support"
62085 +       depends on PATA_PLATFORM && PPC_OF
62086 +       help
62087 +         This option enables support for generic directly connected ATA
62088 +         devices commonly found on embedded systems with OpenFirmware
62089 +         bindings.
62090 +
62091 +         If unsure, say N.
62092 +
62093  config PATA_ICSIDE
62094         tristate "Acorn ICS PATA support"
62095         depends on ARM && ARCH_ACORN
62096 --- a/drivers/ata/Makefile
62097 +++ b/drivers/ata/Makefile
62098 @@ -67,6 +67,7 @@
62099  obj-$(CONFIG_PATA_SCC)         += pata_scc.o
62100  obj-$(CONFIG_PATA_BF54X)       += pata_bf54x.o
62101  obj-$(CONFIG_PATA_PLATFORM)    += pata_platform.o
62102 +obj-$(CONFIG_PATA_OF_PLATFORM) += pata_of_platform.o
62103  obj-$(CONFIG_PATA_ICSIDE)      += pata_icside.o
62104  # Should be last but two libata driver
62105  obj-$(CONFIG_PATA_ACPI)                += pata_acpi.o
62106 --- /dev/null
62107 +++ b/drivers/ata/pata_of_platform.c
62108 @@ -0,0 +1,114 @@
62109 +/*
62110 + * OF-platform PATA driver
62111 + *
62112 + * Copyright (c) 2007  MontaVista Software, Inc.
62113 + *                     Anton Vorontsov <avorontsov@ru.mvista.com>
62114 + *
62115 + * This program is free software; you can redistribute it and/or modify
62116 + * it under the terms of the GNU General Public License (Version 2) as
62117 + * published by the Free Software Foundation.
62118 + */
62119 +
62120 +#include <linux/kernel.h>
62121 +#include <linux/module.h>
62122 +#include <linux/of_platform.h>
62123 +#include <linux/pata_platform.h>
62124 +
62125 +static int __devinit pata_of_platform_probe(struct of_device *ofdev,
62126 +                                           const struct of_device_id *match)
62127 +{
62128 +       int ret;
62129 +       struct device_node *dn = ofdev->node;
62130 +       struct resource io_res;
62131 +       struct resource ctl_res;
62132 +       struct resource irq_res;
62133 +       unsigned int reg_shift = 0;
62134 +       int pio_mode = 0;
62135 +       int pio_mask;
62136 +       const u32 *prop;
62137 +
62138 +       ret = of_address_to_resource(dn, 0, &io_res);
62139 +       if (ret) {
62140 +               dev_err(&ofdev->dev, "can't get IO address from "
62141 +                       "device tree\n");
62142 +               return -EINVAL;
62143 +       }
62144 +
62145 +       if (of_device_is_compatible(dn, "electra-ide")) {
62146 +               /* Altstatus is really at offset 0x3f6 from the primary window
62147 +                * on electra-ide. Adjust ctl_res and io_res accordingly.
62148 +                */
62149 +               ctl_res = io_res;
62150 +               ctl_res.start = ctl_res.start+0x3f6;
62151 +               io_res.end = ctl_res.start-1;
62152 +       } else {
62153 +               ret = of_address_to_resource(dn, 1, &ctl_res);
62154 +               if (ret) {
62155 +                       dev_err(&ofdev->dev, "can't get CTL address from "
62156 +                               "device tree\n");
62157 +                       return -EINVAL;
62158 +               }
62159 +       }
62160 +
62161 +       ret = of_irq_to_resource(dn, 0, &irq_res);
62162 +       if (ret == NO_IRQ)
62163 +               irq_res.start = irq_res.end = -1;
62164 +       else
62165 +               irq_res.flags = 0;
62166 +
62167 +       prop = of_get_property(dn, "reg-shift", NULL);
62168 +       if (prop)
62169 +               reg_shift = *prop;
62170 +
62171 +       prop = of_get_property(dn, "pio-mode", NULL);
62172 +       if (prop) {
62173 +               pio_mode = *prop;
62174 +               if (pio_mode > 6) {
62175 +                       dev_err(&ofdev->dev, "invalid pio-mode\n");
62176 +                       return -EINVAL;
62177 +               }
62178 +       } else {
62179 +               dev_info(&ofdev->dev, "pio-mode unspecified, assuming PIO0\n");
62180 +       }
62181 +
62182 +       pio_mask = 1 << pio_mode;
62183 +       pio_mask |= (1 << pio_mode) - 1;
62184 +
62185 +       return __pata_platform_probe(&ofdev->dev, &io_res, &ctl_res, &irq_res,
62186 +                                    reg_shift, pio_mask);
62187 +}
62188 +
62189 +static int __devexit pata_of_platform_remove(struct of_device *ofdev)
62190 +{
62191 +       return __pata_platform_remove(&ofdev->dev);
62192 +}
62193 +
62194 +static struct of_device_id pata_of_platform_match[] = {
62195 +       { .compatible = "ata-generic", },
62196 +       { .compatible = "electra-ide", },
62197 +       {},
62198 +};
62199 +MODULE_DEVICE_TABLE(of, pata_of_platform_match);
62200 +
62201 +static struct of_platform_driver pata_of_platform_driver = {
62202 +       .name           = "pata_of_platform",
62203 +       .match_table    = pata_of_platform_match,
62204 +       .probe          = pata_of_platform_probe,
62205 +       .remove         = __devexit_p(pata_of_platform_remove),
62206 +};
62207 +
62208 +static int __init pata_of_platform_init(void)
62209 +{
62210 +       return of_register_platform_driver(&pata_of_platform_driver);
62211 +}
62212 +module_init(pata_of_platform_init);
62213 +
62214 +static void __exit pata_of_platform_exit(void)
62215 +{
62216 +       of_unregister_platform_driver(&pata_of_platform_driver);
62217 +}
62218 +module_exit(pata_of_platform_exit);
62219 +
62220 +MODULE_DESCRIPTION("OF-platform PATA driver");
62221 +MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
62222 +MODULE_LICENSE("GPL");
62223 --- a/drivers/ata/pata_platform.c
62224 +++ b/drivers/ata/pata_platform.c
62225 @@ -93,14 +93,9 @@
62226  };
62227  
62228  static void pata_platform_setup_port(struct ata_ioports *ioaddr,
62229 -                                    struct pata_platform_info *info)
62230 +                                    unsigned int shift)
62231  {
62232 -       unsigned int shift = 0;
62233 -
62234         /* Fixup the port shift for platforms that need it */
62235 -       if (info && info->ioport_shift)
62236 -               shift = info->ioport_shift;
62237 -
62238         ioaddr->data_addr       = ioaddr->cmd_addr + (ATA_REG_DATA    << shift);
62239         ioaddr->error_addr      = ioaddr->cmd_addr + (ATA_REG_ERR     << shift);
62240         ioaddr->feature_addr    = ioaddr->cmd_addr + (ATA_REG_FEATURE << shift);
62241 @@ -114,8 +109,13 @@
62242  }
62243  
62244  /**
62245 - *     pata_platform_probe             -       attach a platform interface
62246 - *     @pdev: platform device
62247 + *     __pata_platform_probe           -       attach a platform interface
62248 + *     @dev: device
62249 + *     @io_res: Resource representing I/O base
62250 + *     @ctl_res: Resource representing CTL base
62251 + *     @irq_res: Resource representing IRQ and its flags
62252 + *     @ioport_shift: I/O port shift
62253 + *     @__pio_mask: PIO mask
62254   *
62255   *     Register a platform bus IDE interface. Such interfaces are PIO and we
62256   *     assume do not support IRQ sharing.
62257 @@ -135,42 +135,18 @@
62258   *
62259   *     If no IRQ resource is present, PIO polling mode is used instead.
62260   */
62261 -static int __devinit pata_platform_probe(struct platform_device *pdev)
62262 +int __devinit __pata_platform_probe(struct device *dev,
62263 +                                   struct resource *io_res,
62264 +                                   struct resource *ctl_res,
62265 +                                   struct resource *irq_res,
62266 +                                   unsigned int ioport_shift,
62267 +                                   int __pio_mask)
62268  {
62269 -       struct resource *io_res, *ctl_res;
62270         struct ata_host *host;
62271         struct ata_port *ap;
62272 -       struct pata_platform_info *pp_info;
62273         unsigned int mmio;
62274 -       int irq;
62275 -
62276 -       /*
62277 -        * Simple resource validation ..
62278 -        */
62279 -       if ((pdev->num_resources != 3) && (pdev->num_resources != 2)) {
62280 -               dev_err(&pdev->dev, "invalid number of resources\n");
62281 -               return -EINVAL;
62282 -       }
62283 -
62284 -       /*
62285 -        * Get the I/O base first
62286 -        */
62287 -       io_res = platform_get_resource(pdev, IORESOURCE_IO, 0);
62288 -       if (io_res == NULL) {
62289 -               io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
62290 -               if (unlikely(io_res == NULL))
62291 -                       return -EINVAL;
62292 -       }
62293 -
62294 -       /*
62295 -        * Then the CTL base
62296 -        */
62297 -       ctl_res = platform_get_resource(pdev, IORESOURCE_IO, 1);
62298 -       if (ctl_res == NULL) {
62299 -               ctl_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
62300 -               if (unlikely(ctl_res == NULL))
62301 -                       return -EINVAL;
62302 -       }
62303 +       int irq = 0;
62304 +       int irq_flags = 0;
62305  
62306         /*
62307          * Check for MMIO
62308 @@ -181,20 +157,21 @@
62309         /*
62310          * And the IRQ
62311          */
62312 -       irq = platform_get_irq(pdev, 0);
62313 -       if (irq < 0)
62314 -               irq = 0;        /* no irq */
62315 +       if (irq_res && irq_res->start > 0) {
62316 +               irq = irq_res->start;
62317 +               irq_flags = irq_res->flags;
62318 +       }
62319  
62320         /*
62321          * Now that that's out of the way, wire up the port..
62322          */
62323 -       host = ata_host_alloc(&pdev->dev, 1);
62324 +       host = ata_host_alloc(dev, 1);
62325         if (!host)
62326                 return -ENOMEM;
62327         ap = host->ports[0];
62328  
62329         ap->ops = &pata_platform_port_ops;
62330 -       ap->pio_mask = pio_mask;
62331 +       ap->pio_mask = __pio_mask;
62332         ap->flags |= ATA_FLAG_SLAVE_POSS;
62333  
62334         /*
62335 @@ -209,25 +186,24 @@
62336          * Handle the MMIO case
62337          */
62338         if (mmio) {
62339 -               ap->ioaddr.cmd_addr = devm_ioremap(&pdev->dev, io_res->start,
62340 +               ap->ioaddr.cmd_addr = devm_ioremap(dev, io_res->start,
62341                                 io_res->end - io_res->start + 1);
62342 -               ap->ioaddr.ctl_addr = devm_ioremap(&pdev->dev, ctl_res->start,
62343 +               ap->ioaddr.ctl_addr = devm_ioremap(dev, ctl_res->start,
62344                                 ctl_res->end - ctl_res->start + 1);
62345         } else {
62346 -               ap->ioaddr.cmd_addr = devm_ioport_map(&pdev->dev, io_res->start,
62347 +               ap->ioaddr.cmd_addr = devm_ioport_map(dev, io_res->start,
62348                                 io_res->end - io_res->start + 1);
62349 -               ap->ioaddr.ctl_addr = devm_ioport_map(&pdev->dev, ctl_res->start,
62350 +               ap->ioaddr.ctl_addr = devm_ioport_map(dev, ctl_res->start,
62351                                 ctl_res->end - ctl_res->start + 1);
62352         }
62353         if (!ap->ioaddr.cmd_addr || !ap->ioaddr.ctl_addr) {
62354 -               dev_err(&pdev->dev, "failed to map IO/CTL base\n");
62355 +               dev_err(dev, "failed to map IO/CTL base\n");
62356                 return -ENOMEM;
62357         }
62358  
62359         ap->ioaddr.altstatus_addr = ap->ioaddr.ctl_addr;
62360  
62361 -       pp_info = pdev->dev.platform_data;
62362 -       pata_platform_setup_port(&ap->ioaddr, pp_info);
62363 +       pata_platform_setup_port(&ap->ioaddr, ioport_shift);
62364  
62365         ata_port_desc(ap, "%s cmd 0x%llx ctl 0x%llx", mmio ? "mmio" : "ioport",
62366                       (unsigned long long)io_res->start,
62367 @@ -235,26 +211,78 @@
62368  
62369         /* activate */
62370         return ata_host_activate(host, irq, irq ? ata_interrupt : NULL,
62371 -                                pp_info ? pp_info->irq_flags : 0,
62372 -                                &pata_platform_sht);
62373 +                                irq_flags, &pata_platform_sht);
62374  }
62375 +EXPORT_SYMBOL_GPL(__pata_platform_probe);
62376  
62377  /**
62378 - *     pata_platform_remove    -       unplug a platform interface
62379 - *     @pdev: platform device
62380 + *     __pata_platform_remove          -       unplug a platform interface
62381 + *     @dev: device
62382   *
62383   *     A platform bus ATA device has been unplugged. Perform the needed
62384   *     cleanup. Also called on module unload for any active devices.
62385   */
62386 -static int __devexit pata_platform_remove(struct platform_device *pdev)
62387 +int __devexit __pata_platform_remove(struct device *dev)
62388  {
62389 -       struct device *dev = &pdev->dev;
62390         struct ata_host *host = dev_get_drvdata(dev);
62391  
62392         ata_host_detach(host);
62393  
62394         return 0;
62395  }
62396 +EXPORT_SYMBOL_GPL(__pata_platform_remove);
62397 +
62398 +static int __devinit pata_platform_probe(struct platform_device *pdev)
62399 +{
62400 +       struct resource *io_res;
62401 +       struct resource *ctl_res;
62402 +       struct resource *irq_res;
62403 +       struct pata_platform_info *pp_info = pdev->dev.platform_data;
62404 +
62405 +       /*
62406 +        * Simple resource validation ..
62407 +        */
62408 +       if ((pdev->num_resources != 3) && (pdev->num_resources != 2)) {
62409 +               dev_err(&pdev->dev, "invalid number of resources\n");
62410 +               return -EINVAL;
62411 +       }
62412 +
62413 +       /*
62414 +        * Get the I/O base first
62415 +        */
62416 +       io_res = platform_get_resource(pdev, IORESOURCE_IO, 0);
62417 +       if (io_res == NULL) {
62418 +               io_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
62419 +               if (unlikely(io_res == NULL))
62420 +                       return -EINVAL;
62421 +       }
62422 +
62423 +       /*
62424 +        * Then the CTL base
62425 +        */
62426 +       ctl_res = platform_get_resource(pdev, IORESOURCE_IO, 1);
62427 +       if (ctl_res == NULL) {
62428 +               ctl_res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
62429 +               if (unlikely(ctl_res == NULL))
62430 +                       return -EINVAL;
62431 +       }
62432 +
62433 +       /*
62434 +        * And the IRQ
62435 +        */
62436 +       irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
62437 +       if (irq_res)
62438 +               irq_res->flags = pp_info ? pp_info->irq_flags : 0;
62439 +
62440 +       return __pata_platform_probe(&pdev->dev, io_res, ctl_res, irq_res,
62441 +                                    pp_info ? pp_info->ioport_shift : 0,
62442 +                                    pio_mask);
62443 +}
62444 +
62445 +static int __devexit pata_platform_remove(struct platform_device *pdev)
62446 +{
62447 +       return __pata_platform_remove(&pdev->dev);
62448 +}
62449  
62450  static struct platform_driver pata_platform_driver = {
62451         .probe          = pata_platform_probe,
62452 --- a/drivers/char/hw_random/Kconfig
62453 +++ b/drivers/char/hw_random/Kconfig
62454 @@ -98,7 +98,7 @@
62455         default HW_RANDOM
62456         ---help---
62457           This driver provides kernel-side support for the Random Number
62458 -         Generator hardware found on PA6T-1682M processor.
62459 +         Generator hardware found on PA Semi PWRficient SoCs.
62460  
62461           To compile this driver as a module, choose M here: the
62462           module will be called pasemi-rng.
62463 --- a/drivers/char/hw_random/pasemi-rng.c
62464 +++ b/drivers/char/hw_random/pasemi-rng.c
62465 @@ -126,10 +126,9 @@
62466  }
62467  
62468  static struct of_device_id rng_match[] = {
62469 -       {
62470 -               .compatible      = "1682m-rng",
62471 -       },
62472 -       {},
62473 +       { .compatible      = "1682m-rng", },
62474 +       { .compatible      = "pasemi,pwrficient-rng", },
62475 +       { },
62476  };
62477  
62478  static struct of_platform_driver rng_driver = {
62479 --- a/drivers/edac/pasemi_edac.c
62480 +++ b/drivers/edac/pasemi_edac.c
62481 @@ -225,7 +225,7 @@
62482                 EDAC_FLAG_NONE;
62483         mci->mod_name = MODULE_NAME;
62484         mci->dev_name = pci_name(pdev);
62485 -       mci->ctl_name = "pasemi,1682m-mc";
62486 +       mci->ctl_name = "pasemi,pwrficient-mc";
62487         mci->edac_check = pasemi_edac_check;
62488         mci->ctl_page_to_phys = NULL;
62489         pci_read_config_dword(pdev, MCCFG_SCRUB, &scrub);
62490 @@ -297,4 +297,4 @@
62491  
62492  MODULE_LICENSE("GPL");
62493  MODULE_AUTHOR("Egor Martovetsky <egor@pasemi.com>");
62494 -MODULE_DESCRIPTION("MC support for PA Semi PA6T-1682M memory controller");
62495 +MODULE_DESCRIPTION("MC support for PA Semi PWRficient memory controller");
62496 --- a/drivers/macintosh/adb.c
62497 +++ b/drivers/macintosh/adb.c
62498 @@ -35,6 +35,7 @@
62499  #include <linux/spinlock.h>
62500  #include <linux/completion.h>
62501  #include <linux/device.h>
62502 +#include <linux/kthread.h>
62503  
62504  #include <asm/uaccess.h>
62505  #include <asm/semaphore.h>
62506 @@ -82,21 +83,11 @@
62507  BLOCKING_NOTIFIER_HEAD(adb_client_list);
62508  static int adb_got_sleep;
62509  static int adb_inited;
62510 -static pid_t adb_probe_task_pid;
62511  static DECLARE_MUTEX(adb_probe_mutex);
62512 -static struct completion adb_probe_task_comp;
62513  static int sleepy_trackpad;
62514  static int autopoll_devs;
62515  int __adb_probe_sync;
62516  
62517 -#ifdef CONFIG_PM_SLEEP
62518 -static void adb_notify_sleep(struct pmu_sleep_notifier *self, int when);
62519 -static struct pmu_sleep_notifier adb_sleep_notifier = {
62520 -       adb_notify_sleep,
62521 -       SLEEP_LEVEL_ADB,
62522 -};
62523 -#endif
62524 -
62525  static int adb_scan_bus(void);
62526  static int do_adb_reset_bus(void);
62527  static void adbdev_init(void);
62528 @@ -134,16 +125,6 @@
62529  }
62530  #endif
62531  
62532 -
62533 -static __inline__ void adb_wait_ms(unsigned int ms)
62534 -{
62535 -       if (current->pid && adb_probe_task_pid &&
62536 -         adb_probe_task_pid == current->pid)
62537 -               msleep(ms);
62538 -       else
62539 -               mdelay(ms);
62540 -}
62541 -
62542  static int adb_scan_bus(void)
62543  {
62544         int i, highFree=0, noMovement;
62545 @@ -248,13 +229,10 @@
62546  static int
62547  adb_probe_task(void *x)
62548  {
62549 -       strcpy(current->comm, "kadbprobe");
62550 -
62551         printk(KERN_INFO "adb: starting probe task...\n");
62552         do_adb_reset_bus();
62553         printk(KERN_INFO "adb: finished probe task...\n");
62554  
62555 -       adb_probe_task_pid = 0;
62556         up(&adb_probe_mutex);
62557  
62558         return 0;
62559 @@ -263,7 +241,7 @@
62560  static void
62561  __adb_probe_task(struct work_struct *bullshit)
62562  {
62563 -       adb_probe_task_pid = kernel_thread(adb_probe_task, NULL, SIGCHLD | CLONE_KERNEL);
62564 +       kthread_run(adb_probe_task, NULL, "kadbprobe");
62565  }
62566  
62567  static DECLARE_WORK(adb_reset_work, __adb_probe_task);
62568 @@ -281,6 +259,36 @@
62569         return 0;
62570  }
62571  
62572 +#ifdef CONFIG_PM
62573 +/*
62574 + * notify clients before sleep
62575 + */
62576 +static int adb_suspend(struct platform_device *dev, pm_message_t state)
62577 +{
62578 +       adb_got_sleep = 1;
62579 +       /* We need to get a lock on the probe thread */
62580 +       down(&adb_probe_mutex);
62581 +       /* Stop autopoll */
62582 +       if (adb_controller->autopoll)
62583 +               adb_controller->autopoll(0);
62584 +       blocking_notifier_call_chain(&adb_client_list, ADB_MSG_POWERDOWN, NULL);
62585 +
62586 +       return 0;
62587 +}
62588 +
62589 +/*
62590 + * reset bus after sleep
62591 + */
62592 +static int adb_resume(struct platform_device *dev)
62593 +{
62594 +       adb_got_sleep = 0;
62595 +       up(&adb_probe_mutex);
62596 +       adb_reset_bus();
62597 +
62598 +       return 0;
62599 +}
62600 +#endif /* CONFIG_PM */
62601 +
62602  int __init adb_init(void)
62603  {
62604         struct adb_driver *driver;
62605 @@ -313,15 +321,12 @@
62606                 printk(KERN_WARNING "Warning: no ADB interface detected\n");
62607                 adb_controller = NULL;
62608         } else {
62609 -#ifdef CONFIG_PM_SLEEP
62610 -               pmu_register_sleep_notifier(&adb_sleep_notifier);
62611 -#endif /* CONFIG_PM */
62612  #ifdef CONFIG_PPC
62613                 if (machine_is_compatible("AAPL,PowerBook1998") ||
62614                         machine_is_compatible("PowerBook1,1"))
62615                         sleepy_trackpad = 1;
62616  #endif /* CONFIG_PPC */
62617 -               init_completion(&adb_probe_task_comp);
62618 +
62619                 adbdev_init();
62620                 adb_reset_bus();
62621         }
62622 @@ -330,33 +335,6 @@
62623  
62624  __initcall(adb_init);
62625  
62626 -#ifdef CONFIG_PM
62627 -/*
62628 - * notify clients before sleep and reset bus afterwards
62629 - */
62630 -void
62631 -adb_notify_sleep(struct pmu_sleep_notifier *self, int when)
62632 -{
62633 -       switch (when) {
62634 -       case PBOOK_SLEEP_REQUEST:
62635 -               adb_got_sleep = 1;
62636 -               /* We need to get a lock on the probe thread */
62637 -               down(&adb_probe_mutex);
62638 -               /* Stop autopoll */
62639 -               if (adb_controller->autopoll)
62640 -                       adb_controller->autopoll(0);
62641 -               blocking_notifier_call_chain(&adb_client_list,
62642 -                       ADB_MSG_POWERDOWN, NULL);
62643 -               break;
62644 -       case PBOOK_WAKE:
62645 -               adb_got_sleep = 0;
62646 -               up(&adb_probe_mutex);
62647 -               adb_reset_bus();
62648 -               break;
62649 -       }
62650 -}
62651 -#endif /* CONFIG_PM */
62652 -
62653  static int
62654  do_adb_reset_bus(void)
62655  {
62656 @@ -373,7 +351,7 @@
62657  
62658         if (sleepy_trackpad) {
62659                 /* Let the trackpad settle down */
62660 -               adb_wait_ms(500);
62661 +               msleep(500);
62662         }
62663  
62664         down(&adb_handler_sem);
62665 @@ -389,7 +367,7 @@
62666  
62667         if (sleepy_trackpad) {
62668                 /* Let the trackpad settle down */
62669 -               adb_wait_ms(1500);
62670 +               msleep(1500);
62671         }
62672  
62673         if (!ret) {
62674 @@ -413,41 +391,27 @@
62675         adb_controller->poll();
62676  }
62677  
62678 -static void
62679 -adb_probe_wakeup(struct adb_request *req)
62680 +static void adb_sync_req_done(struct adb_request *req)
62681  {
62682 -       complete(&adb_probe_task_comp);
62683 -}
62684 +       struct completion *comp = req->arg;
62685  
62686 -/* Static request used during probe */
62687 -static struct adb_request adb_sreq;
62688 -static unsigned long adb_sreq_lock; // Use semaphore ! */ 
62689 +       complete(comp);
62690 +}
62691  
62692  int
62693  adb_request(struct adb_request *req, void (*done)(struct adb_request *),
62694             int flags, int nbytes, ...)
62695  {
62696         va_list list;
62697 -       int i, use_sreq;
62698 +       int i;
62699         int rc;
62700 +       struct completion comp;
62701  
62702         if ((adb_controller == NULL) || (adb_controller->send_request == NULL))
62703                 return -ENXIO;
62704         if (nbytes < 1)
62705                 return -EINVAL;
62706 -       if (req == NULL && (flags & ADBREQ_NOSEND))
62707 -               return -EINVAL;
62708 -       
62709 -       if (req == NULL) {
62710 -               if (test_and_set_bit(0,&adb_sreq_lock)) {
62711 -                       printk("adb.c: Warning: contention on static request !\n");
62712 -                       return -EPERM;
62713 -               }
62714 -               req = &adb_sreq;
62715 -               flags |= ADBREQ_SYNC;
62716 -               use_sreq = 1;
62717 -       } else
62718 -               use_sreq = 0;
62719 +
62720         req->nbytes = nbytes+1;
62721         req->done = done;
62722         req->reply_expected = flags & ADBREQ_REPLY;
62723 @@ -460,25 +424,18 @@
62724         if (flags & ADBREQ_NOSEND)
62725                 return 0;
62726  
62727 -       /* Synchronous requests send from the probe thread cause it to
62728 -        * block. Beware that the "done" callback will be overriden !
62729 -        */
62730 -       if ((flags & ADBREQ_SYNC) &&
62731 -           (current->pid && adb_probe_task_pid &&
62732 -           adb_probe_task_pid == current->pid)) {
62733 -               req->done = adb_probe_wakeup;
62734 -               rc = adb_controller->send_request(req, 0);
62735 -               if (rc || req->complete)
62736 -                       goto bail;
62737 -               wait_for_completion(&adb_probe_task_comp);
62738 -               rc = 0;
62739 -               goto bail;
62740 -       }
62741 -
62742 -       rc = adb_controller->send_request(req, flags & ADBREQ_SYNC);
62743 -bail:
62744 -       if (use_sreq)
62745 -               clear_bit(0, &adb_sreq_lock);
62746 +       /* Synchronous requests block using an on-stack completion */
62747 +       if (flags & ADBREQ_SYNC) {
62748 +               WARN_ON(done);
62749 +               req->done = adb_sync_req_done;
62750 +               req->arg = &comp;
62751 +               init_completion(&comp);
62752 +       }
62753 +
62754 +       rc = adb_controller->send_request(req, 0);
62755 +
62756 +       if ((flags & ADBREQ_SYNC) && !rc && !req->complete)
62757 +               wait_for_completion(&comp);
62758  
62759         return rc;
62760  }
62761 @@ -864,7 +821,29 @@
62762         .release        = adb_release,
62763  };
62764  
62765 -static void
62766 +static struct platform_driver adb_pfdrv = {
62767 +       .driver = {
62768 +               .name = "adb",
62769 +       },
62770 +#ifdef CONFIG_PM
62771 +       .suspend = adb_suspend,
62772 +       .resume = adb_resume,
62773 +#endif
62774 +};
62775 +
62776 +static struct platform_device adb_pfdev = {
62777 +       .name = "adb",
62778 +};
62779 +
62780 +static int __init
62781 +adb_dummy_probe(struct platform_device *dev)
62782 +{
62783 +       if (dev == &adb_pfdev)
62784 +               return 0;
62785 +       return -ENODEV;
62786 +}
62787 +
62788 +static void __init
62789  adbdev_init(void)
62790  {
62791         if (register_chrdev(ADB_MAJOR, "adb", &adb_fops)) {
62792 @@ -876,4 +855,7 @@
62793         if (IS_ERR(adb_dev_class))
62794                 return;
62795         class_device_create(adb_dev_class, NULL, MKDEV(ADB_MAJOR, 0), NULL, "adb");
62796 +
62797 +       platform_device_register(&adb_pfdev);
62798 +       platform_driver_probe(&adb_pfdrv, adb_dummy_probe);
62799  }
62800 --- a/drivers/macintosh/mediabay.c
62801 +++ b/drivers/macintosh/mediabay.c
62802 @@ -20,6 +20,7 @@
62803  #include <linux/stddef.h>
62804  #include <linux/init.h>
62805  #include <linux/ide.h>
62806 +#include <linux/kthread.h>
62807  #include <asm/prom.h>
62808  #include <asm/pgtable.h>
62809  #include <asm/io.h>
62810 @@ -35,7 +36,6 @@
62811  
62812  
62813  #define MB_DEBUG
62814 -#define MB_IGNORE_SIGNALS
62815  
62816  #ifdef MB_DEBUG
62817  #define MBDBG(fmt, arg...)     printk(KERN_INFO fmt , ## arg)
62818 @@ -622,12 +622,7 @@
62819  {
62820         int     i;
62821  
62822 -       strcpy(current->comm, "media-bay");
62823 -#ifdef MB_IGNORE_SIGNALS
62824 -       sigfillset(&current->blocked);
62825 -#endif
62826 -
62827 -       for (;;) {
62828 +       while (!kthread_should_stop()) {
62829                 for (i = 0; i < media_bay_count; ++i) {
62830                         down(&media_bays[i].lock);
62831                         if (!media_bays[i].sleeping)
62832 @@ -636,9 +631,8 @@
62833                 }
62834  
62835                 msleep_interruptible(MB_POLL_DELAY);
62836 -               if (signal_pending(current))
62837 -                       return 0;
62838         }
62839 +       return 0;
62840  }
62841  
62842  static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_device_id *match)
62843 @@ -699,7 +693,7 @@
62844  
62845         /* Startup kernel thread */
62846         if (i == 0)
62847 -               kernel_thread(media_bay_task, NULL, CLONE_KERNEL);
62848 +               kthread_run(media_bay_task, NULL, "media-bay");
62849  
62850         return 0;
62851  
62852 --- a/drivers/macintosh/therm_adt746x.c
62853 +++ b/drivers/macintosh/therm_adt746x.c
62854 @@ -553,6 +553,7 @@
62855         struct device_node* np;
62856         const u32 *prop;
62857         int i = 0, offset = 0;
62858 +       int err;
62859         
62860         np = of_find_node_by_name(NULL, "fan");
62861         if (!np)
62862 @@ -612,17 +613,20 @@
62863                 return -ENODEV;
62864         }
62865         
62866 -       device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
62867 -       device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
62868 -       device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
62869 -       device_create_file(&of_dev->dev, &dev_attr_sensor2_limit);
62870 -       device_create_file(&of_dev->dev, &dev_attr_sensor1_location);
62871 -       device_create_file(&of_dev->dev, &dev_attr_sensor2_location);
62872 -       device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
62873 -       device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
62874 -       device_create_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);
62875 +       err = device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
62876 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
62877 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);
62878 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_limit);
62879 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_location);
62880 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_location);
62881 +       err |= device_create_file(&of_dev->dev, &dev_attr_limit_adjust);
62882 +       err |= device_create_file(&of_dev->dev, &dev_attr_specified_fan_speed);
62883 +       err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_fan_speed);
62884         if(therm_type == ADT7460)
62885 -               device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);
62886 +               err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_fan_speed);
62887 +       if (err)
62888 +               printk(KERN_WARNING
62889 +                       "Failed to create tempertaure attribute file(s).\n");
62890  
62891  #ifndef CONFIG_I2C_POWERMAC
62892         request_module("i2c-powermac");
62893 --- a/drivers/macintosh/therm_pm72.c
62894 +++ b/drivers/macintosh/therm_pm72.c
62895 @@ -121,6 +121,7 @@
62896  #include <linux/reboot.h>
62897  #include <linux/kmod.h>
62898  #include <linux/i2c.h>
62899 +#include <linux/kthread.h>
62900  #include <asm/prom.h>
62901  #include <asm/machdep.h>
62902  #include <asm/io.h>
62903 @@ -161,7 +162,7 @@
62904  static int                             state;
62905  static int                             cpu_count;
62906  static int                             cpu_pid_type;
62907 -static pid_t                           ctrl_task;
62908 +static struct task_struct              *ctrl_task;
62909  static struct completion               ctrl_complete;
62910  static int                             critical_state;
62911  static int                             rackmac;
62912 @@ -1156,6 +1157,8 @@
62913   */
62914  static int init_cpu_state(struct cpu_pid_state *state, int index)
62915  {
62916 +       int err;
62917 +
62918         state->index = index;
62919         state->first = 1;
62920         state->rpm = (cpu_pid_type == CPU_PID_TYPE_RACKMAC) ? 4000 : 1000;
62921 @@ -1181,18 +1184,21 @@
62922         DBG("CPU %d Using %d power history entries\n", index, state->count_power);
62923  
62924         if (index == 0) {
62925 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_temperature);
62926 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_voltage);
62927 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_current);
62928 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm);
62929 -               device_create_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm);
62930 +               err = device_create_file(&of_dev->dev, &dev_attr_cpu0_temperature);
62931 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_voltage);
62932 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_current);
62933 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_exhaust_fan_rpm);
62934 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu0_intake_fan_rpm);
62935         } else {
62936 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_temperature);
62937 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_voltage);
62938 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_current);
62939 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm);
62940 -               device_create_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm);
62941 -       }
62942 +               err = device_create_file(&of_dev->dev, &dev_attr_cpu1_temperature);
62943 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_voltage);
62944 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_current);
62945 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_exhaust_fan_rpm);
62946 +               err |= device_create_file(&of_dev->dev, &dev_attr_cpu1_intake_fan_rpm);
62947 +       }
62948 +       if (err)
62949 +               printk(KERN_WARNING "Failed to create some of the atribute"
62950 +                       "files for CPU %d\n", index);
62951  
62952         return 0;
62953   fail:
62954 @@ -1328,6 +1334,7 @@
62955  {
62956         struct device_node *u3;
62957         int u3h = 1; /* conservative by default */
62958 +       int err;
62959  
62960         /*
62961          * There are different PID params for machines with U3 and machines
62962 @@ -1379,8 +1386,11 @@
62963         if (state->monitor == NULL)
62964                 return -ENODEV;
62965  
62966 -       device_create_file(&of_dev->dev, &dev_attr_backside_temperature);
62967 -       device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm);
62968 +       err = device_create_file(&of_dev->dev, &dev_attr_backside_temperature);
62969 +       err |= device_create_file(&of_dev->dev, &dev_attr_backside_fan_pwm);
62970 +       if (err)
62971 +               printk(KERN_WARNING "Failed to create attribute file(s)"
62972 +                       " for backside fan\n");
62973  
62974         return 0;
62975  }
62976 @@ -1491,6 +1501,8 @@
62977   */
62978  static int init_drives_state(struct drives_pid_state *state)
62979  {
62980 +       int err;
62981 +
62982         state->ticks = 1;
62983         state->first = 1;
62984         state->rpm = 1000;
62985 @@ -1499,8 +1511,11 @@
62986         if (state->monitor == NULL)
62987                 return -ENODEV;
62988  
62989 -       device_create_file(&of_dev->dev, &dev_attr_drives_temperature);
62990 -       device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm);
62991 +       err = device_create_file(&of_dev->dev, &dev_attr_drives_temperature);
62992 +       err |= device_create_file(&of_dev->dev, &dev_attr_drives_fan_rpm);
62993 +       if (err)
62994 +               printk(KERN_WARNING "Failed to create attribute file(s)"
62995 +                       " for drives bay fan\n");
62996  
62997         return 0;
62998  }
62999 @@ -1621,7 +1636,9 @@
63000         if (state->monitor == NULL)
63001                 return -ENODEV;
63002  
63003 -               device_create_file(&of_dev->dev, &dev_attr_dimms_temperature);
63004 +       if (device_create_file(&of_dev->dev, &dev_attr_dimms_temperature))
63005 +               printk(KERN_WARNING "Failed to create attribute file"
63006 +                       " for DIMM temperature\n");
63007  
63008         return 0;
63009  }
63010 @@ -1731,6 +1748,8 @@
63011   */
63012  static int init_slots_state(struct slots_pid_state *state)
63013  {
63014 +       int err;
63015 +
63016         state->ticks = 1;
63017         state->first = 1;
63018         state->pwm = 50;
63019 @@ -1739,8 +1758,11 @@
63020         if (state->monitor == NULL)
63021                 return -ENODEV;
63022  
63023 -       device_create_file(&of_dev->dev, &dev_attr_slots_temperature);
63024 -       device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
63025 +       err = device_create_file(&of_dev->dev, &dev_attr_slots_temperature);
63026 +       err |= device_create_file(&of_dev->dev, &dev_attr_slots_fan_pwm);
63027 +       if (err)
63028 +               printk(KERN_WARNING "Failed to create attribute file(s)"
63029 +                       " for slots bay fan\n");
63030  
63031         return 0;
63032  }
63033 @@ -1779,8 +1801,6 @@
63034   */
63035  static int main_control_loop(void *x)
63036  {
63037 -       daemonize("kfand");
63038 -
63039         DBG("main_control_loop started\n");
63040  
63041         down(&driver_lock);
63042 @@ -1956,7 +1976,7 @@
63043  {
63044         init_completion(&ctrl_complete);
63045  
63046 -       ctrl_task = kernel_thread(main_control_loop, NULL, SIGCHLD | CLONE_KERNEL);
63047 +       ctrl_task = kthread_run(main_control_loop, NULL, "kfand");
63048  }
63049  
63050  /*
63051 @@ -1964,7 +1984,7 @@
63052   */
63053  static void stop_control_loops(void)
63054  {
63055 -       if (ctrl_task != 0)
63056 +       if (ctrl_task)
63057                 wait_for_completion(&ctrl_complete);
63058  }
63059  
63060 --- a/drivers/macintosh/therm_windtunnel.c
63061 +++ b/drivers/macintosh/therm_windtunnel.c
63062 @@ -36,6 +36,7 @@
63063  #include <linux/i2c.h>
63064  #include <linux/slab.h>
63065  #include <linux/init.h>
63066 +#include <linux/kthread.h>
63067  
63068  #include <asm/prom.h>
63069  #include <asm/machdep.h>
63070 @@ -61,8 +62,7 @@
63071  
63072  static struct {
63073         volatile int            running;
63074 -       struct completion       completion;
63075 -       pid_t                   poll_task;
63076 +       struct task_struct      *poll_task;
63077         
63078         struct semaphore        lock;
63079         struct of_device        *of_dev;
63080 @@ -223,6 +223,7 @@
63081  setup_hardware( void )
63082  {
63083         int val;
63084 +       int err;
63085  
63086         /* save registers (if we unload the module) */
63087         x.r0 = read_reg( x.fan, 0x00, 1 );
63088 @@ -265,8 +266,11 @@
63089         x.upind = -1;
63090         /* tune_fan( fan_up_table[x.upind].fan_setting ); */
63091  
63092 -       device_create_file( &x.of_dev->dev, &dev_attr_cpu_temperature );
63093 -       device_create_file( &x.of_dev->dev, &dev_attr_case_temperature );
63094 +       err = device_create_file( &x.of_dev->dev, &dev_attr_cpu_temperature );
63095 +       err |= device_create_file( &x.of_dev->dev, &dev_attr_case_temperature );
63096 +       if (err)
63097 +               printk(KERN_WARNING
63098 +                       "Failed to create temperature attribute file(s).\n");
63099  }
63100  
63101  static void
63102 @@ -282,27 +286,27 @@
63103         write_reg( x.fan, 0x00, x.r0, 1 );
63104  }
63105  
63106 -static int
63107 -control_loop( void *dummy )
63108 +static int control_loop(void *dummy)
63109  {
63110 -       daemonize("g4fand");
63111 -
63112 -       down( &x.lock );
63113 +       down(&x.lock);
63114         setup_hardware();
63115 +       up(&x.lock);
63116  
63117 -       while( x.running ) {
63118 -               up( &x.lock );
63119 -
63120 +       for (;;) {
63121                 msleep_interruptible(8000);
63122 -               
63123 -               down( &x.lock );
63124 +               if (kthread_should_stop())
63125 +                       break;
63126 +
63127 +               down(&x.lock);
63128                 poll_temp();
63129 +               up(&x.lock);
63130         }
63131  
63132 +       down(&x.lock);
63133         restore_regs();
63134 -       up( &x.lock );
63135 +       up(&x.lock);
63136  
63137 -       complete_and_exit( &x.completion, 0 );
63138 +       return 0;
63139  }
63140  
63141  
63142 @@ -322,8 +326,7 @@
63143                 ret = i2c_probe( adapter, &addr_data, &do_probe );
63144                 if( x.thermostat && x.fan ) {
63145                         x.running = 1;
63146 -                       init_completion( &x.completion );
63147 -                       x.poll_task = kernel_thread( control_loop, NULL, SIGCHLD | CLONE_KERNEL );
63148 +                       x.poll_task = kthread_run(control_loop, NULL, "g4fand");
63149                 }
63150         }
63151         return ret;
63152 @@ -339,7 +342,8 @@
63153         else {
63154                 if( x.running ) {
63155                         x.running = 0;
63156 -                       wait_for_completion( &x.completion );
63157 +                       kthread_stop(x.poll_task);
63158 +                       x.poll_task = NULL;
63159                 }
63160                 if( client == x.thermostat )
63161                         x.thermostat = NULL;
63162 --- a/drivers/macintosh/via-pmu-backlight.c
63163 +++ b/drivers/macintosh/via-pmu-backlight.c
63164 @@ -22,7 +22,7 @@
63165  
63166  static void pmu_backlight_init_curve(u8 off, u8 min, u8 max)
63167  {
63168 -       unsigned int i, flat, count, range = (max - min);
63169 +       int i, flat, count, range = (max - min);
63170  
63171         bl_curve[0] = off;
63172  
63173 @@ -68,17 +68,11 @@
63174         return pmulevel;
63175  }
63176  
63177 -static int pmu_backlight_update_status(struct backlight_device *bd)
63178 +static int __pmu_backlight_update_status(struct backlight_device *bd)
63179  {
63180         struct adb_request req;
63181 -       unsigned long flags;
63182         int level = bd->props.brightness;
63183  
63184 -       spin_lock_irqsave(&pmu_backlight_lock, flags);
63185 -
63186 -       /* Don't update brightness when sleeping */
63187 -       if (sleeping)
63188 -               goto out;
63189  
63190         if (bd->props.power != FB_BLANK_UNBLANK ||
63191             bd->props.fb_blank != FB_BLANK_UNBLANK)
63192 @@ -99,12 +93,23 @@
63193                 pmu_wait_complete(&req);
63194         }
63195  
63196 -out:
63197 -       spin_unlock_irqrestore(&pmu_backlight_lock, flags);
63198 -
63199         return 0;
63200  }
63201  
63202 +static int pmu_backlight_update_status(struct backlight_device *bd)
63203 +{
63204 +       unsigned long flags;
63205 +       int rc = 0;
63206 +
63207 +       spin_lock_irqsave(&pmu_backlight_lock, flags);
63208 +       /* Don't update brightness when sleeping */
63209 +       if (!sleeping)
63210 +               rc = __pmu_backlight_update_status(bd);
63211 +       spin_unlock_irqrestore(&pmu_backlight_lock, flags);
63212 +       return rc;
63213 +}
63214 +
63215 +
63216  static int pmu_backlight_get_brightness(struct backlight_device *bd)
63217  {
63218         return bd->props.brightness;
63219 @@ -123,6 +128,16 @@
63220  
63221         spin_lock_irqsave(&pmu_backlight_lock, flags);
63222         sleeping = sleep;
63223 +       if (pmac_backlight) {
63224 +               if (sleep) {
63225 +                       struct adb_request req;
63226 +
63227 +                       pmu_request(&req, NULL, 2, PMU_POWER_CTRL,
63228 +                                   PMU_POW_BACKLIGHT | PMU_POW_OFF);
63229 +                       pmu_wait_complete(&req);
63230 +               } else
63231 +                       __pmu_backlight_update_status(pmac_backlight);
63232 +       }
63233         spin_unlock_irqrestore(&pmu_backlight_lock, flags);
63234  }
63235  #endif /* CONFIG_PM */
63236 @@ -148,8 +163,8 @@
63237  
63238         bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data);
63239         if (IS_ERR(bd)) {
63240 -               printk("pmubl: Backlight registration failed\n");
63241 -               goto error;
63242 +               printk(KERN_ERR "PMU Backlight registration failed\n");
63243 +               return;
63244         }
63245         bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
63246         pmu_backlight_init_curve(0x7F, 0x46, 0x0E);
63247 @@ -171,10 +186,5 @@
63248         bd->props.power = FB_BLANK_UNBLANK;
63249         backlight_update_status(bd);
63250  
63251 -       printk("pmubl: Backlight initialized (%s)\n", name);
63252 -
63253 -       return;
63254 -
63255 -error:
63256 -       return;
63257 +       printk(KERN_INFO "PMU Backlight initialized (%s)\n", name);
63258  }
63259 --- a/drivers/macintosh/via-pmu.c
63260 +++ b/drivers/macintosh/via-pmu.c
63261 @@ -10,13 +10,11 @@
63262   *
63263   * Copyright (C) 1998 Paul Mackerras and Fabio Riccardi.
63264   * Copyright (C) 2001-2002 Benjamin Herrenschmidt
63265 + * Copyright (C) 2006-2007 Johannes Berg
63266   *
63267   * THIS DRIVER IS BECOMING A TOTAL MESS !
63268   *  - Cleanup atomically disabling reply to PMU events after
63269   *    a sleep or a freq. switch
63270 - *  - Move sleep code out of here to pmac_pm, merge into new
63271 - *    common PM infrastructure
63272 - *  - Save/Restore PCI space properly
63273   *
63274   */
63275  #include <stdarg.h>
63276 @@ -33,7 +31,6 @@
63277  #include <linux/adb.h>
63278  #include <linux/pmu.h>
63279  #include <linux/cuda.h>
63280 -#include <linux/smp_lock.h>
63281  #include <linux/module.h>
63282  #include <linux/spinlock.h>
63283  #include <linux/pm.h>
63284 @@ -65,9 +62,7 @@
63285  #include "via-pmu-event.h"
63286  
63287  /* Some compile options */
63288 -#undef SUSPEND_USES_PMU
63289 -#define DEBUG_SLEEP
63290 -#undef HACKED_PCI_SAVE
63291 +#undef DEBUG_SLEEP
63292  
63293  /* Misc minor number allocated for /dev/pmu */
63294  #define PMU_MINOR              154
63295 @@ -152,12 +147,9 @@
63296  static u8 pmu_intr_mask;
63297  static int pmu_version;
63298  static int drop_interrupts;
63299 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
63300 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
63301  static int option_lid_wakeup = 1;
63302 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
63303 -#if (defined(CONFIG_PM_SLEEP)&&defined(CONFIG_PPC32))||defined(CONFIG_PMAC_BACKLIGHT_LEGACY)
63304 -static int sleep_in_progress;
63305 -#endif
63306 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
63307  static unsigned long async_req_locks;
63308  static unsigned int pmu_irq_stats[11];
63309  
63310 @@ -177,7 +169,6 @@
63311  
63312  int __fake_sleep;
63313  int asleep;
63314 -BLOCKING_NOTIFIER_HEAD(sleep_notifier_list);
63315  
63316  #ifdef CONFIG_ADB
63317  static int adb_dev_map;
63318 @@ -224,7 +215,7 @@
63319  
63320  #ifdef DEBUG_SLEEP
63321  int pmu_polled_request(struct adb_request *req);
63322 -int pmu_wink(struct adb_request *req);
63323 +void pmu_blink(int n);
63324  #endif
63325  
63326  /*
63327 @@ -875,7 +866,7 @@
63328  {
63329         char *p = page;
63330  
63331 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
63332 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
63333         if (pmu_kind == PMU_KEYLARGO_BASED &&
63334             pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
63335                 p += sprintf(p, "lid_wakeup=%d\n", option_lid_wakeup);
63336 @@ -916,7 +907,7 @@
63337         *(val++) = 0;
63338         while(*val == ' ')
63339                 val++;
63340 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
63341 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
63342         if (pmu_kind == PMU_KEYLARGO_BASED &&
63343             pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) >= 0)
63344                 if (!strcmp(label, "lid_wakeup"))
63345 @@ -1256,9 +1247,7 @@
63346  pmu_suspend(void)
63347  {
63348         unsigned long flags;
63349 -#ifdef SUSPEND_USES_PMU
63350 -       struct adb_request *req;
63351 -#endif
63352 +
63353         if (!via)
63354                 return;
63355         
63356 @@ -1276,17 +1265,10 @@
63357                 via_pmu_interrupt(0, NULL);
63358                 spin_lock_irqsave(&pmu_lock, flags);
63359                 if (!adb_int_pending && pmu_state == idle && !req_awaiting_reply) {
63360 -#ifdef SUSPEND_USES_PMU
63361 -                       pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0);
63362 -                       spin_unlock_irqrestore(&pmu_lock, flags);
63363 -                       while(!req.complete)
63364 -                               pmu_poll();
63365 -#else /* SUSPEND_USES_PMU */
63366                         if (gpio_irq >= 0)
63367                                 disable_irq_nosync(gpio_irq);
63368                         out_8(&via[IER], CB1_INT | IER_CLR);
63369                         spin_unlock_irqrestore(&pmu_lock, flags);
63370 -#endif /* SUSPEND_USES_PMU */
63371                         break;
63372                 }
63373         } while (1);
63374 @@ -1307,18 +1289,11 @@
63375                 return;
63376         }
63377         adb_int_pending = 1;
63378 -#ifdef SUSPEND_USES_PMU
63379 -       pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, pmu_intr_mask);
63380 -       spin_unlock_irqrestore(&pmu_lock, flags);
63381 -       while(!req.complete)
63382 -               pmu_poll();
63383 -#else /* SUSPEND_USES_PMU */
63384         if (gpio_irq >= 0)
63385                 enable_irq(gpio_irq);
63386         out_8(&via[IER], CB1_INT | IER_SET);
63387         spin_unlock_irqrestore(&pmu_lock, flags);
63388         pmu_poll();
63389 -#endif /* SUSPEND_USES_PMU */
63390  }
63391  
63392  /* Interrupt data could be the result data from an ADB cmd */
63393 @@ -1738,228 +1713,7 @@
63394         return via != 0;
63395  }
63396  
63397 -#ifdef CONFIG_PM_SLEEP
63398 -
63399 -static LIST_HEAD(sleep_notifiers);
63400 -
63401 -int
63402 -pmu_register_sleep_notifier(struct pmu_sleep_notifier *n)
63403 -{
63404 -       struct list_head *list;
63405 -       struct pmu_sleep_notifier *notifier;
63406 -
63407 -       for (list = sleep_notifiers.next; list != &sleep_notifiers;
63408 -            list = list->next) {
63409 -               notifier = list_entry(list, struct pmu_sleep_notifier, list);
63410 -               if (n->priority > notifier->priority)
63411 -                       break;
63412 -       }
63413 -       __list_add(&n->list, list->prev, list);
63414 -       return 0;
63415 -}
63416 -EXPORT_SYMBOL(pmu_register_sleep_notifier);
63417 -
63418 -int
63419 -pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* n)
63420 -{
63421 -       if (n->list.next == 0)
63422 -               return -ENOENT;
63423 -       list_del(&n->list);
63424 -       n->list.next = NULL;
63425 -       return 0;
63426 -}
63427 -EXPORT_SYMBOL(pmu_unregister_sleep_notifier);
63428 -#endif /* CONFIG_PM_SLEEP */
63429 -
63430 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
63431 -
63432 -/* Sleep is broadcast last-to-first */
63433 -static void broadcast_sleep(int when)
63434 -{
63435 -       struct list_head *list;
63436 -       struct pmu_sleep_notifier *notifier;
63437 -
63438 -       for (list = sleep_notifiers.prev; list != &sleep_notifiers;
63439 -            list = list->prev) {
63440 -               notifier = list_entry(list, struct pmu_sleep_notifier, list);
63441 -               notifier->notifier_call(notifier, when);
63442 -       }
63443 -}
63444 -
63445 -/* Wake is broadcast first-to-last */
63446 -static void broadcast_wake(void)
63447 -{
63448 -       struct list_head *list;
63449 -       struct pmu_sleep_notifier *notifier;
63450 -
63451 -       for (list = sleep_notifiers.next; list != &sleep_notifiers;
63452 -            list = list->next) {
63453 -               notifier = list_entry(list, struct pmu_sleep_notifier, list);
63454 -               notifier->notifier_call(notifier, PBOOK_WAKE);
63455 -       }
63456 -}
63457 -
63458 -/*
63459 - * This struct is used to store config register values for
63460 - * PCI devices which may get powered off when we sleep.
63461 - */
63462 -static struct pci_save {
63463 -#ifndef HACKED_PCI_SAVE
63464 -       u16     command;
63465 -       u16     cache_lat;
63466 -       u16     intr;
63467 -       u32     rom_address;
63468 -#else
63469 -       u32     config[16];
63470 -#endif 
63471 -} *pbook_pci_saves;
63472 -static int pbook_npci_saves;
63473 -
63474 -static void
63475 -pbook_alloc_pci_save(void)
63476 -{
63477 -       int npci;
63478 -       struct pci_dev *pd = NULL;
63479 -
63480 -       npci = 0;
63481 -       while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
63482 -               ++npci;
63483 -       }
63484 -       if (npci == 0)
63485 -               return;
63486 -       pbook_pci_saves = (struct pci_save *)
63487 -               kmalloc(npci * sizeof(struct pci_save), GFP_KERNEL);
63488 -       pbook_npci_saves = npci;
63489 -}
63490 -
63491 -static void
63492 -pbook_free_pci_save(void)
63493 -{
63494 -       if (pbook_pci_saves == NULL)
63495 -               return;
63496 -       kfree(pbook_pci_saves);
63497 -       pbook_pci_saves = NULL;
63498 -       pbook_npci_saves = 0;
63499 -}
63500 -
63501 -static void
63502 -pbook_pci_save(void)
63503 -{
63504 -       struct pci_save *ps = pbook_pci_saves;
63505 -       struct pci_dev *pd = NULL;
63506 -       int npci = pbook_npci_saves;
63507 -       
63508 -       if (ps == NULL)
63509 -               return;
63510 -
63511 -       while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
63512 -               if (npci-- == 0) {
63513 -                       pci_dev_put(pd);
63514 -                       return;
63515 -               }
63516 -#ifndef HACKED_PCI_SAVE
63517 -               pci_read_config_word(pd, PCI_COMMAND, &ps->command);
63518 -               pci_read_config_word(pd, PCI_CACHE_LINE_SIZE, &ps->cache_lat);
63519 -               pci_read_config_word(pd, PCI_INTERRUPT_LINE, &ps->intr);
63520 -               pci_read_config_dword(pd, PCI_ROM_ADDRESS, &ps->rom_address);
63521 -#else
63522 -               int i;
63523 -               for (i=1;i<16;i++)
63524 -                       pci_read_config_dword(pd, i<<4, &ps->config[i]);
63525 -#endif
63526 -               ++ps;
63527 -       }
63528 -}
63529 -
63530 -/* For this to work, we must take care of a few things: If gmac was enabled
63531 - * during boot, it will be in the pci dev list. If it's disabled at this point
63532 - * (and it will probably be), then you can't access it's config space.
63533 - */
63534 -static void
63535 -pbook_pci_restore(void)
63536 -{
63537 -       u16 cmd;
63538 -       struct pci_save *ps = pbook_pci_saves - 1;
63539 -       struct pci_dev *pd = NULL;
63540 -       int npci = pbook_npci_saves;
63541 -       int j;
63542 -
63543 -       while ((pd = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pd)) != NULL) {
63544 -#ifdef HACKED_PCI_SAVE
63545 -               int i;
63546 -               if (npci-- == 0) {
63547 -                       pci_dev_put(pd);
63548 -                       return;
63549 -               }
63550 -               ps++;
63551 -               for (i=2;i<16;i++)
63552 -                       pci_write_config_dword(pd, i<<4, ps->config[i]);
63553 -               pci_write_config_dword(pd, 4, ps->config[1]);
63554 -#else
63555 -               if (npci-- == 0)
63556 -                       return;
63557 -               ps++;
63558 -               if (ps->command == 0)
63559 -                       continue;
63560 -               pci_read_config_word(pd, PCI_COMMAND, &cmd);
63561 -               if ((ps->command & ~cmd) == 0)
63562 -                       continue;
63563 -               switch (pd->hdr_type) {
63564 -               case PCI_HEADER_TYPE_NORMAL:
63565 -                       for (j = 0; j < 6; ++j)
63566 -                               pci_write_config_dword(pd,
63567 -                                       PCI_BASE_ADDRESS_0 + j*4,
63568 -                                       pd->resource[j].start);
63569 -                       pci_write_config_dword(pd, PCI_ROM_ADDRESS,
63570 -                               ps->rom_address);
63571 -                       pci_write_config_word(pd, PCI_CACHE_LINE_SIZE,
63572 -                               ps->cache_lat);
63573 -                       pci_write_config_word(pd, PCI_INTERRUPT_LINE,
63574 -                               ps->intr);
63575 -                       pci_write_config_word(pd, PCI_COMMAND, ps->command);
63576 -                       break;
63577 -               }
63578 -#endif 
63579 -       }
63580 -}
63581 -
63582 -#ifdef DEBUG_SLEEP
63583 -/* N.B. This doesn't work on the 3400 */
63584 -void 
63585 -pmu_blink(int n)
63586 -{
63587 -       struct adb_request req;
63588 -
63589 -       memset(&req, 0, sizeof(req));
63590 -
63591 -       for (; n > 0; --n) {
63592 -               req.nbytes = 4;
63593 -               req.done = NULL;
63594 -               req.data[0] = 0xee;
63595 -               req.data[1] = 4;
63596 -               req.data[2] = 0;
63597 -               req.data[3] = 1;
63598 -               req.reply[0] = ADB_RET_OK;
63599 -               req.reply_len = 1;
63600 -               req.reply_expected = 0;
63601 -               pmu_polled_request(&req);
63602 -               mdelay(50);
63603 -               req.nbytes = 4;
63604 -               req.done = NULL;
63605 -               req.data[0] = 0xee;
63606 -               req.data[1] = 4;
63607 -               req.data[2] = 0;
63608 -               req.data[3] = 0;
63609 -               req.reply[0] = ADB_RET_OK;
63610 -               req.reply_len = 1;
63611 -               req.reply_expected = 0;
63612 -               pmu_polled_request(&req);
63613 -               mdelay(50);
63614 -       }
63615 -       mdelay(50);
63616 -}
63617 -#endif
63618 -
63619 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
63620  /*
63621   * Put the powerbook to sleep.
63622   */
63623 @@ -1994,134 +1748,6 @@
63624         out_8(&via[IER], IER_SET | SR_INT | CB1_INT);
63625  }
63626  
63627 -extern void pmu_backlight_set_sleep(int sleep);
63628 -
63629 -static int
63630 -pmac_suspend_devices(void)
63631 -{
63632 -       int ret;
63633 -
63634 -       pm_prepare_console();
63635 -       
63636 -       /* Notify old-style device drivers */
63637 -       broadcast_sleep(PBOOK_SLEEP_REQUEST);
63638 -
63639 -       /* Sync the disks. */
63640 -       /* XXX It would be nice to have some way to ensure that
63641 -        * nobody is dirtying any new buffers while we wait. That
63642 -        * could be achieved using the refrigerator for processes
63643 -        * that swsusp uses
63644 -        */
63645 -       sys_sync();
63646 -
63647 -       broadcast_sleep(PBOOK_SLEEP_NOW);
63648 -
63649 -       /* Send suspend call to devices, hold the device core's dpm_sem */
63650 -       ret = device_suspend(PMSG_SUSPEND);
63651 -       if (ret) {
63652 -               broadcast_wake();
63653 -               printk(KERN_ERR "Driver sleep failed\n");
63654 -               return -EBUSY;
63655 -       }
63656 -
63657 -#ifdef CONFIG_PMAC_BACKLIGHT
63658 -       /* Tell backlight code not to muck around with the chip anymore */
63659 -       pmu_backlight_set_sleep(1);
63660 -#endif
63661 -
63662 -       /* Call platform functions marked "on sleep" */
63663 -       pmac_pfunc_i2c_suspend();
63664 -       pmac_pfunc_base_suspend();
63665 -
63666 -       /* Stop preemption */
63667 -       preempt_disable();
63668 -
63669 -       /* Make sure the decrementer won't interrupt us */
63670 -       asm volatile("mtdec %0" : : "r" (0x7fffffff));
63671 -       /* Make sure any pending DEC interrupt occurring while we did
63672 -        * the above didn't re-enable the DEC */
63673 -       mb();
63674 -       asm volatile("mtdec %0" : : "r" (0x7fffffff));
63675 -
63676 -       /* We can now disable MSR_EE. This code of course works properly only
63677 -        * on UP machines... For SMP, if we ever implement sleep, we'll have to
63678 -        * stop the "other" CPUs way before we do all that stuff.
63679 -        */
63680 -       local_irq_disable();
63681 -
63682 -       /* Broadcast power down irq
63683 -        * This isn't that useful in most cases (only directly wired devices can
63684 -        * use this but still... This will take care of sysdev's as well, so
63685 -        * we exit from here with local irqs disabled and PIC off.
63686 -        */
63687 -       ret = device_power_down(PMSG_SUSPEND);
63688 -       if (ret) {
63689 -               wakeup_decrementer();
63690 -               local_irq_enable();
63691 -               preempt_enable();
63692 -               device_resume();
63693 -               broadcast_wake();
63694 -               printk(KERN_ERR "Driver powerdown failed\n");
63695 -               return -EBUSY;
63696 -       }
63697 -
63698 -       /* Wait for completion of async requests */
63699 -       while (!batt_req.complete)
63700 -               pmu_poll();
63701 -
63702 -       /* Giveup the lazy FPU & vec so we don't have to back them
63703 -        * up from the low level code
63704 -        */
63705 -       enable_kernel_fp();
63706 -
63707 -#ifdef CONFIG_ALTIVEC
63708 -       if (cpu_has_feature(CPU_FTR_ALTIVEC))
63709 -               enable_kernel_altivec();
63710 -#endif /* CONFIG_ALTIVEC */
63711 -
63712 -       return 0;
63713 -}
63714 -
63715 -static int
63716 -pmac_wakeup_devices(void)
63717 -{
63718 -       mdelay(100);
63719 -
63720 -#ifdef CONFIG_PMAC_BACKLIGHT
63721 -       /* Tell backlight code it can use the chip again */
63722 -       pmu_backlight_set_sleep(0);
63723 -#endif
63724 -
63725 -       /* Power back up system devices (including the PIC) */
63726 -       device_power_up();
63727 -
63728 -       /* Force a poll of ADB interrupts */
63729 -       adb_int_pending = 1;
63730 -       via_pmu_interrupt(0, NULL);
63731 -
63732 -       /* Restart jiffies & scheduling */
63733 -       wakeup_decrementer();
63734 -
63735 -       /* Re-enable local CPU interrupts */
63736 -       local_irq_enable();
63737 -       mdelay(10);
63738 -       preempt_enable();
63739 -
63740 -       /* Call platform functions marked "on wake" */
63741 -       pmac_pfunc_base_resume();
63742 -       pmac_pfunc_i2c_resume();
63743 -
63744 -       /* Resume devices */
63745 -       device_resume();
63746 -
63747 -       /* Notify old style drivers */
63748 -       broadcast_wake();
63749 -
63750 -       pm_restore_console();
63751 -
63752 -       return 0;
63753 -}
63754 -
63755  #define        GRACKLE_PM      (1<<7)
63756  #define GRACKLE_DOZE   (1<<5)
63757  #define        GRACKLE_NAP     (1<<4)
63758 @@ -2132,19 +1758,12 @@
63759         unsigned long save_l2cr;
63760         unsigned short pmcr1;
63761         struct adb_request req;
63762 -       int ret;
63763         struct pci_dev *grackle;
63764  
63765         grackle = pci_get_bus_and_slot(0, 0);
63766         if (!grackle)
63767                 return -ENODEV;
63768  
63769 -       ret = pmac_suspend_devices();
63770 -       if (ret) {
63771 -               printk(KERN_ERR "Sleep rejected by devices\n");
63772 -               return ret;
63773 -       }
63774 -       
63775         /* Turn off various things. Darwin does some retry tests here... */
63776         pmu_request(&req, NULL, 2, PMU_POWER_CTRL0, PMU_POW0_OFF|PMU_POW0_HARD_DRIVE);
63777         pmu_wait_complete(&req);
63778 @@ -2207,8 +1826,6 @@
63779                         PMU_POW_ON|PMU_POW_BACKLIGHT|PMU_POW_CHARGER|PMU_POW_IRLED|PMU_POW_MEDIABAY);
63780         pmu_wait_complete(&req);
63781  
63782 -       pmac_wakeup_devices();
63783 -
63784         return 0;
63785  }
63786  
63787 @@ -2218,7 +1835,6 @@
63788         unsigned long save_l2cr;
63789         unsigned long save_l3cr;
63790         struct adb_request req;
63791 -       int ret;
63792         
63793         if (pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) < 0) {
63794                 printk(KERN_ERR "Sleep mode not supported on this machine\n");
63795 @@ -2228,12 +1844,6 @@
63796         if (num_online_cpus() > 1 || cpu_is_offline(0))
63797                 return -EAGAIN;
63798  
63799 -       ret = pmac_suspend_devices();
63800 -       if (ret) {
63801 -               printk(KERN_ERR "Sleep rejected by devices\n");
63802 -               return ret;
63803 -       }
63804 -
63805         /* Stop environment and ADB interrupts */
63806         pmu_request(&req, NULL, 2, PMU_SET_INTR_MASK, 0);
63807         pmu_wait_complete(&req);
63808 @@ -2304,45 +1914,33 @@
63809         /* Restore LPJ, cpufreq will adjust the cpu frequency */
63810         loops_per_jiffy /= 2;
63811  
63812 -       pmac_wakeup_devices();
63813 -
63814         return 0;
63815  }
63816  
63817  #define PB3400_MEM_CTRL                0xf8000000
63818  #define PB3400_MEM_CTRL_SLEEP  0x70
63819  
63820 -static int
63821 -powerbook_sleep_3400(void)
63822 +static void __iomem *pb3400_mem_ctrl;
63823 +
63824 +static void powerbook_sleep_init_3400(void)
63825  {
63826 -       int ret, i, x;
63827 +       /* map in the memory controller registers */
63828 +       pb3400_mem_ctrl = ioremap(PB3400_MEM_CTRL, 0x100);
63829 +       if (pb3400_mem_ctrl == NULL)
63830 +               printk(KERN_WARNING "ioremap failed: sleep won't be possible");
63831 +}
63832 +
63833 +static int powerbook_sleep_3400(void)
63834 +{
63835 +       int i, x;
63836         unsigned int hid0;
63837 -       unsigned long p;
63838 +       unsigned long msr;
63839         struct adb_request sleep_req;
63840 -       void __iomem *mem_ctrl;
63841         unsigned int __iomem *mem_ctrl_sleep;
63842  
63843 -       /* first map in the memory controller registers */
63844 -       mem_ctrl = ioremap(PB3400_MEM_CTRL, 0x100);
63845 -       if (mem_ctrl == NULL) {
63846 -               printk("powerbook_sleep_3400: ioremap failed\n");
63847 +       if (pb3400_mem_ctrl == NULL)
63848                 return -ENOMEM;
63849 -       }
63850 -       mem_ctrl_sleep = mem_ctrl + PB3400_MEM_CTRL_SLEEP;
63851 -
63852 -       /* Allocate room for PCI save */
63853 -       pbook_alloc_pci_save();
63854 -
63855 -       ret = pmac_suspend_devices();
63856 -       if (ret) {
63857 -               pbook_free_pci_save();
63858 -               iounmap(mem_ctrl);
63859 -               printk(KERN_ERR "Sleep rejected by devices\n");
63860 -               return ret;
63861 -       }
63862 -
63863 -       /* Save the state of PCI config space for some slots */
63864 -       pbook_pci_save();
63865 +       mem_ctrl_sleep = pb3400_mem_ctrl + PB3400_MEM_CTRL_SLEEP;
63866  
63867         /* Set the memory controller to keep the memory refreshed
63868            while we're asleep */
63869 @@ -2357,41 +1955,34 @@
63870  
63871         /* Ask the PMU to put us to sleep */
63872         pmu_request(&sleep_req, NULL, 5, PMU_SLEEP, 'M', 'A', 'T', 'T');
63873 -       while (!sleep_req.complete)
63874 -               mb();
63875 +       pmu_wait_complete(&sleep_req);
63876 +       pmu_unlock();
63877  
63878 -       pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,1);
63879 +       pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, 1);
63880  
63881 -       /* displacement-flush the L2 cache - necessary? */
63882 -       for (p = KERNELBASE; p < KERNELBASE + 0x100000; p += 0x1000)
63883 -               i = *(volatile int *)p;
63884         asleep = 1;
63885  
63886         /* Put the CPU into sleep mode */
63887         hid0 = mfspr(SPRN_HID0);
63888         hid0 = (hid0 & ~(HID0_NAP | HID0_DOZE)) | HID0_SLEEP;
63889         mtspr(SPRN_HID0, hid0);
63890 -       mtmsr(mfmsr() | MSR_POW | MSR_EE);
63891 -       udelay(10);
63892 +       local_irq_enable();
63893 +       msr = mfmsr() | MSR_POW;
63894 +       while (asleep) {
63895 +               mb();
63896 +               mtmsr(msr);
63897 +               isync();
63898 +       }
63899 +       local_irq_disable();
63900  
63901         /* OK, we're awake again, start restoring things */
63902         out_be32(mem_ctrl_sleep, 0x3f);
63903 -       pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,0);
63904 -       pbook_pci_restore();
63905 -       pmu_unlock();
63906 -
63907 -       /* wait for the PMU interrupt sequence to complete */
63908 -       while (asleep)
63909 -               mb();
63910 -
63911 -       pmac_wakeup_devices();
63912 -       pbook_free_pci_save();
63913 -       iounmap(mem_ctrl);
63914 +       pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, 0);
63915  
63916         return 0;
63917  }
63918  
63919 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
63920 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
63921  
63922  /*
63923   * Support for /dev/pmu device
63924 @@ -2548,7 +2139,6 @@
63925         struct pmu_private *pp = file->private_data;
63926         unsigned long flags;
63927  
63928 -       lock_kernel();
63929         if (pp != 0) {
63930                 file->private_data = NULL;
63931                 spin_lock_irqsave(&all_pvt_lock, flags);
63932 @@ -2562,10 +2152,96 @@
63933  
63934                 kfree(pp);
63935         }
63936 -       unlock_kernel();
63937         return 0;
63938  }
63939  
63940 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
63941 +static void pmac_suspend_disable_irqs(void)
63942 +{
63943 +       /* Call platform functions marked "on sleep" */
63944 +       pmac_pfunc_i2c_suspend();
63945 +       pmac_pfunc_base_suspend();
63946 +}
63947 +
63948 +static int powerbook_sleep(suspend_state_t state)
63949 +{
63950 +       int error = 0;
63951 +
63952 +       /* Wait for completion of async requests */
63953 +       while (!batt_req.complete)
63954 +               pmu_poll();
63955 +
63956 +       /* Giveup the lazy FPU & vec so we don't have to back them
63957 +        * up from the low level code
63958 +        */
63959 +       enable_kernel_fp();
63960 +
63961 +#ifdef CONFIG_ALTIVEC
63962 +       if (cpu_has_feature(CPU_FTR_ALTIVEC))
63963 +               enable_kernel_altivec();
63964 +#endif /* CONFIG_ALTIVEC */
63965 +
63966 +       switch (pmu_kind) {
63967 +       case PMU_OHARE_BASED:
63968 +               error = powerbook_sleep_3400();
63969 +               break;
63970 +       case PMU_HEATHROW_BASED:
63971 +       case PMU_PADDINGTON_BASED:
63972 +               error = powerbook_sleep_grackle();
63973 +               break;
63974 +       case PMU_KEYLARGO_BASED:
63975 +               error = powerbook_sleep_Core99();
63976 +               break;
63977 +       default:
63978 +               return -ENOSYS;
63979 +       }
63980 +
63981 +       if (error)
63982 +               return error;
63983 +
63984 +       mdelay(100);
63985 +
63986 +       return 0;
63987 +}
63988 +
63989 +static void pmac_suspend_enable_irqs(void)
63990 +{
63991 +       /* Force a poll of ADB interrupts */
63992 +       adb_int_pending = 1;
63993 +       via_pmu_interrupt(0, NULL);
63994 +
63995 +       mdelay(10);
63996 +
63997 +       /* Call platform functions marked "on wake" */
63998 +       pmac_pfunc_base_resume();
63999 +       pmac_pfunc_i2c_resume();
64000 +}
64001 +
64002 +static int pmu_sleep_valid(suspend_state_t state)
64003 +{
64004 +       return state == PM_SUSPEND_MEM
64005 +               && (pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, -1) >= 0);
64006 +}
64007 +
64008 +static struct platform_suspend_ops pmu_pm_ops = {
64009 +       .enter = powerbook_sleep,
64010 +       .valid = pmu_sleep_valid,
64011 +};
64012 +
64013 +static int register_pmu_pm_ops(void)
64014 +{
64015 +       if (pmu_kind == PMU_OHARE_BASED)
64016 +               powerbook_sleep_init_3400();
64017 +       ppc_md.suspend_disable_irqs = pmac_suspend_disable_irqs;
64018 +       ppc_md.suspend_enable_irqs = pmac_suspend_enable_irqs;
64019 +       suspend_set_ops(&pmu_pm_ops);
64020 +
64021 +       return 0;
64022 +}
64023 +
64024 +device_initcall(register_pmu_pm_ops);
64025 +#endif
64026 +
64027  static int
64028  pmu_ioctl(struct inode * inode, struct file *filp,
64029                      u_int cmd, u_long arg)
64030 @@ -2574,35 +2250,15 @@
64031         int error = -EINVAL;
64032  
64033         switch (cmd) {
64034 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64035         case PMU_IOC_SLEEP:
64036                 if (!capable(CAP_SYS_ADMIN))
64037                         return -EACCES;
64038 -               if (sleep_in_progress)
64039 -                       return -EBUSY;
64040 -               sleep_in_progress = 1;
64041 -               switch (pmu_kind) {
64042 -               case PMU_OHARE_BASED:
64043 -                       error = powerbook_sleep_3400();
64044 -                       break;
64045 -               case PMU_HEATHROW_BASED:
64046 -               case PMU_PADDINGTON_BASED:
64047 -                       error = powerbook_sleep_grackle();
64048 -                       break;
64049 -               case PMU_KEYLARGO_BASED:
64050 -                       error = powerbook_sleep_Core99();
64051 -                       break;
64052 -               default:
64053 -                       error = -ENOSYS;
64054 -               }
64055 -               sleep_in_progress = 0;
64056 -               break;
64057 +               return pm_suspend(PM_SUSPEND_MEM);
64058         case PMU_IOC_CAN_SLEEP:
64059 -               if (pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,-1) < 0)
64060 +               if (pmac_call_feature(PMAC_FTR_SLEEP_STATE, NULL, 0, -1) < 0)
64061                         return put_user(0, argp);
64062                 else
64063                         return put_user(1, argp);
64064 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64065  
64066  #ifdef CONFIG_PMAC_BACKLIGHT_LEGACY
64067         /* Compatibility ioctl's for backlight */
64068 @@ -2610,9 +2266,6 @@
64069         {
64070                 int brightness;
64071  
64072 -               if (sleep_in_progress)
64073 -                       return -EBUSY;
64074 -
64075                 brightness = pmac_backlight_get_legacy_brightness();
64076                 if (brightness < 0)
64077                         return brightness;
64078 @@ -2624,9 +2277,6 @@
64079         {
64080                 int brightness;
64081  
64082 -               if (sleep_in_progress)
64083 -                       return -EBUSY;
64084 -
64085                 error = get_user(brightness, argp);
64086                 if (error)
64087                         return error;
64088 @@ -2751,15 +2401,43 @@
64089         local_irq_restore(flags);
64090         return 0;
64091  }
64092 -#endif /* DEBUG_SLEEP */
64093  
64094 +/* N.B. This doesn't work on the 3400 */
64095 +void pmu_blink(int n)
64096 +{
64097 +       struct adb_request req;
64098  
64099 -/* FIXME: This is a temporary set of callbacks to enable us
64100 - * to do suspend-to-disk.
64101 - */
64102 +       memset(&req, 0, sizeof(req));
64103  
64104 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64105 +       for (; n > 0; --n) {
64106 +               req.nbytes = 4;
64107 +               req.done = NULL;
64108 +               req.data[0] = 0xee;
64109 +               req.data[1] = 4;
64110 +               req.data[2] = 0;
64111 +               req.data[3] = 1;
64112 +               req.reply[0] = ADB_RET_OK;
64113 +               req.reply_len = 1;
64114 +               req.reply_expected = 0;
64115 +               pmu_polled_request(&req);
64116 +               mdelay(50);
64117 +               req.nbytes = 4;
64118 +               req.done = NULL;
64119 +               req.data[0] = 0xee;
64120 +               req.data[1] = 4;
64121 +               req.data[2] = 0;
64122 +               req.data[3] = 0;
64123 +               req.reply[0] = ADB_RET_OK;
64124 +               req.reply_len = 1;
64125 +               req.reply_expected = 0;
64126 +               pmu_polled_request(&req);
64127 +               mdelay(50);
64128 +       }
64129 +       mdelay(50);
64130 +}
64131 +#endif /* DEBUG_SLEEP */
64132  
64133 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64134  int pmu_sys_suspended;
64135  
64136  static int pmu_sys_suspend(struct sys_device *sysdev, pm_message_t state)
64137 @@ -2767,10 +2445,15 @@
64138         if (state.event != PM_EVENT_SUSPEND || pmu_sys_suspended)
64139                 return 0;
64140  
64141 -       /* Suspend PMU event interrupts */
64142 +       /* Suspend PMU event interrupts */\
64143         pmu_suspend();
64144 -
64145         pmu_sys_suspended = 1;
64146 +
64147 +#ifdef CONFIG_PMAC_BACKLIGHT
64148 +       /* Tell backlight code not to muck around with the chip anymore */
64149 +       pmu_backlight_set_sleep(1);
64150 +#endif
64151 +
64152         return 0;
64153  }
64154  
64155 @@ -2785,15 +2468,18 @@
64156         pmu_request(&req, NULL, 2, PMU_SYSTEM_READY, 2);
64157         pmu_wait_complete(&req);
64158  
64159 +#ifdef CONFIG_PMAC_BACKLIGHT
64160 +       /* Tell backlight code it can use the chip again */
64161 +       pmu_backlight_set_sleep(0);
64162 +#endif
64163         /* Resume PMU event interrupts */
64164         pmu_resume();
64165 -
64166         pmu_sys_suspended = 0;
64167  
64168         return 0;
64169  }
64170  
64171 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64172 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
64173  
64174  static struct sysdev_class pmu_sysclass = {
64175         set_kset_name("pmu"),
64176 @@ -2804,10 +2490,10 @@
64177  };
64178  
64179  static struct sysdev_driver driver_pmu = {
64180 -#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PPC32)
64181 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64182         .suspend        = &pmu_sys_suspend,
64183         .resume         = &pmu_sys_resume,
64184 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64185 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
64186  };
64187  
64188  static int __init init_pmu_sysfs(void)
64189 @@ -2842,10 +2528,10 @@
64190  EXPORT_SYMBOL(pmu_suspend);
64191  EXPORT_SYMBOL(pmu_resume);
64192  EXPORT_SYMBOL(pmu_unlock);
64193 -#if defined(CONFIG_PPC32)
64194 +#if defined(CONFIG_SUSPEND) && defined(CONFIG_PPC32)
64195  EXPORT_SYMBOL(pmu_enable_irled);
64196  EXPORT_SYMBOL(pmu_battery_count);
64197  EXPORT_SYMBOL(pmu_batteries);
64198  EXPORT_SYMBOL(pmu_power_flags);
64199 -#endif /* CONFIG_PM_SLEEP && CONFIG_PPC32 */
64200 +#endif /* CONFIG_SUSPEND && CONFIG_PPC32 */
64201  
64202 --- a/drivers/net/fs_enet/fs_enet-main.c
64203 +++ b/drivers/net/fs_enet/fs_enet-main.c
64204 @@ -1178,8 +1178,15 @@
64205         struct device_node *phynode, *mdionode;
64206         struct resource res;
64207         int ret = 0, len;
64208 +       const u32 *data;
64209 +
64210 +       data  = of_get_property(np, "fixed-link", NULL);
64211 +       if (data) {
64212 +               snprintf(fpi->bus_id, 16, PHY_ID_FMT, 0, *data);
64213 +               return 0;
64214 +       }
64215  
64216 -       const u32 *data = of_get_property(np, "phy-handle", &len);
64217 +       data = of_get_property(np, "phy-handle", &len);
64218         if (!data || len != 4)
64219                 return -EINVAL;
64220  
64221 --- a/drivers/net/fs_enet/mac-fcc.c
64222 +++ b/drivers/net/fs_enet/mac-fcc.c
64223 @@ -81,16 +81,8 @@
64224  static inline int fcc_cr_cmd(struct fs_enet_private *fep, u32 op)
64225  {
64226         const struct fs_platform_info *fpi = fep->fpi;
64227 -       int i;
64228  
64229 -       W32(cpmp, cp_cpcr, fpi->cp_command | op | CPM_CR_FLG);
64230 -       for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
64231 -               if ((R32(cpmp, cp_cpcr) & CPM_CR_FLG) == 0)
64232 -                       return 0;
64233 -
64234 -       printk(KERN_ERR "%s(): Not able to issue CPM command\n",
64235 -              __FUNCTION__);
64236 -       return 1;
64237 +       return cpm_command(fpi->cp_command, op);
64238  }
64239  
64240  static int do_pd_setup(struct fs_enet_private *fep)
64241 --- a/drivers/net/fs_enet/mac-scc.c
64242 +++ b/drivers/net/fs_enet/mac-scc.c
64243 @@ -89,21 +89,12 @@
64244   * Delay to wait for SCC reset command to complete (in us)
64245   */
64246  #define SCC_RESET_DELAY                50
64247 -#define MAX_CR_CMD_LOOPS       10000
64248  
64249  static inline int scc_cr_cmd(struct fs_enet_private *fep, u32 op)
64250  {
64251         const struct fs_platform_info *fpi = fep->fpi;
64252 -       int i;
64253  
64254 -       W16(cpmp, cp_cpcr, fpi->cp_command | CPM_CR_FLG | (op << 8));
64255 -       for (i = 0; i < MAX_CR_CMD_LOOPS; i++)
64256 -               if ((R16(cpmp, cp_cpcr) & CPM_CR_FLG) == 0)
64257 -                       return 0;
64258 -
64259 -       printk(KERN_ERR "%s(): Not able to issue CPM command\n",
64260 -               __FUNCTION__);
64261 -       return 1;
64262 +       return cpm_command(fpi->cp_command, op);
64263  }
64264  
64265  static int do_pd_setup(struct fs_enet_private *fep)
64266 --- a/drivers/net/ibm_newemac/core.c
64267 +++ b/drivers/net/ibm_newemac/core.c
64268 @@ -37,6 +37,7 @@
64269  #include <linux/mii.h>
64270  #include <linux/bitops.h>
64271  #include <linux/workqueue.h>
64272 +#include <linux/of.h>
64273  
64274  #include <asm/processor.h>
64275  #include <asm/io.h>
64276 --- a/drivers/net/phy/Kconfig
64277 +++ b/drivers/net/phy/Kconfig
64278 @@ -61,34 +61,12 @@
64279           Currently supports the IP175C PHY.
64280  
64281  config FIXED_PHY
64282 -       tristate "Drivers for PHY emulation on fixed speed/link"
64283 +       bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs"
64284         ---help---
64285 -         Adds the driver to PHY layer to cover the boards that do not have any PHY bound,
64286 -         but with the ability to manipulate the speed/link in software. The relevant MII
64287 -         speed/duplex parameters could be effectively handled in a user-specified function.
64288 -         Currently tested with mpc866ads.
64289 +         Adds the platform "fixed" MDIO Bus to cover the boards that use
64290 +         PHYs that are not connected to the real MDIO bus.
64291  
64292 -config FIXED_MII_10_FDX
64293 -       bool "Emulation for 10M Fdx fixed PHY behavior"
64294 -       depends on FIXED_PHY
64295 -
64296 -config FIXED_MII_100_FDX
64297 -       bool "Emulation for 100M Fdx fixed PHY behavior"
64298 -       depends on FIXED_PHY
64299 -
64300 -config FIXED_MII_1000_FDX
64301 -       bool "Emulation for 1000M Fdx fixed PHY behavior"
64302 -       depends on FIXED_PHY
64303 -
64304 -config FIXED_MII_AMNT
64305 -        int "Number of emulated PHYs to allocate "
64306 -        depends on FIXED_PHY
64307 -        default "1"
64308 -        ---help---
64309 -        Sometimes it is required to have several independent emulated
64310 -        PHYs on the bus (in case of multi-eth but phy-less HW for instance).
64311 -        This control will have specified number allocated for each fixed
64312 -        PHY type enabled.
64313 +         Currently tested with mpc866ads and mpc8349e-mitx.
64314  
64315  config MDIO_BITBANG
64316         tristate "Support for bitbanged MDIO buses"
64317 --- a/drivers/net/phy/fixed.c
64318 +++ b/drivers/net/phy/fixed.c
64319 @@ -1,362 +1,253 @@
64320  /*
64321 - * drivers/net/phy/fixed.c
64322 + * Fixed MDIO bus (MDIO bus emulation with fixed PHYs)
64323   *
64324 - * Driver for fixed PHYs, when transceiver is able to operate in one fixed mode.
64325 + * Author: Vitaly Bordug <vbordug@ru.mvista.com>
64326 + *         Anton Vorontsov <avorontsov@ru.mvista.com>
64327   *
64328 - * Author: Vitaly Bordug
64329 - *
64330 - * Copyright (c) 2006 MontaVista Software, Inc.
64331 + * Copyright (c) 2006-2007 MontaVista Software, Inc.
64332   *
64333   * This program is free software; you can redistribute  it and/or modify it
64334   * under  the terms of  the GNU General  Public License as published by the
64335   * Free Software Foundation;  either version 2 of the  License, or (at your
64336   * option) any later version.
64337 - *
64338   */
64339 +
64340  #include <linux/kernel.h>
64341 -#include <linux/string.h>
64342 -#include <linux/errno.h>
64343 -#include <linux/unistd.h>
64344 -#include <linux/slab.h>
64345 -#include <linux/interrupt.h>
64346 -#include <linux/init.h>
64347 -#include <linux/delay.h>
64348 -#include <linux/netdevice.h>
64349 -#include <linux/etherdevice.h>
64350 -#include <linux/skbuff.h>
64351 -#include <linux/spinlock.h>
64352 -#include <linux/mm.h>
64353  #include <linux/module.h>
64354 +#include <linux/platform_device.h>
64355 +#include <linux/list.h>
64356  #include <linux/mii.h>
64357 -#include <linux/ethtool.h>
64358  #include <linux/phy.h>
64359  #include <linux/phy_fixed.h>
64360  
64361 -#include <asm/io.h>
64362 -#include <asm/irq.h>
64363 -#include <asm/uaccess.h>
64364 -
64365 -/* we need to track the allocated pointers in order to free them on exit */
64366 -static struct fixed_info *fixed_phy_ptrs[CONFIG_FIXED_MII_AMNT*MAX_PHY_AMNT];
64367 -
64368 -/*-----------------------------------------------------------------------------
64369 - *  If something weird is required to be done with link/speed,
64370 - * network driver is able to assign a function to implement this.
64371 - * May be useful for PHY's that need to be software-driven.
64372 - *-----------------------------------------------------------------------------*/
64373 -int fixed_mdio_set_link_update(struct phy_device *phydev,
64374 -                              int (*link_update) (struct net_device *,
64375 -                                                  struct fixed_phy_status *))
64376 -{
64377 -       struct fixed_info *fixed;
64378 -
64379 -       if (link_update == NULL)
64380 -               return -EINVAL;
64381 +#define MII_REGS_NUM 29
64382  
64383 -       if (phydev) {
64384 -               if (phydev->bus) {
64385 -                       fixed = phydev->bus->priv;
64386 -                       fixed->link_update = link_update;
64387 -                       return 0;
64388 -               }
64389 -       }
64390 -       return -EINVAL;
64391 -}
64392 -
64393 -EXPORT_SYMBOL(fixed_mdio_set_link_update);
64394 +struct fixed_mdio_bus {
64395 +       int irqs[PHY_MAX_ADDR];
64396 +       struct mii_bus mii_bus;
64397 +       struct list_head phys;
64398 +};
64399  
64400 -struct fixed_info *fixed_mdio_get_phydev (int phydev_ind)
64401 -{
64402 -       if (phydev_ind >= MAX_PHY_AMNT)
64403 -               return NULL;
64404 -       return fixed_phy_ptrs[phydev_ind];
64405 -}
64406 +struct fixed_phy {
64407 +       int id;
64408 +       u16 regs[MII_REGS_NUM];
64409 +       struct phy_device *phydev;
64410 +       struct fixed_phy_status status;
64411 +       int (*link_update)(struct net_device *, struct fixed_phy_status *);
64412 +       struct list_head node;
64413 +};
64414  
64415 -EXPORT_SYMBOL(fixed_mdio_get_phydev);
64416 +static struct platform_device *pdev;
64417 +static struct fixed_mdio_bus platform_fmb = {
64418 +       .phys = LIST_HEAD_INIT(platform_fmb.phys),
64419 +};
64420  
64421 -/*-----------------------------------------------------------------------------
64422 - *  This is used for updating internal mii regs from the status
64423 - *-----------------------------------------------------------------------------*/
64424 -#if defined(CONFIG_FIXED_MII_100_FDX) || defined(CONFIG_FIXED_MII_10_FDX) || defined(CONFIG_FIXED_MII_1000_FDX)
64425 -static int fixed_mdio_update_regs(struct fixed_info *fixed)
64426 +static int fixed_phy_update_regs(struct fixed_phy *fp)
64427  {
64428 -       u16 *regs = fixed->regs;
64429 -       u16 bmsr = 0;
64430 +       u16 bmsr = BMSR_ANEGCAPABLE;
64431         u16 bmcr = 0;
64432 +       u16 lpagb = 0;
64433 +       u16 lpa = 0;
64434  
64435 -       if (!regs) {
64436 -               printk(KERN_ERR "%s: regs not set up", __FUNCTION__);
64437 -               return -EINVAL;
64438 -       }
64439 -
64440 -       if (fixed->phy_status.link)
64441 -               bmsr |= BMSR_LSTATUS;
64442 -
64443 -       if (fixed->phy_status.duplex) {
64444 +       if (fp->status.duplex) {
64445                 bmcr |= BMCR_FULLDPLX;
64446  
64447 -               switch (fixed->phy_status.speed) {
64448 +               switch (fp->status.speed) {
64449 +               case 1000:
64450 +                       bmsr |= BMSR_ESTATEN;
64451 +                       bmcr |= BMCR_SPEED1000;
64452 +                       lpagb |= LPA_1000FULL;
64453 +                       break;
64454                 case 100:
64455                         bmsr |= BMSR_100FULL;
64456                         bmcr |= BMCR_SPEED100;
64457 +                       lpa |= LPA_100FULL;
64458                         break;
64459 -
64460                 case 10:
64461                         bmsr |= BMSR_10FULL;
64462 +                       lpa |= LPA_10FULL;
64463                         break;
64464 +               default:
64465 +                       printk(KERN_WARNING "fixed phy: unknown speed\n");
64466 +                       return -EINVAL;
64467                 }
64468         } else {
64469 -               switch (fixed->phy_status.speed) {
64470 +               switch (fp->status.speed) {
64471 +               case 1000:
64472 +                       bmsr |= BMSR_ESTATEN;
64473 +                       bmcr |= BMCR_SPEED1000;
64474 +                       lpagb |= LPA_1000HALF;
64475 +                       break;
64476                 case 100:
64477                         bmsr |= BMSR_100HALF;
64478                         bmcr |= BMCR_SPEED100;
64479 +                       lpa |= LPA_100HALF;
64480                         break;
64481 -
64482                 case 10:
64483 -                       bmsr |= BMSR_100HALF;
64484 +                       bmsr |= BMSR_10HALF;
64485 +                       lpa |= LPA_10HALF;
64486                         break;
64487 +               default:
64488 +                       printk(KERN_WARNING "fixed phy: unknown speed\n");
64489 +                       return -EINVAL;
64490                 }
64491         }
64492  
64493 -       regs[MII_BMCR] = bmcr;
64494 -       regs[MII_BMSR] = bmsr | 0x800;  /*we are always capable of 10 hdx */
64495 +       if (fp->status.link)
64496 +               bmsr |= BMSR_LSTATUS | BMSR_ANEGCOMPLETE;
64497 +
64498 +       if (fp->status.pause)
64499 +               lpa |= LPA_PAUSE_CAP;
64500 +
64501 +       if (fp->status.asym_pause)
64502 +               lpa |= LPA_PAUSE_ASYM;
64503 +
64504 +       fp->regs[MII_PHYSID1] = fp->id >> 16;
64505 +       fp->regs[MII_PHYSID2] = fp->id;
64506 +
64507 +       fp->regs[MII_BMSR] = bmsr;
64508 +       fp->regs[MII_BMCR] = bmcr;
64509 +       fp->regs[MII_LPA] = lpa;
64510 +       fp->regs[MII_STAT1000] = lpagb;
64511  
64512         return 0;
64513  }
64514  
64515 -static int fixed_mii_read(struct mii_bus *bus, int phy_id, int location)
64516 +static int fixed_mdio_read(struct mii_bus *bus, int phy_id, int reg_num)
64517  {
64518 -       struct fixed_info *fixed = bus->priv;
64519 +       struct fixed_mdio_bus *fmb = container_of(bus, struct fixed_mdio_bus,
64520 +                                                 mii_bus);
64521 +       struct fixed_phy *fp;
64522  
64523 -       /* if user has registered link update callback, use it */
64524 -       if (fixed->phydev)
64525 -               if (fixed->phydev->attached_dev) {
64526 -                       if (fixed->link_update) {
64527 -                               fixed->link_update(fixed->phydev->attached_dev,
64528 -                                                  &fixed->phy_status);
64529 -                               fixed_mdio_update_regs(fixed);
64530 +       if (reg_num >= MII_REGS_NUM)
64531 +               return -1;
64532 +
64533 +       list_for_each_entry(fp, &fmb->phys, node) {
64534 +               if (fp->id == phy_id) {
64535 +                       /* Issue callback if user registered it. */
64536 +                       if (fp->link_update) {
64537 +                               fp->link_update(fp->phydev->attached_dev,
64538 +                                               &fp->status);
64539 +                               fixed_phy_update_regs(fp);
64540                         }
64541 +                       return fp->regs[reg_num];
64542                 }
64543 +       }
64544  
64545 -       if ((unsigned int)location >= fixed->regs_num)
64546 -               return -1;
64547 -       return fixed->regs[location];
64548 +       return 0xFFFF;
64549  }
64550  
64551 -static int fixed_mii_write(struct mii_bus *bus, int phy_id, int location,
64552 -                          u16 val)
64553 +static int fixed_mdio_write(struct mii_bus *bus, int phy_id, int reg_num,
64554 +                           u16 val)
64555  {
64556 -       /* do nothing for now */
64557         return 0;
64558  }
64559  
64560 -static int fixed_mii_reset(struct mii_bus *bus)
64561 +/*
64562 + * If something weird is required to be done with link/speed,
64563 + * network driver is able to assign a function to implement this.
64564 + * May be useful for PHY's that need to be software-driven.
64565 + */
64566 +int fixed_phy_set_link_update(struct phy_device *phydev,
64567 +                             int (*link_update)(struct net_device *,
64568 +                                                struct fixed_phy_status *))
64569  {
64570 -       /*nothing here - no way/need to reset it */
64571 -       return 0;
64572 -}
64573 -#endif
64574 +       struct fixed_mdio_bus *fmb = &platform_fmb;
64575 +       struct fixed_phy *fp;
64576  
64577 -static int fixed_config_aneg(struct phy_device *phydev)
64578 -{
64579 -       /* :TODO:03/13/2006 09:45:37 PM::
64580 -          The full autoneg funcionality can be emulated,
64581 -          but no need to have anything here for now
64582 -        */
64583 -       return 0;
64584 -}
64585 +       if (!link_update || !phydev || !phydev->bus)
64586 +               return -EINVAL;
64587  
64588 -/*-----------------------------------------------------------------------------
64589 - * the manual bind will do the magic - with phy_id_mask == 0
64590 - * match will never return true...
64591 - *-----------------------------------------------------------------------------*/
64592 -static struct phy_driver fixed_mdio_driver = {
64593 -       .name = "Fixed PHY",
64594 -#ifdef CONFIG_FIXED_MII_1000_FDX
64595 -       .features = PHY_GBIT_FEATURES,
64596 -#else
64597 -       .features = PHY_BASIC_FEATURES,
64598 -#endif
64599 -       .config_aneg = fixed_config_aneg,
64600 -       .read_status = genphy_read_status,
64601 -       .driver = { .owner = THIS_MODULE, },
64602 -};
64603 +       list_for_each_entry(fp, &fmb->phys, node) {
64604 +               if (fp->id == phydev->phy_id) {
64605 +                       fp->link_update = link_update;
64606 +                       fp->phydev = phydev;
64607 +                       return 0;
64608 +               }
64609 +       }
64610  
64611 -static void fixed_mdio_release(struct device *dev)
64612 -{
64613 -       struct phy_device *phydev = container_of(dev, struct phy_device, dev);
64614 -       struct mii_bus *bus = phydev->bus;
64615 -       struct fixed_info *fixed = bus->priv;
64616 -
64617 -       kfree(phydev);
64618 -       kfree(bus->dev);
64619 -       kfree(bus);
64620 -       kfree(fixed->regs);
64621 -       kfree(fixed);
64622 +       return -ENOENT;
64623  }
64624 +EXPORT_SYMBOL_GPL(fixed_phy_set_link_update);
64625  
64626 -/*-----------------------------------------------------------------------------
64627 - *  This func is used to create all the necessary stuff, bind
64628 - * the fixed phy driver and register all it on the mdio_bus_type.
64629 - * speed is either 10 or 100 or 1000, duplex is boolean.
64630 - * number is used to create multiple fixed PHYs, so that several devices can
64631 - * utilize them simultaneously.
64632 - *
64633 - * The device on mdio bus will look like [bus_id]:[phy_id],
64634 - * bus_id = number
64635 - * phy_id = speed+duplex.
64636 - *-----------------------------------------------------------------------------*/
64637 -#if defined(CONFIG_FIXED_MII_100_FDX) || defined(CONFIG_FIXED_MII_10_FDX) || defined(CONFIG_FIXED_MII_1000_FDX)
64638 -struct fixed_info *fixed_mdio_register_device(
64639 -       int bus_id, int speed, int duplex, u8 phy_id)
64640 +int fixed_phy_add(unsigned int irq, int phy_id,
64641 +                 struct fixed_phy_status *status)
64642  {
64643 -       struct mii_bus *new_bus;
64644 -       struct fixed_info *fixed;
64645 -       struct phy_device *phydev;
64646 -       int err;
64647 +       int ret;
64648 +       struct fixed_mdio_bus *fmb = &platform_fmb;
64649 +       struct fixed_phy *fp;
64650  
64651 -       struct device *dev = kzalloc(sizeof(struct device), GFP_KERNEL);
64652 +       fp = kzalloc(sizeof(*fp), GFP_KERNEL);
64653 +       if (!fp)
64654 +               return -ENOMEM;
64655  
64656 -       if (dev == NULL)
64657 -               goto err_dev_alloc;
64658 +       memset(fp->regs, 0xFF,  sizeof(fp->regs[0]) * MII_REGS_NUM);
64659  
64660 -       new_bus = kzalloc(sizeof(struct mii_bus), GFP_KERNEL);
64661 +       fmb->irqs[phy_id] = irq;
64662  
64663 -       if (new_bus == NULL)
64664 -               goto err_bus_alloc;
64665 -
64666 -       fixed = kzalloc(sizeof(struct fixed_info), GFP_KERNEL);
64667 -
64668 -       if (fixed == NULL)
64669 -               goto err_fixed_alloc;
64670 -
64671 -       fixed->regs = kzalloc(MII_REGS_NUM * sizeof(int), GFP_KERNEL);
64672 -       if (NULL == fixed->regs)
64673 -               goto err_fixed_regs_alloc;
64674 -
64675 -       fixed->regs_num = MII_REGS_NUM;
64676 -       fixed->phy_status.speed = speed;
64677 -       fixed->phy_status.duplex = duplex;
64678 -       fixed->phy_status.link = 1;
64679 -
64680 -       new_bus->name = "Fixed MII Bus";
64681 -       new_bus->read = &fixed_mii_read;
64682 -       new_bus->write = &fixed_mii_write;
64683 -       new_bus->reset = &fixed_mii_reset;
64684 -       /*set up workspace */
64685 -       fixed_mdio_update_regs(fixed);
64686 -       new_bus->priv = fixed;
64687 -
64688 -       new_bus->dev = dev;
64689 -       dev_set_drvdata(dev, new_bus);
64690 -
64691 -       /* create phy_device and register it on the mdio bus */
64692 -       phydev = phy_device_create(new_bus, 0, 0);
64693 -       if (phydev == NULL)
64694 -               goto err_phy_dev_create;
64695 -
64696 -       /*
64697 -        * Put the phydev pointer into the fixed pack so that bus read/write
64698 -        * code could be able to access for instance attached netdev. Well it
64699 -        * doesn't have to do so, only in case of utilizing user-specified
64700 -        * link-update...
64701 -        */
64702 -
64703 -       fixed->phydev = phydev;
64704 -       phydev->speed = speed;
64705 -       phydev->duplex = duplex;
64706 -
64707 -       phydev->irq = PHY_IGNORE_INTERRUPT;
64708 -       phydev->dev.bus = &mdio_bus_type;
64709 -
64710 -       snprintf(phydev->dev.bus_id, BUS_ID_SIZE,
64711 -                PHY_ID_FMT, bus_id, phy_id);
64712 -
64713 -       phydev->bus = new_bus;
64714 -
64715 -       phydev->dev.driver = &fixed_mdio_driver.driver;
64716 -       phydev->dev.release = fixed_mdio_release;
64717 -       err = phydev->dev.driver->probe(&phydev->dev);
64718 -       if (err < 0) {
64719 -               printk(KERN_ERR "Phy %s: problems with fixed driver\n",
64720 -                      phydev->dev.bus_id);
64721 -               goto err_out;
64722 -       }
64723 -       err = device_register(&phydev->dev);
64724 -       if (err) {
64725 -               printk(KERN_ERR "Phy %s failed to register\n",
64726 -                      phydev->dev.bus_id);
64727 -               goto err_out;
64728 -       }
64729 -       //phydev->state = PHY_RUNNING; /* make phy go up quick, but in 10Mbit/HDX
64730 -       return fixed;
64731 +       fp->id = phy_id;
64732 +       fp->status = *status;
64733  
64734 -err_out:
64735 -       kfree(phydev);
64736 -err_phy_dev_create:
64737 -       kfree(fixed->regs);
64738 -err_fixed_regs_alloc:
64739 -       kfree(fixed);
64740 -err_fixed_alloc:
64741 -       kfree(new_bus);
64742 -err_bus_alloc:
64743 -       kfree(dev);
64744 -err_dev_alloc:
64745 +       ret = fixed_phy_update_regs(fp);
64746 +       if (ret)
64747 +               goto err_regs;
64748  
64749 -       return NULL;
64750 +       list_add_tail(&fp->node, &fmb->phys);
64751  
64752 -}
64753 -#endif
64754 +       return 0;
64755  
64756 -MODULE_DESCRIPTION("Fixed PHY device & driver for PAL");
64757 -MODULE_AUTHOR("Vitaly Bordug");
64758 -MODULE_LICENSE("GPL");
64759 +err_regs:
64760 +       kfree(fp);
64761 +       return ret;
64762 +}
64763 +EXPORT_SYMBOL_GPL(fixed_phy_add);
64764  
64765 -static int __init fixed_init(void)
64766 +static int __init fixed_mdio_bus_init(void)
64767  {
64768 -       int cnt = 0;
64769 -       int i;
64770 -/* register on the bus... Not expected to be matched
64771 - * with anything there...
64772 - *
64773 - */
64774 -       phy_driver_register(&fixed_mdio_driver);
64775 +       struct fixed_mdio_bus *fmb = &platform_fmb;
64776 +       int ret;
64777  
64778 -/* We will create several mdio devices here, and will bound the upper
64779 - * driver to them.
64780 - *
64781 - * Then the external software can lookup the phy bus by searching
64782 - * for 0:101, to be connected to the virtual 100M Fdx phy.
64783 - *
64784 - * In case several virtual PHYs required, the bus_id will be in form
64785 - * [num]:[duplex]+[speed], which make it able even to define
64786 - * driver-specific link control callback, if for instance PHY is
64787 - * completely SW-driven.
64788 - */
64789 -       for (i=1; i <= CONFIG_FIXED_MII_AMNT; i++) {
64790 -#ifdef CONFIG_FIXED_MII_1000_FDX
64791 -               fixed_phy_ptrs[cnt++] = fixed_mdio_register_device(0, 1000, 1, i);
64792 -#endif
64793 -#ifdef CONFIG_FIXED_MII_100_FDX
64794 -               fixed_phy_ptrs[cnt++] = fixed_mdio_register_device(1, 100, 1, i);
64795 -#endif
64796 -#ifdef CONFIG_FIXED_MII_10_FDX
64797 -               fixed_phy_ptrs[cnt++] = fixed_mdio_register_device(2, 10, 1, i);
64798 -#endif
64799 +       pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0);
64800 +       if (!pdev) {
64801 +               ret = -ENOMEM;
64802 +               goto err_pdev;
64803         }
64804  
64805 +       fmb->mii_bus.id = 0;
64806 +       fmb->mii_bus.name = "Fixed MDIO Bus";
64807 +       fmb->mii_bus.dev = &pdev->dev;
64808 +       fmb->mii_bus.read = &fixed_mdio_read;
64809 +       fmb->mii_bus.write = &fixed_mdio_write;
64810 +       fmb->mii_bus.irq = fmb->irqs;
64811 +
64812 +       ret = mdiobus_register(&fmb->mii_bus);
64813 +       if (ret)
64814 +               goto err_mdiobus_reg;
64815 +
64816         return 0;
64817 +
64818 +err_mdiobus_reg:
64819 +       platform_device_unregister(pdev);
64820 +err_pdev:
64821 +       return ret;
64822  }
64823 +module_init(fixed_mdio_bus_init);
64824  
64825 -static void __exit fixed_exit(void)
64826 +static void __exit fixed_mdio_bus_exit(void)
64827  {
64828 -       int i;
64829 +       struct fixed_mdio_bus *fmb = &platform_fmb;
64830 +       struct fixed_phy *fp;
64831  
64832 -       phy_driver_unregister(&fixed_mdio_driver);
64833 -       for (i=0; i < MAX_PHY_AMNT; i++)
64834 -               if ( fixed_phy_ptrs[i] )
64835 -                       device_unregister(&fixed_phy_ptrs[i]->phydev->dev);
64836 +       mdiobus_unregister(&fmb->mii_bus);
64837 +       platform_device_unregister(pdev);
64838 +
64839 +       list_for_each_entry(fp, &fmb->phys, node) {
64840 +               list_del(&fp->node);
64841 +               kfree(fp);
64842 +       }
64843  }
64844 +module_exit(fixed_mdio_bus_exit);
64845  
64846 -module_init(fixed_init);
64847 -module_exit(fixed_exit);
64848 +MODULE_DESCRIPTION("Fixed MDIO bus (MDIO bus emulation with fixed PHYs)");
64849 +MODULE_AUTHOR("Vitaly Bordug");
64850 +MODULE_LICENSE("GPL");
64851 --- a/drivers/net/ps3_gelic_net.c
64852 +++ b/drivers/net/ps3_gelic_net.c
64853 @@ -58,11 +58,11 @@
64854  {
64855         return &card->dev->core;
64856  }
64857 -static inline unsigned int bus_id(struct gelic_net_card *card)
64858 +static inline u64 bus_id(struct gelic_net_card *card)
64859  {
64860         return card->dev->bus_id;
64861  }
64862 -static inline unsigned int dev_id(struct gelic_net_card *card)
64863 +static inline u64 dev_id(struct gelic_net_card *card)
64864  {
64865         return card->dev->dev_id;
64866  }
64867 --- a/drivers/net/ucc_geth.c
64868 +++ b/drivers/net/ucc_geth.c
64869 @@ -3822,6 +3822,7 @@
64870         int err, ucc_num, max_speed = 0;
64871         const phandle *ph;
64872         const unsigned int *prop;
64873 +       const char *sprop;
64874         const void *mac_addr;
64875         phy_interface_t phy_interface;
64876         static const int enet_to_speed[] = {
64877 @@ -3854,10 +3855,56 @@
64878  
64879         ug_info->uf_info.ucc_num = ucc_num;
64880  
64881 -       prop = of_get_property(np, "rx-clock", NULL);
64882 -       ug_info->uf_info.rx_clock = *prop;
64883 -       prop = of_get_property(np, "tx-clock", NULL);
64884 -       ug_info->uf_info.tx_clock = *prop;
64885 +       sprop = of_get_property(np, "rx-clock-name", NULL);
64886 +       if (sprop) {
64887 +               ug_info->uf_info.rx_clock = qe_clock_source(sprop);
64888 +               if ((ug_info->uf_info.rx_clock < QE_CLK_NONE) ||
64889 +                   (ug_info->uf_info.rx_clock > QE_CLK24)) {
64890 +                       printk(KERN_ERR
64891 +                               "ucc_geth: invalid rx-clock-name property\n");
64892 +                       return -EINVAL;
64893 +               }
64894 +       } else {
64895 +               prop = of_get_property(np, "rx-clock", NULL);
64896 +               if (!prop) {
64897 +                       /* If both rx-clock-name and rx-clock are missing,
64898 +                          we want to tell people to use rx-clock-name. */
64899 +                       printk(KERN_ERR
64900 +                               "ucc_geth: missing rx-clock-name property\n");
64901 +                       return -EINVAL;
64902 +               }
64903 +               if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) {
64904 +                       printk(KERN_ERR
64905 +                               "ucc_geth: invalid rx-clock propperty\n");
64906 +                       return -EINVAL;
64907 +               }
64908 +               ug_info->uf_info.rx_clock = *prop;
64909 +       }
64910 +
64911 +       sprop = of_get_property(np, "tx-clock-name", NULL);
64912 +       if (sprop) {
64913 +               ug_info->uf_info.tx_clock = qe_clock_source(sprop);
64914 +               if ((ug_info->uf_info.tx_clock < QE_CLK_NONE) ||
64915 +                   (ug_info->uf_info.tx_clock > QE_CLK24)) {
64916 +                       printk(KERN_ERR
64917 +                               "ucc_geth: invalid tx-clock-name property\n");
64918 +                       return -EINVAL;
64919 +               }
64920 +       } else {
64921 +               prop = of_get_property(np, "rx-clock", NULL);
64922 +               if (!prop) {
64923 +                       printk(KERN_ERR
64924 +                               "ucc_geth: mising tx-clock-name property\n");
64925 +                       return -EINVAL;
64926 +               }
64927 +               if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) {
64928 +                       printk(KERN_ERR
64929 +                               "ucc_geth: invalid tx-clock property\n");
64930 +                       return -EINVAL;
64931 +               }
64932 +               ug_info->uf_info.tx_clock = *prop;
64933 +       }
64934 +
64935         err = of_address_to_resource(np, 0, &res);
64936         if (err)
64937                 return -EINVAL;
64938 --- a/drivers/of/base.c
64939 +++ b/drivers/of/base.c
64940 @@ -273,3 +273,61 @@
64941         return np;
64942  }
64943  EXPORT_SYMBOL(of_find_compatible_node);
64944 +
64945 +/**
64946 + * of_match_node - Tell if an device_node has a matching of_match structure
64947 + *     @matches:       array of of device match structures to search in
64948 + *     @node:          the of device structure to match against
64949 + *
64950 + *     Low level utility function used by device matching.
64951 + */
64952 +const struct of_device_id *of_match_node(const struct of_device_id *matches,
64953 +                                        const struct device_node *node)
64954 +{
64955 +       while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
64956 +               int match = 1;
64957 +               if (matches->name[0])
64958 +                       match &= node->name
64959 +                               && !strcmp(matches->name, node->name);
64960 +               if (matches->type[0])
64961 +                       match &= node->type
64962 +                               && !strcmp(matches->type, node->type);
64963 +               if (matches->compatible[0])
64964 +                       match &= of_device_is_compatible(node,
64965 +                                               matches->compatible);
64966 +               if (match)
64967 +                       return matches;
64968 +               matches++;
64969 +       }
64970 +       return NULL;
64971 +}
64972 +EXPORT_SYMBOL(of_match_node);
64973 +
64974 +/**
64975 + *     of_find_matching_node - Find a node based on an of_device_id match
64976 + *                             table.
64977 + *     @from:          The node to start searching from or NULL, the node
64978 + *                     you pass will not be searched, only the next one
64979 + *                     will; typically, you pass what the previous call
64980 + *                     returned. of_node_put() will be called on it
64981 + *     @matches:       array of of device match structures to search in
64982 + *
64983 + *     Returns a node pointer with refcount incremented, use
64984 + *     of_node_put() on it when done.
64985 + */
64986 +struct device_node *of_find_matching_node(struct device_node *from,
64987 +                                         const struct of_device_id *matches)
64988 +{
64989 +       struct device_node *np;
64990 +
64991 +       read_lock(&devtree_lock);
64992 +       np = from ? from->allnext : allnodes;
64993 +       for (; np; np = np->allnext) {
64994 +               if (of_match_node(matches, np) && of_node_get(np))
64995 +                       break;
64996 +       }
64997 +       of_node_put(from);
64998 +       read_unlock(&devtree_lock);
64999 +       return np;
65000 +}
65001 +EXPORT_SYMBOL(of_find_matching_node);
65002 --- a/drivers/of/device.c
65003 +++ b/drivers/of/device.c
65004 @@ -10,35 +10,6 @@
65005  #include <asm/errno.h>
65006  
65007  /**
65008 - * of_match_node - Tell if an device_node has a matching of_match structure
65009 - * @ids: array of of device match structures to search in
65010 - * @node: the of device structure to match against
65011 - *
65012 - * Low level utility function used by device matching.
65013 - */
65014 -const struct of_device_id *of_match_node(const struct of_device_id *matches,
65015 -                                        const struct device_node *node)
65016 -{
65017 -       while (matches->name[0] || matches->type[0] || matches->compatible[0]) {
65018 -               int match = 1;
65019 -               if (matches->name[0])
65020 -                       match &= node->name
65021 -                               && !strcmp(matches->name, node->name);
65022 -               if (matches->type[0])
65023 -                       match &= node->type
65024 -                               && !strcmp(matches->type, node->type);
65025 -               if (matches->compatible[0])
65026 -                       match &= of_device_is_compatible(node,
65027 -                                               matches->compatible);
65028 -               if (match)
65029 -                       return matches;
65030 -               matches++;
65031 -       }
65032 -       return NULL;
65033 -}
65034 -EXPORT_SYMBOL(of_match_node);
65035 -
65036 -/**
65037   * of_match_device - Tell if an of_device structure has a matching
65038   * of_match structure
65039   * @ids: array of of device match structures to search in
65040 --- a/drivers/ps3/Makefile
65041 +++ b/drivers/ps3/Makefile
65042 @@ -4,3 +4,4 @@
65043  obj-$(CONFIG_PPC_PS3) += sys-manager-core.o
65044  obj-$(CONFIG_PS3_SYS_MANAGER) += ps3-sys-manager.o
65045  obj-$(CONFIG_PS3_STORAGE) += ps3stor_lib.o
65046 +obj-$(CONFIG_PS3_LPM) += ps3-lpm.o
65047 --- /dev/null
65048 +++ b/drivers/ps3/ps3-lpm.c
65049 @@ -0,0 +1,1248 @@
65050 +/*
65051 + * PS3 Logical Performance Monitor.
65052 + *
65053 + *  Copyright (C) 2007 Sony Computer Entertainment Inc.
65054 + *  Copyright 2007 Sony Corp.
65055 + *
65056 + *  This program is free software; you can redistribute it and/or modify
65057 + *  it under the terms of the GNU General Public License as published by
65058 + *  the Free Software Foundation; version 2 of the License.
65059 + *
65060 + *  This program is distributed in the hope that it will be useful,
65061 + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
65062 + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
65063 + *  GNU General Public License for more details.
65064 + *
65065 + *  You should have received a copy of the GNU General Public License
65066 + *  along with this program; if not, write to the Free Software
65067 + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
65068 + */
65069 +
65070 +#include <linux/kernel.h>
65071 +#include <linux/module.h>
65072 +#include <linux/interrupt.h>
65073 +#include <linux/uaccess.h>
65074 +#include <asm/ps3.h>
65075 +#include <asm/lv1call.h>
65076 +#include <asm/cell-pmu.h>
65077 +
65078 +
65079 +/* BOOKMARK tag macros */
65080 +#define PS3_PM_BOOKMARK_START                    0x8000000000000000ULL
65081 +#define PS3_PM_BOOKMARK_STOP                     0x4000000000000000ULL
65082 +#define PS3_PM_BOOKMARK_TAG_KERNEL               0x1000000000000000ULL
65083 +#define PS3_PM_BOOKMARK_TAG_USER                 0x3000000000000000ULL
65084 +#define PS3_PM_BOOKMARK_TAG_MASK_HI              0xF000000000000000ULL
65085 +#define PS3_PM_BOOKMARK_TAG_MASK_LO              0x0F00000000000000ULL
65086 +
65087 +/* CBE PM CONTROL register macros */
65088 +#define PS3_PM_CONTROL_PPU_TH0_BOOKMARK          0x00001000
65089 +#define PS3_PM_CONTROL_PPU_TH1_BOOKMARK          0x00000800
65090 +#define PS3_PM_CONTROL_PPU_COUNT_MODE_MASK       0x000C0000
65091 +#define PS3_PM_CONTROL_PPU_COUNT_MODE_PROBLEM    0x00080000
65092 +#define PS3_WRITE_PM_MASK                        0xFFFFFFFFFFFFFFFFULL
65093 +
65094 +/* CBE PM START STOP register macros */
65095 +#define PS3_PM_START_STOP_PPU_TH0_BOOKMARK_START 0x02000000
65096 +#define PS3_PM_START_STOP_PPU_TH1_BOOKMARK_START 0x01000000
65097 +#define PS3_PM_START_STOP_PPU_TH0_BOOKMARK_STOP  0x00020000
65098 +#define PS3_PM_START_STOP_PPU_TH1_BOOKMARK_STOP  0x00010000
65099 +#define PS3_PM_START_STOP_START_MASK             0xFF000000
65100 +#define PS3_PM_START_STOP_STOP_MASK              0x00FF0000
65101 +
65102 +/* CBE PM COUNTER register macres */
65103 +#define PS3_PM_COUNTER_MASK_HI                   0xFFFFFFFF00000000ULL
65104 +#define PS3_PM_COUNTER_MASK_LO                   0x00000000FFFFFFFFULL
65105 +
65106 +/* BASE SIGNAL GROUP NUMBER macros */
65107 +#define PM_ISLAND2_BASE_SIGNAL_GROUP_NUMBER  0
65108 +#define PM_ISLAND2_SIGNAL_GROUP_NUMBER1      6
65109 +#define PM_ISLAND2_SIGNAL_GROUP_NUMBER2      7
65110 +#define PM_ISLAND3_BASE_SIGNAL_GROUP_NUMBER  7
65111 +#define PM_ISLAND4_BASE_SIGNAL_GROUP_NUMBER  15
65112 +#define PM_SPU_TRIGGER_SIGNAL_GROUP_NUMBER   17
65113 +#define PM_SPU_EVENT_SIGNAL_GROUP_NUMBER     18
65114 +#define PM_ISLAND5_BASE_SIGNAL_GROUP_NUMBER  18
65115 +#define PM_ISLAND6_BASE_SIGNAL_GROUP_NUMBER  24
65116 +#define PM_ISLAND7_BASE_SIGNAL_GROUP_NUMBER  49
65117 +#define PM_ISLAND8_BASE_SIGNAL_GROUP_NUMBER  52
65118 +#define PM_SIG_GROUP_SPU                     41
65119 +#define PM_SIG_GROUP_SPU_TRIGGER             42
65120 +#define PM_SIG_GROUP_SPU_EVENT               43
65121 +#define PM_SIG_GROUP_MFC_MAX                 60
65122 +
65123 +/**
65124 + * struct ps3_lpm_shadow_regs - Performance monitor shadow registers.
65125 + *
65126 + * @pm_control: Shadow of the processor's pm_control register.
65127 + * @pm_start_stop: Shadow of the processor's pm_start_stop register.
65128 + * @pm_interval: Shadow of the processor's pm_interval register.
65129 + * @group_control: Shadow of the processor's group_control register.
65130 + * @debug_bus_control: Shadow of the processor's debug_bus_control register.
65131 + *
65132 + * The logical performance monitor provides a write-only interface to
65133 + * these processor registers.  These shadow variables cache the processor
65134 + * register values for reading.
65135 + *
65136 + * The initial value of the shadow registers at lpm creation is
65137 + * PS3_LPM_SHADOW_REG_INIT.
65138 + */
65139 +
65140 +struct ps3_lpm_shadow_regs {
65141 +       u64 pm_control;
65142 +       u64 pm_start_stop;
65143 +       u64 pm_interval;
65144 +       u64 group_control;
65145 +       u64 debug_bus_control;
65146 +};
65147 +
65148 +#define PS3_LPM_SHADOW_REG_INIT 0xFFFFFFFF00000000ULL
65149 +
65150 +/**
65151 + * struct ps3_lpm_priv - Private lpm device data.
65152 + *
65153 + * @open: An atomic variable indicating the lpm driver has been opened.
65154 + * @rights: The lpm rigths granted by the system policy module.  A logical
65155 + *  OR of enum ps3_lpm_rights.
65156 + * @node_id: The node id of a BE prosessor whose performance monitor this
65157 + *  lpar has the right to use.
65158 + * @pu_id: The lv1 id of the logical PU.
65159 + * @lpm_id: The lv1 id of this lpm instance.
65160 + * @outlet_id: The outlet created by lv1 for this lpm instance.
65161 + * @tb_count: The number of bytes of data held in the lv1 trace buffer.
65162 + * @tb_cache: Kernel buffer to receive the data from the lv1 trace buffer.
65163 + *  Must be 128 byte aligned.
65164 + * @tb_cache_size: Size of the kernel @tb_cache buffer.  Must be 128 byte
65165 + *  aligned.
65166 + * @tb_cache_internal: An unaligned buffer allocated by this driver to be
65167 + *  used for the trace buffer cache when ps3_lpm_open() is called with a
65168 + *  NULL tb_cache argument.  Otherwise unused.
65169 + * @shadow: Processor register shadow of type struct ps3_lpm_shadow_regs.
65170 + * @sbd: The struct ps3_system_bus_device attached to this driver.
65171 + *
65172 + * The trace buffer is a buffer allocated and used internally to the lv1
65173 + * hypervisor to collect trace data.  The trace buffer cache is a guest
65174 + * buffer that accepts the trace data from the trace buffer.
65175 + */
65176 +
65177 +struct ps3_lpm_priv {
65178 +       atomic_t open;
65179 +       u64 rights;
65180 +       u64 node_id;
65181 +       u64 pu_id;
65182 +       u64 lpm_id;
65183 +       u64 outlet_id;
65184 +       u64 tb_count;
65185 +       void *tb_cache;
65186 +       u64 tb_cache_size;
65187 +       void *tb_cache_internal;
65188 +       struct ps3_lpm_shadow_regs shadow;
65189 +       struct ps3_system_bus_device *sbd;
65190 +};
65191 +
65192 +enum {
65193 +       PS3_LPM_DEFAULT_TB_CACHE_SIZE = 0x4000,
65194 +};
65195 +
65196 +/**
65197 + * lpm_priv - Static instance of the lpm data.
65198 + *
65199 + * Since the exported routines don't support the notion of a device
65200 + * instance we need to hold the instance in this static variable
65201 + * and then only allow at most one instance at a time to be created.
65202 + */
65203 +
65204 +static struct ps3_lpm_priv *lpm_priv;
65205 +
65206 +static struct device *sbd_core(void)
65207 +{
65208 +       BUG_ON(!lpm_priv || !lpm_priv->sbd);
65209 +       return &lpm_priv->sbd->core;
65210 +}
65211 +
65212 +/**
65213 + * use_start_stop_bookmark - Enable the PPU bookmark trace.
65214 + *
65215 + * And it enables PPU bookmark triggers ONLY if the other triggers are not set.
65216 + * The start/stop bookmarks are inserted at ps3_enable_pm() and ps3_disable_pm()
65217 + * to start/stop LPM.
65218 + *
65219 + * Used to get good quality of the performance counter.
65220 + */
65221 +
65222 +enum {use_start_stop_bookmark = 1,};
65223 +
65224 +void ps3_set_bookmark(u64 bookmark)
65225 +{
65226 +       /*
65227 +        * As per the PPE book IV, to avoid bookmark loss there must
65228 +        * not be a traced branch within 10 cycles of setting the
65229 +        * SPRN_BKMK register.  The actual text is unclear if 'within'
65230 +        * includes cycles before the call.
65231 +        */
65232 +
65233 +       asm volatile("or 29, 29, 29;"); /* db10cyc */
65234 +       mtspr(SPRN_BKMK, bookmark);
65235 +       asm volatile("or 29, 29, 29;"); /* db10cyc */
65236 +}
65237 +EXPORT_SYMBOL_GPL(ps3_set_bookmark);
65238 +
65239 +void ps3_set_pm_bookmark(u64 tag, u64 incident, u64 th_id)
65240 +{
65241 +       u64 bookmark;
65242 +
65243 +       bookmark = (get_tb() & 0x00000000FFFFFFFFULL) |
65244 +               PS3_PM_BOOKMARK_TAG_KERNEL;
65245 +       bookmark = ((tag << 56) & PS3_PM_BOOKMARK_TAG_MASK_LO) |
65246 +               (incident << 48) | (th_id << 32) | bookmark;
65247 +       ps3_set_bookmark(bookmark);
65248 +}
65249 +EXPORT_SYMBOL_GPL(ps3_set_pm_bookmark);
65250 +
65251 +/**
65252 + * ps3_read_phys_ctr - Read physical counter registers.
65253 + *
65254 + * Each physical counter can act as one 32 bit counter or as two 16 bit
65255 + * counters.
65256 + */
65257 +
65258 +u32 ps3_read_phys_ctr(u32 cpu, u32 phys_ctr)
65259 +{
65260 +       int result;
65261 +       u64 counter0415;
65262 +       u64 counter2637;
65263 +
65264 +       if (phys_ctr >= NR_PHYS_CTRS) {
65265 +               dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__,
65266 +                       __LINE__, phys_ctr);
65267 +               return 0;
65268 +       }
65269 +
65270 +       result = lv1_set_lpm_counter(lpm_priv->lpm_id, 0, 0, 0, 0, &counter0415,
65271 +                                    &counter2637);
65272 +       if (result) {
65273 +               dev_err(sbd_core(), "%s:%u: lv1_set_lpm_counter failed: "
65274 +                       "phys_ctr %u, %s\n", __func__, __LINE__, phys_ctr,
65275 +                       ps3_result(result));
65276 +               return 0;
65277 +       }
65278 +
65279 +       switch (phys_ctr) {
65280 +       case 0:
65281 +               return counter0415 >> 32;
65282 +       case 1:
65283 +               return counter0415 & PS3_PM_COUNTER_MASK_LO;
65284 +       case 2:
65285 +               return counter2637 >> 32;
65286 +       case 3:
65287 +               return counter2637 & PS3_PM_COUNTER_MASK_LO;
65288 +       default:
65289 +               BUG();
65290 +       }
65291 +       return 0;
65292 +}
65293 +EXPORT_SYMBOL_GPL(ps3_read_phys_ctr);
65294 +
65295 +/**
65296 + * ps3_write_phys_ctr - Write physical counter registers.
65297 + *
65298 + * Each physical counter can act as one 32 bit counter or as two 16 bit
65299 + * counters.
65300 + */
65301 +
65302 +void ps3_write_phys_ctr(u32 cpu, u32 phys_ctr, u32 val)
65303 +{
65304 +       u64 counter0415;
65305 +       u64 counter0415_mask;
65306 +       u64 counter2637;
65307 +       u64 counter2637_mask;
65308 +       int result;
65309 +
65310 +       if (phys_ctr >= NR_PHYS_CTRS) {
65311 +               dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__,
65312 +                       __LINE__, phys_ctr);
65313 +               return;
65314 +       }
65315 +
65316 +       switch (phys_ctr) {
65317 +       case 0:
65318 +               counter0415 = (u64)val << 32;
65319 +               counter0415_mask = PS3_PM_COUNTER_MASK_HI;
65320 +               counter2637 = 0x0;
65321 +               counter2637_mask = 0x0;
65322 +               break;
65323 +       case 1:
65324 +               counter0415 = (u64)val;
65325 +               counter0415_mask = PS3_PM_COUNTER_MASK_LO;
65326 +               counter2637 = 0x0;
65327 +               counter2637_mask = 0x0;
65328 +               break;
65329 +       case 2:
65330 +               counter0415 = 0x0;
65331 +               counter0415_mask = 0x0;
65332 +               counter2637 = (u64)val << 32;
65333 +               counter2637_mask = PS3_PM_COUNTER_MASK_HI;
65334 +               break;
65335 +       case 3:
65336 +               counter0415 = 0x0;
65337 +               counter0415_mask = 0x0;
65338 +               counter2637 = (u64)val;
65339 +               counter2637_mask = PS3_PM_COUNTER_MASK_LO;
65340 +               break;
65341 +       default:
65342 +               BUG();
65343 +       }
65344 +
65345 +       result = lv1_set_lpm_counter(lpm_priv->lpm_id,
65346 +                                    counter0415, counter0415_mask,
65347 +                                    counter2637, counter2637_mask,
65348 +                                    &counter0415, &counter2637);
65349 +       if (result)
65350 +               dev_err(sbd_core(), "%s:%u: lv1_set_lpm_counter failed: "
65351 +                       "phys_ctr %u, val %u, %s\n", __func__, __LINE__,
65352 +                       phys_ctr, val, ps3_result(result));
65353 +}
65354 +EXPORT_SYMBOL_GPL(ps3_write_phys_ctr);
65355 +
65356 +/**
65357 + * ps3_read_ctr - Read counter.
65358 + *
65359 + * Read 16 or 32 bits depending on the current size of the counter.
65360 + * Counters 4, 5, 6 & 7 are always 16 bit.
65361 + */
65362 +
65363 +u32 ps3_read_ctr(u32 cpu, u32 ctr)
65364 +{
65365 +       u32 val;
65366 +       u32 phys_ctr = ctr & (NR_PHYS_CTRS - 1);
65367 +
65368 +       val = ps3_read_phys_ctr(cpu, phys_ctr);
65369 +
65370 +       if (ps3_get_ctr_size(cpu, phys_ctr) == 16)
65371 +               val = (ctr < NR_PHYS_CTRS) ? (val >> 16) : (val & 0xffff);
65372 +
65373 +       return val;
65374 +}
65375 +EXPORT_SYMBOL_GPL(ps3_read_ctr);
65376 +
65377 +/**
65378 + * ps3_write_ctr - Write counter.
65379 + *
65380 + * Write 16 or 32 bits depending on the current size of the counter.
65381 + * Counters 4, 5, 6 & 7 are always 16 bit.
65382 + */
65383 +
65384 +void ps3_write_ctr(u32 cpu, u32 ctr, u32 val)
65385 +{
65386 +       u32 phys_ctr;
65387 +       u32 phys_val;
65388 +
65389 +       phys_ctr = ctr & (NR_PHYS_CTRS - 1);
65390 +
65391 +       if (ps3_get_ctr_size(cpu, phys_ctr) == 16) {
65392 +               phys_val = ps3_read_phys_ctr(cpu, phys_ctr);
65393 +
65394 +               if (ctr < NR_PHYS_CTRS)
65395 +                       val = (val << 16) | (phys_val & 0xffff);
65396 +               else
65397 +                       val = (val & 0xffff) | (phys_val & 0xffff0000);
65398 +       }
65399 +
65400 +       ps3_write_phys_ctr(cpu, phys_ctr, val);
65401 +}
65402 +EXPORT_SYMBOL_GPL(ps3_write_ctr);
65403 +
65404 +/**
65405 + * ps3_read_pm07_control - Read counter control registers.
65406 + *
65407 + * Each logical counter has a corresponding control register.
65408 + */
65409 +
65410 +u32 ps3_read_pm07_control(u32 cpu, u32 ctr)
65411 +{
65412 +       return 0;
65413 +}
65414 +EXPORT_SYMBOL_GPL(ps3_read_pm07_control);
65415 +
65416 +/**
65417 + * ps3_write_pm07_control - Write counter control registers.
65418 + *
65419 + * Each logical counter has a corresponding control register.
65420 + */
65421 +
65422 +void ps3_write_pm07_control(u32 cpu, u32 ctr, u32 val)
65423 +{
65424 +       int result;
65425 +       static const u64 mask = 0xFFFFFFFFFFFFFFFFULL;
65426 +       u64 old_value;
65427 +
65428 +       if (ctr >= NR_CTRS) {
65429 +               dev_dbg(sbd_core(), "%s:%u: ctr too big: %u\n", __func__,
65430 +                       __LINE__, ctr);
65431 +               return;
65432 +       }
65433 +
65434 +       result = lv1_set_lpm_counter_control(lpm_priv->lpm_id, ctr, val, mask,
65435 +                                            &old_value);
65436 +       if (result)
65437 +               dev_err(sbd_core(), "%s:%u: lv1_set_lpm_counter_control "
65438 +                       "failed: ctr %u, %s\n", __func__, __LINE__, ctr,
65439 +                       ps3_result(result));
65440 +}
65441 +EXPORT_SYMBOL_GPL(ps3_write_pm07_control);
65442 +
65443 +/**
65444 + * ps3_read_pm - Read Other LPM control registers.
65445 + */
65446 +
65447 +u32 ps3_read_pm(u32 cpu, enum pm_reg_name reg)
65448 +{
65449 +       int result = 0;
65450 +       u64 val = 0;
65451 +
65452 +       switch (reg) {
65453 +       case pm_control:
65454 +               return lpm_priv->shadow.pm_control;
65455 +       case trace_address:
65456 +               return CBE_PM_TRACE_BUF_EMPTY;
65457 +       case pm_start_stop:
65458 +               return lpm_priv->shadow.pm_start_stop;
65459 +       case pm_interval:
65460 +               return lpm_priv->shadow.pm_interval;
65461 +       case group_control:
65462 +               return lpm_priv->shadow.group_control;
65463 +       case debug_bus_control:
65464 +               return lpm_priv->shadow.debug_bus_control;
65465 +       case pm_status:
65466 +               result = lv1_get_lpm_interrupt_status(lpm_priv->lpm_id,
65467 +                                                     &val);
65468 +               if (result) {
65469 +                       val = 0;
65470 +                       dev_dbg(sbd_core(), "%s:%u: lv1 get_lpm_status failed: "
65471 +                               "reg %u, %s\n", __func__, __LINE__, reg,
65472 +                               ps3_result(result));
65473 +               }
65474 +               return (u32)val;
65475 +       case ext_tr_timer:
65476 +               return 0;
65477 +       default:
65478 +               dev_dbg(sbd_core(), "%s:%u: unknown reg: %d\n", __func__,
65479 +                       __LINE__, reg);
65480 +               BUG();
65481 +               break;
65482 +       }
65483 +
65484 +       return 0;
65485 +}
65486 +EXPORT_SYMBOL_GPL(ps3_read_pm);
65487 +
65488 +/**
65489 + * ps3_write_pm - Write Other LPM control registers.
65490 + */
65491 +
65492 +void ps3_write_pm(u32 cpu, enum pm_reg_name reg, u32 val)
65493 +{
65494 +       int result = 0;
65495 +       u64 dummy;
65496 +
65497 +       switch (reg) {
65498 +       case group_control:
65499 +               if (val != lpm_priv->shadow.group_control)
65500 +                       result = lv1_set_lpm_group_control(lpm_priv->lpm_id,
65501 +                                                          val,
65502 +                                                          PS3_WRITE_PM_MASK,
65503 +                                                          &dummy);
65504 +               lpm_priv->shadow.group_control = val;
65505 +               break;
65506 +       case debug_bus_control:
65507 +               if (val != lpm_priv->shadow.debug_bus_control)
65508 +                       result = lv1_set_lpm_debug_bus_control(lpm_priv->lpm_id,
65509 +                                                             val,
65510 +                                                             PS3_WRITE_PM_MASK,
65511 +                                                             &dummy);
65512 +               lpm_priv->shadow.debug_bus_control = val;
65513 +               break;
65514 +       case pm_control:
65515 +               if (use_start_stop_bookmark)
65516 +                       val |= (PS3_PM_CONTROL_PPU_TH0_BOOKMARK |
65517 +                               PS3_PM_CONTROL_PPU_TH1_BOOKMARK);
65518 +               if (val != lpm_priv->shadow.pm_control)
65519 +                       result = lv1_set_lpm_general_control(lpm_priv->lpm_id,
65520 +                                                            val,
65521 +                                                            PS3_WRITE_PM_MASK,
65522 +                                                            0, 0, &dummy,
65523 +                                                            &dummy);
65524 +               lpm_priv->shadow.pm_control = val;
65525 +               break;
65526 +       case pm_interval:
65527 +               if (val != lpm_priv->shadow.pm_interval)
65528 +                       result = lv1_set_lpm_interval(lpm_priv->lpm_id, val,
65529 +                                                  PS3_WRITE_PM_MASK, &dummy);
65530 +               lpm_priv->shadow.pm_interval = val;
65531 +               break;
65532 +       case pm_start_stop:
65533 +               if (val != lpm_priv->shadow.pm_start_stop)
65534 +                       result = lv1_set_lpm_trigger_control(lpm_priv->lpm_id,
65535 +                                                            val,
65536 +                                                            PS3_WRITE_PM_MASK,
65537 +                                                            &dummy);
65538 +               lpm_priv->shadow.pm_start_stop = val;
65539 +               break;
65540 +       case trace_address:
65541 +       case ext_tr_timer:
65542 +       case pm_status:
65543 +               break;
65544 +       default:
65545 +               dev_dbg(sbd_core(), "%s:%u: unknown reg: %d\n", __func__,
65546 +                       __LINE__, reg);
65547 +               BUG();
65548 +               break;
65549 +       }
65550 +
65551 +       if (result)
65552 +               dev_err(sbd_core(), "%s:%u: lv1 set_control failed: "
65553 +                       "reg %u, %s\n", __func__, __LINE__, reg,
65554 +                       ps3_result(result));
65555 +}
65556 +EXPORT_SYMBOL_GPL(ps3_write_pm);
65557 +
65558 +/**
65559 + * ps3_get_ctr_size - Get the size of a physical counter.
65560 + *
65561 + * Returns either 16 or 32.
65562 + */
65563 +
65564 +u32 ps3_get_ctr_size(u32 cpu, u32 phys_ctr)
65565 +{
65566 +       u32 pm_ctrl;
65567 +
65568 +       if (phys_ctr >= NR_PHYS_CTRS) {
65569 +               dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__,
65570 +                       __LINE__, phys_ctr);
65571 +               return 0;
65572 +       }
65573 +
65574 +       pm_ctrl = ps3_read_pm(cpu, pm_control);
65575 +       return (pm_ctrl & CBE_PM_16BIT_CTR(phys_ctr)) ? 16 : 32;
65576 +}
65577 +EXPORT_SYMBOL_GPL(ps3_get_ctr_size);
65578 +
65579 +/**
65580 + * ps3_set_ctr_size - Set the size of a physical counter to 16 or 32 bits.
65581 + */
65582 +
65583 +void ps3_set_ctr_size(u32 cpu, u32 phys_ctr, u32 ctr_size)
65584 +{
65585 +       u32 pm_ctrl;
65586 +
65587 +       if (phys_ctr >= NR_PHYS_CTRS) {
65588 +               dev_dbg(sbd_core(), "%s:%u: phys_ctr too big: %u\n", __func__,
65589 +                       __LINE__, phys_ctr);
65590 +               return;
65591 +       }
65592 +
65593 +       pm_ctrl = ps3_read_pm(cpu, pm_control);
65594 +
65595 +       switch (ctr_size) {
65596 +       case 16:
65597 +               pm_ctrl |= CBE_PM_16BIT_CTR(phys_ctr);
65598 +               ps3_write_pm(cpu, pm_control, pm_ctrl);
65599 +               break;
65600 +
65601 +       case 32:
65602 +               pm_ctrl &= ~CBE_PM_16BIT_CTR(phys_ctr);
65603 +               ps3_write_pm(cpu, pm_control, pm_ctrl);
65604 +               break;
65605 +       default:
65606 +               BUG();
65607 +       }
65608 +}
65609 +EXPORT_SYMBOL_GPL(ps3_set_ctr_size);
65610 +
65611 +static u64 pm_translate_signal_group_number_on_island2(u64 subgroup)
65612 +{
65613 +
65614 +       if (subgroup == 2)
65615 +               subgroup = 3;
65616 +
65617 +       if (subgroup <= 6)
65618 +               return PM_ISLAND2_BASE_SIGNAL_GROUP_NUMBER + subgroup;
65619 +       else if (subgroup == 7)
65620 +               return PM_ISLAND2_SIGNAL_GROUP_NUMBER1;
65621 +       else
65622 +               return PM_ISLAND2_SIGNAL_GROUP_NUMBER2;
65623 +}
65624 +
65625 +static u64 pm_translate_signal_group_number_on_island3(u64 subgroup)
65626 +{
65627 +
65628 +       switch (subgroup) {
65629 +       case 2:
65630 +       case 3:
65631 +       case 4:
65632 +               subgroup += 2;
65633 +               break;
65634 +       case 5:
65635 +               subgroup = 8;
65636 +               break;
65637 +       default:
65638 +               break;
65639 +       }
65640 +       return PM_ISLAND3_BASE_SIGNAL_GROUP_NUMBER + subgroup;
65641 +}
65642 +
65643 +static u64 pm_translate_signal_group_number_on_island4(u64 subgroup)
65644 +{
65645 +       return PM_ISLAND4_BASE_SIGNAL_GROUP_NUMBER + subgroup;
65646 +}
65647 +
65648 +static u64 pm_translate_signal_group_number_on_island5(u64 subgroup)
65649 +{
65650 +
65651 +       switch (subgroup) {
65652 +       case 3:
65653 +               subgroup = 4;
65654 +               break;
65655 +       case 4:
65656 +               subgroup = 6;
65657 +               break;
65658 +       default:
65659 +               break;
65660 +       }
65661 +       return PM_ISLAND5_BASE_SIGNAL_GROUP_NUMBER + subgroup;
65662 +}
65663 +
65664 +static u64 pm_translate_signal_group_number_on_island6(u64 subgroup,
65665 +                                                      u64 subsubgroup)
65666 +{
65667 +       switch (subgroup) {
65668 +       case 3:
65669 +       case 4:
65670 +       case 5:
65671 +               subgroup += 1;
65672 +               break;
65673 +       default:
65674 +               break;
65675 +       }
65676 +
65677 +       switch (subsubgroup) {
65678 +       case 4:
65679 +       case 5:
65680 +       case 6:
65681 +               subsubgroup += 2;
65682 +               break;
65683 +       case 7:
65684 +       case 8:
65685 +       case 9:
65686 +       case 10:
65687 +               subsubgroup += 4;
65688 +               break;
65689 +       case 11:
65690 +       case 12:
65691 +       case 13:
65692 +               subsubgroup += 5;
65693 +               break;
65694 +       default:
65695 +               break;
65696 +       }
65697 +
65698 +       if (subgroup <= 5)
65699 +               return (PM_ISLAND6_BASE_SIGNAL_GROUP_NUMBER + subgroup);
65700 +       else
65701 +               return (PM_ISLAND6_BASE_SIGNAL_GROUP_NUMBER + subgroup
65702 +                       + subsubgroup - 1);
65703 +}
65704 +
65705 +static u64 pm_translate_signal_group_number_on_island7(u64 subgroup)
65706 +{
65707 +       return PM_ISLAND7_BASE_SIGNAL_GROUP_NUMBER + subgroup;
65708 +}
65709 +
65710 +static u64 pm_translate_signal_group_number_on_island8(u64 subgroup)
65711 +{
65712 +       return PM_ISLAND8_BASE_SIGNAL_GROUP_NUMBER + subgroup;
65713 +}
65714 +
65715 +static u64 pm_signal_group_to_ps3_lv1_signal_group(u64 group)
65716 +{
65717 +       u64 island;
65718 +       u64 subgroup;
65719 +       u64 subsubgroup;
65720 +
65721 +       subgroup = 0;
65722 +       subsubgroup = 0;
65723 +       island = 0;
65724 +       if (group < 1000) {
65725 +               if (group < 100) {
65726 +                       if (20 <= group && group < 30) {
65727 +                               island = 2;
65728 +                               subgroup = group - 20;
65729 +                       } else if (30 <= group && group < 40) {
65730 +                               island = 3;
65731 +                               subgroup = group - 30;
65732 +                       } else if (40 <= group && group < 50) {
65733 +                               island = 4;
65734 +                               subgroup = group - 40;
65735 +                       } else if (50 <= group && group < 60) {
65736 +                               island = 5;
65737 +                               subgroup = group - 50;
65738 +                       } else if (60 <= group && group < 70) {
65739 +                               island = 6;
65740 +                               subgroup = group - 60;
65741 +                       } else if (70 <= group && group < 80) {
65742 +                               island = 7;
65743 +                               subgroup = group - 70;
65744 +                       } else if (80 <= group && group < 90) {
65745 +                               island = 8;
65746 +                               subgroup = group - 80;
65747 +                       }
65748 +               } else if (200 <= group && group < 300) {
65749 +                       island = 2;
65750 +                       subgroup = group - 200;
65751 +               } else if (600 <= group && group < 700) {
65752 +                       island = 6;
65753 +                       subgroup = 5;
65754 +                       subsubgroup = group - 650;
65755 +               }
65756 +       } else if (6000 <= group && group < 7000) {
65757 +               island = 6;
65758 +               subgroup = 5;
65759 +               subsubgroup = group - 6500;
65760 +       }
65761 +
65762 +       switch (island) {
65763 +       case 2:
65764 +               return pm_translate_signal_group_number_on_island2(subgroup);
65765 +       case 3:
65766 +               return pm_translate_signal_group_number_on_island3(subgroup);
65767 +       case 4:
65768 +               return pm_translate_signal_group_number_on_island4(subgroup);
65769 +       case 5:
65770 +               return pm_translate_signal_group_number_on_island5(subgroup);
65771 +       case 6:
65772 +               return pm_translate_signal_group_number_on_island6(subgroup,
65773 +                                                                  subsubgroup);
65774 +       case 7:
65775 +               return pm_translate_signal_group_number_on_island7(subgroup);
65776 +       case 8:
65777 +               return pm_translate_signal_group_number_on_island8(subgroup);
65778 +       default:
65779 +               dev_dbg(sbd_core(), "%s:%u: island not found: %lu\n", __func__,
65780 +                       __LINE__, group);
65781 +               BUG();
65782 +               break;
65783 +       }
65784 +       return 0;
65785 +}
65786 +
65787 +static u64 pm_bus_word_to_ps3_lv1_bus_word(u8 word)
65788 +{
65789 +
65790 +       switch (word) {
65791 +       case 1:
65792 +               return 0xF000;
65793 +       case 2:
65794 +               return 0x0F00;
65795 +       case 4:
65796 +               return 0x00F0;
65797 +       case 8:
65798 +       default:
65799 +               return 0x000F;
65800 +       }
65801 +}
65802 +
65803 +static int __ps3_set_signal(u64 lv1_signal_group, u64 bus_select,
65804 +                           u64 signal_select, u64 attr1, u64 attr2, u64 attr3)
65805 +{
65806 +       int ret;
65807 +
65808 +       ret = lv1_set_lpm_signal(lpm_priv->lpm_id, lv1_signal_group, bus_select,
65809 +                                signal_select, attr1, attr2, attr3);
65810 +       if (ret)
65811 +               dev_err(sbd_core(),
65812 +                       "%s:%u: error:%d 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx\n",
65813 +                       __func__, __LINE__, ret, lv1_signal_group, bus_select,
65814 +                       signal_select, attr1, attr2, attr3);
65815 +
65816 +       return ret;
65817 +}
65818 +
65819 +int ps3_set_signal(u64 signal_group, u8 signal_bit, u16 sub_unit,
65820 +                  u8 bus_word)
65821 +{
65822 +       int ret;
65823 +       u64 lv1_signal_group;
65824 +       u64 bus_select;
65825 +       u64 signal_select;
65826 +       u64 attr1, attr2, attr3;
65827 +
65828 +       if (signal_group == 0)
65829 +               return __ps3_set_signal(0, 0, 0, 0, 0, 0);
65830 +
65831 +       lv1_signal_group =
65832 +               pm_signal_group_to_ps3_lv1_signal_group(signal_group);
65833 +       bus_select = pm_bus_word_to_ps3_lv1_bus_word(bus_word);
65834 +
65835 +       switch (signal_group) {
65836 +       case PM_SIG_GROUP_SPU_TRIGGER:
65837 +               signal_select = 1;
65838 +               signal_select = signal_select << (63 - signal_bit);
65839 +               break;
65840 +       case PM_SIG_GROUP_SPU_EVENT:
65841 +               signal_select = 1;
65842 +               signal_select = (signal_select << (63 - signal_bit)) | 0x3;
65843 +               break;
65844 +       default:
65845 +               signal_select = 0;
65846 +               break;
65847 +       }
65848 +
65849 +       /*
65850 +        * 0: physical object.
65851 +        * 1: logical object.
65852 +        * This parameter is only used for the PPE and SPE signals.
65853 +        */
65854 +       attr1 = 1;
65855 +
65856 +       /*
65857 +        * This parameter is used to specify the target physical/logical
65858 +        * PPE/SPE object.
65859 +        */
65860 +       if (PM_SIG_GROUP_SPU <= signal_group &&
65861 +               signal_group < PM_SIG_GROUP_MFC_MAX)
65862 +               attr2 = sub_unit;
65863 +       else
65864 +               attr2 = lpm_priv->pu_id;
65865 +
65866 +       /*
65867 +        * This parameter is only used for setting the SPE signal.
65868 +        */
65869 +       attr3 = 0;
65870 +
65871 +       ret = __ps3_set_signal(lv1_signal_group, bus_select, signal_select,
65872 +                              attr1, attr2, attr3);
65873 +       if (ret)
65874 +               dev_err(sbd_core(), "%s:%u: __ps3_set_signal failed: %d\n",
65875 +                       __func__, __LINE__, ret);
65876 +
65877 +       return ret;
65878 +}
65879 +EXPORT_SYMBOL_GPL(ps3_set_signal);
65880 +
65881 +u32 ps3_get_hw_thread_id(int cpu)
65882 +{
65883 +       return get_hard_smp_processor_id(cpu);
65884 +}
65885 +EXPORT_SYMBOL_GPL(ps3_get_hw_thread_id);
65886 +
65887 +/**
65888 + * ps3_enable_pm - Enable the entire performance monitoring unit.
65889 + *
65890 + * When we enable the LPM, all pending writes to counters get committed.
65891 + */
65892 +
65893 +void ps3_enable_pm(u32 cpu)
65894 +{
65895 +       int result;
65896 +       u64 tmp;
65897 +       int insert_bookmark = 0;
65898 +
65899 +       lpm_priv->tb_count = 0;
65900 +
65901 +       if (use_start_stop_bookmark) {
65902 +               if (!(lpm_priv->shadow.pm_start_stop &
65903 +                       (PS3_PM_START_STOP_START_MASK
65904 +                       | PS3_PM_START_STOP_STOP_MASK))) {
65905 +                       result = lv1_set_lpm_trigger_control(lpm_priv->lpm_id,
65906 +                               (PS3_PM_START_STOP_PPU_TH0_BOOKMARK_START |
65907 +                               PS3_PM_START_STOP_PPU_TH1_BOOKMARK_START |
65908 +                               PS3_PM_START_STOP_PPU_TH0_BOOKMARK_STOP |
65909 +                               PS3_PM_START_STOP_PPU_TH1_BOOKMARK_STOP),
65910 +                               0xFFFFFFFFFFFFFFFFULL, &tmp);
65911 +
65912 +                       if (result)
65913 +                               dev_err(sbd_core(), "%s:%u: "
65914 +                                       "lv1_set_lpm_trigger_control failed: "
65915 +                                       "%s\n", __func__, __LINE__,
65916 +                                       ps3_result(result));
65917 +
65918 +                       insert_bookmark = !result;
65919 +               }
65920 +       }
65921 +
65922 +       result = lv1_start_lpm(lpm_priv->lpm_id);
65923 +
65924 +       if (result)
65925 +               dev_err(sbd_core(), "%s:%u: lv1_start_lpm failed: %s\n",
65926 +                       __func__, __LINE__, ps3_result(result));
65927 +
65928 +       if (use_start_stop_bookmark && !result && insert_bookmark)
65929 +               ps3_set_bookmark(get_tb() | PS3_PM_BOOKMARK_START);
65930 +}
65931 +EXPORT_SYMBOL_GPL(ps3_enable_pm);
65932 +
65933 +/**
65934 + * ps3_disable_pm - Disable the entire performance monitoring unit.
65935 + */
65936 +
65937 +void ps3_disable_pm(u32 cpu)
65938 +{
65939 +       int result;
65940 +       u64 tmp;
65941 +
65942 +       ps3_set_bookmark(get_tb() | PS3_PM_BOOKMARK_STOP);
65943 +
65944 +       result = lv1_stop_lpm(lpm_priv->lpm_id, &tmp);
65945 +
65946 +       if (result) {
65947 +               if(result != LV1_WRONG_STATE)
65948 +                       dev_err(sbd_core(), "%s:%u: lv1_stop_lpm failed: %s\n",
65949 +                               __func__, __LINE__, ps3_result(result));
65950 +               return;
65951 +       }
65952 +
65953 +       lpm_priv->tb_count = tmp;
65954 +
65955 +       dev_dbg(sbd_core(), "%s:%u: tb_count %lu (%lxh)\n", __func__, __LINE__,
65956 +               lpm_priv->tb_count, lpm_priv->tb_count);
65957 +}
65958 +EXPORT_SYMBOL_GPL(ps3_disable_pm);
65959 +
65960 +/**
65961 + * ps3_lpm_copy_tb - Copy data from the trace buffer to a kernel buffer.
65962 + * @offset: Offset in bytes from the start of the trace buffer.
65963 + * @buf: Copy destination.
65964 + * @count: Maximum count of bytes to copy.
65965 + * @bytes_copied: Pointer to a variable that will recieve the number of
65966 + *  bytes copied to @buf.
65967 + *
65968 + * On error @buf will contain any successfully copied trace buffer data
65969 + * and bytes_copied will be set to the number of bytes successfully copied.
65970 + */
65971 +
65972 +int ps3_lpm_copy_tb(unsigned long offset, void *buf, unsigned long count,
65973 +                   unsigned long *bytes_copied)
65974 +{
65975 +       int result;
65976 +
65977 +       *bytes_copied = 0;
65978 +
65979 +       if (!lpm_priv->tb_cache)
65980 +               return -EPERM;
65981 +
65982 +       if (offset >= lpm_priv->tb_count)
65983 +               return 0;
65984 +
65985 +       count = min(count, lpm_priv->tb_count - offset);
65986 +
65987 +       while (*bytes_copied < count) {
65988 +               const unsigned long request = count - *bytes_copied;
65989 +               u64 tmp;
65990 +
65991 +               result = lv1_copy_lpm_trace_buffer(lpm_priv->lpm_id, offset,
65992 +                                                  request, &tmp);
65993 +               if (result) {
65994 +                       dev_dbg(sbd_core(), "%s:%u: 0x%lx bytes at 0x%lx\n",
65995 +                               __func__, __LINE__, request, offset);
65996 +
65997 +                       dev_err(sbd_core(), "%s:%u: lv1_copy_lpm_trace_buffer "
65998 +                               "failed: %s\n", __func__, __LINE__,
65999 +                               ps3_result(result));
66000 +                       return result == LV1_WRONG_STATE ? -EBUSY : -EINVAL;
66001 +               }
66002 +
66003 +               memcpy(buf, lpm_priv->tb_cache, tmp);
66004 +               buf += tmp;
66005 +               *bytes_copied += tmp;
66006 +               offset += tmp;
66007 +       }
66008 +       dev_dbg(sbd_core(), "%s:%u: copied %lxh bytes\n", __func__, __LINE__,
66009 +               *bytes_copied);
66010 +
66011 +       return 0;
66012 +}
66013 +EXPORT_SYMBOL_GPL(ps3_lpm_copy_tb);
66014 +
66015 +/**
66016 + * ps3_lpm_copy_tb_to_user - Copy data from the trace buffer to a user buffer.
66017 + * @offset: Offset in bytes from the start of the trace buffer.
66018 + * @buf: A __user copy destination.
66019 + * @count: Maximum count of bytes to copy.
66020 + * @bytes_copied: Pointer to a variable that will recieve the number of
66021 + *  bytes copied to @buf.
66022 + *
66023 + * On error @buf will contain any successfully copied trace buffer data
66024 + * and bytes_copied will be set to the number of bytes successfully copied.
66025 + */
66026 +
66027 +int ps3_lpm_copy_tb_to_user(unsigned long offset, void __user *buf,
66028 +                           unsigned long count, unsigned long *bytes_copied)
66029 +{
66030 +       int result;
66031 +
66032 +       *bytes_copied = 0;
66033 +
66034 +       if (!lpm_priv->tb_cache)
66035 +               return -EPERM;
66036 +
66037 +       if (offset >= lpm_priv->tb_count)
66038 +               return 0;
66039 +
66040 +       count = min(count, lpm_priv->tb_count - offset);
66041 +
66042 +       while (*bytes_copied < count) {
66043 +               const unsigned long request = count - *bytes_copied;
66044 +               u64 tmp;
66045 +
66046 +               result = lv1_copy_lpm_trace_buffer(lpm_priv->lpm_id, offset,
66047 +                                                  request, &tmp);
66048 +               if (result) {
66049 +                       dev_dbg(sbd_core(), "%s:%u: 0x%lx bytes at 0x%lx\n",
66050 +                               __func__, __LINE__, request, offset);
66051 +                       dev_err(sbd_core(), "%s:%u: lv1_copy_lpm_trace_buffer "
66052 +                               "failed: %s\n", __func__, __LINE__,
66053 +                               ps3_result(result));
66054 +                       return result == LV1_WRONG_STATE ? -EBUSY : -EINVAL;
66055 +               }
66056 +
66057 +               result = copy_to_user(buf, lpm_priv->tb_cache, tmp);
66058 +
66059 +               if (result) {
66060 +                       dev_dbg(sbd_core(), "%s:%u: 0x%lx bytes at 0x%p\n",
66061 +                               __func__, __LINE__, tmp, buf);
66062 +                       dev_err(sbd_core(), "%s:%u: copy_to_user failed: %d\n",
66063 +                               __func__, __LINE__, result);
66064 +                       return -EFAULT;
66065 +               }
66066 +
66067 +               buf += tmp;
66068 +               *bytes_copied += tmp;
66069 +               offset += tmp;
66070 +       }
66071 +       dev_dbg(sbd_core(), "%s:%u: copied %lxh bytes\n", __func__, __LINE__,
66072 +               *bytes_copied);
66073 +
66074 +       return 0;
66075 +}
66076 +EXPORT_SYMBOL_GPL(ps3_lpm_copy_tb_to_user);
66077 +
66078 +/**
66079 + * ps3_get_and_clear_pm_interrupts -
66080 + *
66081 + * Clearing interrupts for the entire performance monitoring unit.
66082 + * Reading pm_status clears the interrupt bits.
66083 + */
66084 +
66085 +u32 ps3_get_and_clear_pm_interrupts(u32 cpu)
66086 +{
66087 +       return ps3_read_pm(cpu, pm_status);
66088 +}
66089 +EXPORT_SYMBOL_GPL(ps3_get_and_clear_pm_interrupts);
66090 +
66091 +/**
66092 + * ps3_enable_pm_interrupts -
66093 + *
66094 + * Enabling interrupts for the entire performance monitoring unit.
66095 + * Enables the interrupt bits in the pm_status register.
66096 + */
66097 +
66098 +void ps3_enable_pm_interrupts(u32 cpu, u32 thread, u32 mask)
66099 +{
66100 +       if (mask)
66101 +               ps3_write_pm(cpu, pm_status, mask);
66102 +}
66103 +EXPORT_SYMBOL_GPL(ps3_enable_pm_interrupts);
66104 +
66105 +/**
66106 + * ps3_enable_pm_interrupts -
66107 + *
66108 + * Disabling interrupts for the entire performance monitoring unit.
66109 + */
66110 +
66111 +void ps3_disable_pm_interrupts(u32 cpu)
66112 +{
66113 +       ps3_get_and_clear_pm_interrupts(cpu);
66114 +       ps3_write_pm(cpu, pm_status, 0);
66115 +}
66116 +EXPORT_SYMBOL_GPL(ps3_disable_pm_interrupts);
66117 +
66118 +/**
66119 + * ps3_lpm_open - Open the logical performance monitor device.
66120 + * @tb_type: Specifies the type of trace buffer lv1 sould use for this lpm
66121 + *  instance, specified by one of enum ps3_lpm_tb_type.
66122 + * @tb_cache: Optional user supplied buffer to use as the trace buffer cache.
66123 + *  If NULL, the driver will allocate and manage an internal buffer.
66124 + *  Unused when when @tb_type is PS3_LPM_TB_TYPE_NONE.
66125 + * @tb_cache_size: The size in bytes of the user supplied @tb_cache buffer.
66126 + *  Unused when @tb_cache is NULL or @tb_type is PS3_LPM_TB_TYPE_NONE.
66127 + */
66128 +
66129 +int ps3_lpm_open(enum ps3_lpm_tb_type tb_type, void *tb_cache,
66130 +       u64 tb_cache_size)
66131 +{
66132 +       int result;
66133 +       u64 tb_size;
66134 +
66135 +       BUG_ON(!lpm_priv);
66136 +       BUG_ON(tb_type != PS3_LPM_TB_TYPE_NONE
66137 +               && tb_type != PS3_LPM_TB_TYPE_INTERNAL);
66138 +
66139 +       if (tb_type == PS3_LPM_TB_TYPE_NONE && tb_cache)
66140 +               dev_dbg(sbd_core(), "%s:%u: bad in vals\n", __func__, __LINE__);
66141 +
66142 +       if (!atomic_add_unless(&lpm_priv->open, 1, 1)) {
66143 +               dev_dbg(sbd_core(), "%s:%u: busy\n", __func__, __LINE__);
66144 +               return -EBUSY;
66145 +       }
66146 +
66147 +       /* Note tb_cache needs 128 byte alignment. */
66148 +
66149 +       if (tb_type == PS3_LPM_TB_TYPE_NONE) {
66150 +               lpm_priv->tb_cache_size = 0;
66151 +               lpm_priv->tb_cache_internal = NULL;
66152 +               lpm_priv->tb_cache = NULL;
66153 +       } else if (tb_cache) {
66154 +               if (tb_cache != (void *)_ALIGN_UP((unsigned long)tb_cache, 128)
66155 +                       || tb_cache_size != _ALIGN_UP(tb_cache_size, 128)) {
66156 +                       dev_err(sbd_core(), "%s:%u: unaligned tb_cache\n",
66157 +                               __func__, __LINE__);
66158 +                       result = -EINVAL;
66159 +                       goto fail_align;
66160 +               }
66161 +               lpm_priv->tb_cache_size = tb_cache_size;
66162 +               lpm_priv->tb_cache_internal = NULL;
66163 +               lpm_priv->tb_cache = tb_cache;
66164 +       } else {
66165 +               lpm_priv->tb_cache_size = PS3_LPM_DEFAULT_TB_CACHE_SIZE;
66166 +               lpm_priv->tb_cache_internal = kzalloc(
66167 +                       lpm_priv->tb_cache_size + 127, GFP_KERNEL);
66168 +               if (!lpm_priv->tb_cache_internal) {
66169 +                       dev_err(sbd_core(), "%s:%u: alloc internal tb_cache "
66170 +                               "failed\n", __func__, __LINE__);
66171 +                       result = -ENOMEM;
66172 +                       goto fail_malloc;
66173 +               }
66174 +               lpm_priv->tb_cache = (void *)_ALIGN_UP(
66175 +                       (unsigned long)lpm_priv->tb_cache_internal, 128);
66176 +       }
66177 +
66178 +       result = lv1_construct_lpm(lpm_priv->node_id, tb_type, 0, 0,
66179 +                               ps3_mm_phys_to_lpar(__pa(lpm_priv->tb_cache)),
66180 +                               lpm_priv->tb_cache_size, &lpm_priv->lpm_id,
66181 +                               &lpm_priv->outlet_id, &tb_size);
66182 +
66183 +       if (result) {
66184 +               dev_err(sbd_core(), "%s:%u: lv1_construct_lpm failed: %s\n",
66185 +                       __func__, __LINE__, ps3_result(result));
66186 +               result = -EINVAL;
66187 +               goto fail_construct;
66188 +       }
66189 +
66190 +       lpm_priv->shadow.pm_control = PS3_LPM_SHADOW_REG_INIT;
66191 +       lpm_priv->shadow.pm_start_stop = PS3_LPM_SHADOW_REG_INIT;
66192 +       lpm_priv->shadow.pm_interval = PS3_LPM_SHADOW_REG_INIT;
66193 +       lpm_priv->shadow.group_control = PS3_LPM_SHADOW_REG_INIT;
66194 +       lpm_priv->shadow.debug_bus_control = PS3_LPM_SHADOW_REG_INIT;
66195 +
66196 +       dev_dbg(sbd_core(), "%s:%u: lpm_id 0x%lx, outlet_id 0x%lx, "
66197 +               "tb_size 0x%lx\n", __func__, __LINE__, lpm_priv->lpm_id,
66198 +               lpm_priv->outlet_id, tb_size);
66199 +
66200 +       return 0;
66201 +
66202 +fail_construct:
66203 +       kfree(lpm_priv->tb_cache_internal);
66204 +       lpm_priv->tb_cache_internal = NULL;
66205 +fail_malloc:
66206 +fail_align:
66207 +       atomic_dec(&lpm_priv->open);
66208 +       return result;
66209 +}
66210 +EXPORT_SYMBOL_GPL(ps3_lpm_open);
66211 +
66212 +/**
66213 + * ps3_lpm_close - Close the lpm device.
66214 + *
66215 + */
66216 +
66217 +int ps3_lpm_close(void)
66218 +{
66219 +       dev_dbg(sbd_core(), "%s:%u\n", __func__, __LINE__);
66220 +
66221 +       lv1_destruct_lpm(lpm_priv->lpm_id);
66222 +       lpm_priv->lpm_id = 0;
66223 +
66224 +       kfree(lpm_priv->tb_cache_internal);
66225 +       lpm_priv->tb_cache_internal = NULL;
66226 +
66227 +       atomic_dec(&lpm_priv->open);
66228 +       return 0;
66229 +}
66230 +EXPORT_SYMBOL_GPL(ps3_lpm_close);
66231 +
66232 +static int __devinit ps3_lpm_probe(struct ps3_system_bus_device *dev)
66233 +{
66234 +       dev_dbg(&dev->core, " -> %s:%u\n", __func__, __LINE__);
66235 +
66236 +       if (lpm_priv) {
66237 +               dev_info(&dev->core, "%s:%u: called twice\n",
66238 +                       __func__, __LINE__);
66239 +               return -EBUSY;
66240 +       }
66241 +
66242 +       lpm_priv = kzalloc(sizeof(*lpm_priv), GFP_KERNEL);
66243 +
66244 +       if (!lpm_priv)
66245 +               return -ENOMEM;
66246 +
66247 +       lpm_priv->sbd = dev;
66248 +       lpm_priv->node_id = dev->lpm.node_id;
66249 +       lpm_priv->pu_id = dev->lpm.pu_id;
66250 +       lpm_priv->rights = dev->lpm.rights;
66251 +
66252 +       dev_info(&dev->core, " <- %s:%u:\n", __func__, __LINE__);
66253 +
66254 +       return 0;
66255 +}
66256 +
66257 +static int ps3_lpm_remove(struct ps3_system_bus_device *dev)
66258 +{
66259 +       dev_dbg(&dev->core, " -> %s:%u:\n", __func__, __LINE__);
66260 +
66261 +       ps3_lpm_close();
66262 +
66263 +       kfree(lpm_priv);
66264 +       lpm_priv = NULL;
66265 +
66266 +       dev_info(&dev->core, " <- %s:%u:\n", __func__, __LINE__);
66267 +       return 0;
66268 +}
66269 +
66270 +static struct ps3_system_bus_driver ps3_lpm_driver = {
66271 +       .match_id = PS3_MATCH_ID_LPM,
66272 +       .core.name      = "ps3-lpm",
66273 +       .core.owner     = THIS_MODULE,
66274 +       .probe          = ps3_lpm_probe,
66275 +       .remove         = ps3_lpm_remove,
66276 +       .shutdown       = ps3_lpm_remove,
66277 +};
66278 +
66279 +static int __init ps3_lpm_init(void)
66280 +{
66281 +       pr_debug("%s:%d:\n", __func__, __LINE__);
66282 +       return ps3_system_bus_driver_register(&ps3_lpm_driver);
66283 +}
66284 +
66285 +static void __exit ps3_lpm_exit(void)
66286 +{
66287 +       pr_debug("%s:%d:\n", __func__, __LINE__);
66288 +       ps3_system_bus_driver_unregister(&ps3_lpm_driver);
66289 +}
66290 +
66291 +module_init(ps3_lpm_init);
66292 +module_exit(ps3_lpm_exit);
66293 +
66294 +MODULE_LICENSE("GPL v2");
66295 +MODULE_DESCRIPTION("PS3 Logical Performance Monitor Driver");
66296 +MODULE_AUTHOR("Sony Corporation");
66297 +MODULE_ALIAS(PS3_MODULE_ALIAS_LPM);
66298 --- a/drivers/ps3/ps3-sys-manager.c
66299 +++ b/drivers/ps3/ps3-sys-manager.c
66300 @@ -452,7 +452,7 @@
66301         case PS3_SM_EVENT_THERMAL_ALERT:
66302                 dev_dbg(&dev->core, "%s:%d: THERMAL_ALERT (zone %u)\n",
66303                         __func__, __LINE__, event.value);
66304 -               printk(KERN_INFO "PS3 Thermal Alert Zone %u\n", event.value);
66305 +               pr_info("PS3 Thermal Alert Zone %u\n", event.value);
66306                 break;
66307         case PS3_SM_EVENT_THERMAL_CLEARED:
66308                 dev_dbg(&dev->core, "%s:%d: THERMAL_CLEARED (zone %u)\n",
66309 @@ -488,7 +488,7 @@
66310         result = ps3_vuart_read(dev, &cmd, sizeof(cmd));
66311         BUG_ON(result && "need to retry here");
66312  
66313 -       if(result)
66314 +       if (result)
66315                 return result;
66316  
66317         if (cmd.version != 1) {
66318 @@ -521,7 +521,7 @@
66319         result = ps3_vuart_read(dev, &header,
66320                 sizeof(struct ps3_sys_manager_header));
66321  
66322 -       if(result)
66323 +       if (result)
66324                 return result;
66325  
66326         if (header.version != 1) {
66327 @@ -589,9 +589,9 @@
66328                 PS3_SM_WAKE_DEFAULT);
66329         ps3_sys_manager_send_request_shutdown(dev);
66330  
66331 -       printk(KERN_EMERG "System Halted, OK to turn off power\n");
66332 +       pr_emerg("System Halted, OK to turn off power\n");
66333  
66334 -       while(1)
66335 +       while (1)
66336                 ps3_sys_manager_handle_msg(dev);
66337  }
66338  
66339 @@ -626,9 +626,9 @@
66340                 PS3_SM_WAKE_DEFAULT);
66341         ps3_sys_manager_send_request_shutdown(dev);
66342  
66343 -       printk(KERN_EMERG "System Halted, OK to turn off power\n");
66344 +       pr_emerg("System Halted, OK to turn off power\n");
66345  
66346 -       while(1)
66347 +       while (1)
66348                 ps3_sys_manager_handle_msg(dev);
66349  }
66350  
66351 --- a/drivers/ps3/ps3-vuart.c
66352 +++ b/drivers/ps3/ps3-vuart.c
66353 @@ -108,18 +108,18 @@
66354  struct ports_bmp {
66355         u64 status;
66356         u64 unused[3];
66357 -} __attribute__ ((aligned (32)));
66358 +} __attribute__((aligned(32)));
66359  
66360  #define dump_ports_bmp(_b) _dump_ports_bmp(_b, __func__, __LINE__)
66361  static void __maybe_unused _dump_ports_bmp(
66362 -       const struct ports_bmp* bmp, const char* func, int line)
66363 +       const struct ports_bmp *bmp, const char *func, int line)
66364  {
66365         pr_debug("%s:%d: ports_bmp: %016lxh\n", func, line, bmp->status);
66366  }
66367  
66368  #define dump_port_params(_b) _dump_port_params(_b, __func__, __LINE__)
66369  static void __maybe_unused _dump_port_params(unsigned int port_number,
66370 -       const char* func, int line)
66371 +       const char *func, int line)
66372  {
66373  #if defined(DEBUG)
66374         static const char *strings[] = {
66375 @@ -363,7 +363,7 @@
66376   */
66377  
66378  static int ps3_vuart_raw_write(struct ps3_system_bus_device *dev,
66379 -       const void* buf, unsigned int bytes, unsigned long *bytes_written)
66380 +       const void *buf, unsigned int bytes, unsigned long *bytes_written)
66381  {
66382         int result;
66383         struct ps3_vuart_port_priv *priv = to_port_priv(dev);
66384 @@ -431,7 +431,7 @@
66385         int result;
66386         struct ps3_vuart_port_priv *priv = to_port_priv(dev);
66387         u64 bytes_waiting;
66388 -       void* tmp;
66389 +       void *tmp;
66390  
66391         result = ps3_vuart_get_rx_bytes_waiting(dev, &bytes_waiting);
66392  
66393 @@ -526,9 +526,8 @@
66394  
66395         lb = kmalloc(sizeof(struct list_buffer) + bytes, GFP_KERNEL);
66396  
66397 -       if (!lb) {
66398 +       if (!lb)
66399                 return -ENOMEM;
66400 -       }
66401  
66402         memcpy(lb->data, buf, bytes);
66403         lb->head = lb->data;
66404 @@ -878,7 +877,7 @@
66405  struct vuart_bus_priv {
66406         struct ports_bmp *bmp;
66407         unsigned int virq;
66408 -       struct semaphore probe_mutex;
66409 +       struct mutex probe_mutex;
66410         int use_count;
66411         struct ps3_system_bus_device *devices[PORT_COUNT];
66412  } static vuart_bus_priv;
66413 @@ -926,9 +925,8 @@
66414  
66415         BUG_ON(vuart_bus_priv.use_count > 2);
66416  
66417 -       if (vuart_bus_priv.use_count != 1) {
66418 +       if (vuart_bus_priv.use_count != 1)
66419                 return 0;
66420 -       }
66421  
66422         BUG_ON(vuart_bus_priv.bmp);
66423  
66424 @@ -1017,7 +1015,7 @@
66425                 return -EINVAL;
66426         }
66427  
66428 -       down(&vuart_bus_priv.probe_mutex);
66429 +       mutex_lock(&vuart_bus_priv.probe_mutex);
66430  
66431         result = ps3_vuart_bus_interrupt_get();
66432  
66433 @@ -1077,7 +1075,7 @@
66434                 goto fail_probe;
66435         }
66436  
66437 -       up(&vuart_bus_priv.probe_mutex);
66438 +       mutex_unlock(&vuart_bus_priv.probe_mutex);
66439  
66440         return result;
66441  
66442 @@ -1090,7 +1088,7 @@
66443  fail_busy:
66444         ps3_vuart_bus_interrupt_put();
66445  fail_setup_interrupt:
66446 -       up(&vuart_bus_priv.probe_mutex);
66447 +       mutex_unlock(&vuart_bus_priv.probe_mutex);
66448         dev_dbg(&dev->core, "%s:%d: failed\n", __func__, __LINE__);
66449         return result;
66450  }
66451 @@ -1129,7 +1127,7 @@
66452  
66453         BUG_ON(!dev);
66454  
66455 -       down(&vuart_bus_priv.probe_mutex);
66456 +       mutex_lock(&vuart_bus_priv.probe_mutex);
66457  
66458         dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,
66459                 dev->match_id);
66460 @@ -1137,7 +1135,7 @@
66461         if (!dev->core.driver) {
66462                 dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,
66463                         __LINE__);
66464 -               up(&vuart_bus_priv.probe_mutex);
66465 +               mutex_unlock(&vuart_bus_priv.probe_mutex);
66466                 return 0;
66467         }
66468  
66469 @@ -1160,7 +1158,7 @@
66470         priv = NULL;
66471  
66472         dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
66473 -       up(&vuart_bus_priv.probe_mutex);
66474 +       mutex_unlock(&vuart_bus_priv.probe_mutex);
66475         return 0;
66476  }
66477  
66478 @@ -1180,7 +1178,7 @@
66479  
66480         BUG_ON(!dev);
66481  
66482 -       down(&vuart_bus_priv.probe_mutex);
66483 +       mutex_lock(&vuart_bus_priv.probe_mutex);
66484  
66485         dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,
66486                 dev->match_id);
66487 @@ -1188,7 +1186,7 @@
66488         if (!dev->core.driver) {
66489                 dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,
66490                         __LINE__);
66491 -               up(&vuart_bus_priv.probe_mutex);
66492 +               mutex_unlock(&vuart_bus_priv.probe_mutex);
66493                 return 0;
66494         }
66495  
66496 @@ -1212,7 +1210,7 @@
66497  
66498         dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
66499  
66500 -       up(&vuart_bus_priv.probe_mutex);
66501 +       mutex_unlock(&vuart_bus_priv.probe_mutex);
66502         return 0;
66503  }
66504  
66505 @@ -1223,7 +1221,7 @@
66506         if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
66507                 return -ENODEV;
66508  
66509 -       init_MUTEX(&vuart_bus_priv.probe_mutex);
66510 +       mutex_init(&vuart_bus_priv.probe_mutex);
66511  
66512         return 0;
66513  }
66514 --- a/drivers/serial/Kconfig
66515 +++ b/drivers/serial/Kconfig
66516 @@ -1284,4 +1284,14 @@
66517           Currently, only 8250 compatible ports are supported, but
66518           others can easily be added.
66519  
66520 +config SERIAL_QE
66521 +       tristate "Freescale QUICC Engine serial port support"
66522 +       depends on QUICC_ENGINE
66523 +       select SERIAL_CORE
66524 +       select FW_LOADER
66525 +       default n
66526 +       help
66527 +         This driver supports the QE serial ports on Freescale embedded
66528 +         PowerPC that contain a QUICC Engine.
66529 +
66530  endmenu
66531 --- a/drivers/serial/Makefile
66532 +++ b/drivers/serial/Makefile
66533 @@ -64,3 +64,4 @@
66534  obj-$(CONFIG_SERIAL_NETX) += netx-serial.o
66535  obj-$(CONFIG_SERIAL_OF_PLATFORM) += of_serial.o
66536  obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o
66537 +obj-$(CONFIG_SERIAL_QE) += ucc_uart.o
66538 --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
66539 +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
66540 @@ -52,11 +52,7 @@
66541  #ifdef CONFIG_PPC_CPM_NEW_BINDING
66542  void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
66543  {
66544 -       u16 __iomem *cpcr = &cpmp->cp_cpcr;
66545 -
66546 -       out_be16(cpcr, port->command | (cmd << 8) | CPM_CR_FLG);
66547 -       while (in_be16(cpcr) & CPM_CR_FLG)
66548 -               ;
66549 +       cpm_command(port->command, cmd);
66550  }
66551  #else
66552  void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
66553 --- a/drivers/serial/cpm_uart/cpm_uart_cpm2.c
66554 +++ b/drivers/serial/cpm_uart/cpm_uart_cpm2.c
66555 @@ -52,13 +52,7 @@
66556  #ifdef CONFIG_PPC_CPM_NEW_BINDING
66557  void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
66558  {
66559 -       cpm_cpm2_t __iomem *cp = cpm2_map(im_cpm);
66560 -
66561 -       out_be32(&cp->cp_cpcr, port->command | cmd | CPM_CR_FLG);
66562 -       while (in_be32(&cp->cp_cpcr) & CPM_CR_FLG)
66563 -               ;
66564 -
66565 -       cpm2_unmap(cp);
66566 +       cpm_command(port->command, cmd);
66567  }
66568  #else
66569  void cpm_line_cr_cmd(struct uart_cpm_port *port, int cmd)
66570 @@ -171,9 +165,9 @@
66571          * really has to get out of the driver so boards can
66572          * be supported in a sane fashion.
66573          */
66574 +       volatile cpmux_t *cpmux = cpm2_map(im_cpmux);
66575  #ifndef CONFIG_STX_GP3
66576         volatile iop_cpm2_t *io = cpm2_map(im_ioport);
66577 -       volatile cpmux_t *cpmux = cpm2_map(im_cpmux);
66578  
66579         io->iop_pparb |= 0x008b0000;
66580         io->iop_pdirb |= 0x00880000;
66581 --- a/drivers/serial/mpc52xx_uart.c
66582 +++ b/drivers/serial/mpc52xx_uart.c
66583 @@ -36,7 +36,7 @@
66584   * DCD. However, the pin multiplexing aren't changed and should be set either
66585   * by the bootloader or in the platform init code.
66586   *
66587 - * The idx field must be equal to the PSC index ( e.g. 0 for PSC1, 1 for PSC2,
66588 + * The idx field must be equal to the PSC index (e.g. 0 for PSC1, 1 for PSC2,
66589   * and so on). So the PSC1 is mapped to /dev/ttyPSC0, PSC2 to /dev/ttyPSC1 and
66590   * so on. But be warned, it's an ABSOLUTE REQUIREMENT ! This is needed mainly
66591   * fpr the console code : without this 1:1 mapping, at early boot time, when we
66592 @@ -68,11 +68,12 @@
66593  #include <linux/sysrq.h>
66594  #include <linux/console.h>
66595  
66596 -#include <asm/delay.h>
66597 -#include <asm/io.h>
66598 +#include <linux/delay.h>
66599 +#include <linux/io.h>
66600  
66601  #if defined(CONFIG_PPC_MERGE)
66602 -#include <asm/of_platform.h>
66603 +#include <linux/of.h>
66604 +#include <linux/of_platform.h>
66605  #else
66606  #include <linux/platform_device.h>
66607  #endif
66608 @@ -111,16 +112,18 @@
66609  #endif
66610  
66611  #define PSC(port) ((struct mpc52xx_psc __iomem *)((port)->membase))
66612 +#define FIFO(port) ((struct mpc52xx_psc_fifo __iomem *)(PSC(port)+1))
66613  
66614  
66615  /* Forward declaration of the interruption handling routine */
66616 -static irqreturn_t mpc52xx_uart_int(int irq,void *dev_id);
66617 +static irqreturn_t mpc52xx_uart_int(int irq, void *dev_id);
66618  
66619  
66620  /* Simple macro to test if a port is console or not. This one is taken
66621   * for serial_core.c and maybe should be moved to serial_core.h ? */
66622  #ifdef CONFIG_SERIAL_CORE_CONSOLE
66623 -#define uart_console(port)     ((port)->cons && (port)->cons->index == (port)->line)
66624 +#define uart_console(port) \
66625 +       ((port)->cons && (port)->cons->index == (port)->line)
66626  #else
66627  #define uart_console(port)     (0)
66628  #endif
66629 @@ -162,7 +165,7 @@
66630  {
66631         /* port->lock taken by caller */
66632         port->read_status_mask &= ~MPC52xx_PSC_IMR_TXRDY;
66633 -       out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
66634 +       out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
66635  }
66636  
66637  static void
66638 @@ -170,7 +173,7 @@
66639  {
66640         /* port->lock taken by caller */
66641         port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY;
66642 -       out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
66643 +       out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
66644  }
66645  
66646  static void
66647 @@ -184,7 +187,7 @@
66648                 /* Make sure tx interrupts are on */
66649                 /* Truly necessary ??? They should be anyway */
66650                 port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY;
66651 -               out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
66652 +               out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
66653         }
66654  
66655         spin_unlock_irqrestore(&port->lock, flags);
66656 @@ -195,7 +198,7 @@
66657  {
66658         /* port->lock taken by caller */
66659         port->read_status_mask &= ~MPC52xx_PSC_IMR_RXRDY;
66660 -       out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
66661 +       out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
66662  }
66663  
66664  static void
66665 @@ -210,10 +213,10 @@
66666         unsigned long flags;
66667         spin_lock_irqsave(&port->lock, flags);
66668  
66669 -       if ( ctl == -1 )
66670 -               out_8(&PSC(port)->command,MPC52xx_PSC_START_BRK);
66671 +       if (ctl == -1)
66672 +               out_8(&PSC(port)->command, MPC52xx_PSC_START_BRK);
66673         else
66674 -               out_8(&PSC(port)->command,MPC52xx_PSC_STOP_BRK);
66675 +               out_8(&PSC(port)->command, MPC52xx_PSC_STOP_BRK);
66676  
66677         spin_unlock_irqrestore(&port->lock, flags);
66678  }
66679 @@ -222,6 +225,7 @@
66680  mpc52xx_uart_startup(struct uart_port *port)
66681  {
66682         struct mpc52xx_psc __iomem *psc = PSC(port);
66683 +       struct mpc52xx_psc_fifo __iomem *fifo = FIFO(port);
66684         int ret;
66685  
66686         /* Request IRQ */
66687 @@ -231,23 +235,23 @@
66688                 return ret;
66689  
66690         /* Reset/activate the port, clear and enable interrupts */
66691 -       out_8(&psc->command,MPC52xx_PSC_RST_RX);
66692 -       out_8(&psc->command,MPC52xx_PSC_RST_TX);
66693 +       out_8(&psc->command, MPC52xx_PSC_RST_RX);
66694 +       out_8(&psc->command, MPC52xx_PSC_RST_TX);
66695  
66696 -       out_be32(&psc->sicr,0); /* UART mode DCD ignored */
66697 +       out_be32(&psc->sicr, 0);        /* UART mode DCD ignored */
66698  
66699         out_be16(&psc->mpc52xx_psc_clock_select, 0xdd00); /* /16 prescaler on */
66700  
66701 -       out_8(&psc->rfcntl, 0x00);
66702 -       out_be16(&psc->rfalarm, 0x1ff);
66703 -       out_8(&psc->tfcntl, 0x07);
66704 -       out_be16(&psc->tfalarm, 0x80);
66705 +       out_8(&fifo->rfcntl, 0x00);
66706 +       out_be16(&fifo->rfalarm, 0x1ff);
66707 +       out_8(&fifo->tfcntl, 0x07);
66708 +       out_be16(&fifo->tfalarm, 0x80);
66709  
66710         port->read_status_mask |= MPC52xx_PSC_IMR_RXRDY | MPC52xx_PSC_IMR_TXRDY;
66711 -       out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
66712 +       out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask);
66713  
66714 -       out_8(&psc->command,MPC52xx_PSC_TX_ENABLE);
66715 -       out_8(&psc->command,MPC52xx_PSC_RX_ENABLE);
66716 +       out_8(&psc->command, MPC52xx_PSC_TX_ENABLE);
66717 +       out_8(&psc->command, MPC52xx_PSC_RX_ENABLE);
66718  
66719         return 0;
66720  }
66721 @@ -258,12 +262,12 @@
66722         struct mpc52xx_psc __iomem *psc = PSC(port);
66723  
66724         /* Shut down the port.  Leave TX active if on a console port */
66725 -       out_8(&psc->command,MPC52xx_PSC_RST_RX);
66726 +       out_8(&psc->command, MPC52xx_PSC_RST_RX);
66727         if (!uart_console(port))
66728 -               out_8(&psc->command,MPC52xx_PSC_RST_TX);
66729 +               out_8(&psc->command, MPC52xx_PSC_RST_TX);
66730  
66731         port->read_status_mask = 0;
66732 -       out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
66733 +       out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask);
66734  
66735         /* Release interrupt */
66736         free_irq(port->irq, port);
66737 @@ -271,7 +275,7 @@
66738  
66739  static void
66740  mpc52xx_uart_set_termios(struct uart_port *port, struct ktermios *new,
66741 -                         struct ktermios *old)
66742 +                        struct ktermios *old)
66743  {
66744         struct mpc52xx_psc __iomem *psc = PSC(port);
66745         unsigned long flags;
66746 @@ -283,14 +287,14 @@
66747         mr1 = 0;
66748  
66749         switch (new->c_cflag & CSIZE) {
66750 -               case CS5:       mr1 |= MPC52xx_PSC_MODE_5_BITS;
66751 -                               break;
66752 -               case CS6:       mr1 |= MPC52xx_PSC_MODE_6_BITS;
66753 -                               break;
66754 -               case CS7:       mr1 |= MPC52xx_PSC_MODE_7_BITS;
66755 -                               break;
66756 -               case CS8:
66757 -               default:        mr1 |= MPC52xx_PSC_MODE_8_BITS;
66758 +       case CS5:       mr1 |= MPC52xx_PSC_MODE_5_BITS;
66759 +               break;
66760 +       case CS6:       mr1 |= MPC52xx_PSC_MODE_6_BITS;
66761 +               break;
66762 +       case CS7:       mr1 |= MPC52xx_PSC_MODE_7_BITS;
66763 +               break;
66764 +       case CS8:
66765 +       default:        mr1 |= MPC52xx_PSC_MODE_8_BITS;
66766         }
66767  
66768         if (new->c_cflag & PARENB) {
66769 @@ -332,24 +336,24 @@
66770                 udelay(1);
66771  
66772         if (!j)
66773 -               printk( KERN_ERR "mpc52xx_uart.c: "
66774 +               printk(KERN_ERR "mpc52xx_uart.c: "
66775                         "Unable to flush RX & TX fifos in-time in set_termios."
66776 -                       "Some chars may have been lost.\n" );
66777 +                       "Some chars may have been lost.\n");
66778  
66779         /* Reset the TX & RX */
66780 -       out_8(&psc->command,MPC52xx_PSC_RST_RX);
66781 -       out_8(&psc->command,MPC52xx_PSC_RST_TX);
66782 +       out_8(&psc->command, MPC52xx_PSC_RST_RX);
66783 +       out_8(&psc->command, MPC52xx_PSC_RST_TX);
66784  
66785         /* Send new mode settings */
66786 -       out_8(&psc->command,MPC52xx_PSC_SEL_MODE_REG_1);
66787 -       out_8(&psc->mode,mr1);
66788 -       out_8(&psc->mode,mr2);
66789 -       out_8(&psc->ctur,ctr >> 8);
66790 -       out_8(&psc->ctlr,ctr & 0xff);
66791 +       out_8(&psc->command, MPC52xx_PSC_SEL_MODE_REG_1);
66792 +       out_8(&psc->mode, mr1);
66793 +       out_8(&psc->mode, mr2);
66794 +       out_8(&psc->ctur, ctr >> 8);
66795 +       out_8(&psc->ctlr, ctr & 0xff);
66796  
66797         /* Reenable TX & RX */
66798 -       out_8(&psc->command,MPC52xx_PSC_TX_ENABLE);
66799 -       out_8(&psc->command,MPC52xx_PSC_RX_ENABLE);
66800 +       out_8(&psc->command, MPC52xx_PSC_TX_ENABLE);
66801 +       out_8(&psc->command, MPC52xx_PSC_RX_ENABLE);
66802  
66803         /* We're all set, release the lock */
66804         spin_unlock_irqrestore(&port->lock, flags);
66805 @@ -364,7 +368,8 @@
66806  static void
66807  mpc52xx_uart_release_port(struct uart_port *port)
66808  {
66809 -       if (port->flags & UPF_IOREMAP) { /* remapped by us ? */
66810 +       /* remapped by us ? */
66811 +       if (port->flags & UPF_IOREMAP) {
66812                 iounmap(port->membase);
66813                 port->membase = NULL;
66814         }
66815 @@ -379,7 +384,7 @@
66816  
66817         if (port->flags & UPF_IOREMAP) /* Need to remap ? */
66818                 port->membase = ioremap(port->mapbase,
66819 -                                       sizeof(struct mpc52xx_psc));
66820 +                                       sizeof(struct mpc52xx_psc));
66821  
66822         if (!port->membase)
66823                 return -EINVAL;
66824 @@ -398,22 +403,22 @@
66825  static void
66826  mpc52xx_uart_config_port(struct uart_port *port, int flags)
66827  {
66828 -       if ( (flags & UART_CONFIG_TYPE) &&
66829 -            (mpc52xx_uart_request_port(port) == 0) )
66830 -               port->type = PORT_MPC52xx;
66831 +       if ((flags & UART_CONFIG_TYPE)
66832 +               && (mpc52xx_uart_request_port(port) == 0))
66833 +               port->type = PORT_MPC52xx;
66834  }
66835  
66836  static int
66837  mpc52xx_uart_verify_port(struct uart_port *port, struct serial_struct *ser)
66838  {
66839 -       if ( ser->type != PORT_UNKNOWN && ser->type != PORT_MPC52xx )
66840 +       if (ser->type != PORT_UNKNOWN && ser->type != PORT_MPC52xx)
66841                 return -EINVAL;
66842  
66843 -       if ( (ser->irq != port->irq) ||
66844 -            (ser->io_type != SERIAL_IO_MEM) ||
66845 -            (ser->baud_base != port->uartclk)  ||
66846 -            (ser->iomem_base != (void*)port->mapbase) ||
66847 -            (ser->hub6 != 0 ) )
66848 +       if ((ser->irq != port->irq) ||
66849 +           (ser->io_type != SERIAL_IO_MEM) ||
66850 +           (ser->baud_base != port->uartclk)  ||
66851 +           (ser->iomem_base != (void *)port->mapbase) ||
66852 +           (ser->hub6 != 0))
66853                 return -EINVAL;
66854  
66855         return 0;
66856 @@ -455,8 +460,8 @@
66857         unsigned short status;
66858  
66859         /* While we can read, do so ! */
66860 -       while ( (status = in_be16(&PSC(port)->mpc52xx_psc_status)) &
66861 -               MPC52xx_PSC_SR_RXRDY) {
66862 +       while ((status = in_be16(&PSC(port)->mpc52xx_psc_status)) &
66863 +               MPC52xx_PSC_SR_RXRDY) {
66864  
66865                 /* Get the char */
66866                 ch = in_8(&PSC(port)->mpc52xx_psc_buffer_8);
66867 @@ -474,9 +479,9 @@
66868                 flag = TTY_NORMAL;
66869                 port->icount.rx++;
66870  
66871 -               if ( status & (MPC52xx_PSC_SR_PE |
66872 -                              MPC52xx_PSC_SR_FE |
66873 -                              MPC52xx_PSC_SR_RB) ) {
66874 +               if (status & (MPC52xx_PSC_SR_PE |
66875 +                             MPC52xx_PSC_SR_FE |
66876 +                             MPC52xx_PSC_SR_RB)) {
66877  
66878                         if (status & MPC52xx_PSC_SR_RB) {
66879                                 flag = TTY_BREAK;
66880 @@ -487,7 +492,7 @@
66881                                 flag = TTY_FRAME;
66882  
66883                         /* Clear error condition */
66884 -                       out_8(&PSC(port)->command,MPC52xx_PSC_RST_ERR_STAT);
66885 +                       out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STAT);
66886  
66887                 }
66888                 tty_insert_flip_char(tty, ch, flag);
66889 @@ -568,16 +573,16 @@
66890  
66891                 /* Do we need to receive chars ? */
66892                 /* For this RX interrupts must be on and some chars waiting */
66893 -               if ( status & MPC52xx_PSC_IMR_RXRDY )
66894 +               if (status & MPC52xx_PSC_IMR_RXRDY)
66895                         keepgoing |= mpc52xx_uart_int_rx_chars(port);
66896  
66897                 /* Do we need to send chars ? */
66898                 /* For this, TX must be ready and TX interrupt enabled */
66899 -               if ( status & MPC52xx_PSC_IMR_TXRDY )
66900 +               if (status & MPC52xx_PSC_IMR_TXRDY)
66901                         keepgoing |= mpc52xx_uart_int_tx_chars(port);
66902  
66903                 /* Limit number of iteration */
66904 -               if ( !(--pass) )
66905 +               if (!(--pass))
66906                         keepgoing = 0;
66907  
66908         } while (keepgoing);
66909 @@ -596,7 +601,7 @@
66910  
66911  static void __init
66912  mpc52xx_console_get_options(struct uart_port *port,
66913 -                            int *baud, int *parity, int *bits, int *flow)
66914 +                           int *baud, int *parity, int *bits, int *flow)
66915  {
66916         struct mpc52xx_psc __iomem *psc = PSC(port);
66917         unsigned char mr1;
66918 @@ -604,7 +609,7 @@
66919         pr_debug("mpc52xx_console_get_options(port=%p)\n", port);
66920  
66921         /* Read the mode registers */
66922 -       out_8(&psc->command,MPC52xx_PSC_SEL_MODE_REG_1);
66923 +       out_8(&psc->command, MPC52xx_PSC_SEL_MODE_REG_1);
66924         mr1 = in_8(&psc->mode);
66925  
66926         /* CT{U,L}R are write-only ! */
66927 @@ -616,11 +621,18 @@
66928  
66929         /* Parse them */
66930         switch (mr1 & MPC52xx_PSC_MODE_BITS_MASK) {
66931 -               case MPC52xx_PSC_MODE_5_BITS:   *bits = 5; break;
66932 -               case MPC52xx_PSC_MODE_6_BITS:   *bits = 6; break;
66933 -               case MPC52xx_PSC_MODE_7_BITS:   *bits = 7; break;
66934 -               case MPC52xx_PSC_MODE_8_BITS:
66935 -               default:                        *bits = 8;
66936 +       case MPC52xx_PSC_MODE_5_BITS:
66937 +               *bits = 5;
66938 +               break;
66939 +       case MPC52xx_PSC_MODE_6_BITS:
66940 +               *bits = 6;
66941 +               break;
66942 +       case MPC52xx_PSC_MODE_7_BITS:
66943 +               *bits = 7;
66944 +               break;
66945 +       case MPC52xx_PSC_MODE_8_BITS:
66946 +       default:
66947 +               *bits = 8;
66948         }
66949  
66950         if (mr1 & MPC52xx_PSC_MODE_PARNONE)
66951 @@ -657,7 +669,7 @@
66952                 /* Wait the TX buffer to be empty */
66953                 j = 20000;      /* Maximum wait */
66954                 while (!(in_be16(&psc->mpc52xx_psc_status) &
66955 -                        MPC52xx_PSC_SR_TXEMP) && --j)
66956 +                        MPC52xx_PSC_SR_TXEMP) && --j)
66957                         udelay(1);
66958         }
66959  
66960 @@ -730,16 +742,18 @@
66961         }
66962  
66963         pr_debug("Console on ttyPSC%x is %s\n",
66964 -                co->index, mpc52xx_uart_nodes[co->index]->full_name);
66965 +                co->index, mpc52xx_uart_nodes[co->index]->full_name);
66966  
66967         /* Fetch register locations */
66968 -       if ((ret = of_address_to_resource(np, 0, &res)) != 0) {
66969 +       ret = of_address_to_resource(np, 0, &res);
66970 +       if (ret) {
66971                 pr_debug("Could not get resources for PSC%x\n", co->index);
66972                 return ret;
66973         }
66974  
66975         /* Search for bus-frequency property in this node or a parent */
66976 -       if ((ipb_freq = mpc52xx_find_ipb_freq(np)) == 0) {
66977 +       ipb_freq = mpc52xx_find_ipb_freq(np);
66978 +       if (ipb_freq == 0) {
66979                 pr_debug("Could not find IPB bus frequency!\n");
66980                 return -EINVAL;
66981         }
66982 @@ -757,7 +771,8 @@
66983                 return -EINVAL;
66984  
66985         pr_debug("mpc52xx-psc uart at %p, mapped to %p, irq=%x, freq=%i\n",
66986 -                (void*)port->mapbase, port->membase, port->irq, port->uartclk);
66987 +                (void *)port->mapbase, port->membase,
66988 +                port->irq, port->uartclk);
66989  
66990         /* Setup the port parameters accoding to options */
66991         if (options)
66992 @@ -766,7 +781,7 @@
66993                 mpc52xx_console_get_options(port, &baud, &parity, &bits, &flow);
66994  
66995         pr_debug("Setting console parameters: %i %i%c1 flow=%c\n",
66996 -                baud, bits, parity, flow);
66997 +                baud, bits, parity, flow);
66998  
66999         return uart_set_options(port, co, baud, parity, bits, flow);
67000  }
67001 @@ -781,7 +796,7 @@
67002         .device = uart_console_device,
67003         .setup  = mpc52xx_console_setup,
67004         .flags  = CON_PRINTBUFFER,
67005 -       .index  = -1,   /* Specified on the cmdline (e.g. console=ttyPSC0 ) */
67006 +       .index  = -1,   /* Specified on the cmdline (e.g. console=ttyPSC0) */
67007         .data   = &mpc52xx_uart_driver,
67008  };
67009  
67010 @@ -809,7 +824,6 @@
67011  /* ======================================================================== */
67012  
67013  static struct uart_driver mpc52xx_uart_driver = {
67014 -       .owner          = THIS_MODULE,
67015         .driver_name    = "mpc52xx_psc_uart",
67016         .dev_name       = "ttyPSC",
67017         .major          = SERIAL_PSC_MAJOR,
67018 @@ -837,7 +851,7 @@
67019         if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM)
67020                 return -EINVAL;
67021  
67022 -       if (!mpc52xx_match_psc_function(idx,"uart"))
67023 +       if (!mpc52xx_match_psc_function(idx, "uart"))
67024                 return -ENODEV;
67025  
67026         /* Init the port structure */
67027 @@ -848,13 +862,13 @@
67028         port->fifosize  = 512;
67029         port->iotype    = UPIO_MEM;
67030         port->flags     = UPF_BOOT_AUTOCONF |
67031 -                         ( uart_console(port) ? 0 : UPF_IOREMAP );
67032 +                         (uart_console(port) ? 0 : UPF_IOREMAP);
67033         port->line      = idx;
67034         port->ops       = &mpc52xx_uart_ops;
67035         port->dev       = &dev->dev;
67036  
67037         /* Search for IRQ and mapbase */
67038 -       for (i=0 ; i<dev->num_resources ; i++, res++) {
67039 +       for (i = 0 ; i < dev->num_resources ; i++, res++) {
67040                 if (res->flags & IORESOURCE_MEM)
67041                         port->mapbase = res->start;
67042                 else if (res->flags & IORESOURCE_IRQ)
67043 @@ -866,7 +880,7 @@
67044         /* Add the port to the uart sub-system */
67045         ret = uart_add_one_port(&mpc52xx_uart_driver, port);
67046         if (!ret)
67047 -               platform_set_drvdata(dev, (void*)port);
67048 +               platform_set_drvdata(dev, (void *)port);
67049  
67050         return ret;
67051  }
67052 @@ -917,6 +931,7 @@
67053         .resume         = mpc52xx_uart_resume,
67054  #endif
67055         .driver         = {
67056 +               .owner  = THIS_MODULE,
67057                 .name   = "mpc52xx-psc",
67058         },
67059  };
67060 @@ -946,10 +961,11 @@
67061         if (idx >= MPC52xx_PSC_MAXNUM)
67062                 return -EINVAL;
67063         pr_debug("Found %s assigned to ttyPSC%x\n",
67064 -                mpc52xx_uart_nodes[idx]->full_name, idx);
67065 +                mpc52xx_uart_nodes[idx]->full_name, idx);
67066  
67067         /* Search for bus-frequency property in this node or a parent */
67068 -       if ((ipb_freq = mpc52xx_find_ipb_freq(op->node)) == 0) {
67069 +       ipb_freq = mpc52xx_find_ipb_freq(op->node);
67070 +       if (ipb_freq == 0) {
67071                 dev_dbg(&op->dev, "Could not find IPB bus frequency!\n");
67072                 return -EINVAL;
67073         }
67074 @@ -962,22 +978,23 @@
67075         port->fifosize  = 512;
67076         port->iotype    = UPIO_MEM;
67077         port->flags     = UPF_BOOT_AUTOCONF |
67078 -                         ( uart_console(port) ? 0 : UPF_IOREMAP );
67079 +                         (uart_console(port) ? 0 : UPF_IOREMAP);
67080         port->line      = idx;
67081         port->ops       = &mpc52xx_uart_ops;
67082         port->dev       = &op->dev;
67083  
67084         /* Search for IRQ and mapbase */
67085 -       if ((ret = of_address_to_resource(op->node, 0, &res)) != 0)
67086 +       ret = of_address_to_resource(op->node, 0, &res);
67087 +       if (ret)
67088                 return ret;
67089  
67090         port->mapbase = res.start;
67091         port->irq = irq_of_parse_and_map(op->node, 0);
67092  
67093         dev_dbg(&op->dev, "mpc52xx-psc uart at %p, irq=%x, freq=%i\n",
67094 -               (void*)port->mapbase, port->irq, port->uartclk);
67095 +               (void *)port->mapbase, port->irq, port->uartclk);
67096  
67097 -       if ((port->irq==NO_IRQ) || !port->mapbase) {
67098 +       if ((port->irq == NO_IRQ) || !port->mapbase) {
67099                 printk(KERN_ERR "Could not allocate resources for PSC\n");
67100                 return -EINVAL;
67101         }
67102 @@ -985,7 +1002,7 @@
67103         /* Add the port to the uart sub-system */
67104         ret = uart_add_one_port(&mpc52xx_uart_driver, port);
67105         if (!ret)
67106 -               dev_set_drvdata(&op->dev, (void*)port);
67107 +               dev_set_drvdata(&op->dev, (void *)port);
67108  
67109         return ret;
67110  }
67111 @@ -1048,6 +1065,7 @@
67112         if (idx < 0)
67113                 return; /* No free slot; abort */
67114  
67115 +       of_node_get(np);
67116         /* If the slot is already occupied, then swap slots */
67117         if (mpc52xx_uart_nodes[idx] && (free_idx != -1))
67118                 mpc52xx_uart_nodes[free_idx] = mpc52xx_uart_nodes[idx];
67119 @@ -1057,7 +1075,7 @@
67120  static void
67121  mpc52xx_uart_of_enumerate(void)
67122  {
67123 -       static int enum_done = 0;
67124 +       static int enum_done;
67125         struct device_node *np;
67126         const unsigned int *devno;
67127         int i;
67128 @@ -1071,7 +1089,7 @@
67129  
67130                 /* Is a particular device number requested? */
67131                 devno = of_get_property(np, "port-number", NULL);
67132 -               mpc52xx_uart_of_assign(of_node_get(np), devno ? *devno : -1);
67133 +               mpc52xx_uart_of_assign(np, devno ? *devno : -1);
67134         }
67135  
67136         enum_done = 1;
67137 @@ -1079,15 +1097,13 @@
67138         for (i = 0; i < MPC52xx_PSC_MAXNUM; i++) {
67139                 if (mpc52xx_uart_nodes[i])
67140                         pr_debug("%s assigned to ttyPSC%x\n",
67141 -                                mpc52xx_uart_nodes[i]->full_name, i);
67142 +                                mpc52xx_uart_nodes[i]->full_name, i);
67143         }
67144  }
67145  
67146  MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match);
67147  
67148  static struct of_platform_driver mpc52xx_uart_of_driver = {
67149 -       .owner          = THIS_MODULE,
67150 -       .name           = "mpc52xx-psc-uart",
67151         .match_table    = mpc52xx_uart_of_match,
67152         .probe          = mpc52xx_uart_of_probe,
67153         .remove         = mpc52xx_uart_of_remove,
67154 @@ -1113,7 +1129,8 @@
67155  
67156         printk(KERN_INFO "Serial: MPC52xx PSC UART driver\n");
67157  
67158 -       if ((ret = uart_register_driver(&mpc52xx_uart_driver)) != 0) {
67159 +       ret = uart_register_driver(&mpc52xx_uart_driver);
67160 +       if (ret) {
67161                 printk(KERN_ERR "%s: uart_register_driver failed (%i)\n",
67162                        __FILE__, ret);
67163                 return ret;
67164 --- a/drivers/serial/uartlite.c
67165 +++ b/drivers/serial/uartlite.c
67166 @@ -539,7 +539,7 @@
67167   *
67168   * @dev: pointer to device structure
67169   */
67170 -static int __devinit ulite_release(struct device *dev)
67171 +static int __devexit ulite_release(struct device *dev)
67172  {
67173         struct uart_port *port = dev_get_drvdata(dev);
67174         int rc = 0;
67175 @@ -572,14 +572,14 @@
67176         return ulite_assign(&pdev->dev, pdev->id, res->start, res2->start);
67177  }
67178  
67179 -static int ulite_remove(struct platform_device *pdev)
67180 +static int __devexit ulite_remove(struct platform_device *pdev)
67181  {
67182         return ulite_release(&pdev->dev);
67183  }
67184  
67185  static struct platform_driver ulite_platform_driver = {
67186         .probe  = ulite_probe,
67187 -       .remove = ulite_remove,
67188 +       .remove = __devexit_p(ulite_remove),
67189         .driver = {
67190                    .owner = THIS_MODULE,
67191                    .name  = "uartlite",
67192 --- /dev/null
67193 +++ b/drivers/serial/ucc_uart.c
67194 @@ -0,0 +1,1514 @@
67195 +/*
67196 + * Freescale QUICC Engine UART device driver
67197 + *
67198 + * Author: Timur Tabi <timur@freescale.com>
67199 + *
67200 + * Copyright 2007 Freescale Semiconductor, Inc.  This file is licensed under
67201 + * the terms of the GNU General Public License version 2.  This program
67202 + * is licensed "as is" without any warranty of any kind, whether express
67203 + * or implied.
67204 + *
67205 + * This driver adds support for UART devices via Freescale's QUICC Engine
67206 + * found on some Freescale SOCs.
67207 + *
67208 + * If Soft-UART support is needed but not already present, then this driver
67209 + * will request and upload the "Soft-UART" microcode upon probe.  The
67210 + * filename of the microcode should be fsl_qe_ucode_uart_X_YZ.bin, where "X"
67211 + * is the name of the SOC (e.g. 8323), and YZ is the revision of the SOC,
67212 + * (e.g. "11" for 1.1).
67213 + */
67214 +
67215 +#include <linux/module.h>
67216 +#include <linux/serial.h>
67217 +#include <linux/serial_core.h>
67218 +#include <linux/io.h>
67219 +#include <linux/of_platform.h>
67220 +#include <linux/dma-mapping.h>
67221 +
67222 +#include <linux/fs_uart_pd.h>
67223 +#include <asm/ucc_slow.h>
67224 +
67225 +#include <linux/firmware.h>
67226 +#include <asm/reg.h>
67227 +
67228 +/*
67229 + * The GUMR flag for Soft UART.  This would normally be defined in qe.h,
67230 + * but Soft-UART is a hack and we want to keep everything related to it in
67231 + * this file.
67232 + */
67233 +#define UCC_SLOW_GUMR_H_SUART          0x00004000      /* Soft-UART */
67234 +
67235 +/*
67236 + * soft_uart is 1 if we need to use Soft-UART mode
67237 + */
67238 +static int soft_uart;
67239 +/*
67240 + * firmware_loaded is 1 if the firmware has been loaded, 0 otherwise.
67241 + */
67242 +static int firmware_loaded;
67243 +
67244 +/* Enable this macro to configure all serial ports in internal loopback
67245 +   mode */
67246 +/* #define LOOPBACK */
67247 +
67248 +/* The major and minor device numbers are defined in
67249 + * http://www.lanana.org/docs/device-list/devices-2.6+.txt.  For the QE
67250 + * UART, we have major number 204 and minor numbers 46 - 49, which are the
67251 + * same as for the CPM2.  This decision was made because no Freescale part
67252 + * has both a CPM and a QE.
67253 + */
67254 +#define SERIAL_QE_MAJOR 204
67255 +#define SERIAL_QE_MINOR 46
67256 +
67257 +/* Since we only have minor numbers 46 - 49, there is a hard limit of 4 ports */
67258 +#define UCC_MAX_UART    4
67259 +
67260 +/* The number of buffer descriptors for receiving characters. */
67261 +#define RX_NUM_FIFO     4
67262 +
67263 +/* The number of buffer descriptors for transmitting characters. */
67264 +#define TX_NUM_FIFO     4
67265 +
67266 +/* The maximum size of the character buffer for a single RX BD. */
67267 +#define RX_BUF_SIZE     32
67268 +
67269 +/* The maximum size of the character buffer for a single TX BD. */
67270 +#define TX_BUF_SIZE     32
67271 +
67272 +/*
67273 + * The number of jiffies to wait after receiving a close command before the
67274 + * device is actually closed.  This allows the last few characters to be
67275 + * sent over the wire.
67276 + */
67277 +#define UCC_WAIT_CLOSING 100
67278 +
67279 +struct ucc_uart_pram {
67280 +       struct ucc_slow_pram common;
67281 +       u8 res1[8];             /* reserved */
67282 +       __be16 maxidl;          /* Maximum idle chars */
67283 +       __be16 idlc;            /* temp idle counter */
67284 +       __be16 brkcr;           /* Break count register */
67285 +       __be16 parec;           /* receive parity error counter */
67286 +       __be16 frmec;           /* receive framing error counter */
67287 +       __be16 nosec;           /* receive noise counter */
67288 +       __be16 brkec;           /* receive break condition counter */
67289 +       __be16 brkln;           /* last received break length */
67290 +       __be16 uaddr[2];        /* UART address character 1 & 2 */
67291 +       __be16 rtemp;           /* Temp storage */
67292 +       __be16 toseq;           /* Transmit out of sequence char */
67293 +       __be16 cchars[8];       /* control characters 1-8 */
67294 +       __be16 rccm;            /* receive control character mask */
67295 +       __be16 rccr;            /* receive control character register */
67296 +       __be16 rlbc;            /* receive last break character */
67297 +       __be16 res2;            /* reserved */
67298 +       __be32 res3;            /* reserved, should be cleared */
67299 +       u8 res4;                /* reserved, should be cleared */
67300 +       u8 res5[3];             /* reserved, should be cleared */
67301 +       __be32 res6;            /* reserved, should be cleared */
67302 +       __be32 res7;            /* reserved, should be cleared */
67303 +       __be32 res8;            /* reserved, should be cleared */
67304 +       __be32 res9;            /* reserved, should be cleared */
67305 +       __be32 res10;           /* reserved, should be cleared */
67306 +       __be32 res11;           /* reserved, should be cleared */
67307 +       __be32 res12;           /* reserved, should be cleared */
67308 +       __be32 res13;           /* reserved, should be cleared */
67309 +/* The rest is for Soft-UART only */
67310 +       __be16 supsmr;          /* 0x90, Shadow UPSMR */
67311 +       __be16 res92;           /* 0x92, reserved, initialize to 0 */
67312 +       __be32 rx_state;        /* 0x94, RX state, initialize to 0 */
67313 +       __be32 rx_cnt;          /* 0x98, RX count, initialize to 0 */
67314 +       u8 rx_length;           /* 0x9C, Char length, set to 1+CL+PEN+1+SL */
67315 +       u8 rx_bitmark;          /* 0x9D, reserved, initialize to 0 */
67316 +       u8 rx_temp_dlst_qe;     /* 0x9E, reserved, initialize to 0 */
67317 +       u8 res14[0xBC - 0x9F];  /* reserved */
67318 +       __be32 dump_ptr;        /* 0xBC, Dump pointer */
67319 +       __be32 rx_frame_rem;    /* 0xC0, reserved, initialize to 0 */
67320 +       u8 rx_frame_rem_size;   /* 0xC4, reserved, initialize to 0 */
67321 +       u8 tx_mode;             /* 0xC5, mode, 0=AHDLC, 1=UART */
67322 +       __be16 tx_state;        /* 0xC6, TX state */
67323 +       u8 res15[0xD0 - 0xC8];  /* reserved */
67324 +       __be32 resD0;           /* 0xD0, reserved, initialize to 0 */
67325 +       u8 resD4;               /* 0xD4, reserved, initialize to 0 */
67326 +       __be16 resD5;           /* 0xD5, reserved, initialize to 0 */
67327 +} __attribute__ ((packed));
67328 +
67329 +/* SUPSMR definitions, for Soft-UART only */
67330 +#define UCC_UART_SUPSMR_SL             0x8000
67331 +#define UCC_UART_SUPSMR_RPM_MASK       0x6000
67332 +#define UCC_UART_SUPSMR_RPM_ODD        0x0000
67333 +#define UCC_UART_SUPSMR_RPM_LOW        0x2000
67334 +#define UCC_UART_SUPSMR_RPM_EVEN       0x4000
67335 +#define UCC_UART_SUPSMR_RPM_HIGH       0x6000
67336 +#define UCC_UART_SUPSMR_PEN            0x1000
67337 +#define UCC_UART_SUPSMR_TPM_MASK       0x0C00
67338 +#define UCC_UART_SUPSMR_TPM_ODD        0x0000
67339 +#define UCC_UART_SUPSMR_TPM_LOW        0x0400
67340 +#define UCC_UART_SUPSMR_TPM_EVEN       0x0800
67341 +#define UCC_UART_SUPSMR_TPM_HIGH       0x0C00
67342 +#define UCC_UART_SUPSMR_FRZ            0x0100
67343 +#define UCC_UART_SUPSMR_UM_MASK        0x00c0
67344 +#define UCC_UART_SUPSMR_UM_NORMAL       0x0000
67345 +#define UCC_UART_SUPSMR_UM_MAN_MULTI    0x0040
67346 +#define UCC_UART_SUPSMR_UM_AUTO_MULTI   0x00c0
67347 +#define UCC_UART_SUPSMR_CL_MASK        0x0030
67348 +#define UCC_UART_SUPSMR_CL_8           0x0030
67349 +#define UCC_UART_SUPSMR_CL_7           0x0020
67350 +#define UCC_UART_SUPSMR_CL_6           0x0010
67351 +#define UCC_UART_SUPSMR_CL_5           0x0000
67352 +
67353 +#define UCC_UART_TX_STATE_AHDLC        0x00
67354 +#define UCC_UART_TX_STATE_UART         0x01
67355 +#define UCC_UART_TX_STATE_X1           0x00
67356 +#define UCC_UART_TX_STATE_X16          0x80
67357 +
67358 +#define UCC_UART_PRAM_ALIGNMENT 0x100
67359 +
67360 +#define UCC_UART_SIZE_OF_BD     UCC_SLOW_SIZE_OF_BD
67361 +#define NUM_CONTROL_CHARS       8
67362 +
67363 +/* Private per-port data structure */
67364 +struct uart_qe_port {
67365 +       struct uart_port port;
67366 +       struct ucc_slow __iomem *uccp;
67367 +       struct ucc_uart_pram __iomem *uccup;
67368 +       struct ucc_slow_info us_info;
67369 +       struct ucc_slow_private *us_private;
67370 +       struct device_node *np;
67371 +       unsigned int ucc_num;   /* First ucc is 0, not 1 */
67372 +
67373 +       u16 rx_nrfifos;
67374 +       u16 rx_fifosize;
67375 +       u16 tx_nrfifos;
67376 +       u16 tx_fifosize;
67377 +       int wait_closing;
67378 +       u32 flags;
67379 +       struct qe_bd *rx_bd_base;
67380 +       struct qe_bd *rx_cur;
67381 +       struct qe_bd *tx_bd_base;
67382 +       struct qe_bd *tx_cur;
67383 +       unsigned char *tx_buf;
67384 +       unsigned char *rx_buf;
67385 +       void *bd_virt;          /* virtual address of the BD buffers */
67386 +       dma_addr_t bd_dma_addr; /* bus address of the BD buffers */
67387 +       unsigned int bd_size;   /* size of BD buffer space */
67388 +};
67389 +
67390 +static struct uart_driver ucc_uart_driver = {
67391 +       .owner          = THIS_MODULE,
67392 +       .driver_name    = "serial",
67393 +       .dev_name       = "ttyQE",
67394 +       .major          = SERIAL_QE_MAJOR,
67395 +       .minor          = SERIAL_QE_MINOR,
67396 +       .nr             = UCC_MAX_UART,
67397 +};
67398 +
67399 +/*
67400 + * Virtual to physical address translation.
67401 + *
67402 + * Given the virtual address for a character buffer, this function returns
67403 + * the physical (DMA) equivalent.
67404 + */
67405 +static inline dma_addr_t cpu2qe_addr(void *addr, struct uart_qe_port *qe_port)
67406 +{
67407 +       if (likely((addr >= qe_port->bd_virt)) &&
67408 +           (addr < (qe_port->bd_virt + qe_port->bd_size)))
67409 +               return qe_port->bd_dma_addr + (addr - qe_port->bd_virt);
67410 +
67411 +       /* something nasty happened */
67412 +       printk(KERN_ERR "%s: addr=%p\n", __FUNCTION__, addr);
67413 +       BUG();
67414 +       return 0;
67415 +}
67416 +
67417 +/*
67418 + * Physical to virtual address translation.
67419 + *
67420 + * Given the physical (DMA) address for a character buffer, this function
67421 + * returns the virtual equivalent.
67422 + */
67423 +static inline void *qe2cpu_addr(dma_addr_t addr, struct uart_qe_port *qe_port)
67424 +{
67425 +       /* sanity check */
67426 +       if (likely((addr >= qe_port->bd_dma_addr) &&
67427 +                  (addr < (qe_port->bd_dma_addr + qe_port->bd_size))))
67428 +               return qe_port->bd_virt + (addr - qe_port->bd_dma_addr);
67429 +
67430 +       /* something nasty happened */
67431 +       printk(KERN_ERR "%s: addr=%x\n", __FUNCTION__, addr);
67432 +       BUG();
67433 +       return NULL;
67434 +}
67435 +
67436 +/*
67437 + * Return 1 if the QE is done transmitting all buffers for this port
67438 + *
67439 + * This function scans each BD in sequence.  If we find a BD that is not
67440 + * ready (READY=1), then we return 0 indicating that the QE is still sending
67441 + * data.  If we reach the last BD (WRAP=1), then we know we've scanned
67442 + * the entire list, and all BDs are done.
67443 + */
67444 +static unsigned int qe_uart_tx_empty(struct uart_port *port)
67445 +{
67446 +       struct uart_qe_port *qe_port =
67447 +               container_of(port, struct uart_qe_port, port);
67448 +       struct qe_bd *bdp = qe_port->tx_bd_base;
67449 +
67450 +       while (1) {
67451 +               if (in_be16(&bdp->status) & BD_SC_READY)
67452 +                       /* This BD is not done, so return "not done" */
67453 +                       return 0;
67454 +
67455 +               if (in_be16(&bdp->status) & BD_SC_WRAP)
67456 +                       /*
67457 +                        * This BD is done and it's the last one, so return
67458 +                        * "done"
67459 +                        */
67460 +                       return 1;
67461 +
67462 +               bdp++;
67463 +       };
67464 +}
67465 +
67466 +/*
67467 + * Set the modem control lines
67468 + *
67469 + * Although the QE can control the modem control lines (e.g. CTS), we
67470 + * don't need that support. This function must exist, however, otherwise
67471 + * the kernel will panic.
67472 + */
67473 +void qe_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
67474 +{
67475 +}
67476 +
67477 +/*
67478 + * Get the current modem control line status
67479 + *
67480 + * Although the QE can control the modem control lines (e.g. CTS), this
67481 + * driver currently doesn't support that, so we always return Carrier
67482 + * Detect, Data Set Ready, and Clear To Send.
67483 + */
67484 +static unsigned int qe_uart_get_mctrl(struct uart_port *port)
67485 +{
67486 +       return TIOCM_CAR | TIOCM_DSR | TIOCM_CTS;
67487 +}
67488 +
67489 +/*
67490 + * Disable the transmit interrupt.
67491 + *
67492 + * Although this function is called "stop_tx", it does not actually stop
67493 + * transmission of data.  Instead, it tells the QE to not generate an
67494 + * interrupt when the UCC is finished sending characters.
67495 + */
67496 +static void qe_uart_stop_tx(struct uart_port *port)
67497 +{
67498 +       struct uart_qe_port *qe_port =
67499 +               container_of(port, struct uart_qe_port, port);
67500 +
67501 +       clrbits16(&qe_port->uccp->uccm, UCC_UART_UCCE_TX);
67502 +}
67503 +
67504 +/*
67505 + * Transmit as many characters to the HW as possible.
67506 + *
67507 + * This function will attempt to stuff of all the characters from the
67508 + * kernel's transmit buffer into TX BDs.
67509 + *
67510 + * A return value of non-zero indicates that it sucessfully stuffed all
67511 + * characters from the kernel buffer.
67512 + *
67513 + * A return value of zero indicates that there are still characters in the
67514 + * kernel's buffer that have not been transmitted, but there are no more BDs
67515 + * available.  This function should be called again after a BD has been made
67516 + * available.
67517 + */
67518 +static int qe_uart_tx_pump(struct uart_qe_port *qe_port)
67519 +{
67520 +       struct qe_bd *bdp;
67521 +       unsigned char *p;
67522 +       unsigned int count;
67523 +       struct uart_port *port = &qe_port->port;
67524 +       struct circ_buf *xmit = &port->info->xmit;
67525 +
67526 +       bdp = qe_port->rx_cur;
67527 +
67528 +       /* Handle xon/xoff */
67529 +       if (port->x_char) {
67530 +               /* Pick next descriptor and fill from buffer */
67531 +               bdp = qe_port->tx_cur;
67532 +
67533 +               p = qe2cpu_addr(bdp->buf, qe_port);
67534 +
67535 +               *p++ = port->x_char;
67536 +               out_be16(&bdp->length, 1);
67537 +               setbits16(&bdp->status, BD_SC_READY);
67538 +               /* Get next BD. */
67539 +               if (in_be16(&bdp->status) & BD_SC_WRAP)
67540 +                       bdp = qe_port->tx_bd_base;
67541 +               else
67542 +                       bdp++;
67543 +               qe_port->tx_cur = bdp;
67544 +
67545 +               port->icount.tx++;
67546 +               port->x_char = 0;
67547 +               return 1;
67548 +       }
67549 +
67550 +       if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
67551 +               qe_uart_stop_tx(port);
67552 +               return 0;
67553 +       }
67554 +
67555 +       /* Pick next descriptor and fill from buffer */
67556 +       bdp = qe_port->tx_cur;
67557 +
67558 +       while (!(in_be16(&bdp->status) & BD_SC_READY) &&
67559 +              (xmit->tail != xmit->head)) {
67560 +               count = 0;
67561 +               p = qe2cpu_addr(bdp->buf, qe_port);
67562 +               while (count < qe_port->tx_fifosize) {
67563 +                       *p++ = xmit->buf[xmit->tail];
67564 +                       xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
67565 +                       port->icount.tx++;
67566 +                       count++;
67567 +                       if (xmit->head == xmit->tail)
67568 +                               break;
67569 +               }
67570 +
67571 +               out_be16(&bdp->length, count);
67572 +               setbits16(&bdp->status, BD_SC_READY);
67573 +
67574 +               /* Get next BD. */
67575 +               if (in_be16(&bdp->status) & BD_SC_WRAP)
67576 +                       bdp = qe_port->tx_bd_base;
67577 +               else
67578 +                       bdp++;
67579 +       }
67580 +       qe_port->tx_cur = bdp;
67581 +
67582 +       if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
67583 +               uart_write_wakeup(port);
67584 +
67585 +       if (uart_circ_empty(xmit)) {
67586 +               /* The kernel buffer is empty, so turn off TX interrupts.  We
67587 +                  don't need to be told when the QE is finished transmitting
67588 +                  the data. */
67589 +               qe_uart_stop_tx(port);
67590 +               return 0;
67591 +       }
67592 +
67593 +       return 1;
67594 +}
67595 +
67596 +/*
67597 + * Start transmitting data
67598 + *
67599 + * This function will start transmitting any available data, if the port
67600 + * isn't already transmitting data.
67601 + */
67602 +static void qe_uart_start_tx(struct uart_port *port)
67603 +{
67604 +       struct uart_qe_port *qe_port =
67605 +               container_of(port, struct uart_qe_port, port);
67606 +
67607 +       /* If we currently are transmitting, then just return */
67608 +       if (in_be16(&qe_port->uccp->uccm) & UCC_UART_UCCE_TX)
67609 +               return;
67610 +
67611 +       /* Otherwise, pump the port and start transmission */
67612 +       if (qe_uart_tx_pump(qe_port))
67613 +               setbits16(&qe_port->uccp->uccm, UCC_UART_UCCE_TX);
67614 +}
67615 +
67616 +/*
67617 + * Stop transmitting data
67618 + */
67619 +static void qe_uart_stop_rx(struct uart_port *port)
67620 +{
67621 +       struct uart_qe_port *qe_port =
67622 +               container_of(port, struct uart_qe_port, port);
67623 +
67624 +       clrbits16(&qe_port->uccp->uccm, UCC_UART_UCCE_RX);
67625 +}
67626 +
67627 +/*
67628 + * Enable status change interrupts
67629 + *
67630 + * We don't support status change interrupts, but we need to define this
67631 + * function otherwise the kernel will panic.
67632 + */
67633 +static void qe_uart_enable_ms(struct uart_port *port)
67634 +{
67635 +}
67636 +
67637 +/* Start or stop sending  break signal
67638 + *
67639 + * This function controls the sending of a break signal.  If break_state=1,
67640 + * then we start sending a break signal.  If break_state=0, then we stop
67641 + * sending the break signal.
67642 + */
67643 +static void qe_uart_break_ctl(struct uart_port *port, int break_state)
67644 +{
67645 +       struct uart_qe_port *qe_port =
67646 +               container_of(port, struct uart_qe_port, port);
67647 +
67648 +       if (break_state)
67649 +               ucc_slow_stop_tx(qe_port->us_private);
67650 +       else
67651 +               ucc_slow_restart_tx(qe_port->us_private);
67652 +}
67653 +
67654 +/* ISR helper function for receiving character.
67655 + *
67656 + * This function is called by the ISR to handling receiving characters
67657 + */
67658 +static void qe_uart_int_rx(struct uart_qe_port *qe_port)
67659 +{
67660 +       int i;
67661 +       unsigned char ch, *cp;
67662 +       struct uart_port *port = &qe_port->port;
67663 +       struct tty_struct *tty = port->info->tty;
67664 +       struct qe_bd *bdp;
67665 +       u16 status;
67666 +       unsigned int flg;
67667 +
67668 +       /* Just loop through the closed BDs and copy the characters into
67669 +        * the buffer.
67670 +        */
67671 +       bdp = qe_port->rx_cur;
67672 +       while (1) {
67673 +               status = in_be16(&bdp->status);
67674 +
67675 +               /* If this one is empty, then we assume we've read them all */
67676 +               if (status & BD_SC_EMPTY)
67677 +                       break;
67678 +
67679 +               /* get number of characters, and check space in RX buffer */
67680 +               i = in_be16(&bdp->length);
67681 +
67682 +               /* If we don't have enough room in RX buffer for the entire BD,
67683 +                * then we try later, which will be the next RX interrupt.
67684 +                */
67685 +               if (tty_buffer_request_room(tty, i) < i) {
67686 +                       dev_dbg(port->dev, "ucc-uart: no room in RX buffer\n");
67687 +                       return;
67688 +               }
67689 +
67690 +               /* get pointer */
67691 +               cp = qe2cpu_addr(bdp->buf, qe_port);
67692 +
67693 +               /* loop through the buffer */
67694 +               while (i-- > 0) {
67695 +                       ch = *cp++;
67696 +                       port->icount.rx++;
67697 +                       flg = TTY_NORMAL;
67698 +
67699 +                       if (!i && status &
67700 +                           (BD_SC_BR | BD_SC_FR | BD_SC_PR | BD_SC_OV))
67701 +                               goto handle_error;
67702 +                       if (uart_handle_sysrq_char(port, ch))
67703 +                               continue;
67704 +
67705 +error_return:
67706 +                       tty_insert_flip_char(tty, ch, flg);
67707 +
67708 +               }
67709 +
67710 +               /* This BD is ready to be used again. Clear status. get next */
67711 +               clrsetbits_be16(&bdp->status, BD_SC_BR | BD_SC_FR | BD_SC_PR |
67712 +                       BD_SC_OV | BD_SC_ID, BD_SC_EMPTY);
67713 +               if (in_be16(&bdp->status) & BD_SC_WRAP)
67714 +                       bdp = qe_port->rx_bd_base;
67715 +               else
67716 +                       bdp++;
67717 +
67718 +       }
67719 +
67720 +       /* Write back buffer pointer */
67721 +       qe_port->rx_cur = bdp;
67722 +
67723 +       /* Activate BH processing */
67724 +       tty_flip_buffer_push(tty);
67725 +
67726 +       return;
67727 +
67728 +       /* Error processing */
67729 +
67730 +handle_error:
67731 +       /* Statistics */
67732 +       if (status & BD_SC_BR)
67733 +               port->icount.brk++;
67734 +       if (status & BD_SC_PR)
67735 +               port->icount.parity++;
67736 +       if (status & BD_SC_FR)
67737 +               port->icount.frame++;
67738 +       if (status & BD_SC_OV)
67739 +               port->icount.overrun++;
67740 +
67741 +       /* Mask out ignored conditions */
67742 +       status &= port->read_status_mask;
67743 +
67744 +       /* Handle the remaining ones */
67745 +       if (status & BD_SC_BR)
67746 +               flg = TTY_BREAK;
67747 +       else if (status & BD_SC_PR)
67748 +               flg = TTY_PARITY;
67749 +       else if (status & BD_SC_FR)
67750 +               flg = TTY_FRAME;
67751 +
67752 +       /* Overrun does not affect the current character ! */
67753 +       if (status & BD_SC_OV)
67754 +               tty_insert_flip_char(tty, 0, TTY_OVERRUN);
67755 +#ifdef SUPPORT_SYSRQ
67756 +       port->sysrq = 0;
67757 +#endif
67758 +       goto error_return;
67759 +}
67760 +
67761 +/* Interrupt handler
67762 + *
67763 + * This interrupt handler is called after a BD is processed.
67764 + */
67765 +static irqreturn_t qe_uart_int(int irq, void *data)
67766 +{
67767 +       struct uart_qe_port *qe_port = (struct uart_qe_port *) data;
67768 +       struct ucc_slow __iomem *uccp = qe_port->uccp;
67769 +       u16 events;
67770 +
67771 +       /* Clear the interrupts */
67772 +       events = in_be16(&uccp->ucce);
67773 +       out_be16(&uccp->ucce, events);
67774 +
67775 +       if (events & UCC_UART_UCCE_BRKE)
67776 +               uart_handle_break(&qe_port->port);
67777 +
67778 +       if (events & UCC_UART_UCCE_RX)
67779 +               qe_uart_int_rx(qe_port);
67780 +
67781 +       if (events & UCC_UART_UCCE_TX)
67782 +               qe_uart_tx_pump(qe_port);
67783 +
67784 +       return events ? IRQ_HANDLED : IRQ_NONE;
67785 +}
67786 +
67787 +/* Initialize buffer descriptors
67788 + *
67789 + * This function initializes all of the RX and TX buffer descriptors.
67790 + */
67791 +static void qe_uart_initbd(struct uart_qe_port *qe_port)
67792 +{
67793 +       int i;
67794 +       void *bd_virt;
67795 +       struct qe_bd *bdp;
67796 +
67797 +       /* Set the physical address of the host memory buffers in the buffer
67798 +        * descriptors, and the virtual address for us to work with.
67799 +        */
67800 +       bd_virt = qe_port->bd_virt;
67801 +       bdp = qe_port->rx_bd_base;
67802 +       qe_port->rx_cur = qe_port->rx_bd_base;
67803 +       for (i = 0; i < (qe_port->rx_nrfifos - 1); i++) {
67804 +               out_be16(&bdp->status, BD_SC_EMPTY | BD_SC_INTRPT);
67805 +               out_be32(&bdp->buf, cpu2qe_addr(bd_virt, qe_port));
67806 +               out_be16(&bdp->length, 0);
67807 +               bd_virt += qe_port->rx_fifosize;
67808 +               bdp++;
67809 +       }
67810 +
67811 +       /* */
67812 +       out_be16(&bdp->status, BD_SC_WRAP | BD_SC_EMPTY | BD_SC_INTRPT);
67813 +       out_be32(&bdp->buf, cpu2qe_addr(bd_virt, qe_port));
67814 +       out_be16(&bdp->length, 0);
67815 +
67816 +       /* Set the physical address of the host memory
67817 +        * buffers in the buffer descriptors, and the
67818 +        * virtual address for us to work with.
67819 +        */
67820 +       bd_virt = qe_port->bd_virt +
67821 +               L1_CACHE_ALIGN(qe_port->rx_nrfifos * qe_port->rx_fifosize);
67822 +       qe_port->tx_cur = qe_port->tx_bd_base;
67823 +       bdp = qe_port->tx_bd_base;
67824 +       for (i = 0; i < (qe_port->tx_nrfifos - 1); i++) {
67825 +               out_be16(&bdp->status, BD_SC_INTRPT);
67826 +               out_be32(&bdp->buf, cpu2qe_addr(bd_virt, qe_port));
67827 +               out_be16(&bdp->length, 0);
67828 +               bd_virt += qe_port->tx_fifosize;
67829 +               bdp++;
67830 +       }
67831 +
67832 +       /* Loopback requires the preamble bit to be set on the first TX BD */
67833 +#ifdef LOOPBACK
67834 +       setbits16(&qe_port->tx_cur->status, BD_SC_P);
67835 +#endif
67836 +
67837 +       out_be16(&bdp->status, BD_SC_WRAP | BD_SC_INTRPT);
67838 +       out_be32(&bdp->buf, cpu2qe_addr(bd_virt, qe_port));
67839 +       out_be16(&bdp->length, 0);
67840 +}
67841 +
67842 +/*
67843 + * Initialize a UCC for UART.
67844 + *
67845 + * This function configures a given UCC to be used as a UART device. Basic
67846 + * UCC initialization is handled in qe_uart_request_port().  This function
67847 + * does all the UART-specific stuff.
67848 + */
67849 +static void qe_uart_init_ucc(struct uart_qe_port *qe_port)
67850 +{
67851 +       u32 cecr_subblock;
67852 +       struct ucc_slow __iomem *uccp = qe_port->uccp;
67853 +       struct ucc_uart_pram *uccup = qe_port->uccup;
67854 +
67855 +       unsigned int i;
67856 +
67857 +       /* First, disable TX and RX in the UCC */
67858 +       ucc_slow_disable(qe_port->us_private, COMM_DIR_RX_AND_TX);
67859 +
67860 +       /* Program the UCC UART parameter RAM */
67861 +       out_8(&uccup->common.rbmr, UCC_BMR_GBL | UCC_BMR_BO_BE);
67862 +       out_8(&uccup->common.tbmr, UCC_BMR_GBL | UCC_BMR_BO_BE);
67863 +       out_be16(&uccup->common.mrblr, qe_port->rx_fifosize);
67864 +       out_be16(&uccup->maxidl, 0x10);
67865 +       out_be16(&uccup->brkcr, 1);
67866 +       out_be16(&uccup->parec, 0);
67867 +       out_be16(&uccup->frmec, 0);
67868 +       out_be16(&uccup->nosec, 0);
67869 +       out_be16(&uccup->brkec, 0);
67870 +       out_be16(&uccup->uaddr[0], 0);
67871 +       out_be16(&uccup->uaddr[1], 0);
67872 +       out_be16(&uccup->toseq, 0);
67873 +       for (i = 0; i < 8; i++)
67874 +               out_be16(&uccup->cchars[i], 0xC000);
67875 +       out_be16(&uccup->rccm, 0xc0ff);
67876 +
67877 +       /* Configure the GUMR registers for UART */
67878 +       if (soft_uart)
67879 +               /* Soft-UART requires a 1X multiplier for TX */
67880 +               clrsetbits_be32(&uccp->gumr_l,
67881 +                       UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
67882 +                       UCC_SLOW_GUMR_L_RDCR_MASK,
67883 +                       UCC_SLOW_GUMR_L_MODE_UART | UCC_SLOW_GUMR_L_TDCR_1 |
67884 +                       UCC_SLOW_GUMR_L_RDCR_16);
67885 +       else
67886 +               clrsetbits_be32(&uccp->gumr_l,
67887 +                       UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
67888 +                       UCC_SLOW_GUMR_L_RDCR_MASK,
67889 +                       UCC_SLOW_GUMR_L_MODE_UART | UCC_SLOW_GUMR_L_TDCR_16 |
67890 +                       UCC_SLOW_GUMR_L_RDCR_16);
67891 +
67892 +       clrsetbits_be32(&uccp->gumr_h, UCC_SLOW_GUMR_H_RFW,
67893 +               UCC_SLOW_GUMR_H_TRX | UCC_SLOW_GUMR_H_TTX);
67894 +
67895 +#ifdef LOOPBACK
67896 +       clrsetbits_be32(&uccp->gumr_l, UCC_SLOW_GUMR_L_DIAG_MASK,
67897 +               UCC_SLOW_GUMR_L_DIAG_LOOP);
67898 +       clrsetbits_be32(&uccp->gumr_h,
67899 +               UCC_SLOW_GUMR_H_CTSP | UCC_SLOW_GUMR_H_RSYN,
67900 +               UCC_SLOW_GUMR_H_CDS);
67901 +#endif
67902 +
67903 +       /* Enable rx interrupts  and clear all pending events.  */
67904 +       out_be16(&uccp->uccm, 0);
67905 +       out_be16(&uccp->ucce, 0xffff);
67906 +       out_be16(&uccp->udsr, 0x7e7e);
67907 +
67908 +       /* Initialize UPSMR */
67909 +       out_be16(&uccp->upsmr, 0);
67910 +
67911 +       if (soft_uart) {
67912 +               out_be16(&uccup->supsmr, 0x30);
67913 +               out_be16(&uccup->res92, 0);
67914 +               out_be32(&uccup->rx_state, 0);
67915 +               out_be32(&uccup->rx_cnt, 0);
67916 +               out_8(&uccup->rx_bitmark, 0);
67917 +               out_8(&uccup->rx_length, 10);
67918 +               out_be32(&uccup->dump_ptr, 0x4000);
67919 +               out_8(&uccup->rx_temp_dlst_qe, 0);
67920 +               out_be32(&uccup->rx_frame_rem, 0);
67921 +               out_8(&uccup->rx_frame_rem_size, 0);
67922 +               /* Soft-UART requires TX to be 1X */
67923 +               out_8(&uccup->tx_mode,
67924 +                       UCC_UART_TX_STATE_UART | UCC_UART_TX_STATE_X1);
67925 +               out_be16(&uccup->tx_state, 0);
67926 +               out_8(&uccup->resD4, 0);
67927 +               out_be16(&uccup->resD5, 0);
67928 +
67929 +               /* Set UART mode.
67930 +                * Enable receive and transmit.
67931 +                */
67932 +
67933 +               /* From the microcode errata:
67934 +                * 1.GUMR_L register, set mode=0010 (QMC).
67935 +                * 2.Set GUMR_H[17] bit. (UART/AHDLC mode).
67936 +                * 3.Set GUMR_H[19:20] (Transparent mode)
67937 +                * 4.Clear GUMR_H[26] (RFW)
67938 +                * ...
67939 +                * 6.Receiver must use 16x over sampling
67940 +                */
67941 +               clrsetbits_be32(&uccp->gumr_l,
67942 +                       UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
67943 +                       UCC_SLOW_GUMR_L_RDCR_MASK,
67944 +                       UCC_SLOW_GUMR_L_MODE_QMC | UCC_SLOW_GUMR_L_TDCR_16 |
67945 +                       UCC_SLOW_GUMR_L_RDCR_16);
67946 +
67947 +               clrsetbits_be32(&uccp->gumr_h,
67948 +                       UCC_SLOW_GUMR_H_RFW | UCC_SLOW_GUMR_H_RSYN,
67949 +                       UCC_SLOW_GUMR_H_SUART | UCC_SLOW_GUMR_H_TRX |
67950 +                       UCC_SLOW_GUMR_H_TTX | UCC_SLOW_GUMR_H_TFL);
67951 +
67952 +#ifdef LOOPBACK
67953 +               clrsetbits_be32(&uccp->gumr_l, UCC_SLOW_GUMR_L_DIAG_MASK,
67954 +                               UCC_SLOW_GUMR_L_DIAG_LOOP);
67955 +               clrbits32(&uccp->gumr_h, UCC_SLOW_GUMR_H_CTSP |
67956 +                         UCC_SLOW_GUMR_H_CDS);
67957 +#endif
67958 +
67959 +               cecr_subblock = ucc_slow_get_qe_cr_subblock(qe_port->ucc_num);
67960 +               qe_issue_cmd(QE_INIT_TX_RX, cecr_subblock,
67961 +                       QE_CR_PROTOCOL_UNSPECIFIED, 0);
67962 +       }
67963 +}
67964 +
67965 +/*
67966 + * Initialize the port.
67967 + */
67968 +static int qe_uart_startup(struct uart_port *port)
67969 +{
67970 +       struct uart_qe_port *qe_port =
67971 +               container_of(port, struct uart_qe_port, port);
67972 +       int ret;
67973 +
67974 +       /*
67975 +        * If we're using Soft-UART mode, then we need to make sure the
67976 +        * firmware has been uploaded first.
67977 +        */
67978 +       if (soft_uart && !firmware_loaded) {
67979 +               dev_err(port->dev, "Soft-UART firmware not uploaded\n");
67980 +               return -ENODEV;
67981 +       }
67982 +
67983 +       qe_uart_initbd(qe_port);
67984 +       qe_uart_init_ucc(qe_port);
67985 +
67986 +       /* Install interrupt handler. */
67987 +       ret = request_irq(port->irq, qe_uart_int, IRQF_SHARED, "ucc-uart",
67988 +               qe_port);
67989 +       if (ret) {
67990 +               dev_err(port->dev, "could not claim IRQ %u\n", port->irq);
67991 +               return ret;
67992 +       }
67993 +
67994 +       /* Startup rx-int */
67995 +       setbits16(&qe_port->uccp->uccm, UCC_UART_UCCE_RX);
67996 +       ucc_slow_enable(qe_port->us_private, COMM_DIR_RX_AND_TX);
67997 +
67998 +       return 0;
67999 +}
68000 +
68001 +/*
68002 + * Shutdown the port.
68003 + */
68004 +static void qe_uart_shutdown(struct uart_port *port)
68005 +{
68006 +       struct uart_qe_port *qe_port =
68007 +               container_of(port, struct uart_qe_port, port);
68008 +       struct ucc_slow __iomem *uccp = qe_port->uccp;
68009 +       unsigned int timeout = 20;
68010 +
68011 +       /* Disable RX and TX */
68012 +
68013 +       /* Wait for all the BDs marked sent */
68014 +       while (!qe_uart_tx_empty(port)) {
68015 +               if (!--timeout) {
68016 +                       dev_warn(port->dev, "shutdown timeout\n");
68017 +                       break;
68018 +               }
68019 +               set_current_state(TASK_UNINTERRUPTIBLE);
68020 +               schedule_timeout(2);
68021 +       }
68022 +
68023 +       if (qe_port->wait_closing) {
68024 +               /* Wait a bit longer */
68025 +               set_current_state(TASK_UNINTERRUPTIBLE);
68026 +               schedule_timeout(qe_port->wait_closing);
68027 +       }
68028 +
68029 +       /* Stop uarts */
68030 +       ucc_slow_disable(qe_port->us_private, COMM_DIR_RX_AND_TX);
68031 +       clrbits16(&uccp->uccm, UCC_UART_UCCE_TX | UCC_UART_UCCE_RX);
68032 +
68033 +       /* Shut them really down and reinit buffer descriptors */
68034 +       ucc_slow_graceful_stop_tx(qe_port->us_private);
68035 +       qe_uart_initbd(qe_port);
68036 +
68037 +       free_irq(port->irq, qe_port);
68038 +}
68039 +
68040 +/*
68041 + * Set the serial port parameters.
68042 + */
68043 +static void qe_uart_set_termios(struct uart_port *port,
68044 +                               struct ktermios *termios, struct ktermios *old)
68045 +{
68046 +       struct uart_qe_port *qe_port =
68047 +               container_of(port, struct uart_qe_port, port);
68048 +       struct ucc_slow __iomem *uccp = qe_port->uccp;
68049 +       unsigned int baud;
68050 +       unsigned long flags;
68051 +       u16 upsmr = in_be16(&uccp->upsmr);
68052 +       struct ucc_uart_pram __iomem *uccup = qe_port->uccup;
68053 +       u16 supsmr = in_be16(&uccup->supsmr);
68054 +       u8 char_length = 2; /* 1 + CL + PEN + 1 + SL */
68055 +
68056 +       /* Character length programmed into the mode register is the
68057 +        * sum of: 1 start bit, number of data bits, 0 or 1 parity bit,
68058 +        * 1 or 2 stop bits, minus 1.
68059 +        * The value 'bits' counts this for us.
68060 +        */
68061 +
68062 +       /* byte size */
68063 +       upsmr &= UCC_UART_UPSMR_CL_MASK;
68064 +       supsmr &= UCC_UART_SUPSMR_CL_MASK;
68065 +
68066 +       switch (termios->c_cflag & CSIZE) {
68067 +       case CS5:
68068 +               upsmr |= UCC_UART_UPSMR_CL_5;
68069 +               supsmr |= UCC_UART_SUPSMR_CL_5;
68070 +               char_length += 5;
68071 +               break;
68072 +       case CS6:
68073 +               upsmr |= UCC_UART_UPSMR_CL_6;
68074 +               supsmr |= UCC_UART_SUPSMR_CL_6;
68075 +               char_length += 6;
68076 +               break;
68077 +       case CS7:
68078 +               upsmr |= UCC_UART_UPSMR_CL_7;
68079 +               supsmr |= UCC_UART_SUPSMR_CL_7;
68080 +               char_length += 7;
68081 +               break;
68082 +       default:        /* case CS8 */
68083 +               upsmr |= UCC_UART_UPSMR_CL_8;
68084 +               supsmr |= UCC_UART_SUPSMR_CL_8;
68085 +               char_length += 8;
68086 +               break;
68087 +       }
68088 +
68089 +       /* If CSTOPB is set, we want two stop bits */
68090 +       if (termios->c_cflag & CSTOPB) {
68091 +               upsmr |= UCC_UART_UPSMR_SL;
68092 +               supsmr |= UCC_UART_SUPSMR_SL;
68093 +               char_length++;  /* + SL */
68094 +       }
68095 +
68096 +       if (termios->c_cflag & PARENB) {
68097 +               upsmr |= UCC_UART_UPSMR_PEN;
68098 +               supsmr |= UCC_UART_SUPSMR_PEN;
68099 +               char_length++;  /* + PEN */
68100 +
68101 +               if (!(termios->c_cflag & PARODD)) {
68102 +                       upsmr &= ~(UCC_UART_UPSMR_RPM_MASK |
68103 +                                  UCC_UART_UPSMR_TPM_MASK);
68104 +                       upsmr |= UCC_UART_UPSMR_RPM_EVEN |
68105 +                               UCC_UART_UPSMR_TPM_EVEN;
68106 +                       supsmr &= ~(UCC_UART_SUPSMR_RPM_MASK |
68107 +                                   UCC_UART_SUPSMR_TPM_MASK);
68108 +                       supsmr |= UCC_UART_SUPSMR_RPM_EVEN |
68109 +                               UCC_UART_SUPSMR_TPM_EVEN;
68110 +               }
68111 +       }
68112 +
68113 +       /*
68114 +        * Set up parity check flag
68115 +        */
68116 +       port->read_status_mask = BD_SC_EMPTY | BD_SC_OV;
68117 +       if (termios->c_iflag & INPCK)
68118 +               port->read_status_mask |= BD_SC_FR | BD_SC_PR;
68119 +       if (termios->c_iflag & (BRKINT | PARMRK))
68120 +               port->read_status_mask |= BD_SC_BR;
68121 +
68122 +       /*
68123 +        * Characters to ignore
68124 +        */
68125 +       port->ignore_status_mask = 0;
68126 +       if (termios->c_iflag & IGNPAR)
68127 +               port->ignore_status_mask |= BD_SC_PR | BD_SC_FR;
68128 +       if (termios->c_iflag & IGNBRK) {
68129 +               port->ignore_status_mask |= BD_SC_BR;
68130 +               /*
68131 +                * If we're ignore parity and break indicators, ignore
68132 +                * overruns too.  (For real raw support).
68133 +                */
68134 +               if (termios->c_iflag & IGNPAR)
68135 +                       port->ignore_status_mask |= BD_SC_OV;
68136 +       }
68137 +       /*
68138 +        * !!! ignore all characters if CREAD is not set
68139 +        */
68140 +       if ((termios->c_cflag & CREAD) == 0)
68141 +               port->read_status_mask &= ~BD_SC_EMPTY;
68142 +
68143 +       baud = uart_get_baud_rate(port, termios, old, 0, 115200);
68144 +
68145 +       /* Do we really need a spinlock here? */
68146 +       spin_lock_irqsave(&port->lock, flags);
68147 +
68148 +       out_be16(&uccp->upsmr, upsmr);
68149 +       if (soft_uart) {
68150 +               out_be16(&uccup->supsmr, supsmr);
68151 +               out_8(&uccup->rx_length, char_length);
68152 +
68153 +               /* Soft-UART requires a 1X multiplier for TX */
68154 +               qe_setbrg(qe_port->us_info.rx_clock, baud, 16);
68155 +               qe_setbrg(qe_port->us_info.tx_clock, baud, 1);
68156 +       } else {
68157 +               qe_setbrg(qe_port->us_info.rx_clock, baud, 16);
68158 +               qe_setbrg(qe_port->us_info.tx_clock, baud, 16);
68159 +       }
68160 +
68161 +       spin_unlock_irqrestore(&port->lock, flags);
68162 +}
68163 +
68164 +/*
68165 + * Return a pointer to a string that describes what kind of port this is.
68166 + */
68167 +static const char *qe_uart_type(struct uart_port *port)
68168 +{
68169 +       return "QE";
68170 +}
68171 +
68172 +/*
68173 + * Allocate any memory and I/O resources required by the port.
68174 + */
68175 +static int qe_uart_request_port(struct uart_port *port)
68176 +{
68177 +       int ret;
68178 +       struct uart_qe_port *qe_port =
68179 +               container_of(port, struct uart_qe_port, port);
68180 +       struct ucc_slow_info *us_info = &qe_port->us_info;
68181 +       struct ucc_slow_private *uccs;
68182 +       unsigned int rx_size, tx_size;
68183 +       void *bd_virt;
68184 +       dma_addr_t bd_dma_addr = 0;
68185 +
68186 +       ret = ucc_slow_init(us_info, &uccs);
68187 +       if (ret) {
68188 +               dev_err(port->dev, "could not initialize UCC%u\n",
68189 +                      qe_port->ucc_num);
68190 +               return ret;
68191 +       }
68192 +
68193 +       qe_port->us_private = uccs;
68194 +       qe_port->uccp = uccs->us_regs;
68195 +       qe_port->uccup = (struct ucc_uart_pram *) uccs->us_pram;
68196 +       qe_port->rx_bd_base = uccs->rx_bd;
68197 +       qe_port->tx_bd_base = uccs->tx_bd;
68198 +
68199 +       /*
68200 +        * Allocate the transmit and receive data buffers.
68201 +        */
68202 +
68203 +       rx_size = L1_CACHE_ALIGN(qe_port->rx_nrfifos * qe_port->rx_fifosize);
68204 +       tx_size = L1_CACHE_ALIGN(qe_port->tx_nrfifos * qe_port->tx_fifosize);
68205 +
68206 +       bd_virt = dma_alloc_coherent(NULL, rx_size + tx_size, &bd_dma_addr,
68207 +               GFP_KERNEL);
68208 +       if (!bd_virt) {
68209 +               dev_err(port->dev, "could not allocate buffer descriptors\n");
68210 +               return -ENOMEM;
68211 +       }
68212 +
68213 +       qe_port->bd_virt = bd_virt;
68214 +       qe_port->bd_dma_addr = bd_dma_addr;
68215 +       qe_port->bd_size = rx_size + tx_size;
68216 +
68217 +       qe_port->rx_buf = bd_virt;
68218 +       qe_port->tx_buf = qe_port->rx_buf + rx_size;
68219 +
68220 +       return 0;
68221 +}
68222 +
68223 +/*
68224 + * Configure the port.
68225 + *
68226 + * We say we're a CPM-type port because that's mostly true.  Once the device
68227 + * is configured, this driver operates almost identically to the CPM serial
68228 + * driver.
68229 + */
68230 +static void qe_uart_config_port(struct uart_port *port, int flags)
68231 +{
68232 +       if (flags & UART_CONFIG_TYPE) {
68233 +               port->type = PORT_CPM;
68234 +               qe_uart_request_port(port);
68235 +       }
68236 +}
68237 +
68238 +/*
68239 + * Release any memory and I/O resources that were allocated in
68240 + * qe_uart_request_port().
68241 + */
68242 +static void qe_uart_release_port(struct uart_port *port)
68243 +{
68244 +       struct uart_qe_port *qe_port =
68245 +               container_of(port, struct uart_qe_port, port);
68246 +       struct ucc_slow_private *uccs = qe_port->us_private;
68247 +
68248 +       dma_free_coherent(NULL, qe_port->bd_size, qe_port->bd_virt,
68249 +                         qe_port->bd_dma_addr);
68250 +
68251 +       ucc_slow_free(uccs);
68252 +}
68253 +
68254 +/*
68255 + * Verify that the data in serial_struct is suitable for this device.
68256 + */
68257 +static int qe_uart_verify_port(struct uart_port *port,
68258 +                              struct serial_struct *ser)
68259 +{
68260 +       if (ser->type != PORT_UNKNOWN && ser->type != PORT_CPM)
68261 +               return -EINVAL;
68262 +
68263 +       if (ser->irq < 0 || ser->irq >= NR_IRQS)
68264 +               return -EINVAL;
68265 +
68266 +       if (ser->baud_base < 9600)
68267 +               return -EINVAL;
68268 +
68269 +       return 0;
68270 +}
68271 +/* UART operations
68272 + *
68273 + * Details on these functions can be found in Documentation/serial/driver
68274 + */
68275 +static struct uart_ops qe_uart_pops = {
68276 +       .tx_empty       = qe_uart_tx_empty,
68277 +       .set_mctrl      = qe_uart_set_mctrl,
68278 +       .get_mctrl      = qe_uart_get_mctrl,
68279 +       .stop_tx        = qe_uart_stop_tx,
68280 +       .start_tx       = qe_uart_start_tx,
68281 +       .stop_rx        = qe_uart_stop_rx,
68282 +       .enable_ms      = qe_uart_enable_ms,
68283 +       .break_ctl      = qe_uart_break_ctl,
68284 +       .startup        = qe_uart_startup,
68285 +       .shutdown       = qe_uart_shutdown,
68286 +       .set_termios    = qe_uart_set_termios,
68287 +       .type           = qe_uart_type,
68288 +       .release_port   = qe_uart_release_port,
68289 +       .request_port   = qe_uart_request_port,
68290 +       .config_port    = qe_uart_config_port,
68291 +       .verify_port    = qe_uart_verify_port,
68292 +};
68293 +
68294 +/*
68295 + * Obtain the SOC model number and revision level
68296 + *
68297 + * This function parses the device tree to obtain the SOC model.  It then
68298 + * reads the SVR register to the revision.
68299 + *
68300 + * The device tree stores the SOC model two different ways.
68301 + *
68302 + * The new way is:
68303 + *
68304 + *             cpu@0 {
68305 + *                     compatible = "PowerPC,8323";
68306 + *                     device_type = "cpu";
68307 + *                     ...
68308 + *
68309 + *
68310 + * The old way is:
68311 + *              PowerPC,8323@0 {
68312 + *                     device_type = "cpu";
68313 + *                     ...
68314 + *
68315 + * This code first checks the new way, and then the old way.
68316 + */
68317 +static unsigned int soc_info(unsigned int *rev_h, unsigned int *rev_l)
68318 +{
68319 +       struct device_node *np;
68320 +       const char *soc_string;
68321 +       unsigned int svr;
68322 +       unsigned int soc;
68323 +
68324 +       /* Find the CPU node */
68325 +       np = of_find_node_by_type(NULL, "cpu");
68326 +       if (!np)
68327 +               return 0;
68328 +       /* Find the compatible property */
68329 +       soc_string = of_get_property(np, "compatible", NULL);
68330 +       if (!soc_string)
68331 +               /* No compatible property, so try the name. */
68332 +               soc_string = np->name;
68333 +
68334 +       /* Extract the SOC number from the "PowerPC," string */
68335 +       if ((sscanf(soc_string, "PowerPC,%u", &soc) != 1) || !soc)
68336 +               return 0;
68337 +
68338 +       /* Get the revision from the SVR */
68339 +       svr = mfspr(SPRN_SVR);
68340 +       *rev_h = (svr >> 4) & 0xf;
68341 +       *rev_l = svr & 0xf;
68342 +
68343 +       return soc;
68344 +}
68345 +
68346 +/*
68347 + * requst_firmware_nowait() callback function
68348 + *
68349 + * This function is called by the kernel when a firmware is made available,
68350 + * or if it times out waiting for the firmware.
68351 + */
68352 +static void uart_firmware_cont(const struct firmware *fw, void *context)
68353 +{
68354 +       struct qe_firmware *firmware;
68355 +       struct device *dev = context;
68356 +       int ret;
68357 +
68358 +       if (!fw) {
68359 +               dev_err(dev, "firmware not found\n");
68360 +               return;
68361 +       }
68362 +
68363 +       firmware = (struct qe_firmware *) fw->data;
68364 +
68365 +       if (firmware->header.length != fw->size) {
68366 +               dev_err(dev, "invalid firmware\n");
68367 +               return;
68368 +       }
68369 +
68370 +       ret = qe_upload_firmware(firmware);
68371 +       if (ret) {
68372 +               dev_err(dev, "could not load firmware\n");
68373 +               return;
68374 +       }
68375 +
68376 +       firmware_loaded = 1;
68377 +}
68378 +
68379 +static int ucc_uart_probe(struct of_device *ofdev,
68380 +       const struct of_device_id *match)
68381 +{
68382 +       struct device_node *np = ofdev->node;
68383 +       const unsigned int *iprop;      /* Integer OF properties */
68384 +       const char *sprop;      /* String OF properties */
68385 +       struct uart_qe_port *qe_port = NULL;
68386 +       struct resource res;
68387 +       int ret;
68388 +
68389 +       /*
68390 +        * Determine if we need Soft-UART mode
68391 +        */
68392 +       if (of_find_property(np, "soft-uart", NULL)) {
68393 +               dev_dbg(&ofdev->dev, "using Soft-UART mode\n");
68394 +               soft_uart = 1;
68395 +       }
68396 +
68397 +       /*
68398 +        * If we are using Soft-UART, determine if we need to upload the
68399 +        * firmware, too.
68400 +        */
68401 +       if (soft_uart) {
68402 +               struct qe_firmware_info *qe_fw_info;
68403 +
68404 +               qe_fw_info = qe_get_firmware_info();
68405 +
68406 +               /* Check if the firmware has been uploaded. */
68407 +               if (qe_fw_info && strstr(qe_fw_info->id, "Soft-UART")) {
68408 +                       firmware_loaded = 1;
68409 +               } else {
68410 +                       char filename[32];
68411 +                       unsigned int soc;
68412 +                       unsigned int rev_h;
68413 +                       unsigned int rev_l;
68414 +
68415 +                       soc = soc_info(&rev_h, &rev_l);
68416 +                       if (!soc) {
68417 +                               dev_err(&ofdev->dev, "unknown CPU model\n");
68418 +                               return -ENXIO;
68419 +                       }
68420 +                       sprintf(filename, "fsl_qe_ucode_uart_%u_%u%u.bin",
68421 +                               soc, rev_h, rev_l);
68422 +
68423 +                       dev_info(&ofdev->dev, "waiting for firmware %s\n",
68424 +                               filename);
68425 +
68426 +                       /*
68427 +                        * We call request_firmware_nowait instead of
68428 +                        * request_firmware so that the driver can load and
68429 +                        * initialize the ports without holding up the rest of
68430 +                        * the kernel.  If hotplug support is enabled in the
68431 +                        * kernel, then we use it.
68432 +                        */
68433 +                       ret = request_firmware_nowait(THIS_MODULE,
68434 +                               FW_ACTION_HOTPLUG, filename, &ofdev->dev,
68435 +                               &ofdev->dev, uart_firmware_cont);
68436 +                       if (ret) {
68437 +                               dev_err(&ofdev->dev,
68438 +                                       "could not load firmware %s\n",
68439 +                                       filename);
68440 +                               return ret;
68441 +                       }
68442 +               }
68443 +       }
68444 +
68445 +       qe_port = kzalloc(sizeof(struct uart_qe_port), GFP_KERNEL);
68446 +       if (!qe_port) {
68447 +               dev_err(&ofdev->dev, "can't allocate QE port structure\n");
68448 +               return -ENOMEM;
68449 +       }
68450 +
68451 +       /* Search for IRQ and mapbase */
68452 +       ret = of_address_to_resource(np, 0, &res);
68453 +       if (ret) {
68454 +               dev_err(&ofdev->dev, "missing 'reg' property in device tree\n");
68455 +               kfree(qe_port);
68456 +               return ret;
68457 +       }
68458 +       if (!res.start) {
68459 +               dev_err(&ofdev->dev, "invalid 'reg' property in device tree\n");
68460 +               kfree(qe_port);
68461 +               return -EINVAL;
68462 +       }
68463 +       qe_port->port.mapbase = res.start;
68464 +
68465 +       /* Get the UCC number (device ID) */
68466 +       /* UCCs are numbered 1-7 */
68467 +       iprop = of_get_property(np, "device-id", NULL);
68468 +       if (!iprop || (*iprop < 1) || (*iprop > UCC_MAX_NUM)) {
68469 +               dev_err(&ofdev->dev,
68470 +                       "missing or invalid UCC specified in device tree\n");
68471 +               kfree(qe_port);
68472 +               return -ENODEV;
68473 +       }
68474 +       qe_port->ucc_num = *iprop - 1;
68475 +
68476 +       /*
68477 +        * In the future, we should not require the BRG to be specified in the
68478 +        * device tree.  If no clock-source is specified, then just pick a BRG
68479 +        * to use.  This requires a new QE library function that manages BRG
68480 +        * assignments.
68481 +        */
68482 +
68483 +       sprop = of_get_property(np, "rx-clock-name", NULL);
68484 +       if (!sprop) {
68485 +               dev_err(&ofdev->dev, "missing rx-clock-name in device tree\n");
68486 +               kfree(qe_port);
68487 +               return -ENODEV;
68488 +       }
68489 +
68490 +       qe_port->us_info.rx_clock = qe_clock_source(sprop);
68491 +       if ((qe_port->us_info.rx_clock < QE_BRG1) ||
68492 +           (qe_port->us_info.rx_clock > QE_BRG16)) {
68493 +               dev_err(&ofdev->dev, "rx-clock-name must be a BRG for UART\n");
68494 +               kfree(qe_port);
68495 +               return -ENODEV;
68496 +       }
68497 +
68498 +#ifdef LOOPBACK
68499 +       /* In internal loopback mode, TX and RX must use the same clock */
68500 +       qe_port->us_info.tx_clock = qe_port->us_info.rx_clock;
68501 +#else
68502 +       sprop = of_get_property(np, "tx-clock-name", NULL);
68503 +       if (!sprop) {
68504 +               dev_err(&ofdev->dev, "missing tx-clock-name in device tree\n");
68505 +               kfree(qe_port);
68506 +               return -ENODEV;
68507 +       }
68508 +       qe_port->us_info.tx_clock = qe_clock_source(sprop);
68509 +#endif
68510 +       if ((qe_port->us_info.tx_clock < QE_BRG1) ||
68511 +           (qe_port->us_info.tx_clock > QE_BRG16)) {
68512 +               dev_err(&ofdev->dev, "tx-clock-name must be a BRG for UART\n");
68513 +               kfree(qe_port);
68514 +               return -ENODEV;
68515 +       }
68516 +
68517 +       /* Get the port number, numbered 0-3 */
68518 +       iprop = of_get_property(np, "port-number", NULL);
68519 +       if (!iprop) {
68520 +               dev_err(&ofdev->dev, "missing port-number in device tree\n");
68521 +               kfree(qe_port);
68522 +               return -EINVAL;
68523 +       }
68524 +       qe_port->port.line = *iprop;
68525 +       if (qe_port->port.line >= UCC_MAX_UART) {
68526 +               dev_err(&ofdev->dev, "port-number must be 0-%u\n",
68527 +                       UCC_MAX_UART - 1);
68528 +               kfree(qe_port);
68529 +               return -EINVAL;
68530 +       }
68531 +
68532 +       qe_port->port.irq = irq_of_parse_and_map(np, 0);
68533 +       if (qe_port->port.irq == NO_IRQ) {
68534 +               dev_err(&ofdev->dev, "could not map IRQ for UCC%u\n",
68535 +                      qe_port->ucc_num + 1);
68536 +               kfree(qe_port);
68537 +               return -EINVAL;
68538 +       }
68539 +
68540 +       /*
68541 +        * Newer device trees have an "fsl,qe" compatible property for the QE
68542 +        * node, but we still need to support older device trees.
68543 +        */
68544 +       np = of_find_compatible_node(NULL, NULL, "fsl,qe");
68545 +       if (!np) {
68546 +               np = of_find_node_by_type(NULL, "qe");
68547 +               if (!np) {
68548 +                       dev_err(&ofdev->dev, "could not find 'qe' node\n");
68549 +                       kfree(qe_port);
68550 +                       return -EINVAL;
68551 +               }
68552 +       }
68553 +
68554 +       iprop = of_get_property(np, "brg-frequency", NULL);
68555 +       if (!iprop) {
68556 +               dev_err(&ofdev->dev,
68557 +                      "missing brg-frequency in device tree\n");
68558 +               kfree(qe_port);
68559 +               return -EINVAL;
68560 +       }
68561 +
68562 +       if (*iprop)
68563 +               qe_port->port.uartclk = *iprop;
68564 +       else {
68565 +               /*
68566 +                * Older versions of U-Boot do not initialize the brg-frequency
68567 +                * property, so in this case we assume the BRG frequency is
68568 +                * half the QE bus frequency.
68569 +                */
68570 +               iprop = of_get_property(np, "bus-frequency", NULL);
68571 +               if (!iprop) {
68572 +                       dev_err(&ofdev->dev,
68573 +                               "missing QE bus-frequency in device tree\n");
68574 +                       kfree(qe_port);
68575 +                       return -EINVAL;
68576 +               }
68577 +               if (*iprop)
68578 +                       qe_port->port.uartclk = *iprop / 2;
68579 +               else {
68580 +                       dev_err(&ofdev->dev,
68581 +                               "invalid QE bus-frequency in device tree\n");
68582 +                       kfree(qe_port);
68583 +                       return -EINVAL;
68584 +               }
68585 +       }
68586 +
68587 +       spin_lock_init(&qe_port->port.lock);
68588 +       qe_port->np = np;
68589 +       qe_port->port.dev = &ofdev->dev;
68590 +       qe_port->port.ops = &qe_uart_pops;
68591 +       qe_port->port.iotype = UPIO_MEM;
68592 +
68593 +       qe_port->tx_nrfifos = TX_NUM_FIFO;
68594 +       qe_port->tx_fifosize = TX_BUF_SIZE;
68595 +       qe_port->rx_nrfifos = RX_NUM_FIFO;
68596 +       qe_port->rx_fifosize = RX_BUF_SIZE;
68597 +
68598 +       qe_port->wait_closing = UCC_WAIT_CLOSING;
68599 +       qe_port->port.fifosize = 512;
68600 +       qe_port->port.flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP;
68601 +
68602 +       qe_port->us_info.ucc_num = qe_port->ucc_num;
68603 +       qe_port->us_info.regs = (phys_addr_t) res.start;
68604 +       qe_port->us_info.irq = qe_port->port.irq;
68605 +
68606 +       qe_port->us_info.rx_bd_ring_len = qe_port->rx_nrfifos;
68607 +       qe_port->us_info.tx_bd_ring_len = qe_port->tx_nrfifos;
68608 +
68609 +       /* Make sure ucc_slow_init() initializes both TX and RX */
68610 +       qe_port->us_info.init_tx = 1;
68611 +       qe_port->us_info.init_rx = 1;
68612 +
68613 +       /* Add the port to the uart sub-system.  This will cause
68614 +        * qe_uart_config_port() to be called, so the us_info structure must
68615 +        * be initialized.
68616 +        */
68617 +       ret = uart_add_one_port(&ucc_uart_driver, &qe_port->port);
68618 +       if (ret) {
68619 +               dev_err(&ofdev->dev, "could not add /dev/ttyQE%u\n",
68620 +                      qe_port->port.line);
68621 +               kfree(qe_port);
68622 +               return ret;
68623 +       }
68624 +
68625 +       dev_set_drvdata(&ofdev->dev, qe_port);
68626 +
68627 +       dev_info(&ofdev->dev, "UCC%u assigned to /dev/ttyQE%u\n",
68628 +               qe_port->ucc_num + 1, qe_port->port.line);
68629 +
68630 +       /* Display the mknod command for this device */
68631 +       dev_dbg(&ofdev->dev, "mknod command is 'mknod /dev/ttyQE%u c %u %u'\n",
68632 +              qe_port->port.line, SERIAL_QE_MAJOR,
68633 +              SERIAL_QE_MINOR + qe_port->port.line);
68634 +
68635 +       return 0;
68636 +}
68637 +
68638 +static int ucc_uart_remove(struct of_device *ofdev)
68639 +{
68640 +       struct uart_qe_port *qe_port = dev_get_drvdata(&ofdev->dev);
68641 +
68642 +       dev_info(&ofdev->dev, "removing /dev/ttyQE%u\n", qe_port->port.line);
68643 +
68644 +       uart_remove_one_port(&ucc_uart_driver, &qe_port->port);
68645 +
68646 +       dev_set_drvdata(&ofdev->dev, NULL);
68647 +       kfree(qe_port);
68648 +
68649 +       return 0;
68650 +}
68651 +
68652 +static struct of_device_id ucc_uart_match[] = {
68653 +       {
68654 +               .type = "serial",
68655 +               .compatible = "ucc_uart",
68656 +       },
68657 +       {},
68658 +};
68659 +MODULE_DEVICE_TABLE(of, ucc_uart_match);
68660 +
68661 +static struct of_platform_driver ucc_uart_of_driver = {
68662 +       .owner          = THIS_MODULE,
68663 +       .name           = "ucc_uart",
68664 +       .match_table    = ucc_uart_match,
68665 +       .probe          = ucc_uart_probe,
68666 +       .remove         = ucc_uart_remove,
68667 +};
68668 +
68669 +static int __init ucc_uart_init(void)
68670 +{
68671 +       int ret;
68672 +
68673 +       printk(KERN_INFO "Freescale QUICC Engine UART device driver\n");
68674 +#ifdef LOOPBACK
68675 +       printk(KERN_INFO "ucc-uart: Using loopback mode\n");
68676 +#endif
68677 +
68678 +       ret = uart_register_driver(&ucc_uart_driver);
68679 +       if (ret) {
68680 +               printk(KERN_ERR "ucc-uart: could not register UART driver\n");
68681 +               return ret;
68682 +       }
68683 +
68684 +       ret = of_register_platform_driver(&ucc_uart_of_driver);
68685 +       if (ret)
68686 +               printk(KERN_ERR
68687 +                      "ucc-uart: could not register platform driver\n");
68688 +
68689 +       return ret;
68690 +}
68691 +
68692 +static void __exit ucc_uart_exit(void)
68693 +{
68694 +       printk(KERN_INFO
68695 +              "Freescale QUICC Engine UART device driver unloading\n");
68696 +
68697 +       of_unregister_platform_driver(&ucc_uart_of_driver);
68698 +       uart_unregister_driver(&ucc_uart_driver);
68699 +}
68700 +
68701 +module_init(ucc_uart_init);
68702 +module_exit(ucc_uart_exit);
68703 +
68704 +MODULE_DESCRIPTION("Freescale QUICC Engine (QE) UART");
68705 +MODULE_AUTHOR("Timur Tabi <timur@freescale.com>");
68706 +MODULE_LICENSE("GPL v2");
68707 +MODULE_ALIAS_CHARDEV_MAJOR(SERIAL_QE_MAJOR);
68708 +
68709 --- a/drivers/spi/mpc52xx_psc_spi.c
68710 +++ b/drivers/spi/mpc52xx_psc_spi.c
68711 @@ -330,6 +330,7 @@
68712  
68713  static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps)
68714  {
68715 +       struct device_node *np;
68716         struct mpc52xx_cdm __iomem *cdm;
68717         struct mpc52xx_gpio __iomem *gpio;
68718         struct mpc52xx_psc __iomem *psc = mps->psc;
68719 @@ -338,8 +339,12 @@
68720         int ret = 0;
68721  
68722  #if defined(CONFIG_PPC_MERGE)
68723 -       cdm = mpc52xx_find_and_map("mpc5200-cdm");
68724 -       gpio = mpc52xx_find_and_map("mpc5200-gpio");
68725 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-cdm");
68726 +       cdm = of_iomap(np, 0);
68727 +       of_node_put(np);
68728 +       np = of_find_compatible_node(NULL, NULL, "mpc5200-gpio");
68729 +       gpio = of_iomap(np, 0);
68730 +       of_node_put(np);
68731  #else
68732         cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
68733         gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE);
68734 --- a/fs/openpromfs/inode.c
68735 +++ b/fs/openpromfs/inode.c
68736 @@ -131,7 +131,7 @@
68737         /* Nothing to do */
68738  }
68739  
68740 -static const struct seq_operations property_op = {
68741 +static struct seq_operations property_op = {
68742         .start          = property_start,
68743         .next           = property_next,
68744         .stop           = property_stop,
68745 --- a/include/asm-powerpc/8xx_immap.h
68746 +++ b/include/asm-powerpc/8xx_immap.h
68747 @@ -123,7 +123,7 @@
68748  #define OR_G5LA                0x00000400      /* Output #GPL5 on #GPL_A5              */
68749  #define OR_G5LS                0x00000200      /* Drive #GPL high on falling edge of...*/
68750  #define OR_BI          0x00000100      /* Burst inhibit                        */
68751 -#define OR_SCY_MSK     0x000000f0      /* Cycle Lenght in Clocks               */
68752 +#define OR_SCY_MSK     0x000000f0      /* Cycle Length in Clocks               */
68753  #define OR_SCY_0_CLK   0x00000000      /* 0 clock cycles wait states           */
68754  #define OR_SCY_1_CLK   0x00000010      /* 1 clock cycles wait states           */
68755  #define OR_SCY_2_CLK   0x00000020      /* 2 clock cycles wait states           */
68756 --- a/include/asm-powerpc/commproc.h
68757 +++ b/include/asm-powerpc/commproc.h
68758 @@ -693,7 +693,7 @@
68759  #define        CICR_SCC_SCC3           ((uint)0x00200000)      /* SCC3 @ SCCc */
68760  #define        CICR_SCB_SCC2           ((uint)0x00040000)      /* SCC2 @ SCCb */
68761  #define        CICR_SCA_SCC1           ((uint)0x00000000)      /* SCC1 @ SCCa */
68762 -#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrrupt */
68763 +#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrupt */
68764  #define CICR_HP_MASK           ((uint)0x00001f00)      /* Hi-pri int. */
68765  #define CICR_IEN               ((uint)0x00000080)      /* Int. enable */
68766  #define CICR_SPS               ((uint)0x00000001)      /* SCC Spread */
68767 --- a/include/asm-powerpc/cpm.h
68768 +++ b/include/asm-powerpc/cpm.h
68769 @@ -10,5 +10,6 @@
68770  unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size);
68771  void __iomem *cpm_muram_addr(unsigned long offset);
68772  dma_addr_t cpm_muram_dma(void __iomem *addr);
68773 +int cpm_command(u32 command, u8 opcode);
68774  
68775  #endif
68776 --- a/include/asm-powerpc/cputable.h
68777 +++ b/include/asm-powerpc/cputable.h
68778 @@ -57,6 +57,14 @@
68779         PPC_PMC_PA6T = 2,
68780  };
68781  
68782 +struct pt_regs;
68783 +
68784 +extern int machine_check_generic(struct pt_regs *regs);
68785 +extern int machine_check_4xx(struct pt_regs *regs);
68786 +extern int machine_check_440A(struct pt_regs *regs);
68787 +extern int machine_check_e500(struct pt_regs *regs);
68788 +extern int machine_check_e200(struct pt_regs *regs);
68789 +
68790  /* NOTE WELL: Update identify_cpu() if fields are added or removed! */
68791  struct cpu_spec {
68792         /* CPU is matched via (PVR & pvr_mask) == pvr_value */
68793 @@ -97,6 +105,11 @@
68794  
68795         /* Name of processor class, for the ELF AT_PLATFORM entry */
68796         char            *platform;
68797 +
68798 +       /* Processor specific machine check handling. Return negative
68799 +        * if the error is fatal, 1 if it was fully recovered and 0 to
68800 +        * pass up (not CPU originated) */
68801 +       int             (*machine_check)(struct pt_regs *regs);
68802  };
68803  
68804  extern struct cpu_spec         *cur_cpu_spec;
68805 --- /dev/null
68806 +++ b/include/asm-powerpc/cputhreads.h
68807 @@ -0,0 +1,71 @@
68808 +#ifndef _ASM_POWERPC_CPUTHREADS_H
68809 +#define _ASM_POWERPC_CPUTHREADS_H
68810 +
68811 +#include <linux/cpumask.h>
68812 +
68813 +/*
68814 + * Mapping of threads to cores
68815 + */
68816 +
68817 +#ifdef CONFIG_SMP
68818 +extern int threads_per_core;
68819 +extern int threads_shift;
68820 +extern cpumask_t threads_core_mask;
68821 +#else
68822 +#define threads_per_core       1
68823 +#define threads_shift          0
68824 +#define threads_core_mask      (CPU_MASK_CPU0)
68825 +#endif
68826 +
68827 +/* cpu_thread_mask_to_cores - Return a cpumask of one per cores
68828 + *                            hit by the argument
68829 + *
68830 + * @threads:   a cpumask of threads
68831 + *
68832 + * This function returns a cpumask which will have one "cpu" (or thread)
68833 + * bit set for each core that has at least one thread set in the argument.
68834 + *
68835 + * This can typically be used for things like IPI for tlb invalidations
68836 + * since those need to be done only once per core/TLB
68837 + */
68838 +static inline cpumask_t cpu_thread_mask_to_cores(cpumask_t threads)
68839 +{
68840 +       cpumask_t       tmp, res;
68841 +       int             i;
68842 +
68843 +       res = CPU_MASK_NONE;
68844 +       for (i = 0; i < NR_CPUS; i += threads_per_core) {
68845 +               cpus_shift_right(tmp, threads_core_mask, i);
68846 +               if (cpus_intersects(threads, tmp))
68847 +                       cpu_set(i, res);
68848 +       }
68849 +       return res;
68850 +}
68851 +
68852 +static inline int cpu_nr_cores(void)
68853 +{
68854 +       return NR_CPUS >> threads_shift;
68855 +}
68856 +
68857 +static inline cpumask_t cpu_online_cores_map(void)
68858 +{
68859 +       return cpu_thread_mask_to_cores(cpu_online_map);
68860 +}
68861 +
68862 +static inline int cpu_thread_to_core(int cpu)
68863 +{
68864 +       return cpu >> threads_shift;
68865 +}
68866 +
68867 +static inline int cpu_thread_in_core(int cpu)
68868 +{
68869 +       return cpu & (threads_per_core - 1);
68870 +}
68871 +
68872 +static inline int cpu_first_thread_in_core(int cpu)
68873 +{
68874 +       return cpu & ~(threads_per_core - 1);
68875 +}
68876 +
68877 +#endif /* _ASM_POWERPC_CPUTHREADS_H */
68878 +
68879 --- a/include/asm-powerpc/dcr-native.h
68880 +++ b/include/asm-powerpc/dcr-native.h
68881 @@ -22,6 +22,8 @@
68882  #ifdef __KERNEL__
68883  #ifndef __ASSEMBLY__
68884  
68885 +#include <linux/spinlock.h>
68886 +
68887  typedef struct {
68888         unsigned int base;
68889  } dcr_host_t;
68890 @@ -55,20 +57,28 @@
68891  } while (0)
68892  
68893  /* R/W of indirect DCRs make use of standard naming conventions for DCRs */
68894 -#define mfdcri(base, reg)                      \
68895 -({                                             \
68896 -       mtdcr(base ## _CFGADDR, base ## _ ## reg);      \
68897 -       mfdcr(base ## _CFGDATA);                        \
68898 +extern spinlock_t dcr_ind_lock;
68899 +
68900 +#define mfdcri(base, reg)                              \
68901 +({                                                     \
68902 +       unsigned long flags;                            \
68903 +       unsigned int val;                               \
68904 +       spin_lock_irqsave(&dcr_ind_lock, flags);        \
68905 +       mtdcr(DCRN_ ## base ## _CONFIG_ADDR, reg);      \
68906 +       val = mfdcr(DCRN_ ## base ## _CONFIG_DATA);     \
68907 +       spin_unlock_irqrestore(&dcr_ind_lock, flags);   \
68908 +       val;                                            \
68909  })
68910  
68911 -#define mtdcri(base, reg, data)                        \
68912 -do {                                           \
68913 -       mtdcr(base ## _CFGADDR, base ## _ ## reg);      \
68914 -       mtdcr(base ## _CFGDATA, data);          \
68915 +#define mtdcri(base, reg, data)                                \
68916 +do {                                                   \
68917 +       unsigned long flags;                            \
68918 +       spin_lock_irqsave(&dcr_ind_lock, flags);        \
68919 +       mtdcr(DCRN_ ## base ## _CONFIG_ADDR, reg);      \
68920 +       mtdcr(DCRN_ ## base ## _CONFIG_DATA, data);     \
68921 +       spin_unlock_irqrestore(&dcr_ind_lock, flags);   \
68922  } while (0)
68923  
68924  #endif /* __ASSEMBLY__ */
68925  #endif /* __KERNEL__ */
68926  #endif /* _ASM_POWERPC_DCR_NATIVE_H */
68927 -
68928 -
68929 --- /dev/null
68930 +++ b/include/asm-powerpc/dcr-regs.h
68931 @@ -0,0 +1,71 @@
68932 +/*
68933 + * Common DCR / SDR / CPR register definitions used on various IBM/AMCC
68934 + * 4xx processors
68935 + *
68936 + *    Copyright 2007 Benjamin Herrenschmidt, IBM Corp
68937 + *                   <benh@kernel.crashing.org>
68938 + *
68939 + * Mostly lifted from asm-ppc/ibm4xx.h by
68940 + *
68941 + *    Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu>
68942 + *
68943 + */
68944 +
68945 +#ifndef __DCR_REGS_H__
68946 +#define __DCR_REGS_H__
68947 +
68948 +/*
68949 + * Most DCRs used for controlling devices such as the MAL, DMA engine,
68950 + * etc... are obtained for the device tree.
68951 + *
68952 + * The definitions in this files are fixed DCRs and indirect DCRs that
68953 + * are commonly used outside of specific drivers or refer to core
68954 + * common registers that may occasionally have to be tweaked outside
68955 + * of the driver main register set
68956 + */
68957 +
68958 +/* CPRs (440GX and 440SP/440SPe) */
68959 +#define DCRN_CPR0_CONFIG_ADDR  0xc
68960 +#define DCRN_CPR0_CONFIG_DATA  0xd
68961 +
68962 +/* SDRs (440GX and 440SP/440SPe) */
68963 +#define DCRN_SDR0_CONFIG_ADDR  0xe
68964 +#define DCRN_SDR0_CONFIG_DATA  0xf
68965 +
68966 +#define SDR0_PFC0              0x4100
68967 +#define SDR0_PFC1              0x4101
68968 +#define SDR0_PFC1_EPS          0x1c00000
68969 +#define SDR0_PFC1_EPS_SHIFT    22
68970 +#define SDR0_PFC1_RMII         0x02000000
68971 +#define SDR0_MFR               0x4300
68972 +#define SDR0_MFR_TAH0          0x80000000      /* TAHOE0 Enable */
68973 +#define SDR0_MFR_TAH1          0x40000000      /* TAHOE1 Enable */
68974 +#define SDR0_MFR_PCM           0x10000000      /* PPC440GP irq compat mode */
68975 +#define SDR0_MFR_ECS           0x08000000      /* EMAC int clk */
68976 +#define SDR0_MFR_T0TXFL                0x00080000
68977 +#define SDR0_MFR_T0TXFH                0x00040000
68978 +#define SDR0_MFR_T1TXFL                0x00020000
68979 +#define SDR0_MFR_T1TXFH                0x00010000
68980 +#define SDR0_MFR_E0TXFL                0x00008000
68981 +#define SDR0_MFR_E0TXFH                0x00004000
68982 +#define SDR0_MFR_E0RXFL                0x00002000
68983 +#define SDR0_MFR_E0RXFH                0x00001000
68984 +#define SDR0_MFR_E1TXFL                0x00000800
68985 +#define SDR0_MFR_E1TXFH                0x00000400
68986 +#define SDR0_MFR_E1RXFL                0x00000200
68987 +#define SDR0_MFR_E1RXFH                0x00000100
68988 +#define SDR0_MFR_E2TXFL                0x00000080
68989 +#define SDR0_MFR_E2TXFH                0x00000040
68990 +#define SDR0_MFR_E2RXFL                0x00000020
68991 +#define SDR0_MFR_E2RXFH                0x00000010
68992 +#define SDR0_MFR_E3TXFL                0x00000008
68993 +#define SDR0_MFR_E3TXFH                0x00000004
68994 +#define SDR0_MFR_E3RXFL                0x00000002
68995 +#define SDR0_MFR_E3RXFH                0x00000001
68996 +#define SDR0_UART0             0x0120
68997 +#define SDR0_UART1             0x0121
68998 +#define SDR0_UART2             0x0122
68999 +#define SDR0_UART3             0x0123
69000 +#define SDR0_CUST0             0x4000
69001 +
69002 +#endif /* __DCR_REGS_H__ */
69003 --- a/include/asm-powerpc/dma-mapping.h
69004 +++ b/include/asm-powerpc/dma-mapping.h
69005 @@ -87,6 +87,9 @@
69006         return dma_ops->dma_supported(dev, mask);
69007  }
69008  
69009 +/* We have our own implementation of pci_set_dma_mask() */
69010 +#define HAVE_ARCH_PCI_SET_DMA_MASK
69011 +
69012  static inline int dma_set_mask(struct device *dev, u64 dma_mask)
69013  {
69014         struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
69015 @@ -186,8 +189,6 @@
69016  extern struct dma_mapping_ops dma_iommu_ops;
69017  extern struct dma_mapping_ops dma_direct_ops;
69018  
69019 -extern unsigned long dma_direct_offset;
69020 -
69021  #else /* CONFIG_PPC64 */
69022  
69023  #define dma_supported(dev, mask)       (1)
69024 --- a/include/asm-powerpc/firmware.h
69025 +++ b/include/asm-powerpc/firmware.h
69026 @@ -64,7 +64,7 @@
69027         FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
69028         FW_FEATURE_PS3_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
69029         FW_FEATURE_CELLEB_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_BEAT,
69030 -       FW_FEATURE_CELLEB_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_BEAT,
69031 +       FW_FEATURE_CELLEB_ALWAYS = 0,
69032         FW_FEATURE_NATIVE_POSSIBLE = 0,
69033         FW_FEATURE_NATIVE_ALWAYS = 0,
69034         FW_FEATURE_POSSIBLE =
69035 --- a/include/asm-powerpc/immap_86xx.h
69036 +++ b/include/asm-powerpc/immap_86xx.h
69037 @@ -89,14 +89,14 @@
69038   * them.
69039   *
69040   * guts: Pointer to GUTS structure
69041 - * co: The DMA controller (1 or 2)
69042 + * co: The DMA controller (0 or 1)
69043   * ch: The channel on the DMA controller (0, 1, 2, or 3)
69044   * device: The device to set as the source (CCSR_GUTS_DMACR_DEV_xx)
69045   */
69046  static inline void guts_set_dmacr(struct ccsr_guts __iomem *guts,
69047         unsigned int co, unsigned int ch, unsigned int device)
69048  {
69049 -       unsigned int shift = 16 + (8 * (2 - co) + 2 * (3 - ch));
69050 +       unsigned int shift = 16 + (8 * (1 - co) + 2 * (3 - ch));
69051  
69052         clrsetbits_be32(&guts->dmacr, 3 << shift, device << shift);
69053  }
69054 @@ -118,6 +118,27 @@
69055  #define CCSR_GUTS_PMUXCR_DMA1_0                0x00000002
69056  #define CCSR_GUTS_PMUXCR_DMA1_3                0x00000001
69057  
69058 +/*
69059 + * Set the DMA external control bits in the GUTS
69060 + *
69061 + * The DMA external control bits in the PMUXCR are only meaningful for
69062 + * channels 0 and 3.  Any other channels are ignored.
69063 + *
69064 + * guts: Pointer to GUTS structure
69065 + * co: The DMA controller (0 or 1)
69066 + * ch: The channel on the DMA controller (0, 1, 2, or 3)
69067 + * value: the new value for the bit (0 or 1)
69068 + */
69069 +static inline void guts_set_pmuxcr_dma(struct ccsr_guts __iomem *guts,
69070 +       unsigned int co, unsigned int ch, unsigned int value)
69071 +{
69072 +       if ((ch == 0) || (ch == 3)) {
69073 +               unsigned int shift = 2 * (co + 1) - (ch & 1) - 1;
69074 +
69075 +               clrsetbits_be32(&guts->pmuxcr, 1 << shift, value << shift);
69076 +       }
69077 +}
69078 +
69079  #define CCSR_GUTS_CLKDVDR_PXCKEN       0x80000000
69080  #define CCSR_GUTS_CLKDVDR_SSICKEN      0x20000000
69081  #define CCSR_GUTS_CLKDVDR_PXCKINV      0x10000000
69082 --- a/include/asm-powerpc/immap_qe.h
69083 +++ b/include/asm-powerpc/immap_qe.h
69084 @@ -393,9 +393,39 @@
69085         u8      res2[0x48];
69086  } __attribute__ ((packed));
69087  
69088 -/* RISC Special Registers (Trap and Breakpoint) */
69089 +/*
69090 + * RISC Special Registers (Trap and Breakpoint).  These are described in
69091 + * the QE Developer's Handbook.
69092 + */
69093  struct rsp {
69094 -       u32     reg[0x40];      /* 64 32-bit registers */
69095 +       __be32 tibcr[16];       /* Trap/instruction breakpoint control regs */
69096 +       u8 res0[64];
69097 +       __be32 ibcr0;
69098 +       __be32 ibs0;
69099 +       __be32 ibcnr0;
69100 +       u8 res1[4];
69101 +       __be32 ibcr1;
69102 +       __be32 ibs1;
69103 +       __be32 ibcnr1;
69104 +       __be32 npcr;
69105 +       __be32 dbcr;
69106 +       __be32 dbar;
69107 +       __be32 dbamr;
69108 +       __be32 dbsr;
69109 +       __be32 dbcnr;
69110 +       u8 res2[12];
69111 +       __be32 dbdr_h;
69112 +       __be32 dbdr_l;
69113 +       __be32 dbdmr_h;
69114 +       __be32 dbdmr_l;
69115 +       __be32 bsr;
69116 +       __be32 bor;
69117 +       __be32 bior;
69118 +       u8 res3[4];
69119 +       __be32 iatr[4];
69120 +       __be32 eccr;            /* Exception control configuration register */
69121 +       __be32 eicr;
69122 +       u8 res4[0x100-0xf8];
69123  } __attribute__ ((packed));
69124  
69125  struct qe_immap {
69126 --- a/include/asm-powerpc/io.h
69127 +++ b/include/asm-powerpc/io.h
69128 @@ -50,15 +50,16 @@
69129  #define PCI_DRAM_OFFSET        pci_dram_offset
69130  #else
69131  #define _IO_BASE       pci_io_base
69132 -#define _ISA_MEM_BASE  0
69133 +#define _ISA_MEM_BASE  isa_mem_base
69134  #define PCI_DRAM_OFFSET        0
69135  #endif
69136  
69137  extern unsigned long isa_io_base;
69138 -extern unsigned long isa_mem_base;
69139  extern unsigned long pci_io_base;
69140  extern unsigned long pci_dram_offset;
69141  
69142 +extern resource_size_t isa_mem_base;
69143 +
69144  #if defined(CONFIG_PPC32) && defined(CONFIG_PPC_INDIRECT_IO)
69145  #error CONFIG_PPC_INDIRECT_IO is not yet supported on 32 bits
69146  #endif
69147 --- a/include/asm-powerpc/iommu.h
69148 +++ b/include/asm-powerpc/iommu.h
69149 @@ -69,10 +69,9 @@
69150  };
69151  
69152  struct scatterlist;
69153 -struct device_node;
69154  
69155  /* Frees table for an individual device node */
69156 -extern void iommu_free_table(struct device_node *dn);
69157 +extern void iommu_free_table(struct iommu_table *tbl, const char *node_name);
69158  
69159  /* Initializes an iommu_table based in values set in the passed-in
69160   * structure
69161 --- a/include/asm-powerpc/ipic.h
69162 +++ b/include/asm-powerpc/ipic.h
69163 @@ -20,11 +20,13 @@
69164  
69165  /* Flags when we init the IPIC */
69166  #define IPIC_SPREADMODE_GRP_A  0x00000001
69167 -#define IPIC_SPREADMODE_GRP_D  0x00000002
69168 -#define IPIC_SPREADMODE_MIX_A  0x00000004
69169 -#define IPIC_SPREADMODE_MIX_B  0x00000008
69170 -#define IPIC_DISABLE_MCP_OUT   0x00000010
69171 -#define IPIC_IRQ0_MCP          0x00000020
69172 +#define IPIC_SPREADMODE_GRP_B  0x00000002
69173 +#define IPIC_SPREADMODE_GRP_C  0x00000004
69174 +#define IPIC_SPREADMODE_GRP_D  0x00000008
69175 +#define IPIC_SPREADMODE_MIX_A  0x00000010
69176 +#define IPIC_SPREADMODE_MIX_B  0x00000020
69177 +#define IPIC_DISABLE_MCP_OUT   0x00000040
69178 +#define IPIC_IRQ0_MCP          0x00000080
69179  
69180  /* IPIC registers offsets */
69181  #define IPIC_SICFR     0x00    /* System Global Interrupt Configuration Register */
69182 --- a/include/asm-powerpc/iseries/hv_lp_event.h
69183 +++ b/include/asm-powerpc/iseries/hv_lp_event.h
69184 @@ -78,7 +78,7 @@
69185  
69186  /*
69187   * Close an Lp Event Path for a type and partition
69188 - * returns 0 on sucess
69189 + * returns 0 on success
69190   */
69191  extern int HvLpEvent_closePath(HvLpEvent_Type eventType, HvLpIndex lpIndex);
69192  
69193 --- a/include/asm-powerpc/kexec.h
69194 +++ b/include/asm-powerpc/kexec.h
69195 @@ -123,6 +123,9 @@
69196  extern void default_machine_kexec(struct kimage *image);
69197  extern int default_machine_kexec_prepare(struct kimage *image);
69198  extern void default_machine_crash_shutdown(struct pt_regs *regs);
69199 +typedef void (*crash_shutdown_t)(void);
69200 +extern int crash_shutdown_register(crash_shutdown_t handler);
69201 +extern int crash_shutdown_unregister(crash_shutdown_t handler);
69202  
69203  extern void machine_kexec_simple(struct kimage *image);
69204  extern void crash_kexec_secondary(struct pt_regs *regs);
69205 --- a/include/asm-powerpc/lmb.h
69206 +++ b/include/asm-powerpc/lmb.h
69207 @@ -51,6 +51,7 @@
69208  extern unsigned long __init lmb_phys_mem_size(void);
69209  extern unsigned long __init lmb_end_of_DRAM(void);
69210  extern void __init lmb_enforce_memory_limit(unsigned long memory_limit);
69211 +extern int __init lmb_is_reserved(unsigned long addr);
69212  
69213  extern void lmb_dump_all(void);
69214  
69215 --- a/include/asm-powerpc/machdep.h
69216 +++ b/include/asm-powerpc/machdep.h
69217 @@ -204,6 +204,13 @@
69218         /*
69219          * optional PCI "hooks"
69220          */
69221 +       /* Called in indirect_* to avoid touching devices */
69222 +       int (*pci_exclude_device)(struct pci_controller *, unsigned char, unsigned char);
69223 +
69224 +       /* Called at then very end of pcibios_init() */
69225 +       void (*pcibios_after_init)(void);
69226 +
69227 +#endif /* CONFIG_PPC32 */
69228  
69229         /* Called after PPC generic resource fixup to perform
69230            machine specific fixups */
69231 @@ -212,18 +219,9 @@
69232         /* Called for each PCI bus in the system when it's probed */
69233         void (*pcibios_fixup_bus)(struct pci_bus *);
69234  
69235 -       /* Called when pci_enable_device() is called (initial=0) or
69236 -        * when a device with no assigned resource is found (initial=1).
69237 -        * Returns 0 to allow assignment/enabling of the device. */
69238 -       int  (*pcibios_enable_device_hook)(struct pci_dev *, int initial);
69239 -
69240 -       /* Called in indirect_* to avoid touching devices */
69241 -       int (*pci_exclude_device)(struct pci_controller *, unsigned char, unsigned char);
69242 -
69243 -       /* Called at then very end of pcibios_init() */
69244 -       void (*pcibios_after_init)(void);
69245 -
69246 -#endif /* CONFIG_PPC32 */
69247 +       /* Called when pci_enable_device() is called. Returns 0 to
69248 +        * allow assignment/enabling of the device. */
69249 +       int  (*pcibios_enable_device_hook)(struct pci_dev *);
69250  
69251         /* Called to shutdown machine specific hardware not already controlled
69252          * by other drivers.
69253 @@ -253,6 +251,16 @@
69254          */
69255         void (*machine_kexec)(struct kimage *image);
69256  #endif /* CONFIG_KEXEC */
69257 +
69258 +#ifdef CONFIG_SUSPEND
69259 +       /* These are called to disable and enable, respectively, IRQs when
69260 +        * entering a suspend state.  If NULL, then the generic versions
69261 +        * will be called.  The generic versions disable/enable the
69262 +        * decrementer along with interrupts.
69263 +        */
69264 +       void (*suspend_disable_irqs)(void);
69265 +       void (*suspend_enable_irqs)(void);
69266 +#endif
69267  };
69268  
69269  extern void power4_idle(void);
69270 @@ -326,5 +334,31 @@
69271                 ppc_md.log_error(buf, err_type, fatal);
69272  }
69273  
69274 +#define __define_machine_initcall(mach,level,fn,id) \
69275 +       static int __init __machine_initcall_##mach##_##fn(void) { \
69276 +               if (machine_is(mach)) return fn(); \
69277 +               return 0; \
69278 +       } \
69279 +       __define_initcall(level,__machine_initcall_##mach##_##fn,id);
69280 +
69281 +#define machine_core_initcall(mach,fn)         __define_machine_initcall(mach,"1",fn,1)
69282 +#define machine_core_initcall_sync(mach,fn)    __define_machine_initcall(mach,"1s",fn,1s)
69283 +#define machine_postcore_initcall(mach,fn)     __define_machine_initcall(mach,"2",fn,2)
69284 +#define machine_postcore_initcall_sync(mach,fn)        __define_machine_initcall(mach,"2s",fn,2s)
69285 +#define machine_arch_initcall(mach,fn)         __define_machine_initcall(mach,"3",fn,3)
69286 +#define machine_arch_initcall_sync(mach,fn)    __define_machine_initcall(mach,"3s",fn,3s)
69287 +#define machine_subsys_initcall(mach,fn)       __define_machine_initcall(mach,"4",fn,4)
69288 +#define machine_subsys_initcall_sync(mach,fn)  __define_machine_initcall(mach,"4s",fn,4s)
69289 +#define machine_fs_initcall(mach,fn)           __define_machine_initcall(mach,"5",fn,5)
69290 +#define machine_fs_initcall_sync(mach,fn)      __define_machine_initcall(mach,"5s",fn,5s)
69291 +#define machine_rootfs_initcall(mach,fn)       __define_machine_initcall(mach,"rootfs",fn,rootfs)
69292 +#define machine_device_initcall(mach,fn)       __define_machine_initcall(mach,"6",fn,6)
69293 +#define machine_device_initcall_sync(mach,fn)  __define_machine_initcall(mach,"6s",fn,6s)
69294 +#define machine_late_initcall(mach,fn)         __define_machine_initcall(mach,"7",fn,7)
69295 +#define machine_late_initcall_sync(mach,fn)    __define_machine_initcall(mach,"7s",fn,7s)
69296 +
69297 +void generic_suspend_disable_irqs(void);
69298 +void generic_suspend_enable_irqs(void);
69299 +
69300  #endif /* __KERNEL__ */
69301  #endif /* _ASM_POWERPC_MACHDEP_H */
69302 --- a/include/asm-powerpc/mmu-hash64.h
69303 +++ b/include/asm-powerpc/mmu-hash64.h
69304 @@ -80,7 +80,7 @@
69305  #define HPTE_V_AVPN_SHIFT      7
69306  #define HPTE_V_AVPN            ASM_CONST(0x3fffffffffffff80)
69307  #define HPTE_V_AVPN_VAL(x)     (((x) & HPTE_V_AVPN) >> HPTE_V_AVPN_SHIFT)
69308 -#define HPTE_V_COMPARE(x,y)    (!(((x) ^ (y)) & 0xffffffffffffff80))
69309 +#define HPTE_V_COMPARE(x,y)    (!(((x) ^ (y)) & 0xffffffffffffff80UL))
69310  #define HPTE_V_BOLTED          ASM_CONST(0x0000000000000010)
69311  #define HPTE_V_LOCK            ASM_CONST(0x0000000000000008)
69312  #define HPTE_V_LARGE           ASM_CONST(0x0000000000000004)
69313 @@ -180,6 +180,7 @@
69314  extern int mmu_io_psize;
69315  extern int mmu_kernel_ssize;
69316  extern int mmu_highuser_ssize;
69317 +extern u16 mmu_slb_size;
69318  
69319  /*
69320   * If the processor supports 64k normal pages but not 64k cache
69321 @@ -277,6 +278,7 @@
69322  extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
69323                              unsigned long pstart, unsigned long mode,
69324                              int psize, int ssize);
69325 +extern void set_huge_psize(int psize);
69326  
69327  extern void htab_initialize(void);
69328  extern void htab_initialize_secondary(void);
69329 --- a/include/asm-powerpc/mpc52xx.h
69330 +++ b/include/asm-powerpc/mpc52xx.h
69331 @@ -248,8 +248,6 @@
69332  
69333  #ifndef __ASSEMBLY__
69334  
69335 -extern void __iomem * mpc52xx_find_and_map(const char *);
69336 -extern void __iomem * mpc52xx_find_and_map_path(const char *path);
69337  extern unsigned int mpc52xx_find_ipb_freq(struct device_node *node);
69338  extern void mpc5200_setup_xlb_arbiter(void);
69339  extern void mpc52xx_declare_of_platform_devices(void);
69340 @@ -257,7 +255,12 @@
69341  extern void mpc52xx_init_irq(void);
69342  extern unsigned int mpc52xx_get_irq(void);
69343  
69344 +#ifdef CONFIG_PCI
69345  extern int __init mpc52xx_add_bridge(struct device_node *node);
69346 +extern void __init mpc52xx_setup_pci(void);
69347 +#else
69348 +static inline void mpc52xx_setup_pci(void) { }
69349 +#endif
69350  
69351  extern void __init mpc52xx_map_wdt(void);
69352  extern void mpc52xx_restart(char *cmd);
69353 --- a/include/asm-powerpc/mpc52xx_psc.h
69354 +++ b/include/asm-powerpc/mpc52xx_psc.h
69355 @@ -153,6 +153,9 @@
69356         u8              reserved16[3];
69357         u8              irfdr;          /* PSC + 0x54 */
69358         u8              reserved17[3];
69359 +};
69360 +
69361 +struct mpc52xx_psc_fifo {
69362         u16             rfnum;          /* PSC + 0x58 */
69363         u16             reserved18;
69364         u16             tfnum;          /* PSC + 0x5c */
69365 --- a/include/asm-powerpc/mpc8260.h
69366 +++ b/include/asm-powerpc/mpc8260.h
69367 @@ -8,6 +8,7 @@
69368  #ifndef __ASM_POWERPC_MPC8260_H__
69369  #define __ASM_POWERPC_MPC8260_H__
69370  
69371 +#define MPC82XX_BCR_PLDP 0x00800000 /* Pipeline Maximum Depth */
69372  
69373  #ifdef CONFIG_8260
69374  
69375 --- a/include/asm-powerpc/mpic.h
69376 +++ b/include/asm-powerpc/mpic.h
69377 @@ -22,7 +22,9 @@
69378  #define MPIC_GREG_GLOBAL_CONF_0                0x00020
69379  #define                MPIC_GREG_GCONF_RESET                   0x80000000
69380  #define                MPIC_GREG_GCONF_8259_PTHROU_DIS         0x20000000
69381 +#define                MPIC_GREG_GCONF_NO_BIAS                 0x10000000
69382  #define                MPIC_GREG_GCONF_BASE_MASK               0x000fffff
69383 +#define                MPIC_GREG_GCONF_MCK                     0x08000000
69384  #define MPIC_GREG_GLOBAL_CONF_1                0x00030
69385  #define                MPIC_GREG_GLOBAL_CONF_1_SIE             0x08000000
69386  #define                MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK  0x70000000
69387 @@ -78,6 +80,7 @@
69388  #define        MPIC_CPU_WHOAMI_MASK                    0x0000001f
69389  #define MPIC_CPU_INTACK                        0x000a0
69390  #define MPIC_CPU_EOI                   0x000b0
69391 +#define MPIC_CPU_MCACK                 0x000c0
69392  
69393  /*
69394   * Per-source registers
69395 @@ -141,6 +144,7 @@
69396  #define TSI108_CPU_WHOAMI              0xffffffff
69397  #define TSI108_CPU_INTACK              0x00004
69398  #define TSI108_CPU_EOI                 0x00008
69399 +#define TSI108_CPU_MCACK               0x00004 /* Doesn't really exist here */
69400  
69401  /*
69402   * Per-source registers
69403 @@ -183,6 +187,7 @@
69404         MPIC_IDX_CPU_WHOAMI,
69405         MPIC_IDX_CPU_INTACK,
69406         MPIC_IDX_CPU_EOI,
69407 +       MPIC_IDX_CPU_MCACK,
69408  
69409         MPIC_IDX_IRQ_BASE,
69410         MPIC_IDX_IRQ_STRIDE,
69411 @@ -344,6 +349,10 @@
69412  #define MPIC_USES_DCR                  0x00000080
69413  /* MPIC has 11-bit vector fields (or larger) */
69414  #define MPIC_LARGE_VECTORS             0x00000100
69415 +/* Enable delivery of prio 15 interrupts as MCK instead of EE */
69416 +#define MPIC_ENABLE_MCK                        0x00000200
69417 +/* Disable bias among target selection, spread interrupts evenly */
69418 +#define MPIC_NO_BIAS                   0x00000400
69419  
69420  /* MPIC HW modification ID */
69421  #define MPIC_REGSET_MASK               0xf0000000
69422 @@ -447,10 +456,19 @@
69423  /* Send a message (IPI) to a given target (cpu number or MSG_*) */
69424  void smp_mpic_message_pass(int target, int msg);
69425  
69426 +/* Unmask a specific virq */
69427 +extern void mpic_unmask_irq(unsigned int irq);
69428 +/* Mask a specific virq */
69429 +extern void mpic_mask_irq(unsigned int irq);
69430 +/* EOI a specific virq */
69431 +extern void mpic_end_irq(unsigned int irq);
69432 +
69433  /* Fetch interrupt from a given mpic */
69434  extern unsigned int mpic_get_one_irq(struct mpic *mpic);
69435 -/* This one gets to the primary mpic */
69436 +/* This one gets from the primary mpic */
69437  extern unsigned int mpic_get_irq(void);
69438 +/* Fetch Machine Check interrupt from primary mpic */
69439 +extern unsigned int mpic_get_mcirq(void);
69440  
69441  /* Set the EPIC clock ratio */
69442  void mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio);
69443 --- a/include/asm-powerpc/nvram.h
69444 +++ b/include/asm-powerpc/nvram.h
69445 @@ -10,6 +10,8 @@
69446  #ifndef _ASM_POWERPC_NVRAM_H
69447  #define _ASM_POWERPC_NVRAM_H
69448  
69449 +#include <linux/errno.h>
69450 +
69451  #define NVRW_CNT 0x20
69452  #define NVRAM_HEADER_LEN 16 /* sizeof(struct nvram_header) */
69453  #define NVRAM_BLOCK_LEN 16
69454 @@ -71,7 +73,16 @@
69455  extern struct nvram_partition *nvram_find_partition(int sig, const char *name);
69456  
69457  extern int pSeries_nvram_init(void);
69458 +
69459 +#ifdef CONFIG_MMIO_NVRAM
69460  extern int mmio_nvram_init(void);
69461 +#else
69462 +static inline int mmio_nvram_init(void)
69463 +{
69464 +       return -ENODEV;
69465 +}
69466 +#endif
69467 +
69468  #endif /* __KERNEL__ */
69469  
69470  /* PowerMac specific nvram stuffs */
69471 --- a/include/asm-powerpc/of_platform.h
69472 +++ b/include/asm-powerpc/of_platform.h
69473 @@ -15,8 +15,14 @@
69474  #include <linux/of_platform.h>
69475  
69476  /* Platform drivers register/unregister */
69477 -extern int of_register_platform_driver(struct of_platform_driver *drv);
69478 -extern void of_unregister_platform_driver(struct of_platform_driver *drv);
69479 +static inline int of_register_platform_driver(struct of_platform_driver *drv)
69480 +{
69481 +       return of_register_driver(drv, &of_platform_bus_type);
69482 +}
69483 +static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
69484 +{
69485 +       of_unregister_driver(drv);
69486 +}
69487  
69488  /* Platform devices and busses creation */
69489  extern struct of_device *of_platform_device_create(struct device_node *np,
69490 @@ -26,9 +32,11 @@
69491  #define OF_NO_DEEP_PROBE ((struct of_device_id *)-1)
69492  
69493  extern int of_platform_bus_probe(struct device_node *root,
69494 -                                struct of_device_id *matches,
69495 +                                const struct of_device_id *matches,
69496                                  struct device *parent);
69497  
69498  extern struct of_device *of_find_device_by_phandle(phandle ph);
69499  
69500 +extern void of_instantiate_rtc(void);
69501 +
69502  #endif /* _ASM_POWERPC_OF_PLATFORM_H */
69503 --- a/include/asm-powerpc/pci-bridge.h
69504 +++ b/include/asm-powerpc/pci-bridge.h
69505 @@ -1,15 +1,42 @@
69506  #ifndef _ASM_POWERPC_PCI_BRIDGE_H
69507  #define _ASM_POWERPC_PCI_BRIDGE_H
69508  #ifdef __KERNEL__
69509 -
69510 +/*
69511 + * This program is free software; you can redistribute it and/or
69512 + * modify it under the terms of the GNU General Public License
69513 + * as published by the Free Software Foundation; either version
69514 + * 2 of the License, or (at your option) any later version.
69515 + */
69516  #include <linux/pci.h>
69517  #include <linux/list.h>
69518  #include <linux/ioport.h>
69519  
69520 -#ifndef CONFIG_PPC64
69521 -
69522  struct device_node;
69523 -struct pci_controller;
69524 +
69525 +extern unsigned int ppc_pci_flags;
69526 +enum {
69527 +       /* Force re-assigning all resources (ignore firmware
69528 +        * setup completely)
69529 +        */
69530 +       PPC_PCI_REASSIGN_ALL_RSRC       = 0x00000001,
69531 +
69532 +       /* Re-assign all bus numbers */
69533 +       PPC_PCI_REASSIGN_ALL_BUS        = 0x00000002,
69534 +
69535 +       /* Do not try to assign, just use existing setup */
69536 +       PPC_PCI_PROBE_ONLY              = 0x00000004,
69537 +
69538 +       /* Don't bother with ISA alignment unless the bridge has
69539 +        * ISA forwarding enabled
69540 +        */
69541 +       PPC_PCI_CAN_SKIP_ISA_ALIGN      = 0x00000008,
69542 +
69543 +       /* Enable domain numbers in /proc */
69544 +       PPC_PCI_ENABLE_PROC_DOMAINS     = 0x00000010,
69545 +       /* ... except for domain 0 */
69546 +       PPC_PCI_COMPAT_DOMAIN_0         = 0x00000020,
69547 +};
69548 +
69549  
69550  /*
69551   * Structure of a PCI controller (host bridge)
69552 @@ -17,26 +44,41 @@
69553  struct pci_controller {
69554         struct pci_bus *bus;
69555         char is_dynamic;
69556 -       void *arch_data;
69557 +#ifdef CONFIG_PPC64
69558 +       int node;
69559 +#endif
69560 +       struct device_node *dn;
69561         struct list_head list_node;
69562         struct device *parent;
69563  
69564         int first_busno;
69565         int last_busno;
69566 +#ifndef CONFIG_PPC64
69567         int self_busno;
69568 +#endif
69569  
69570         void __iomem *io_base_virt;
69571 +#ifdef CONFIG_PPC64
69572 +       void *io_base_alloc;
69573 +#endif
69574         resource_size_t io_base_phys;
69575 +#ifndef CONFIG_PPC64
69576 +       resource_size_t pci_io_size;
69577 +#endif
69578  
69579         /* Some machines (PReP) have a non 1:1 mapping of
69580          * the PCI memory space in the CPU bus space
69581          */
69582         resource_size_t pci_mem_offset;
69583 +#ifdef CONFIG_PPC64
69584 +       unsigned long pci_io_size;
69585 +#endif
69586  
69587         struct pci_ops *ops;
69588 -       volatile unsigned int __iomem *cfg_addr;
69589 -       volatile void __iomem *cfg_data;
69590 +       unsigned int __iomem *cfg_addr;
69591 +       void __iomem *cfg_data;
69592  
69593 +#ifndef CONFIG_PPC64
69594         /*
69595          * Used for variants of PCI indirect handling and possible quirks:
69596          *  SET_CFG_TYPE - used on 4xx or any PHB that does explicit type0/1
69597 @@ -51,21 +93,30 @@
69598          *   set.
69599          *  BIG_ENDIAN - cfg_addr is a big endian register
69600          */
69601 -#define PPC_INDIRECT_TYPE_SET_CFG_TYPE         (0x00000001)
69602 -#define PPC_INDIRECT_TYPE_EXT_REG              (0x00000002)
69603 -#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS (0x00000004)
69604 -#define PPC_INDIRECT_TYPE_NO_PCIE_LINK         (0x00000008)
69605 -#define PPC_INDIRECT_TYPE_BIG_ENDIAN           (0x00000010)
69606 +#define PPC_INDIRECT_TYPE_SET_CFG_TYPE         0x00000001
69607 +#define PPC_INDIRECT_TYPE_EXT_REG              0x00000002
69608 +#define PPC_INDIRECT_TYPE_SURPRESS_PRIMARY_BUS 0x00000004
69609 +#define PPC_INDIRECT_TYPE_NO_PCIE_LINK         0x00000008
69610 +#define PPC_INDIRECT_TYPE_BIG_ENDIAN           0x00000010
69611         u32 indirect_type;
69612 -
69613 +#endif /* !CONFIG_PPC64 */
69614         /* Currently, we limit ourselves to 1 IO range and 3 mem
69615          * ranges since the common pci_bus structure can't handle more
69616          */
69617         struct resource io_resource;
69618         struct resource mem_resources[3];
69619         int global_number;              /* PCI domain number */
69620 +#ifdef CONFIG_PPC64
69621 +       unsigned long buid;
69622 +       unsigned long dma_window_base_cur;
69623 +       unsigned long dma_window_size;
69624 +
69625 +       void *private_data;
69626 +#endif /* CONFIG_PPC64 */
69627  };
69628  
69629 +#ifndef CONFIG_PPC64
69630 +
69631  static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
69632  {
69633         return bus->sysdata;
69634 @@ -81,18 +132,18 @@
69635  
69636  /* These are used for config access before all the PCI probing
69637     has been done. */
69638 -int early_read_config_byte(struct pci_controller *hose, int bus, int dev_fn,
69639 -                          int where, u8 *val);
69640 -int early_read_config_word(struct pci_controller *hose, int bus, int dev_fn,
69641 -                          int where, u16 *val);
69642 -int early_read_config_dword(struct pci_controller *hose, int bus, int dev_fn,
69643 -                           int where, u32 *val);
69644 -int early_write_config_byte(struct pci_controller *hose, int bus, int dev_fn,
69645 -                           int where, u8 val);
69646 -int early_write_config_word(struct pci_controller *hose, int bus, int dev_fn,
69647 -                           int where, u16 val);
69648 -int early_write_config_dword(struct pci_controller *hose, int bus, int dev_fn,
69649 -                            int where, u32 val);
69650 +extern int early_read_config_byte(struct pci_controller *hose, int bus,
69651 +                       int dev_fn, int where, u8 *val);
69652 +extern int early_read_config_word(struct pci_controller *hose, int bus,
69653 +                       int dev_fn, int where, u16 *val);
69654 +extern int early_read_config_dword(struct pci_controller *hose, int bus,
69655 +                       int dev_fn, int where, u32 *val);
69656 +extern int early_write_config_byte(struct pci_controller *hose, int bus,
69657 +                       int dev_fn, int where, u8 val);
69658 +extern int early_write_config_word(struct pci_controller *hose, int bus,
69659 +                       int dev_fn, int where, u16 val);
69660 +extern int early_write_config_dword(struct pci_controller *hose, int bus,
69661 +                       int dev_fn, int where, u32 val);
69662  
69663  extern int early_find_capability(struct pci_controller *hose, int bus,
69664                                  int dev_fn, int cap);
69665 @@ -101,87 +152,33 @@
69666                                resource_size_t cfg_addr,
69667                                resource_size_t cfg_data, u32 flags);
69668  extern void setup_grackle(struct pci_controller *hose);
69669 -extern void __init update_bridge_resource(struct pci_dev *dev,
69670 -                                         struct resource *res);
69671 -
69672 -#else
69673 -
69674 -
69675 -/*
69676 - * This program is free software; you can redistribute it and/or
69677 - * modify it under the terms of the GNU General Public License
69678 - * as published by the Free Software Foundation; either version
69679 - * 2 of the License, or (at your option) any later version.
69680 - */
69681 -
69682 -/*
69683 - * Structure of a PCI controller (host bridge)
69684 - */
69685 -struct pci_controller {
69686 -       struct pci_bus *bus;
69687 -       char is_dynamic;
69688 -       int node;
69689 -       void *arch_data;
69690 -       struct list_head list_node;
69691 -       struct device *parent;
69692 -
69693 -       int first_busno;
69694 -       int last_busno;
69695 -
69696 -       void __iomem *io_base_virt;
69697 -       void *io_base_alloc;
69698 -       resource_size_t io_base_phys;
69699 -
69700 -       /* Some machines have a non 1:1 mapping of
69701 -        * the PCI memory space in the CPU bus space
69702 -        */
69703 -       resource_size_t pci_mem_offset;
69704 -       unsigned long pci_io_size;
69705 -
69706 -       struct pci_ops *ops;
69707 -       volatile unsigned int __iomem *cfg_addr;
69708 -       volatile void __iomem *cfg_data;
69709 -
69710 -       /* Currently, we limit ourselves to 1 IO range and 3 mem
69711 -        * ranges since the common pci_bus structure can't handle more
69712 -        */
69713 -       struct resource io_resource;
69714 -       struct resource mem_resources[3];
69715 -       int global_number;
69716 -       unsigned long buid;
69717 -       unsigned long dma_window_base_cur;
69718 -       unsigned long dma_window_size;
69719 -
69720 -       void *private_data;
69721 -};
69722 +#else  /* CONFIG_PPC64 */
69723  
69724  /*
69725   * PCI stuff, for nodes representing PCI devices, pointed to
69726   * by device_node->data.
69727   */
69728 -struct pci_controller;
69729  struct iommu_table;
69730  
69731  struct pci_dn {
69732         int     busno;                  /* pci bus number */
69733 -       int     bussubno;               /* pci subordinate bus number */
69734         int     devfn;                  /* pci device and function number */
69735 -       int     class_code;             /* pci device class */
69736  
69737         struct  pci_controller *phb;    /* for pci devices */
69738         struct  iommu_table *iommu_table;       /* for phb's or bridges */
69739 -       struct  pci_dev *pcidev;        /* back-pointer to the pci device */
69740         struct  device_node *node;      /* back-pointer to the device_node */
69741  
69742         int     pci_ext_config_space;   /* for pci devices */
69743  
69744  #ifdef CONFIG_EEH
69745 +       struct  pci_dev *pcidev;        /* back-pointer to the pci device */
69746 +       int     class_code;             /* pci device class */
69747         int     eeh_mode;               /* See eeh.h for possible EEH_MODEs */
69748         int     eeh_config_addr;
69749         int     eeh_pe_config_addr; /* new-style partition endpoint address */
69750 -       int     eeh_check_count;        /* # times driver ignored error */
69751 -       int     eeh_freeze_count;       /* # times this device froze up. */
69752 -       int     eeh_false_positives;    /* # times this device reported #ff's */
69753 +       int     eeh_check_count;        /* # times driver ignored error */
69754 +       int     eeh_freeze_count;       /* # times this device froze up. */
69755 +       int     eeh_false_positives;    /* # times this device reported #ff's */
69756         u32     config_space[16];       /* saved PCI config space */
69757  #endif
69758  };
69759 @@ -189,7 +186,7 @@
69760  /* Get the pointer to a device_node's pci_dn */
69761  #define PCI_DN(dn)     ((struct pci_dn *) (dn)->data)
69762  
69763 -struct device_node *fetch_dev_dn(struct pci_dev *dev);
69764 +extern struct device_node *fetch_dev_dn(struct pci_dev *dev);
69765  
69766  /* Get a device_node from a pci_dev.  This code must be fast except
69767   * in the case where the sysdata is incorrect and needs to be fixed
69768 @@ -227,14 +224,14 @@
69769  }
69770  
69771  /** Find the bus corresponding to the indicated device node */
69772 -struct pci_bus * pcibios_find_pci_bus(struct device_node *dn);
69773 +extern struct pci_bus *pcibios_find_pci_bus(struct device_node *dn);
69774  
69775  /** Remove all of the PCI devices under this bus */
69776 -void pcibios_remove_pci_devices(struct pci_bus *bus);
69777 +extern void pcibios_remove_pci_devices(struct pci_bus *bus);
69778  
69779  /** Discover new pci devices under this bus, and add them */
69780 -void pcibios_add_pci_devices(struct pci_bus * bus);
69781 -void pcibios_fixup_new_pci_devices(struct pci_bus *bus, int fix_bus);
69782 +extern void pcibios_add_pci_devices(struct pci_bus *bus);
69783 +extern void pcibios_fixup_new_pci_devices(struct pci_bus *bus);
69784  
69785  extern int pcibios_remove_root_bus(struct pci_controller *phb);
69786  
69787 @@ -270,20 +267,18 @@
69788  #define PHB_SET_NODE(PHB, NODE)                ((PHB)->node = -1)
69789  #endif
69790  
69791 -#endif /* CONFIG_PPC64 */
69792 +#endif /* CONFIG_PPC64 */
69793  
69794  /* Get the PCI host controller for an OF device */
69795 -extern struct pci_controller*
69796 -pci_find_hose_for_OF_device(struct device_node* node);
69797 +extern struct pci_controller *pci_find_hose_for_OF_device(
69798 +                       struct device_node* node);
69799  
69800  /* Fill up host controller resources from the OF node */
69801 -extern void
69802 -pci_process_bridge_OF_ranges(struct pci_controller *hose,
69803 -                          struct device_node *dev, int primary);
69804 +extern void pci_process_bridge_OF_ranges(struct pci_controller *hose,
69805 +                       struct device_node *dev, int primary);
69806  
69807  /* Allocate & free a PCI host bridge structure */
69808 -extern struct pci_controller *
69809 -pcibios_alloc_controller(struct device_node *dev);
69810 +extern struct pci_controller *pcibios_alloc_controller(struct device_node *dev);
69811  extern void pcibios_free_controller(struct pci_controller *phb);
69812  
69813  #ifdef CONFIG_PCI
69814 @@ -298,9 +293,7 @@
69815  {
69816         return 0;
69817  }
69818 -#endif
69819 -
69820 +#endif /* CONFIG_PCI */
69821  
69822 -
69823 -#endif /* __KERNEL__ */
69824 -#endif
69825 +#endif /* __KERNEL__ */
69826 +#endif /* _ASM_POWERPC_PCI_BRIDGE_H */
69827 --- a/include/asm-powerpc/pci.h
69828 +++ b/include/asm-powerpc/pci.h
69829 @@ -36,11 +36,10 @@
69830  
69831  /*
69832   * Set this to 1 if you want the kernel to re-assign all PCI
69833 - * bus numbers
69834 + * bus numbers (don't do that on ppc64 yet !)
69835   */
69836 -extern int pci_assign_all_buses;
69837 -#define pcibios_assign_all_busses()    (pci_assign_all_buses)
69838 -
69839 +#define pcibios_assign_all_busses()            (ppc_pci_flags & \
69840 +                                        PPC_PCI_REASSIGN_ALL_BUS)
69841  #define pcibios_scan_all_fns(a, b)     0
69842  
69843  static inline void pcibios_set_master(struct pci_dev *dev)
69844 @@ -95,9 +94,6 @@
69845  #define get_pci_dma_ops()      NULL
69846  #endif
69847  
69848 -/* Decide whether to display the domain number in /proc */
69849 -extern int pci_proc_domain(struct pci_bus *bus);
69850 -
69851  #else /* 32-bit */
69852  
69853  #ifdef CONFIG_PCI
69854 @@ -109,17 +105,14 @@
69855         *strategy_parameter = ~0UL;
69856  }
69857  #endif
69858 -
69859 -/* Set the name of the bus as it appears in /proc/bus/pci */
69860 -static inline int pci_proc_domain(struct pci_bus *bus)
69861 -{
69862 -       return 0;
69863 -}
69864 -
69865  #endif /* CONFIG_PPC64 */
69866  
69867  extern int pci_domain_nr(struct pci_bus *bus);
69868  
69869 +/* Decide whether to display the domain number in /proc */
69870 +extern int pci_proc_domain(struct pci_bus *bus);
69871 +
69872 +
69873  struct vm_area_struct;
69874  /* Map a range of PCI memory or I/O space for a device into user space */
69875  int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
69876 @@ -199,13 +192,12 @@
69877         return root;
69878  }
69879  
69880 -extern void pcibios_fixup_device_resources(struct pci_dev *dev,
69881 -                       struct pci_bus *bus);
69882 -
69883  extern void pcibios_setup_new_device(struct pci_dev *dev);
69884  
69885  extern void pcibios_claim_one_bus(struct pci_bus *b);
69886  
69887 +extern void pcibios_resource_survey(void);
69888 +
69889  extern struct pci_controller *init_phb_dynamic(struct device_node *dn);
69890  
69891  extern struct pci_dev *of_create_pci_dev(struct device_node *node,
69892 @@ -229,5 +221,8 @@
69893                                  const struct resource *rsrc,
69894                                  resource_size_t *start, resource_size_t *end);
69895  
69896 +extern void pcibios_do_bus_setup(struct pci_bus *bus);
69897 +extern void pcibios_fixup_of_probed_bus(struct pci_bus *bus);
69898 +
69899  #endif /* __KERNEL__ */
69900  #endif /* __ASM_POWERPC_PCI_H */
69901 --- a/include/asm-powerpc/ppc-pci.h
69902 +++ b/include/asm-powerpc/ppc-pci.h
69903 @@ -22,7 +22,6 @@
69904  
69905  
69906  extern struct list_head hose_list;
69907 -extern int global_phb_number;
69908  
69909  extern void find_and_init_phbs(void);
69910  
69911 @@ -47,9 +46,6 @@
69912  extern unsigned long get_phb_buid (struct device_node *);
69913  extern int rtas_setup_phb(struct pci_controller *phb);
69914  
69915 -/* From iSeries PCI */
69916 -extern void iSeries_pcibios_init(void);
69917 -
69918  extern unsigned long pci_probe_only;
69919  
69920  /* ---- EEH internal-use-only related routines ---- */
69921 --- a/include/asm-powerpc/prom.h
69922 +++ b/include/asm-powerpc/prom.h
69923 @@ -202,6 +202,10 @@
69924   */
69925  extern u64 of_translate_address(struct device_node *np, const u32 *addr);
69926  
69927 +/* Translate a DMA address from device space to CPU space */
69928 +extern u64 of_translate_dma_address(struct device_node *dev,
69929 +                                   const u32 *in_addr);
69930 +
69931  /* Extract an address from a device, returns the region size and
69932   * the address space flags too. The PCI version uses a BAR number
69933   * instead of an absolute index
69934 --- a/include/asm-powerpc/ps3.h
69935 +++ b/include/asm-powerpc/ps3.h
69936 @@ -24,6 +24,7 @@
69937  #include <linux/init.h>
69938  #include <linux/types.h>
69939  #include <linux/device.h>
69940 +#include "cell-pmu.h"
69941  
69942  union ps3_firmware_version {
69943         u64 raw;
69944 @@ -317,6 +318,7 @@
69945         PS3_MATCH_ID_STOR_FLASH     = 8,
69946         PS3_MATCH_ID_SOUND          = 9,
69947         PS3_MATCH_ID_GRAPHICS       = 10,
69948 +       PS3_MATCH_ID_LPM            = 11,
69949  };
69950  
69951  #define PS3_MODULE_ALIAS_EHCI           "ps3:1"
69952 @@ -329,11 +331,13 @@
69953  #define PS3_MODULE_ALIAS_STOR_FLASH     "ps3:8"
69954  #define PS3_MODULE_ALIAS_SOUND          "ps3:9"
69955  #define PS3_MODULE_ALIAS_GRAPHICS       "ps3:10"
69956 +#define PS3_MODULE_ALIAS_LPM            "ps3:11"
69957  
69958  enum ps3_system_bus_device_type {
69959         PS3_DEVICE_TYPE_IOC0 = 1,
69960         PS3_DEVICE_TYPE_SB,
69961         PS3_DEVICE_TYPE_VUART,
69962 +       PS3_DEVICE_TYPE_LPM,
69963  };
69964  
69965  /**
69966 @@ -344,12 +348,17 @@
69967         enum ps3_match_id match_id;
69968         enum ps3_system_bus_device_type dev_type;
69969  
69970 -       unsigned int bus_id;              /* SB */
69971 -       unsigned int dev_id;              /* SB */
69972 +       u64 bus_id;                       /* SB */
69973 +       u64 dev_id;                       /* SB */
69974         unsigned int interrupt_id;        /* SB */
69975         struct ps3_dma_region *d_region;  /* SB, IOC0 */
69976         struct ps3_mmio_region *m_region; /* SB, IOC0*/
69977         unsigned int port_number;         /* VUART */
69978 +       struct {                          /* LPM */
69979 +               u64 node_id;
69980 +               u64 pu_id;
69981 +               u64 rights;
69982 +       } lpm;
69983  
69984  /*     struct iommu_table *iommu_table; -- waiting for BenH's cleanups */
69985         struct device core;
69986 @@ -438,5 +447,66 @@
69987  extern struct ps3_prealloc ps3fb_videomemory;
69988  extern struct ps3_prealloc ps3flash_bounce_buffer;
69989  
69990 +/* logical performance monitor */
69991 +
69992 +/**
69993 + * enum ps3_lpm_rights - Rigths granted by the system policy module.
69994 + *
69995 + * @PS3_LPM_RIGHTS_USE_LPM: The right to use the lpm.
69996 + * @PS3_LPM_RIGHTS_USE_TB: The right to use the internal trace buffer.
69997 + */
69998 +
69999 +enum ps3_lpm_rights {
70000 +       PS3_LPM_RIGHTS_USE_LPM = 0x001,
70001 +       PS3_LPM_RIGHTS_USE_TB = 0x100,
70002 +};
70003 +
70004 +/**
70005 + * enum ps3_lpm_tb_type - Type of trace buffer lv1 should use.
70006 + *
70007 + * @PS3_LPM_TB_TYPE_NONE: Do not use a trace buffer.
70008 + * @PS3_LPM_RIGHTS_USE_TB: Use the lv1 internal trace buffer.  Must have
70009 + *  rights @PS3_LPM_RIGHTS_USE_TB.
70010 + */
70011 +
70012 +enum ps3_lpm_tb_type {
70013 +       PS3_LPM_TB_TYPE_NONE = 0,
70014 +       PS3_LPM_TB_TYPE_INTERNAL = 1,
70015 +};
70016 +
70017 +int ps3_lpm_open(enum ps3_lpm_tb_type tb_type, void *tb_cache,
70018 +       u64 tb_cache_size);
70019 +int ps3_lpm_close(void);
70020 +int ps3_lpm_copy_tb(unsigned long offset, void *buf, unsigned long count,
70021 +       unsigned long *bytes_copied);
70022 +int ps3_lpm_copy_tb_to_user(unsigned long offset, void __user *buf,
70023 +       unsigned long count, unsigned long *bytes_copied);
70024 +void ps3_set_bookmark(u64 bookmark);
70025 +void ps3_set_pm_bookmark(u64 tag, u64 incident, u64 th_id);
70026 +int ps3_set_signal(u64 rtas_signal_group, u8 signal_bit, u16 sub_unit,
70027 +       u8 bus_word);
70028 +
70029 +u32 ps3_read_phys_ctr(u32 cpu, u32 phys_ctr);
70030 +void ps3_write_phys_ctr(u32 cpu, u32 phys_ctr, u32 val);
70031 +u32 ps3_read_ctr(u32 cpu, u32 ctr);
70032 +void ps3_write_ctr(u32 cpu, u32 ctr, u32 val);
70033 +
70034 +u32 ps3_read_pm07_control(u32 cpu, u32 ctr);
70035 +void ps3_write_pm07_control(u32 cpu, u32 ctr, u32 val);
70036 +u32 ps3_read_pm(u32 cpu, enum pm_reg_name reg);
70037 +void ps3_write_pm(u32 cpu, enum pm_reg_name reg, u32 val);
70038 +
70039 +u32 ps3_get_ctr_size(u32 cpu, u32 phys_ctr);
70040 +void ps3_set_ctr_size(u32 cpu, u32 phys_ctr, u32 ctr_size);
70041 +
70042 +void ps3_enable_pm(u32 cpu);
70043 +void ps3_disable_pm(u32 cpu);
70044 +void ps3_enable_pm_interrupts(u32 cpu, u32 thread, u32 mask);
70045 +void ps3_disable_pm_interrupts(u32 cpu);
70046 +
70047 +u32 ps3_get_and_clear_pm_interrupts(u32 cpu);
70048 +void ps3_sync_irq(int node);
70049 +u32 ps3_get_hw_thread_id(int cpu);
70050 +u64 ps3_get_spe_id(void *arg);
70051  
70052  #endif
70053 --- a/include/asm-powerpc/ptrace.h
70054 +++ b/include/asm-powerpc/ptrace.h
70055 @@ -106,7 +106,8 @@
70056   */
70057  #define FULL_REGS(regs)                (((regs)->trap & 1) == 0)
70058  #ifndef __powerpc64__
70059 -#define IS_CRITICAL_EXC(regs)  (((regs)->trap & 2) == 0)
70060 +#define IS_CRITICAL_EXC(regs)  (((regs)->trap & 2) != 0)
70061 +#define IS_MCHECK_EXC(regs)    (((regs)->trap & 4) != 0)
70062  #endif /* ! __powerpc64__ */
70063  #define TRAP(regs)             ((regs)->trap & ~0xF)
70064  #ifdef __powerpc64__
70065 --- a/include/asm-powerpc/qe.h
70066 +++ b/include/asm-powerpc/qe.h
70067 @@ -28,6 +28,52 @@
70068  #define MEM_PART_SECONDARY     1
70069  #define MEM_PART_MURAM         2
70070  
70071 +/* Clocks and BRGs */
70072 +enum qe_clock {
70073 +       QE_CLK_NONE = 0,
70074 +       QE_BRG1,                /* Baud Rate Generator 1 */
70075 +       QE_BRG2,                /* Baud Rate Generator 2 */
70076 +       QE_BRG3,                /* Baud Rate Generator 3 */
70077 +       QE_BRG4,                /* Baud Rate Generator 4 */
70078 +       QE_BRG5,                /* Baud Rate Generator 5 */
70079 +       QE_BRG6,                /* Baud Rate Generator 6 */
70080 +       QE_BRG7,                /* Baud Rate Generator 7 */
70081 +       QE_BRG8,                /* Baud Rate Generator 8 */
70082 +       QE_BRG9,                /* Baud Rate Generator 9 */
70083 +       QE_BRG10,               /* Baud Rate Generator 10 */
70084 +       QE_BRG11,               /* Baud Rate Generator 11 */
70085 +       QE_BRG12,               /* Baud Rate Generator 12 */
70086 +       QE_BRG13,               /* Baud Rate Generator 13 */
70087 +       QE_BRG14,               /* Baud Rate Generator 14 */
70088 +       QE_BRG15,               /* Baud Rate Generator 15 */
70089 +       QE_BRG16,               /* Baud Rate Generator 16 */
70090 +       QE_CLK1,                /* Clock 1 */
70091 +       QE_CLK2,                /* Clock 2 */
70092 +       QE_CLK3,                /* Clock 3 */
70093 +       QE_CLK4,                /* Clock 4 */
70094 +       QE_CLK5,                /* Clock 5 */
70095 +       QE_CLK6,                /* Clock 6 */
70096 +       QE_CLK7,                /* Clock 7 */
70097 +       QE_CLK8,                /* Clock 8 */
70098 +       QE_CLK9,                /* Clock 9 */
70099 +       QE_CLK10,               /* Clock 10 */
70100 +       QE_CLK11,               /* Clock 11 */
70101 +       QE_CLK12,               /* Clock 12 */
70102 +       QE_CLK13,               /* Clock 13 */
70103 +       QE_CLK14,               /* Clock 14 */
70104 +       QE_CLK15,               /* Clock 15 */
70105 +       QE_CLK16,               /* Clock 16 */
70106 +       QE_CLK17,               /* Clock 17 */
70107 +       QE_CLK18,               /* Clock 18 */
70108 +       QE_CLK19,               /* Clock 19 */
70109 +       QE_CLK20,               /* Clock 20 */
70110 +       QE_CLK21,               /* Clock 21 */
70111 +       QE_CLK22,               /* Clock 22 */
70112 +       QE_CLK23,               /* Clock 23 */
70113 +       QE_CLK24,               /* Clock 24 */
70114 +       QE_CLK_DUMMY
70115 +};
70116 +
70117  /* Export QE common operations */
70118  extern void qe_reset(void);
70119  extern int par_io_init(struct device_node *np);
70120 @@ -38,7 +84,8 @@
70121  
70122  /* QE internal API */
70123  int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
70124 -void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier);
70125 +enum qe_clock qe_clock_source(const char *source);
70126 +int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
70127  int qe_get_snum(void);
70128  void qe_put_snum(u8 snum);
70129  unsigned long qe_muram_alloc(int size, int align);
70130 @@ -47,6 +94,58 @@
70131  void qe_muram_dump(void);
70132  void *qe_muram_addr(unsigned long offset);
70133  
70134 +/* Structure that defines QE firmware binary files.
70135 + *
70136 + * See Documentation/powerpc/qe-firmware.txt for a description of these
70137 + * fields.
70138 + */
70139 +struct qe_firmware {
70140 +       struct qe_header {
70141 +               __be32 length;  /* Length of the entire structure, in bytes */
70142 +               u8 magic[3];    /* Set to { 'Q', 'E', 'F' } */
70143 +               u8 version;     /* Version of this layout. First ver is '1' */
70144 +       } header;
70145 +       u8 id[62];      /* Null-terminated identifier string */
70146 +       u8 split;       /* 0 = shared I-RAM, 1 = split I-RAM */
70147 +       u8 count;       /* Number of microcode[] structures */
70148 +       struct {
70149 +               __be16 model;           /* The SOC model  */
70150 +               u8 major;               /* The SOC revision major */
70151 +               u8 minor;               /* The SOC revision minor */
70152 +       } __attribute__ ((packed)) soc;
70153 +       u8 padding[4];                  /* Reserved, for alignment */
70154 +       __be64 extended_modes;          /* Extended modes */
70155 +       __be32 vtraps[8];               /* Virtual trap addresses */
70156 +       u8 reserved[4];                 /* Reserved, for future expansion */
70157 +       struct qe_microcode {
70158 +               u8 id[32];              /* Null-terminated identifier */
70159 +               __be32 traps[16];       /* Trap addresses, 0 == ignore */
70160 +               __be32 eccr;            /* The value for the ECCR register */
70161 +               __be32 iram_offset;     /* Offset into I-RAM for the code */
70162 +               __be32 count;           /* Number of 32-bit words of the code */
70163 +               __be32 code_offset;     /* Offset of the actual microcode */
70164 +               u8 major;               /* The microcode version major */
70165 +               u8 minor;               /* The microcode version minor */
70166 +               u8 revision;            /* The microcode version revision */
70167 +               u8 padding;             /* Reserved, for alignment */
70168 +               u8 reserved[4];         /* Reserved, for future expansion */
70169 +       } __attribute__ ((packed)) microcode[1];
70170 +       /* All microcode binaries should be located here */
70171 +       /* CRC32 should be located here, after the microcode binaries */
70172 +} __attribute__ ((packed));
70173 +
70174 +struct qe_firmware_info {
70175 +       char id[64];            /* Firmware name */
70176 +       u32 vtraps[8];          /* Virtual trap addresses */
70177 +       u64 extended_modes;     /* Extended modes */
70178 +};
70179 +
70180 +/* Upload a firmware to the QE */
70181 +int qe_upload_firmware(const struct qe_firmware *firmware);
70182 +
70183 +/* Obtain information on the uploaded firmware */
70184 +struct qe_firmware_info *qe_get_firmware_info(void);
70185 +
70186  /* Buffer descriptors */
70187  struct qe_bd {
70188         __be16 status;
70189 @@ -129,52 +228,6 @@
70190         COMM_DIR_RX_AND_TX = 3
70191  };
70192  
70193 -/* Clocks and BRGs */
70194 -enum qe_clock {
70195 -       QE_CLK_NONE = 0,
70196 -       QE_BRG1,                /* Baud Rate Generator 1 */
70197 -       QE_BRG2,                /* Baud Rate Generator 2 */
70198 -       QE_BRG3,                /* Baud Rate Generator 3 */
70199 -       QE_BRG4,                /* Baud Rate Generator 4 */
70200 -       QE_BRG5,                /* Baud Rate Generator 5 */
70201 -       QE_BRG6,                /* Baud Rate Generator 6 */
70202 -       QE_BRG7,                /* Baud Rate Generator 7 */
70203 -       QE_BRG8,                /* Baud Rate Generator 8 */
70204 -       QE_BRG9,                /* Baud Rate Generator 9 */
70205 -       QE_BRG10,               /* Baud Rate Generator 10 */
70206 -       QE_BRG11,               /* Baud Rate Generator 11 */
70207 -       QE_BRG12,               /* Baud Rate Generator 12 */
70208 -       QE_BRG13,               /* Baud Rate Generator 13 */
70209 -       QE_BRG14,               /* Baud Rate Generator 14 */
70210 -       QE_BRG15,               /* Baud Rate Generator 15 */
70211 -       QE_BRG16,               /* Baud Rate Generator 16 */
70212 -       QE_CLK1,                /* Clock 1 */
70213 -       QE_CLK2,                /* Clock 2 */
70214 -       QE_CLK3,                /* Clock 3 */
70215 -       QE_CLK4,                /* Clock 4 */
70216 -       QE_CLK5,                /* Clock 5 */
70217 -       QE_CLK6,                /* Clock 6 */
70218 -       QE_CLK7,                /* Clock 7 */
70219 -       QE_CLK8,                /* Clock 8 */
70220 -       QE_CLK9,                /* Clock 9 */
70221 -       QE_CLK10,               /* Clock 10 */
70222 -       QE_CLK11,               /* Clock 11 */
70223 -       QE_CLK12,               /* Clock 12 */
70224 -       QE_CLK13,               /* Clock 13 */
70225 -       QE_CLK14,               /* Clock 14 */
70226 -       QE_CLK15,               /* Clock 15 */
70227 -       QE_CLK16,               /* Clock 16 */
70228 -       QE_CLK17,               /* Clock 17 */
70229 -       QE_CLK18,               /* Clock 18 */
70230 -       QE_CLK19,               /* Clock 19 */
70231 -       QE_CLK20,               /* Clock 20 */
70232 -       QE_CLK21,               /* Clock 21 */
70233 -       QE_CLK22,               /* Clock 22 */
70234 -       QE_CLK23,               /* Clock 23 */
70235 -       QE_CLK24,               /* Clock 24 */
70236 -       QE_CLK_DUMMY,
70237 -};
70238 -
70239  /* QE CMXUCR Registers.
70240   * There are two UCCs represented in each of the four CMXUCR registers.
70241   * These values are for the UCC in the LSBs
70242 @@ -328,6 +381,15 @@
70243  
70244  #define QE_SDEBCR_BA_MASK      0x01FFFFFF
70245  
70246 +/* Communication Processor */
70247 +#define QE_CP_CERCR_MEE                0x8000  /* Multi-user RAM ECC enable */
70248 +#define QE_CP_CERCR_IEE                0x4000  /* Instruction RAM ECC enable */
70249 +#define QE_CP_CERCR_CIR                0x0800  /* Common instruction RAM */
70250 +
70251 +/* I-RAM */
70252 +#define QE_IRAM_IADD_AIE       0x80000000      /* Auto Increment Enable */
70253 +#define QE_IRAM_IADD_BADDR     0x00080000      /* Base Address */
70254 +
70255  /* UPC */
70256  #define UPGCR_PROTOCOL 0x80000000      /* protocol ul2 or pl2 */
70257  #define UPGCR_TMS      0x40000000      /* Transmit master/slave mode */
70258 --- a/include/asm-powerpc/reg.h
70259 +++ b/include/asm-powerpc/reg.h
70260 @@ -553,6 +553,7 @@
70261  #define SPRN_PA6T_BTCR 978     /* Breakpoint and Tagging Control Register */
70262  #define SPRN_PA6T_IMAAT        979     /* Instruction Match Array Action Table */
70263  #define SPRN_PA6T_PCCR 1019    /* Power Counter Control Register */
70264 +#define SPRN_BKMK      1020    /* Cell Bookmark Register */
70265  #define SPRN_PA6T_RPCCR        1021    /* Retire PC Trace Control Register */
70266  
70267  
70268 @@ -691,12 +692,6 @@
70269  #define PV_BE          0x0070
70270  #define PV_PA6T                0x0090
70271  
70272 -/*
70273 - * Number of entries in the SLB. If this ever changes we should handle
70274 - * it with a use a cpu feature fixup.
70275 - */
70276 -#define SLB_NUM_ENTRIES 64
70277 -
70278  /* Macros for setting and retrieving special purpose registers */
70279  #ifndef __ASSEMBLY__
70280  #define mfmsr()                ({unsigned long rval; \
70281 --- a/include/asm-powerpc/reg_booke.h
70282 +++ b/include/asm-powerpc/reg_booke.h
70283 @@ -123,16 +123,23 @@
70284  #define SPRN_SPEFSCR   0x200   /* SPE & Embedded FP Status & Control */
70285  #define SPRN_BBEAR     0x201   /* Branch Buffer Entry Address Register */
70286  #define SPRN_BBTAR     0x202   /* Branch Buffer Target Address Register */
70287 +#define SPRN_ATB       0x20E   /* Alternate Time Base */
70288 +#define SPRN_ATBL      0x20E   /* Alternate Time Base Lower */
70289 +#define SPRN_ATBU      0x20F   /* Alternate Time Base Upper */
70290  #define SPRN_IVOR32    0x210   /* Interrupt Vector Offset Register 32 */
70291  #define SPRN_IVOR33    0x211   /* Interrupt Vector Offset Register 33 */
70292  #define SPRN_IVOR34    0x212   /* Interrupt Vector Offset Register 34 */
70293  #define SPRN_IVOR35    0x213   /* Interrupt Vector Offset Register 35 */
70294 +#define SPRN_IVOR36    0x214   /* Interrupt Vector Offset Register 36 */
70295 +#define SPRN_IVOR37    0x215   /* Interrupt Vector Offset Register 37 */
70296  #define SPRN_MCSRR0    0x23A   /* Machine Check Save and Restore Register 0 */
70297  #define SPRN_MCSRR1    0x23B   /* Machine Check Save and Restore Register 1 */
70298  #define SPRN_MCSR      0x23C   /* Machine Check Status Register */
70299  #define SPRN_MCAR      0x23D   /* Machine Check Address Register */
70300  #define SPRN_DSRR0     0x23E   /* Debug Save and Restore Register 0 */
70301  #define SPRN_DSRR1     0x23F   /* Debug Save and Restore Register 1 */
70302 +#define SPRN_SPRG8     0x25C   /* Special Purpose Register General 8 */
70303 +#define SPRN_SPRG9     0x25D   /* Special Purpose Register General 9 */
70304  #define SPRN_MAS0      0x270   /* MMU Assist Register 0 */
70305  #define SPRN_MAS1      0x271   /* MMU Assist Register 1 */
70306  #define SPRN_MAS2      0x272   /* MMU Assist Register 2 */
70307 @@ -140,15 +147,18 @@
70308  #define SPRN_MAS4      0x274   /* MMU Assist Register 4 */
70309  #define SPRN_MAS5      0x275   /* MMU Assist Register 5 */
70310  #define SPRN_MAS6      0x276   /* MMU Assist Register 6 */
70311 -#define SPRN_MAS7      0x3b0   /* MMU Assist Register 7 */
70312  #define SPRN_PID1      0x279   /* Process ID Register 1 */
70313  #define SPRN_PID2      0x27A   /* Process ID Register 2 */
70314  #define SPRN_TLB0CFG   0x2B0   /* TLB 0 Config Register */
70315  #define SPRN_TLB1CFG   0x2B1   /* TLB 1 Config Register */
70316 +#define SPRN_EPR       0x2BE   /* External Proxy Register */
70317  #define SPRN_CCR1      0x378   /* Core Configuration Register 1 */
70318  #define SPRN_ZPR       0x3B0   /* Zone Protection Register (40x) */
70319 +#define SPRN_MAS7      0x3B0   /* MMU Assist Register 7 */
70320  #define SPRN_MMUCR     0x3B2   /* MMU Control Register */
70321  #define SPRN_CCR0      0x3B3   /* Core Configuration Register 0 */
70322 +#define SPRN_EPLC      0x3B3   /* External Process ID Load Context */
70323 +#define SPRN_EPSC      0x3B4   /* External Process ID Store Context */
70324  #define SPRN_SGR       0x3B9   /* Storage Guarded Register */
70325  #define SPRN_DCWR      0x3BA   /* Data Cache Write-thru Register */
70326  #define SPRN_SLER      0x3BB   /* Little-endian real mode */
70327 @@ -159,6 +169,7 @@
70328  #define SPRN_L1CSR0    0x3F2   /* L1 Cache Control and Status Register 0 */
70329  #define SPRN_L1CSR1    0x3F3   /* L1 Cache Control and Status Register 1 */
70330  #define SPRN_PIT       0x3DB   /* Programmable Interval Timer */
70331 +#define SPRN_BUCSR     0x3F5   /* Branch Unit Control and Status */
70332  #define SPRN_DCCR      0x3FA   /* Data Cache Cacheability Register */
70333  #define SPRN_ICCR      0x3FB   /* Instruction Cache Cacheability Register */
70334  #define SPRN_SVR       0x3FF   /* System Version Register */
70335 @@ -207,7 +218,6 @@
70336  #define        CCR1_TCS        0x00000080 /* Timer Clock Select */
70337  
70338  /* Bit definitions for the MCSR. */
70339 -#ifdef CONFIG_440A
70340  #define MCSR_MCS       0x80000000 /* Machine Check Summary */
70341  #define MCSR_IB                0x40000000 /* Instruction PLB Error */
70342  #define MCSR_DRB       0x20000000 /* Data Read PLB Error */
70343 @@ -217,7 +227,7 @@
70344  #define MCSR_DCSP      0x02000000 /* D-Cache Search Parity Error */
70345  #define MCSR_DCFP      0x01000000 /* D-Cache Flush Parity Error */
70346  #define MCSR_IMPE      0x00800000 /* Imprecise Machine Check Exception */
70347 -#endif
70348 +
70349  #ifdef CONFIG_E500
70350  #define MCSR_MCP       0x80000000UL /* Machine Check Input Pin */
70351  #define MCSR_ICPERR    0x40000000UL /* I-Cache Parity Error */
70352 @@ -293,7 +303,7 @@
70353  #define ESR_IMCB       0x20000000      /* Instr. Machine Check - Bus error */
70354  #define ESR_IMCT       0x10000000      /* Instr. Machine Check - Timeout */
70355  #define ESR_PIL                0x08000000      /* Program Exception - Illegal */
70356 -#define ESR_PPR                0x04000000      /* Program Exception - Priveleged */
70357 +#define ESR_PPR                0x04000000      /* Program Exception - Privileged */
70358  #define ESR_PTR                0x02000000      /* Program Exception - Trap */
70359  #define ESR_FP         0x01000000      /* Floating Point Operation */
70360  #define ESR_DST                0x00800000      /* Storage Exception - Data miss */
70361 --- /dev/null
70362 +++ b/include/asm-powerpc/setjmp.h
70363 @@ -0,0 +1,18 @@
70364 +/*
70365 + * Copyright Â© 2008 Michael Neuling IBM Corporation
70366 + *
70367 + *      This program is free software; you can redistribute it and/or
70368 + *      modify it under the terms of the GNU General Public License
70369 + *      as published by the Free Software Foundation; either version
70370 + *      2 of the License, or (at your option) any later version.
70371 + *
70372 + */
70373 +#ifndef _ASM_POWERPC_SETJMP_H
70374 +#define _ASM_POWERPC_SETJMP_H
70375 +
70376 +#define JMP_BUF_LEN    23
70377 +
70378 +extern long setjmp(long *);
70379 +extern void longjmp(long *, long);
70380 +
70381 +#endif /* _ASM_POWERPC_SETJMP_H */
70382 --- a/include/asm-powerpc/smu.h
70383 +++ b/include/asm-powerpc/smu.h
70384 @@ -22,7 +22,7 @@
70385   * Partition info commands
70386   *
70387   * These commands are used to retrieve the sdb-partition-XX datas from
70388 - * the SMU. The lenght is always 2. First byte is the subcommand code
70389 + * the SMU. The length is always 2. First byte is the subcommand code
70390   * and second byte is the partition ID.
70391   *
70392   * The reply is 6 bytes:
70393 @@ -173,12 +173,12 @@
70394   * Power supply control
70395   *
70396   * The "sub" command is an ASCII string in the data, the
70397 - * data lenght is that of the string.
70398 + * data length is that of the string.
70399   *
70400   * The VSLEW command can be used to get or set the voltage slewing.
70401 - *  - lenght 5 (only "VSLEW") : it returns "DONE" and 3 bytes of
70402 + *  - length 5 (only "VSLEW") : it returns "DONE" and 3 bytes of
70403   *    reply at data offset 6, 7 and 8.
70404 - *  - lenght 8 ("VSLEWxyz") has 3 additional bytes appended, and is
70405 + *  - length 8 ("VSLEWxyz") has 3 additional bytes appended, and is
70406   *    used to set the voltage slewing point. The SMU replies with "DONE"
70407   * I yet have to figure out their exact meaning of those 3 bytes in
70408   * both cases. They seem to be:
70409 @@ -201,20 +201,90 @@
70410   */
70411  #define SMU_CMD_READ_ADC                       0xd8
70412  
70413 +
70414  /* Misc commands
70415   *
70416   * This command seem to be a grab bag of various things
70417 + *
70418 + * Parameters:
70419 + *   1: subcommand
70420   */
70421  #define SMU_CMD_MISC_df_COMMAND                        0xdf
70422 -#define   SMU_CMD_MISC_df_SET_DISPLAY_LIT      0x02 /* i: 1 byte */
70423 +
70424 +/*
70425 + * Sets "system ready" status
70426 + *
70427 + * I did not yet understand how it exactly works or what it does.
70428 + *
70429 + * Guessing from OF code, 0x02 activates the display backlight. Apple uses/used
70430 + * the same codebase for all OF versions. On PowerBooks, this command would
70431 + * enable the backlight. For the G5s, it only activates the front LED. However,
70432 + * don't take this for granted.
70433 + *
70434 + * Parameters:
70435 + *   2: status [0x00, 0x01 or 0x02]
70436 + */
70437 +#define   SMU_CMD_MISC_df_SET_DISPLAY_LIT      0x02
70438 +
70439 +/*
70440 + * Sets mode of power switch.
70441 + *
70442 + * What this actually does is not yet known. Maybe it enables some interrupt.
70443 + *
70444 + * Parameters:
70445 + *   2: enable power switch? [0x00 or 0x01]
70446 + *   3 (optional): enable nmi? [0x00 or 0x01]
70447 + *
70448 + * Returns:
70449 + *   If parameter 2 is 0x00 and parameter 3 is not specified, returns wether
70450 + *   NMI is enabled. Otherwise unknown.
70451 + */
70452  #define   SMU_CMD_MISC_df_NMI_OPTION           0x04
70453  
70454 +/* Sets LED dimm offset.
70455 + *
70456 + * The front LED dimms itself during sleep. Its brightness (or, well, the PWM
70457 + * frequency) depends on current time. Therefore, the SMU needs to know the
70458 + * timezone.
70459 + *
70460 + * Parameters:
70461 + *   2-8: unknown (BCD coding)
70462 + */
70463 +#define   SMU_CMD_MISC_df_DIMM_OFFSET          0x99
70464 +
70465 +
70466  /*
70467   * Version info commands
70468   *
70469 - * I haven't quite tried to figure out how these work
70470 + * Parameters:
70471 + *   1 (optional): Specifies version part to retrieve
70472 + *
70473 + * Returns:
70474 + *   Version value
70475   */
70476  #define SMU_CMD_VERSION_COMMAND                        0xea
70477 +#define   SMU_VERSION_RUNNING                  0x00
70478 +#define   SMU_VERSION_BASE                     0x01
70479 +#define   SMU_VERSION_UPDATE                   0x02
70480 +
70481 +
70482 +/*
70483 + * Switches
70484 + *
70485 + * These are switches whose status seems to be known to the SMU.
70486 + *
70487 + * Parameters:
70488 + *   none
70489 + *
70490 + * Result:
70491 + *   Switch bits (ORed, see below)
70492 + */
70493 +#define SMU_CMD_SWITCHES                       0xdc
70494 +
70495 +/* Switches bits */
70496 +#define SMU_SWITCH_CASE_CLOSED                 0x01
70497 +#define SMU_SWITCH_AC_POWER                    0x04
70498 +#define SMU_SWITCH_POWER_SWITCH                        0x08
70499  
70500  
70501  /*
70502 @@ -243,10 +313,64 @@
70503   */
70504  #define SMU_CMD_MISC_ee_COMMAND                        0xee
70505  #define   SMU_CMD_MISC_ee_GET_DATABLOCK_REC    0x02
70506 -#define          SMU_CMD_MISC_ee_LEDS_CTRL             0x04 /* i: 00 (00,01) [00] */
70507 +
70508 +/* Retrieves currently used watts.
70509 + *
70510 + * Parameters:
70511 + *   1: 0x03 (Meaning unknown)
70512 + */
70513 +#define   SMU_CMD_MISC_ee_GET_WATTS            0x03
70514 +
70515 +#define   SMU_CMD_MISC_ee_LEDS_CTRL            0x04 /* i: 00 (00,01) [00] */
70516  #define   SMU_CMD_MISC_ee_GET_DATA             0x05 /* i: 00 , o: ?? */
70517  
70518  
70519 +/*
70520 + * Power related commands
70521 + *
70522 + * Parameters:
70523 + *   1: subcommand
70524 + */
70525 +#define SMU_CMD_POWER_EVENTS_COMMAND           0x8f
70526 +
70527 +/* SMU_POWER_EVENTS subcommands */
70528 +enum {
70529 +       SMU_PWR_GET_POWERUP_EVENTS      = 0x00,
70530 +       SMU_PWR_SET_POWERUP_EVENTS      = 0x01,
70531 +       SMU_PWR_CLR_POWERUP_EVENTS      = 0x02,
70532 +       SMU_PWR_GET_WAKEUP_EVENTS       = 0x03,
70533 +       SMU_PWR_SET_WAKEUP_EVENTS       = 0x04,
70534 +       SMU_PWR_CLR_WAKEUP_EVENTS       = 0x05,
70535 +
70536 +       /*
70537 +        * Get last shutdown cause
70538 +        *
70539 +        * Returns:
70540 +        *   1 byte (signed char): Last shutdown cause. Exact meaning unknown.
70541 +        */
70542 +       SMU_PWR_LAST_SHUTDOWN_CAUSE     = 0x07,
70543 +
70544 +       /*
70545 +        * Sets or gets server ID. Meaning or use is unknown.
70546 +        *
70547 +        * Parameters:
70548 +        *   2 (optional): Set server ID (1 byte)
70549 +        *
70550 +        * Returns:
70551 +        *   1 byte (server ID?)
70552 +        */
70553 +       SMU_PWR_SERVER_ID               = 0x08,
70554 +};
70555 +
70556 +/* Power events wakeup bits */
70557 +enum {
70558 +       SMU_PWR_WAKEUP_KEY              = 0x01, /* Wake on key press */
70559 +       SMU_PWR_WAKEUP_AC_INSERT        = 0x02, /* Wake on AC adapter plug */
70560 +       SMU_PWR_WAKEUP_AC_CHANGE        = 0x04,
70561 +       SMU_PWR_WAKEUP_LID_OPEN         = 0x08,
70562 +       SMU_PWR_WAKEUP_RING             = 0x10,
70563 +};
70564 +
70565  
70566  /*
70567   * - Kernel side interface -
70568 @@ -564,13 +688,13 @@
70569  
70570         __u8            cmd;                    /* SMU command byte */
70571         __u8            pad[3];                 /* padding */
70572 -       __u32           data_len;               /* Lenght of data following */
70573 +       __u32           data_len;               /* Length of data following */
70574  };
70575  
70576  struct smu_user_reply_hdr
70577  {
70578         __u32           status;                 /* Command status */
70579 -       __u32           reply_len;              /* Lenght of data follwing */
70580 +       __u32           reply_len;              /* Length of data follwing */
70581  };
70582  
70583  #endif /*  _SMU_H */
70584 --- a/include/asm-powerpc/sparsemem.h
70585 +++ b/include/asm-powerpc/sparsemem.h
70586 @@ -10,13 +10,8 @@
70587   */
70588  #define SECTION_SIZE_BITS       24
70589  
70590 -#if defined(CONFIG_PS3_USE_LPAR_ADDR)
70591 -#define MAX_PHYSADDR_BITS       47
70592 -#define MAX_PHYSMEM_BITS        47
70593 -#else
70594  #define MAX_PHYSADDR_BITS       44
70595  #define MAX_PHYSMEM_BITS        44
70596 -#endif
70597  
70598  #ifdef CONFIG_MEMORY_HOTPLUG
70599  extern void create_section_mapping(unsigned long start, unsigned long end);
70600 --- a/include/asm-powerpc/spu.h
70601 +++ b/include/asm-powerpc/spu.h
70602 @@ -104,6 +104,7 @@
70603  
70604  struct spu_context;
70605  struct spu_runqueue;
70606 +struct spu_lscsa;
70607  struct device_node;
70608  
70609  enum spu_utilization_state {
70610 @@ -145,7 +146,6 @@
70611         void (* ibox_callback)(struct spu *spu);
70612         void (* stop_callback)(struct spu *spu);
70613         void (* mfc_callback)(struct spu *spu);
70614 -       void (* dma_callback)(struct spu *spu, int type);
70615  
70616         char irq_c0[8];
70617         char irq_c1[8];
70618 @@ -196,10 +196,11 @@
70619  extern struct cbe_spu_info cbe_spu_info[];
70620  
70621  void spu_init_channels(struct spu *spu);
70622 -int spu_irq_class_0_bottom(struct spu *spu);
70623 -int spu_irq_class_1_bottom(struct spu *spu);
70624  void spu_irq_setaffinity(struct spu *spu, int cpu);
70625  
70626 +void spu_setup_kernel_slbs(struct spu *spu, struct spu_lscsa *lscsa,
70627 +               void *code, int code_size);
70628 +
70629  #ifdef CONFIG_KEXEC
70630  void crash_register_spus(struct list_head *list);
70631  #else
70632 @@ -210,6 +211,7 @@
70633  
70634  extern void spu_invalidate_slbs(struct spu *spu);
70635  extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm);
70636 +int spu_64k_pages_available(void);
70637  
70638  /* Calls from the memory management to the SPU */
70639  struct mm_struct;
70640 @@ -279,6 +281,8 @@
70641  int spu_add_sysdev_attr_group(struct attribute_group *attrs);
70642  void spu_remove_sysdev_attr_group(struct attribute_group *attrs);
70643  
70644 +int spu_handle_mm_fault(struct mm_struct *mm, unsigned long ea,
70645 +               unsigned long dsisr, unsigned *flt);
70646  
70647  /*
70648   * Notifier blocks:
70649 @@ -303,7 +307,7 @@
70650  extern void do_notify_spus_active(void);
70651  
70652  /*
70653 - * This defines the Local Store, Problem Area and Privlege Area of an SPU.
70654 + * This defines the Local Store, Problem Area and Privilege Area of an SPU.
70655   */
70656  
70657  union mfc_tag_size_class_cmd {
70658 @@ -524,8 +528,24 @@
70659  #define CLASS2_ENABLE_SPU_STOP_INTR                    0x2L
70660  #define CLASS2_ENABLE_SPU_HALT_INTR                    0x4L
70661  #define CLASS2_ENABLE_SPU_DMA_TAG_GROUP_COMPLETE_INTR  0x8L
70662 +#define CLASS2_ENABLE_MAILBOX_THRESHOLD_INTR           0x10L
70663         u8  pad_0x118_0x140[0x28];                              /* 0x118 */
70664         u64 int_stat_RW[3];                                     /* 0x140 */
70665 +#define CLASS0_DMA_ALIGNMENT_INTR                      0x1L
70666 +#define CLASS0_INVALID_DMA_COMMAND_INTR                        0x2L
70667 +#define CLASS0_SPU_ERROR_INTR                          0x4L
70668 +#define CLASS0_INTR_MASK                               0x7L
70669 +#define CLASS1_SEGMENT_FAULT_INTR                      0x1L
70670 +#define CLASS1_STORAGE_FAULT_INTR                      0x2L
70671 +#define CLASS1_LS_COMPARE_SUSPEND_ON_GET_INTR          0x4L
70672 +#define CLASS1_LS_COMPARE_SUSPEND_ON_PUT_INTR          0x8L
70673 +#define CLASS1_INTR_MASK                               0xfL
70674 +#define CLASS2_MAILBOX_INTR                            0x1L
70675 +#define CLASS2_SPU_STOP_INTR                           0x2L
70676 +#define CLASS2_SPU_HALT_INTR                           0x4L
70677 +#define CLASS2_SPU_DMA_TAG_GROUP_COMPLETE_INTR         0x8L
70678 +#define CLASS2_MAILBOX_THRESHOLD_INTR                  0x10L
70679 +#define CLASS2_INTR_MASK                               0x1fL
70680         u8  pad_0x158_0x180[0x28];                              /* 0x158 */
70681         u64 int_route_RW;                                       /* 0x180 */
70682  
70683 --- a/include/asm-powerpc/spu_csa.h
70684 +++ b/include/asm-powerpc/spu_csa.h
70685 @@ -194,7 +194,7 @@
70686  };
70687  
70688  /*
70689 - * struct spu_priv2_collapsed - condensed priviliged 2 area, w/o pads.
70690 + * struct spu_priv2_collapsed - condensed privileged 2 area, w/o pads.
70691   */
70692  struct spu_priv2_collapsed {
70693         u64 slb_index_W;
70694 @@ -254,20 +254,11 @@
70695         u64 spu_chnldata_RW[32];
70696         u32 spu_mailbox_data[4];
70697         u32 pu_mailbox_data[1];
70698 -       u64 dar, dsisr;
70699 +       u64 dar, dsisr, class_0_pending;
70700         unsigned long suspend_time;
70701         spinlock_t register_lock;
70702  };
70703  
70704 -extern int spu_init_csa(struct spu_state *csa);
70705 -extern void spu_fini_csa(struct spu_state *csa);
70706 -extern int spu_save(struct spu_state *prev, struct spu *spu);
70707 -extern int spu_restore(struct spu_state *new, struct spu *spu);
70708 -extern int spu_switch(struct spu_state *prev, struct spu_state *new,
70709 -                     struct spu *spu);
70710 -extern int spu_alloc_lscsa(struct spu_state *csa);
70711 -extern void spu_free_lscsa(struct spu_state *csa);
70712 -
70713  #endif /* !__SPU__ */
70714  #endif /* __KERNEL__ */
70715  #endif /* !__ASSEMBLY__ */
70716 --- a/include/asm-powerpc/spu_priv1.h
70717 +++ b/include/asm-powerpc/spu_priv1.h
70718 @@ -24,6 +24,7 @@
70719  #include <linux/types.h>
70720  
70721  struct spu;
70722 +struct spu_context;
70723  
70724  /* access to priv1 registers */
70725  
70726 @@ -178,6 +179,8 @@
70727         int (*enumerate_spus)(int (*fn)(void *data));
70728         int (*create_spu)(struct spu *spu, void *data);
70729         int (*destroy_spu)(struct spu *spu);
70730 +       void (*enable_spu)(struct spu_context *ctx);
70731 +       void (*disable_spu)(struct spu_context *ctx);
70732         int (*init_affinity)(void);
70733  };
70734  
70735 @@ -207,6 +210,18 @@
70736         return spu_management_ops->init_affinity();
70737  }
70738  
70739 +static inline void
70740 +spu_enable_spu (struct spu_context *ctx)
70741 +{
70742 +       spu_management_ops->enable_spu(ctx);
70743 +}
70744 +
70745 +static inline void
70746 +spu_disable_spu (struct spu_context *ctx)
70747 +{
70748 +       spu_management_ops->disable_spu(ctx);
70749 +}
70750 +
70751  /*
70752   * The declarations folowing are put here for convenience
70753   * and only intended to be used by the platform setup code.
70754 --- a/include/asm-powerpc/system.h
70755 +++ b/include/asm-powerpc/system.h
70756 @@ -169,6 +169,8 @@
70757  extern void bad_page_fault(struct pt_regs *, unsigned long, int);
70758  extern int die(const char *, struct pt_regs *, long);
70759  extern void _exception(int, struct pt_regs *, int, unsigned long);
70760 +extern void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val);
70761 +
70762  #ifdef CONFIG_BOOKE_WDT
70763  extern u32 booke_wdt_enabled;
70764  extern u32 booke_wdt_period;
70765 --- a/include/asm-powerpc/udbg.h
70766 +++ b/include/asm-powerpc/udbg.h
70767 @@ -48,6 +48,7 @@
70768  extern void __init udbg_init_debug_beat(void);
70769  extern void __init udbg_init_btext(void);
70770  extern void __init udbg_init_44x_as1(void);
70771 +extern void __init udbg_init_40x_realmode(void);
70772  extern void __init udbg_init_cpm(void);
70773  
70774  #endif /* __KERNEL__ */
70775 --- a/include/asm-ppc/8xx_immap.h
70776 +++ b/include/asm-ppc/8xx_immap.h
70777 @@ -123,7 +123,7 @@
70778  #define OR_G5LA                0x00000400      /* Output #GPL5 on #GPL_A5              */
70779  #define OR_G5LS                0x00000200      /* Drive #GPL high on falling edge of...*/
70780  #define OR_BI          0x00000100      /* Burst inhibit                        */
70781 -#define OR_SCY_MSK     0x000000f0      /* Cycle Lenght in Clocks               */
70782 +#define OR_SCY_MSK     0x000000f0      /* Cycle Length in Clocks               */
70783  #define OR_SCY_0_CLK   0x00000000      /* 0 clock cycles wait states           */
70784  #define OR_SCY_1_CLK   0x00000010      /* 1 clock cycles wait states           */
70785  #define OR_SCY_2_CLK   0x00000020      /* 2 clock cycles wait states           */
70786 --- a/include/asm-ppc/commproc.h
70787 +++ b/include/asm-ppc/commproc.h
70788 @@ -681,7 +681,7 @@
70789  #define        CICR_SCC_SCC3           ((uint)0x00200000)      /* SCC3 @ SCCc */
70790  #define        CICR_SCB_SCC2           ((uint)0x00040000)      /* SCC2 @ SCCb */
70791  #define        CICR_SCA_SCC1           ((uint)0x00000000)      /* SCC1 @ SCCa */
70792 -#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrrupt */
70793 +#define CICR_IRL_MASK          ((uint)0x0000e000)      /* Core interrupt */
70794  #define CICR_HP_MASK           ((uint)0x00001f00)      /* Hi-pri int. */
70795  #define CICR_IEN               ((uint)0x00000080)      /* Int. enable */
70796  #define CICR_SPS               ((uint)0x00000001)      /* SCC Spread */
70797 --- a/include/asm-ppc/mmu.h
70798 +++ b/include/asm-ppc/mmu.h
70799 @@ -383,6 +383,12 @@
70800  #define BOOKE_PAGESZ_256GB     14
70801  #define BOOKE_PAGESZ_1TB       15
70802  
70803 +#ifndef CONFIG_SERIAL_TEXT_DEBUG
70804 +#define PPC44x_EARLY_TLBS      1
70805 +#else
70806 +#define PPC44x_EARLY_TLBS      2
70807 +#endif
70808 +
70809  /*
70810   * Freescale Book-E MMU support
70811   */
70812 --- a/include/asm-ppc/mpc52xx_psc.h
70813 +++ b/include/asm-ppc/mpc52xx_psc.h
70814 @@ -159,6 +159,9 @@
70815         u8              reserved16[3];
70816         u8              irfdr;          /* PSC + 0x54 */
70817         u8              reserved17[3];
70818 +};
70819 +
70820 +struct mpc52xx_psc_fifo {
70821         u16             rfnum;          /* PSC + 0x58 */
70822         u16             reserved18;
70823         u16             tfnum;          /* PSC + 0x5c */
70824 --- a/include/asm-ppc/reg_booke.h
70825 +++ b/include/asm-ppc/reg_booke.h
70826 @@ -207,7 +207,7 @@
70827  #define        CCR1_TCS        0x00000080 /* Timer Clock Select */
70828  
70829  /* Bit definitions for the MCSR. */
70830 -#ifdef CONFIG_440A
70831 +#ifdef CONFIG_4xx
70832  #define MCSR_MCS       0x80000000 /* Machine Check Summary */
70833  #define MCSR_IB                0x40000000 /* Instruction PLB Error */
70834  #define MCSR_DRB       0x20000000 /* Data Read PLB Error */
70835 @@ -283,7 +283,7 @@
70836  #define ESR_IMCB       0x20000000      /* Instr. Machine Check - Bus error */
70837  #define ESR_IMCT       0x10000000      /* Instr. Machine Check - Timeout */
70838  #define ESR_PIL                0x08000000      /* Program Exception - Illegal */
70839 -#define ESR_PPR                0x04000000      /* Program Exception - Priveleged */
70840 +#define ESR_PPR                0x04000000      /* Program Exception - Privileged */
70841  #define ESR_PTR                0x02000000      /* Program Exception - Trap */
70842  #define ESR_FP         0x01000000      /* Floating Point Operation */
70843  #define ESR_DST                0x00800000      /* Storage Exception - Data miss */
70844 --- a/include/linux/of.h
70845 +++ b/include/linux/of.h
70846 @@ -17,6 +17,7 @@
70847   */
70848  #include <linux/types.h>
70849  #include <linux/bitops.h>
70850 +#include <linux/mod_devicetable.h>
70851  
70852  #include <asm/prom.h>
70853  
70854 @@ -41,11 +42,20 @@
70855  #define for_each_compatible_node(dn, type, compatible) \
70856         for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
70857              dn = of_find_compatible_node(dn, type, compatible))
70858 +extern struct device_node *of_find_matching_node(struct device_node *from,
70859 +       const struct of_device_id *matches);
70860 +#define for_each_matching_node(dn, matches) \
70861 +       for (dn = of_find_matching_node(NULL, matches); dn; \
70862 +            dn = of_find_matching_node(dn, matches))
70863  extern struct device_node *of_find_node_by_path(const char *path);
70864  extern struct device_node *of_find_node_by_phandle(phandle handle);
70865  extern struct device_node *of_get_parent(const struct device_node *node);
70866  extern struct device_node *of_get_next_child(const struct device_node *node,
70867                                              struct device_node *prev);
70868 +#define for_each_child_of_node(parent, child) \
70869 +       for (child = of_get_next_child(parent, NULL); child != NULL; \
70870 +            child = of_get_next_child(parent, child))
70871 +
70872  extern struct property *of_find_property(const struct device_node *np,
70873                                          const char *name,
70874                                          int *lenp);
70875 @@ -56,5 +66,7 @@
70876                                 int *lenp);
70877  extern int of_n_addr_cells(struct device_node *np);
70878  extern int of_n_size_cells(struct device_node *np);
70879 +extern const struct of_device_id *of_match_node(
70880 +       const struct of_device_id *matches, const struct device_node *node);
70881  
70882  #endif /* _LINUX_OF_H */
70883 --- a/include/linux/of_device.h
70884 +++ b/include/linux/of_device.h
70885 @@ -10,8 +10,6 @@
70886  
70887  #define        to_of_device(d) container_of(d, struct of_device, dev)
70888  
70889 -extern const struct of_device_id *of_match_node(
70890 -       const struct of_device_id *matches, const struct device_node *node);
70891  extern const struct of_device_id *of_match_device(
70892         const struct of_device_id *matches, const struct of_device *dev);
70893  
70894 --- a/include/linux/pata_platform.h
70895 +++ b/include/linux/pata_platform.h
70896 @@ -15,4 +15,13 @@
70897         unsigned int irq_flags;
70898  };
70899  
70900 +extern int __devinit __pata_platform_probe(struct device *dev,
70901 +                                          struct resource *io_res,
70902 +                                          struct resource *ctl_res,
70903 +                                          struct resource *irq_res,
70904 +                                          unsigned int ioport_shift,
70905 +                                          int __pio_mask);
70906 +
70907 +extern int __devexit __pata_platform_remove(struct device *dev);
70908 +
70909  #endif /* __LINUX_PATA_PLATFORM_H */
70910 --- a/include/linux/phy_fixed.h
70911 +++ b/include/linux/phy_fixed.h
70912 @@ -1,38 +1,31 @@
70913  #ifndef __PHY_FIXED_H
70914  #define __PHY_FIXED_H
70915  
70916 -#define MII_REGS_NUM   29
70917 -
70918 -/* max number of virtual phy stuff */
70919 -#define MAX_PHY_AMNT   10
70920 -/*
70921 -    The idea is to emulate normal phy behavior by responding with
70922 -    pre-defined values to mii BMCR read, so that read_status hook could
70923 -    take all the needed info.
70924 -*/
70925 -
70926  struct fixed_phy_status {
70927 -       u8 link;
70928 -       u16 speed;
70929 -       u8 duplex;
70930 +       int link;
70931 +       int speed;
70932 +       int duplex;
70933 +       int pause;
70934 +       int asym_pause;
70935  };
70936  
70937 -/*-----------------------------------------------------------------------------
70938 - *  Private information hoder for mii_bus
70939 - *-----------------------------------------------------------------------------*/
70940 -struct fixed_info {
70941 -       u16 *regs;
70942 -       u8 regs_num;
70943 -       struct fixed_phy_status phy_status;
70944 -       struct phy_device *phydev;      /* pointer to the container */
70945 -       /* link & speed cb */
70946 -       int (*link_update) (struct net_device *, struct fixed_phy_status *);
70947 +#ifdef CONFIG_FIXED_PHY
70948 +extern int fixed_phy_add(unsigned int irq, int phy_id,
70949 +                        struct fixed_phy_status *status);
70950 +#else
70951 +static inline int fixed_phy_add(unsigned int irq, int phy_id,
70952 +                               struct fixed_phy_status *status)
70953 +{
70954 +       return -ENODEV;
70955 +}
70956 +#endif /* CONFIG_FIXED_PHY */
70957  
70958 -};
70959 -
70960 -
70961 -int fixed_mdio_set_link_update(struct phy_device *,
70962 -       int (*link_update) (struct net_device *, struct fixed_phy_status *));
70963 -struct fixed_info *fixed_mdio_get_phydev (int phydev_ind);
70964 +/*
70965 + * This function issued only by fixed_phy-aware drivers, no need
70966 + * protect it with #ifdef
70967 + */
70968 +extern int fixed_phy_set_link_update(struct phy_device *phydev,
70969 +                       int (*link_update)(struct net_device *,
70970 +                                          struct fixed_phy_status *));
70971  
70972  #endif /* __PHY_FIXED_H */
70973 --- a/include/linux/pmu.h
70974 +++ b/include/linux/pmu.h
70975 @@ -159,41 +159,7 @@
70976  extern int pmu_present(void);
70977  extern int pmu_get_model(void);
70978  
70979 -#ifdef CONFIG_PM
70980 -/*
70981 - * Stuff for putting the powerbook to sleep and waking it again.
70982 - *
70983 - */
70984 -#include <linux/list.h>
70985 -
70986 -struct pmu_sleep_notifier
70987 -{
70988 -       void (*notifier_call)(struct pmu_sleep_notifier *self, int when);
70989 -       int priority;
70990 -       struct list_head list;
70991 -};
70992 -
70993 -/* Code values for calling sleep/wakeup handlers
70994 - */
70995 -#define PBOOK_SLEEP_REQUEST    1
70996 -#define PBOOK_SLEEP_NOW                2
70997 -#define PBOOK_WAKE             3
70998 -
70999 -/* priority levels in notifiers */
71000 -#define SLEEP_LEVEL_VIDEO      100     /* Video driver (first wake) */
71001 -#define SLEEP_LEVEL_MEDIABAY   90      /* Media bay driver */
71002 -#define SLEEP_LEVEL_BLOCK      80      /* IDE, SCSI */
71003 -#define SLEEP_LEVEL_NET                70      /* bmac, gmac */
71004 -#define SLEEP_LEVEL_MISC       60      /* Anything else */
71005 -#define SLEEP_LEVEL_USERLAND   55      /* Reserved for apm_emu */
71006 -#define SLEEP_LEVEL_ADB                50      /* ADB (async) */
71007 -#define SLEEP_LEVEL_SOUND      40      /* Sound driver (blocking) */
71008 -
71009 -/* special register notifier functions */
71010 -int pmu_register_sleep_notifier(struct pmu_sleep_notifier* notifier);
71011 -int pmu_unregister_sleep_notifier(struct pmu_sleep_notifier* notifier);
71012 -
71013 -#endif /* CONFIG_PM */
71014 +extern void pmu_backlight_set_sleep(int sleep);
71015  
71016  #define PMU_MAX_BATTERIES      2
71017